@leaflink/stash 52.0.2 → 53.0.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 (259) hide show
  1. package/README.md +50 -49
  2. package/dist/Accordion.js +16 -16
  3. package/dist/Accordion.js.map +1 -1
  4. package/dist/AccordionGroup.js +7 -7
  5. package/dist/AccordionGroup.js.map +1 -1
  6. package/dist/ActionsDropdown.js +16 -16
  7. package/dist/ActionsDropdown.js.map +1 -1
  8. package/dist/AddressSelect.js.map +1 -1
  9. package/dist/AddressSelect.vue.d.ts +1 -1
  10. package/dist/Alert.js +34 -34
  11. package/dist/Alert.js.map +1 -1
  12. package/dist/AppNavigationItem.js +31 -31
  13. package/dist/AppNavigationItem.js.map +1 -1
  14. package/dist/AppSidebar.js +19 -19
  15. package/dist/AppSidebar.js.map +1 -1
  16. package/dist/AppTopbar.js +32 -32
  17. package/dist/AppTopbar.js.map +1 -1
  18. package/dist/Avatar.js +18 -18
  19. package/dist/Avatar.js.map +1 -1
  20. package/dist/Backdrop.js +5 -5
  21. package/dist/Backdrop.js.map +1 -1
  22. package/dist/Badge.js +38 -38
  23. package/dist/Badge.js.map +1 -1
  24. package/dist/Box.js +1 -1
  25. package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js} +6 -6
  26. package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js.map} +1 -1
  27. package/dist/Button.js +21 -21
  28. package/dist/Button.js.map +1 -1
  29. package/dist/ButtonGroup.js +26 -26
  30. package/dist/ButtonGroup.js.map +1 -1
  31. package/dist/Card.js +14 -14
  32. package/dist/Card.js.map +1 -1
  33. package/dist/CardContent.js +1 -1
  34. package/dist/CardContent.js.map +1 -1
  35. package/dist/CardFooter.js +1 -1
  36. package/dist/CardFooter.js.map +1 -1
  37. package/dist/CardHeader.js +4 -4
  38. package/dist/CardHeader.js.map +1 -1
  39. package/dist/CardMedia.js +20 -20
  40. package/dist/CardMedia.js.map +1 -1
  41. package/dist/Carousel.js +88 -93
  42. package/dist/Carousel.js.map +1 -1
  43. package/dist/Checkbox.js +30 -30
  44. package/dist/Checkbox.js.map +1 -1
  45. package/dist/Checkbox.vue.d.ts +0 -3
  46. package/dist/Chip.js +33 -33
  47. package/dist/Chip.js.map +1 -1
  48. package/dist/ConfirmationCodeInput.js +72 -72
  49. package/dist/ConfirmationCodeInput.js.map +1 -1
  50. package/dist/ContextSwitcher.js +27 -27
  51. package/dist/ContextSwitcher.js.map +1 -1
  52. package/dist/Copy.js +47 -48
  53. package/dist/Copy.js.map +1 -1
  54. package/dist/CurrencyInput.js +1 -1
  55. package/dist/CurrencyInput.js.map +1 -1
  56. package/dist/CurrencyInput.vue.d.ts +5 -5
  57. package/dist/DataView.js +23 -23
  58. package/dist/DataView.js.map +1 -1
  59. package/dist/DataViewFilters.js +26 -26
  60. package/dist/DataViewFilters.js.map +1 -1
  61. package/dist/DataViewSortButton.js +22 -22
  62. package/dist/DataViewSortButton.js.map +1 -1
  63. package/dist/DataViewToolbar.js +52 -52
  64. package/dist/DataViewToolbar.js.map +1 -1
  65. package/dist/DatePicker.js +10 -10
  66. package/dist/DatePicker.js.map +1 -1
  67. package/dist/DescriptionList.js +2 -2
  68. package/dist/DescriptionList.js.map +1 -1
  69. package/dist/DescriptionListDetail.js +2 -2
  70. package/dist/DescriptionListDetail.js.map +1 -1
  71. package/dist/DescriptionListGroup.js +9 -9
  72. package/dist/DescriptionListGroup.js.map +1 -1
  73. package/dist/DescriptionListTerm.js +8 -8
  74. package/dist/DescriptionListTerm.js.map +1 -1
  75. package/dist/Dialog.js +47 -47
  76. package/dist/Dialog.js.map +1 -1
  77. package/dist/Divider.js +6 -6
  78. package/dist/Divider.js.map +1 -1
  79. package/dist/Dropdown.js +20 -20
  80. package/dist/Dropdown.js.map +1 -1
  81. package/dist/EmptyState.js +26 -26
  82. package/dist/EmptyState.js.map +1 -1
  83. package/dist/Field.js +1 -1
  84. package/dist/{Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js → Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js} +17 -17
  85. package/dist/Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js.map +1 -0
  86. package/dist/FileUpload.js +47 -49
  87. package/dist/FileUpload.js.map +1 -1
  88. package/dist/FilterChip.js +20 -20
  89. package/dist/FilterChip.js.map +1 -1
  90. package/dist/FilterDrawerItem.js +13 -13
  91. package/dist/FilterDrawerItem.js.map +1 -1
  92. package/dist/FilterDropdown.js +27 -27
  93. package/dist/FilterDropdown.js.map +1 -1
  94. package/dist/FilterSelect.js +33 -33
  95. package/dist/FilterSelect.js.map +1 -1
  96. package/dist/Filters.js +29 -29
  97. package/dist/Filters.js.map +1 -1
  98. package/dist/Filters.vue.d.ts +2 -8
  99. package/dist/HttpError.js +29 -29
  100. package/dist/HttpError.js.map +1 -1
  101. package/dist/HttpError.vue.d.ts +0 -3
  102. package/dist/Icon.js +12 -12
  103. package/dist/Icon.js.map +1 -1
  104. package/dist/IconLabel.js +19 -19
  105. package/dist/IconLabel.js.map +1 -1
  106. package/dist/IconLabel.vue.d.ts +1 -1
  107. package/dist/Illustration.js +2 -2
  108. package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js} +4 -4
  109. package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js.map} +1 -1
  110. package/dist/Image.js +2 -2
  111. package/dist/Image.vue.d.ts +0 -3
  112. package/dist/{Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js → Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js} +11 -11
  113. package/dist/Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js.map +1 -0
  114. package/dist/InlineEdit.js +8 -8
  115. package/dist/InlineEdit.js.map +1 -1
  116. package/dist/Input.js +29 -29
  117. package/dist/Input.js.map +1 -1
  118. package/dist/InputOptions.js +87 -84
  119. package/dist/InputOptions.js.map +1 -1
  120. package/dist/InputOptions.vue.d.ts +2 -2
  121. package/dist/IntegrationIcon.js +11 -11
  122. package/dist/IntegrationIcon.js.map +1 -1
  123. package/dist/Label.js +1 -1
  124. package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js} +16 -16
  125. package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js.map → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js.map} +1 -1
  126. package/dist/ListItem.js +14 -14
  127. package/dist/ListItem.js.map +1 -1
  128. package/dist/ListItem.vue.d.ts +0 -6
  129. package/dist/ListItemCell.js +9 -9
  130. package/dist/ListItemCell.js.map +1 -1
  131. package/dist/ListView.js +138 -141
  132. package/dist/ListView.js.map +1 -1
  133. package/dist/ListView.vue.d.ts +2 -26
  134. package/dist/Loading.js +8 -8
  135. package/dist/Loading.js.map +1 -1
  136. package/dist/Logo.js +1 -1
  137. package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js} +3 -3
  138. package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js.map} +1 -1
  139. package/dist/Menu.js +5 -5
  140. package/dist/Menu.js.map +1 -1
  141. package/dist/MenuItem.js +12 -12
  142. package/dist/MenuItem.js.map +1 -1
  143. package/dist/Metric.js +24 -24
  144. package/dist/Metric.js.map +1 -1
  145. package/dist/Modal.js +60 -60
  146. package/dist/Modal.js.map +1 -1
  147. package/dist/Modals.js +1 -1
  148. package/dist/Modals.js.map +1 -1
  149. package/dist/Module.js +6 -6
  150. package/dist/Module.js.map +1 -1
  151. package/dist/ModuleContent.js +16 -16
  152. package/dist/ModuleContent.js.map +1 -1
  153. package/dist/ModuleFooter.js +13 -13
  154. package/dist/ModuleFooter.js.map +1 -1
  155. package/dist/ModuleHeader.js +29 -29
  156. package/dist/ModuleHeader.js.map +1 -1
  157. package/dist/MoreActions.js +81 -84
  158. package/dist/MoreActions.js.map +1 -1
  159. package/dist/ObfuscateText.js +4 -4
  160. package/dist/ObfuscateText.js.map +1 -1
  161. package/dist/PageContent.js +13 -13
  162. package/dist/PageContent.js.map +1 -1
  163. package/dist/PageHeader.js +28 -28
  164. package/dist/PageHeader.js.map +1 -1
  165. package/dist/PageNavigation.js +1 -1
  166. package/dist/Paginate.js +45 -45
  167. package/dist/Paginate.js.map +1 -1
  168. package/dist/QuickAction.js +18 -18
  169. package/dist/QuickAction.js.map +1 -1
  170. package/dist/Radio.js +17 -17
  171. package/dist/Radio.js.map +1 -1
  172. package/dist/RadioGroup.js +158 -154
  173. package/dist/RadioGroup.js.map +1 -1
  174. package/dist/RadioNew.js +80 -80
  175. package/dist/RadioNew.js.map +1 -1
  176. package/dist/RadioNew.vue.d.ts +0 -3
  177. package/dist/RangeInput.js +2 -2
  178. package/dist/RangeInput.js.map +1 -1
  179. package/dist/SearchBar.js +9 -9
  180. package/dist/SearchBar.js.map +1 -1
  181. package/dist/SectionHeader.js +14 -14
  182. package/dist/SectionHeader.js.map +1 -1
  183. package/dist/Select.js +369 -366
  184. package/dist/Select.js.map +1 -1
  185. package/dist/SelectStatus.js +26 -27
  186. package/dist/SelectStatus.js.map +1 -1
  187. package/dist/Skeleton.js +20 -20
  188. package/dist/Skeleton.js.map +1 -1
  189. package/dist/Step.js +37 -40
  190. package/dist/Step.js.map +1 -1
  191. package/dist/Stepper.js +17 -17
  192. package/dist/Stepper.js.map +1 -1
  193. package/dist/Switch.js +57 -57
  194. package/dist/Switch.js.map +1 -1
  195. package/dist/Tab.js +17 -19
  196. package/dist/Tab.js.map +1 -1
  197. package/dist/TabPanel.js +1 -1
  198. package/dist/TabPanel.js.map +1 -1
  199. package/dist/Table.js +22 -22
  200. package/dist/Table.js.map +1 -1
  201. package/dist/TableCell.js +32 -32
  202. package/dist/TableCell.js.map +1 -1
  203. package/dist/TableHeaderCell.js +35 -35
  204. package/dist/TableHeaderCell.js.map +1 -1
  205. package/dist/TableHeaderRow.js +10 -10
  206. package/dist/TableHeaderRow.js.map +1 -1
  207. package/dist/TableRow.js +51 -51
  208. package/dist/TableRow.js.map +1 -1
  209. package/dist/Tabs.js +2 -2
  210. package/dist/{Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js → Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js} +33 -33
  211. package/dist/Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js.map +1 -0
  212. package/dist/TextEditor.js +8 -8
  213. package/dist/TextEditor.js.map +1 -1
  214. package/dist/Textarea.js +15 -15
  215. package/dist/Textarea.js.map +1 -1
  216. package/dist/Thumbnail.js +41 -41
  217. package/dist/Thumbnail.js.map +1 -1
  218. package/dist/ThumbnailEmpty.js +3 -3
  219. package/dist/ThumbnailEmpty.js.map +1 -1
  220. package/dist/ThumbnailGroup.js +22 -22
  221. package/dist/ThumbnailGroup.js.map +1 -1
  222. package/dist/Timeline.js +3 -3
  223. package/dist/Timeline.js.map +1 -1
  224. package/dist/TimelineItem.js +22 -22
  225. package/dist/TimelineItem.js.map +1 -1
  226. package/dist/Toast.js +29 -29
  227. package/dist/Toast.js.map +1 -1
  228. package/dist/Toast.vue.d.ts +3 -0
  229. package/dist/Toasts.js +11 -11
  230. package/dist/Toasts.js.map +1 -1
  231. package/dist/Tooltip.js +2 -81
  232. package/dist/Tooltip.js.map +1 -1
  233. package/dist/Tooltip.vue.d.ts +1 -1
  234. package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js +84 -0
  235. package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js.map +1 -0
  236. package/dist/components.css +2 -2
  237. package/dist/constants.d.ts +9 -9
  238. package/dist/constants.js +17 -17
  239. package/dist/constants.js.map +1 -1
  240. package/dist/directives/tooltip.js +2 -2
  241. package/dist/directives/tooltip.js.map +1 -1
  242. package/dist/{index-C14LhAwV.js → index-DBV9Uz0C.js} +3 -3
  243. package/dist/{index-C14LhAwV.js.map → index-DBV9Uz0C.js.map} +1 -1
  244. package/dist/tailwind-base.js.d.ts +12 -0
  245. package/dist/tailwind-base.js.map +1 -1
  246. package/dist/useSortable.js +1 -1
  247. package/dist/utils/helpers.js +15 -15
  248. package/dist/utils/helpers.js.map +1 -1
  249. package/package.json +15 -15
  250. package/styles/backwards-compat.css +373 -2851
  251. package/styles/main.css +8 -0
  252. package/styles/sofia-font.css +23 -27
  253. package/styles/theme.css +1033 -0
  254. package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +0 -1
  255. package/dist/Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map +0 -1
  256. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js.map +0 -1
  257. package/dist/tailwind-base.d.ts +0 -333
  258. package/styles/base.css +0 -902
  259. package/tailwind-base.ts +0 -455
package/dist/Chip.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../src/components/Chip/Chip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types/colors';\n import colorSchemeUtil from '../../utils/colorScheme';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-chip',\n });\n\n export interface ChipProps {\n /**\n * The color for the chip that determines both the text and bg color. Needs to\n * be one of the brand colors in our design system (not a shade).\n */\n colorScheme?: StashPrimaryColorGroup;\n\n /**\n * The shade of the provided color to use for the background color. This effects the inferred\n * text color unless a specific text color is provided. Currently only `light` and `main`\n * shades are supported. `dark` may be added in the future.\n */\n shade?: 'light' | 'main';\n\n /**\n * The size of the chip.\n */\n size?: 'small' | 'medium';\n\n /**\n * The type of border radius to use.\n */\n radius?: 'none' | 'standard' | 'pill';\n\n /**\n * The background color of the chip. Needs to be one of our design system colors.\n */\n bgColor?: StashCommonColor;\n\n /**\n * The color of the chip text. Needs to be one of our design system colors.\n */\n textColor?: StashCommonColor;\n\n /**\n * Determines if a close icon is surfaced.\n */\n isRemovable?: boolean;\n\n /**\n * Determines if background and text color in Chip should be overidden.\n */\n shouldOverrideColors?: boolean;\n\n /**\n * Determines if the chip is disabled.\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<ChipProps>(), {\n size: 'medium',\n radius: 'standard',\n colorScheme: 'ice',\n shade: 'light',\n bgColor: undefined,\n textColor: undefined,\n isRemovable: false,\n shouldOverrideColors: false,\n disabled: false,\n });\n\n const emit = defineEmits<{\n /**\n * Fires on click of the chip.\n */\n (e: 'click'): void;\n /**\n * If `is-removable` is true, fires on click of the close button.\n */\n (e: 'remove'): void;\n }>();\n\n const classes = useCssModule();\n\n function determineConditionalStyles() {\n const { computedBgColor, computedTextColor } = colorSchemeUtil({\n shade: props.shade,\n color: props.colorScheme,\n });\n\n const colorStyles = `tw-text-${props.textColor || computedTextColor} tw-bg-${props.bgColor || computedBgColor}`;\n\n return {\n 'tw-rounded-none': props.radius === 'none',\n 'tw-rounded-sm': props.radius === 'standard',\n 'tw-rounded-full': props.radius === 'pill',\n [colorStyles]: !props.shouldOverrideColors && !props.disabled,\n 'tw-bg-ice-500 tw-text-white': props.disabled,\n };\n }\n</script>\n\n<template>\n <span\n class=\"stash-chip tw-relative tw-inline-flex tw-items-center\"\n :class=\"[\n `stash-chip--radius-${props.radius}`,\n `stash-chip--size-${props.size}`,\n `stash-chip--shade-${props.shade}`,\n classes.root,\n classes.removableChip,\n classes[`size-${props.size}`],\n determineConditionalStyles(),\n ]\"\n data-test=\"stash-chip\"\n @click=\"emit('click')\"\n >\n <span v-if=\"isRemovable\" :class=\"[{ 'tw-mr-6 tw-truncate': props.isRemovable }]\">\n <!-- @slot Chip text -->\n <slot></slot>\n </span>\n\n <!-- Allows easier testing and DOM quering when the chip text isn't nested in an inner span -->\n <!-- @slot Chip text -->\n <slot v-else></slot>\n\n <button\n v-if=\"props.isRemovable\"\n tabindex=\"-1\"\n class=\"stash-chip__remove-button\"\n :class=\"['tw-absolute', classes['remove-button']]\"\n data-test=\"stash-chip|remove-button\"\n :disabled=\"props.disabled\"\n @keypress.enter.prevent=\"emit('remove')\"\n @mousedown.prevent.stop=\"emit('remove')\"\n >\n <Icon data-test=\"icon|close\" name=\"close\" size=\"small\" />\n </button>\n </span>\n</template>\n\n<style module>\n .root {\n /**\n * Applying these styles this way because the rule of thumb is that tailwind classes should\n * always end up taking precedence, so we're converted these specific styles to be generated\n * in a custom class instead, giving `FilterChip` (which wraps `Chip`) the ability to easily\n * override them.\n */\n @apply tw-leading-none tw-font-semibold tw-uppercase tw-text-[10px];\n }\n\n .size-medium {\n height: 20px;\n padding: 2px 8px 0 8px;\n }\n\n .size-small {\n height: 16px;\n padding: 2px 8px 0 8px;\n }\n\n .remove-button {\n border-radius: inherit;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n height: inherit;\n margin-top: -2px; /* used to offset 2px top padding from .size-medium and size-small */\n padding: 0 4px;\n right: 0;\n }\n\n .remove-button:not(:disabled):hover {\n background: rgb(0 0 0 / 10%);\n }\n</style>\n"],"names":["props","__props","emit","__emit","classes","useCssModule","determineConditionalStyles","computedBgColor","computedTextColor","colorSchemeUtil","colorStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6DE,UAAMA,IAAQC,GAYRC,IAAOC,GAWPC,IAAUC,EAAA;AAEhB,aAASC,IAA6B;AACpC,YAAM,EAAE,iBAAAC,GAAiB,mBAAAC,EAAA,IAAsBC,EAAgB;AAAA,QAC7D,OAAOT,EAAM;AAAA,QACb,OAAOA,EAAM;AAAA,MAAA,CACd,GAEKU,IAAc,WAAWV,EAAM,aAAaQ,CAAiB,UAAUR,EAAM,WAAWO,CAAe;AAE7G,aAAO;AAAA,QACL,mBAAmBP,EAAM,WAAW;AAAA,QACpC,iBAAiBA,EAAM,WAAW;AAAA,QAClC,mBAAmBA,EAAM,WAAW;AAAA,QACpC,CAACU,CAAW,GAAG,CAACV,EAAM,wBAAwB,CAACA,EAAM;AAAA,QACrD,+BAA+BA,EAAM;AAAA,MAAA;AAAA,IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Chip.js","sources":["../src/components/Chip/Chip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types/colors';\n import colorSchemeUtil from '../../utils/colorScheme';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-chip',\n });\n\n export interface ChipProps {\n /**\n * The color for the chip that determines both the text and bg color. Needs to\n * be one of the brand colors in our design system (not a shade).\n */\n colorScheme?: StashPrimaryColorGroup;\n\n /**\n * The shade of the provided color to use for the background color. This effects the inferred\n * text color unless a specific text color is provided. Currently only `light` and `main`\n * shades are supported. `dark` may be added in the future.\n */\n shade?: 'light' | 'main';\n\n /**\n * The size of the chip.\n */\n size?: 'small' | 'medium';\n\n /**\n * The type of border radius to use.\n */\n radius?: 'none' | 'standard' | 'pill';\n\n /**\n * The background color of the chip. Needs to be one of our design system colors.\n */\n bgColor?: StashCommonColor;\n\n /**\n * The color of the chip text. Needs to be one of our design system colors.\n */\n textColor?: StashCommonColor;\n\n /**\n * Determines if a close icon is surfaced.\n */\n isRemovable?: boolean;\n\n /**\n * Determines if background and text color in Chip should be overidden.\n */\n shouldOverrideColors?: boolean;\n\n /**\n * Determines if the chip is disabled.\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<ChipProps>(), {\n size: 'medium',\n radius: 'standard',\n colorScheme: 'ice',\n shade: 'light',\n bgColor: undefined,\n textColor: undefined,\n isRemovable: false,\n shouldOverrideColors: false,\n disabled: false,\n });\n\n const emit = defineEmits<{\n /**\n * Fires on click of the chip.\n */\n (e: 'click'): void;\n /**\n * If `is-removable` is true, fires on click of the close button.\n */\n (e: 'remove'): void;\n }>();\n\n const classes = useCssModule();\n\n function determineConditionalStyles() {\n const { computedBgColor, computedTextColor } = colorSchemeUtil({\n shade: props.shade,\n color: props.colorScheme,\n });\n\n const colorStyles = `text-${props.textColor || computedTextColor} bg-${props.bgColor || computedBgColor}`;\n\n return {\n 'rounded-none': props.radius === 'none',\n 'rounded-xs': props.radius === 'standard',\n 'rounded-full': props.radius === 'pill',\n [colorStyles]: !props.shouldOverrideColors && !props.disabled,\n 'bg-ice-500 text-white': props.disabled,\n };\n }\n</script>\n\n<template>\n <span\n class=\"stash-chip relative inline-flex items-center\"\n :class=\"[\n `stash-chip--radius-${props.radius}`,\n `stash-chip--size-${props.size}`,\n `stash-chip--shade-${props.shade}`,\n classes.root,\n classes.removableChip,\n classes[`size-${props.size}`],\n determineConditionalStyles(),\n ]\"\n data-test=\"stash-chip\"\n @click=\"emit('click')\"\n >\n <span v-if=\"isRemovable\" :class=\"[{ 'mr-6 truncate': props.isRemovable }]\">\n <!-- @slot Chip text -->\n <slot></slot>\n </span>\n\n <!-- Allows easier testing and DOM quering when the chip text isn't nested in an inner span -->\n <!-- @slot Chip text -->\n <slot v-else></slot>\n\n <button\n v-if=\"props.isRemovable\"\n tabindex=\"-1\"\n class=\"stash-chip__remove-button\"\n :class=\"['absolute', classes['remove-button']]\"\n data-test=\"stash-chip|remove-button\"\n :disabled=\"props.disabled\"\n @keypress.enter.prevent=\"emit('remove')\"\n @mousedown.prevent.stop=\"emit('remove')\"\n >\n <Icon data-test=\"icon|close\" name=\"close\" size=\"small\" />\n </button>\n </span>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .root {\n /**\n * Applying these styles this way because the rule of thumb is that tailwind classes should\n * always end up taking precedence, so we're converted these specific styles to be generated\n * in a custom class instead, giving `FilterChip` (which wraps `Chip`) the ability to easily\n * override them.\n */\n @apply leading-none font-semibold uppercase text-[10px];\n }\n\n .size-medium {\n height: 20px;\n padding: 2px 8px 0 8px;\n }\n\n .size-small {\n height: 16px;\n padding: 2px 8px 0 8px;\n }\n\n .remove-button {\n border-radius: inherit;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n height: inherit;\n margin-top: -2px; /* used to offset 2px top padding from .size-medium and size-small */\n padding: 0 4px;\n right: 0;\n }\n\n .remove-button:not(:disabled):hover {\n background: rgb(0 0 0 / 10%);\n }\n }\n</style>\n"],"names":["props","__props","emit","__emit","classes","useCssModule","determineConditionalStyles","computedBgColor","computedTextColor","colorSchemeUtil","colorStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6DE,UAAMA,IAAQC,GAYRC,IAAOC,GAWPC,IAAUC,EAAA;AAEhB,aAASC,IAA6B;AACpC,YAAM,EAAE,iBAAAC,GAAiB,mBAAAC,EAAA,IAAsBC,EAAgB;AAAA,QAC7D,OAAOT,EAAM;AAAA,QACb,OAAOA,EAAM;AAAA,MAAA,CACd,GAEKU,IAAc,QAAQV,EAAM,aAAaQ,CAAiB,OAAOR,EAAM,WAAWO,CAAe;AAEvG,aAAO;AAAA,QACL,gBAAgBP,EAAM,WAAW;AAAA,QACjC,cAAcA,EAAM,WAAW;AAAA,QAC/B,gBAAgBA,EAAM,WAAW;AAAA,QACjC,CAACU,CAAW,GAAG,CAACV,EAAM,wBAAwB,CAACA,EAAM;AAAA,QACrD,yBAAyBA,EAAM;AAAA,MAAA;AAAA,IAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,16 +1,16 @@
1
- import { defineComponent as I, useCssVars as v, useCssModule as E, ref as V, onMounted as B, watch as P, createElementBlock as a, openBlock as r, normalizeClass as x, unref as l, createElementVNode as z, createCommentVNode as p, Fragment as A, renderList as M, toDisplayString as f } from "vue";
2
- import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
1
+ import { defineComponent as I, useCssVars as v, useCssModule as E, ref as V, onMounted as B, watch as P, createElementBlock as a, openBlock as r, normalizeClass as g, unref as l, createElementVNode as A, createCommentVNode as p, Fragment as M, renderList as F, toDisplayString as f } from "vue";
2
+ import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const S = { class: "mb-3 flex gap-6" }, U = ["value", "onInput"], j = {
4
4
  key: 0,
5
- class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-red-500",
5
+ class: "mt-1 block whitespace-pre-line pr-6 text-center text-red-500",
6
6
  "data-test": "field-error"
7
- }, j = {
7
+ }, L = {
8
8
  key: 1,
9
- class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-green-500",
9
+ class: "mt-1 block whitespace-pre-line pr-6 text-center text-green-500",
10
10
  "data-test": "field-success"
11
- }, L = {
11
+ }, z = {
12
12
  key: 2,
13
- class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-ice-700",
13
+ class: "mt-1 block whitespace-pre-line pr-6 text-center text-ice-700",
14
14
  "data-test": "field-hint"
15
15
  }, R = /* @__PURE__ */ I({
16
16
  __name: "ConfirmationCodeInput",
@@ -22,96 +22,96 @@ const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
22
22
  modelValue: { default: void 0 }
23
23
  },
24
24
  emits: ["update:model-value", "change", "focus", "blur"],
25
- setup(g, { emit: b }) {
26
- v((t) => ({
27
- b1b2f1d6: t.digitCount
25
+ setup(b, { emit: k }) {
26
+ v((e) => ({
27
+ "18a4a680": e.digitCount
28
28
  }));
29
- const c = E(), o = g, i = b, s = V([]);
29
+ const c = E(), o = b, i = k, s = V([]);
30
30
  B(() => {
31
- var t;
32
- o.modelValue && (s.value = (t = o.modelValue) == null ? void 0 : t.split(""));
31
+ var e;
32
+ o.modelValue && (s.value = (e = o.modelValue) == null ? void 0 : e.split(""));
33
33
  });
34
- function k(t, e) {
34
+ function T(e, t) {
35
35
  var n;
36
- s.value[e] = (n = t.target) == null ? void 0 : n.value, m(t), t.inputType === "deleteContentBackward" ? d(t) : (t.inputType === "insertText" || t.inputType === "deleteContentForward") && w(t);
36
+ s.value[t] = (n = e.target) == null ? void 0 : n.value, m(e), e.inputType === "deleteContentBackward" ? d(e) : (e.inputType === "insertText" || e.inputType === "deleteContentForward") && h(e);
37
37
  }
38
- function m(t) {
39
- const e = s.value.join("");
40
- i("update:model-value", e), i("change", { originalEvent: t, value: e });
38
+ function m(e) {
39
+ const t = s.value.join("");
40
+ i("update:model-value", t), i("change", { originalEvent: e, value: t });
41
41
  }
42
- function d(t) {
43
- const e = h(t.target);
44
- e && (e.focus(), e.select());
42
+ function d(e) {
43
+ const t = _(e.target);
44
+ t && (t.focus(), t.select());
45
45
  }
46
- function w(t) {
47
- const e = _(t.target);
48
- e && (e.focus(), e.select());
46
+ function h(e) {
47
+ const t = x(e.target);
48
+ t && (t.focus(), t.select());
49
49
  }
50
- function h(t) {
51
- const e = t.previousElementSibling;
52
- if (e)
53
- return e.nodeName === "INPUT" ? e : h(e);
50
+ function _(e) {
51
+ const t = e.previousElementSibling;
52
+ if (t)
53
+ return t.nodeName === "INPUT" ? t : _(t);
54
54
  }
55
- function _(t) {
56
- const e = t.nextElementSibling;
57
- if (e)
58
- return e.nodeName === "INPUT" ? e : _(e);
55
+ function x(e) {
56
+ const t = e.nextElementSibling;
57
+ if (t)
58
+ return t.nodeName === "INPUT" ? t : x(t);
59
59
  }
60
- function T(t) {
61
- t.target.select(), i("focus", t);
60
+ function y(e) {
61
+ e.target.select(), i("focus", e);
62
62
  }
63
- function y(t) {
64
- i("blur", t);
63
+ function C(e) {
64
+ i("blur", e);
65
65
  }
66
- function C(t) {
67
- var e;
68
- if (!(t.ctrlKey || t.metaKey))
69
- switch (t.code) {
66
+ function w(e) {
67
+ var t;
68
+ if (!(e.ctrlKey || e.metaKey))
69
+ switch (e.code) {
70
70
  case "ArrowLeft":
71
- d(t), t.preventDefault();
71
+ d(e), e.preventDefault();
72
72
  break;
73
73
  case "ArrowUp":
74
74
  case "ArrowDown":
75
- t.preventDefault();
75
+ e.preventDefault();
76
76
  break;
77
77
  case "Backspace":
78
- ((e = t.target) == null ? void 0 : e.value.length) === 0 && (d(t), t.preventDefault());
78
+ ((t = e.target) == null ? void 0 : t.value.length) === 0 && (d(e), e.preventDefault());
79
79
  break;
80
80
  case "ArrowRight":
81
- w(t), t.preventDefault();
81
+ h(e), e.preventDefault();
82
82
  break;
83
83
  case "Enter":
84
84
  case "NumpadEnter":
85
85
  case "Tab":
86
86
  break;
87
87
  default:
88
- (!(t.code !== "Space" && Number(t.key) >= 0 && Number(t.key) <= 9) || s.value.join("").length >= o.digitCount && t.code !== "Delete") && t.preventDefault();
88
+ (!(e.code !== "Space" && Number(e.key) >= 0 && Number(e.key) <= 9) || s.value.join("").length >= o.digitCount && e.code !== "Delete") && e.preventDefault();
89
89
  break;
90
90
  }
91
91
  }
92
- function N(t) {
92
+ function N(e) {
93
93
  var n;
94
- const e = (n = t.clipboardData) == null ? void 0 : n.getData("text");
95
- if (e != null && e.length) {
96
- const u = e == null ? void 0 : e.substring(0, o.digitCount), D = parseInt(u);
97
- isNaN(D) || (s.value = u.split(""), m(t));
94
+ const t = (n = e.clipboardData) == null ? void 0 : n.getData("text");
95
+ if (t != null && t.length) {
96
+ const u = t == null ? void 0 : t.substring(0, o.digitCount), D = parseInt(u);
97
+ isNaN(D) || (s.value = u.split(""), m(e));
98
98
  }
99
- t.preventDefault();
99
+ e.preventDefault();
100
100
  }
101
101
  return P(
102
102
  () => o.modelValue,
103
- (t) => {
104
- s.value = t ? t.split("") : new Array(o.digitCount);
103
+ (e) => {
104
+ s.value = e ? e.split("") : new Array(o.digitCount);
105
105
  }
106
- ), (t, e) => (r(), a("div", {
107
- class: x(["stash-confirmation-code-input tw-inline-block", [l(c)["stash-confirmation-code-input-container"]]]),
106
+ ), (e, t) => (r(), a("div", {
107
+ class: g(["stash-confirmation-code-input inline-block", [l(c)["stash-confirmation-code-input-container"]]]),
108
108
  "data-test": "stash-confirmation-code-input"
109
109
  }, [
110
- z("div", K, [
111
- (r(!0), a(A, null, M(o.digitCount, (n) => (r(), a("input", {
110
+ A("div", S, [
111
+ (r(!0), a(M, null, F(o.digitCount, (n) => (r(), a("input", {
112
112
  key: n,
113
113
  "data-test": "stash-confirmation-code-input__otp",
114
- class: x(["tw-border tw-bg-white tw-p-2 tw-text-center tw-text-base tw-font-medium tw-text-ice-900 focus:tw-border-blue-500", [
114
+ class: g(["border bg-white p-2 text-center text-base font-medium text-ice-900 focus:border-blue-500", [
115
115
  l(c)["otp-code-input"],
116
116
  { [l(c)["has-error"]]: !!o.errorText },
117
117
  { [l(c)["has-success"]]: !!o.successText }
@@ -122,26 +122,26 @@ const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
122
122
  value: s.value[n - 1],
123
123
  pattern: "[0-9]",
124
124
  autocomplete: "one-time-code",
125
- onInput: (u) => k(u, n - 1),
126
- onKeydown: C,
125
+ onInput: (u) => T(u, n - 1),
126
+ onKeydown: w,
127
127
  onPaste: N,
128
- onFocus: T,
129
- onBlur: y
130
- }, null, 42, S))), 128))
128
+ onFocus: y,
129
+ onBlur: C
130
+ }, null, 42, U))), 128))
131
131
  ]),
132
- o.errorText ? (r(), a("small", U, f(o.errorText), 1)) : p("", !0),
133
- o.successText ? (r(), a("small", j, f(o.successText), 1)) : p("", !0),
134
- o.hintText ? (r(), a("small", L, f(o.hintText), 1)) : p("", !0)
132
+ o.errorText ? (r(), a("small", j, f(o.errorText), 1)) : p("", !0),
133
+ o.successText ? (r(), a("small", L, f(o.successText), 1)) : p("", !0),
134
+ o.hintText ? (r(), a("small", z, f(o.hintText), 1)) : p("", !0)
135
135
  ], 2));
136
136
  }
137
137
  }), $ = {
138
- "stash-confirmation-code-input-container": "_stash-confirmation-code-input-container_kwgaz_2",
139
- "otp-code-input": "_otp-code-input_kwgaz_9",
140
- "has-error": "_has-error_kwgaz_16",
141
- "has-success": "_has-success_kwgaz_20"
138
+ "stash-confirmation-code-input-container": "_stash-confirmation-code-input-container_r8c1g_3",
139
+ "otp-code-input": "_otp-code-input_r8c1g_10",
140
+ "has-error": "_has-error_r8c1g_17",
141
+ "has-success": "_has-success_r8c1g_21"
142
142
  }, q = {
143
143
  $style: $
144
- }, J = /* @__PURE__ */ F(R, [["__cssModules", q]]);
144
+ }, J = /* @__PURE__ */ K(R, [["__cssModules", q]]);
145
145
  export {
146
146
  J as default
147
147
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationCodeInput.js","sources":["../src/components/ConfirmationCodeInput/ConfirmationCodeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { onMounted, Ref, ref, useCssModule, watch } from 'vue';\n\n const classes = useCssModule();\n\n export interface VerificationCodeInputProps {\n digitCount?: number;\n /**\n * Error text to display.\n */\n errorText?: string;\n /**\n * Success text to display.\n */\n successText?: string;\n /**\n * Hint text to display.\n */\n hintText?: string;\n /**\n * One time password/code\n */\n modelValue?: string;\n }\n\n const props = withDefaults(defineProps<VerificationCodeInputProps>(), {\n digitCount: 6,\n errorText: undefined,\n successText: undefined,\n hintText: undefined,\n modelValue: undefined,\n });\n\n const emit = defineEmits<{\n (e: 'update:model-value', value: string | null): void;\n (e: 'change', params: { originalEvent: Event; value: string | null }): void;\n (e: 'focus', params: Event): void;\n (e: 'blur', params: Event): void;\n }>();\n\n const data: Ref<Array<string>> = ref([]);\n\n onMounted(() => {\n if (props.modelValue) {\n data.value = props.modelValue?.split('');\n }\n });\n\n function handleInput(event: InputEvent, index) {\n data.value[index] = event.target?.['value'];\n updateModel(event);\n\n if (event.inputType === 'deleteContentBackward') {\n moveToPrev(event);\n } else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward') {\n moveToNext(event);\n }\n }\n\n function updateModel(event: Event) {\n const newValue = data.value.join('');\n emit('update:model-value', newValue);\n emit('change', { originalEvent: event, value: newValue });\n }\n\n function moveToPrev(event: InputEvent | KeyboardEvent) {\n const prevInput: HTMLInputElement = findPrevInput(event.target as HTMLInputElement);\n\n if (prevInput) {\n prevInput.focus();\n prevInput.select();\n }\n }\n\n function moveToNext(event: InputEvent | KeyboardEvent) {\n const nextInput: HTMLInputElement = findNextInput(event.target as HTMLInputElement);\n\n if (nextInput) {\n nextInput.focus();\n nextInput.select();\n }\n }\n\n function findPrevInput(element: HTMLInputElement) {\n const prevElement = element.previousElementSibling;\n\n if (!prevElement) return;\n\n return prevElement.nodeName === 'INPUT' ? prevElement : findPrevInput(prevElement as HTMLInputElement);\n }\n\n function findNextInput(element: HTMLInputElement) {\n const nextElement = element.nextElementSibling;\n\n if (!nextElement) return;\n\n return nextElement.nodeName === 'INPUT' ? nextElement : findNextInput(nextElement as HTMLInputElement);\n }\n\n function handleFocus(event) {\n event.target.select();\n emit('focus', event);\n }\n\n function handleBlur(event: Event) {\n emit('blur', event);\n }\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey) {\n return;\n }\n\n switch (event.code) {\n case 'ArrowLeft':\n moveToPrev(event);\n event.preventDefault();\n break;\n\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n\n case 'Backspace':\n if (event.target?.['value'].length === 0) {\n moveToPrev(event);\n event.preventDefault();\n }\n break;\n\n case 'ArrowRight':\n moveToNext(event);\n event.preventDefault();\n\n break;\n\n case 'Enter':\n case 'NumpadEnter':\n case 'Tab':\n break;\n\n default:\n if (\n !(event.code !== 'Space' && Number(event.key) >= 0 && Number(event.key) <= 9) ||\n (data.value.join('').length >= props.digitCount && event.code !== 'Delete')\n ) {\n event.preventDefault();\n }\n\n break;\n }\n }\n\n function handlePaste(event: ClipboardEvent) {\n const paste = event.clipboardData?.getData('text');\n\n if (paste?.length) {\n const pastedCode = paste?.substring(0, props.digitCount);\n\n const parsed = parseInt(pastedCode);\n\n if (!isNaN(parsed)) {\n data.value = pastedCode.split('');\n updateModel(event);\n }\n }\n\n event.preventDefault();\n }\n\n watch(\n () => props.modelValue,\n (newValue) => {\n data.value = newValue ? newValue.split('') : new Array(props.digitCount);\n },\n );\n</script>\n\n<template>\n <div\n class=\"stash-confirmation-code-input tw-inline-block\"\n data-test=\"stash-confirmation-code-input\"\n :class=\"[classes['stash-confirmation-code-input-container']]\"\n >\n <div class=\"tw-mb-3 tw-flex tw-gap-6\">\n <template v-for=\"field in props.digitCount\" :key=\"field\">\n <input\n data-test=\"stash-confirmation-code-input__otp\"\n class=\"tw-border tw-bg-white tw-p-2 tw-text-center tw-text-base tw-font-medium tw-text-ice-900 focus:tw-border-blue-500\"\n :class=\"[\n classes['otp-code-input'],\n { [classes['has-error']]: !!props.errorText },\n { [classes['has-success']]: !!props.successText },\n ]\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"1\"\n :value=\"data[field - 1]\"\n pattern=\"[0-9]\"\n autocomplete=\"one-time-code\"\n @input=\"handleInput($event as InputEvent, field - 1)\"\n @keydown=\"handleKeyDown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n />\n </template>\n </div>\n <small\n v-if=\"props.errorText\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-red-500\"\n data-test=\"field-error\"\n >\n {{ props.errorText }}\n </small>\n <small\n v-if=\"props.successText\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-green-500\"\n data-test=\"field-success\"\n >\n {{ props.successText }}\n </small>\n <small\n v-if=\"props.hintText\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-pr-6 tw-text-center tw-text-ice-700\"\n data-test=\"field-hint\"\n >\n {{ props.hintText }}\n </small>\n </div>\n</template>\n\n<style module>\n .stash-confirmation-code-input-container {\n --otp-digits: v-bind(digitCount);\n --otp-container-width: calc(var(--otp-digits) * 60px);\n\n width: var(--otp-container-width);\n }\n\n .otp-code-input {\n border-radius: 4px;\n caret-color: transparent;\n height: 36px;\n width: 36px;\n }\n\n .otp-code-input.has-error:not(:focus) {\n border-color: var(--color-red-500);\n }\n\n .otp-code-input.has-success:not(:focus) {\n border-color: var(--color-green-500);\n }\n\n .otp-code-input:focus {\n box-shadow: 0 0 0 3px rgb(0 114 240 / 15%);\n outline: none;\n }\n</style>\n"],"names":["classes","useCssModule","props","__props","emit","__emit","data","ref","onMounted","_a","handleInput","event","index","updateModel","moveToPrev","moveToNext","newValue","prevInput","findPrevInput","nextInput","findNextInput","element","prevElement","nextElement","handleFocus","handleBlur","handleKeyDown","handlePaste","paste","pastedCode","parsed","watch"],"mappings":"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"}
1
+ {"version":3,"file":"ConfirmationCodeInput.js","sources":["../src/components/ConfirmationCodeInput/ConfirmationCodeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { onMounted, Ref, ref, useCssModule, watch } from 'vue';\n\n const classes = useCssModule();\n\n export interface VerificationCodeInputProps {\n digitCount?: number;\n /**\n * Error text to display.\n */\n errorText?: string;\n /**\n * Success text to display.\n */\n successText?: string;\n /**\n * Hint text to display.\n */\n hintText?: string;\n /**\n * One time password/code\n */\n modelValue?: string;\n }\n\n const props = withDefaults(defineProps<VerificationCodeInputProps>(), {\n digitCount: 6,\n errorText: undefined,\n successText: undefined,\n hintText: undefined,\n modelValue: undefined,\n });\n\n const emit = defineEmits<{\n (e: 'update:model-value', value: string | null): void;\n (e: 'change', params: { originalEvent: Event; value: string | null }): void;\n (e: 'focus', params: Event): void;\n (e: 'blur', params: Event): void;\n }>();\n\n const data: Ref<Array<string>> = ref([]);\n\n onMounted(() => {\n if (props.modelValue) {\n data.value = props.modelValue?.split('');\n }\n });\n\n function handleInput(event: InputEvent, index) {\n data.value[index] = event.target?.['value'];\n updateModel(event);\n\n if (event.inputType === 'deleteContentBackward') {\n moveToPrev(event);\n } else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward') {\n moveToNext(event);\n }\n }\n\n function updateModel(event: Event) {\n const newValue = data.value.join('');\n emit('update:model-value', newValue);\n emit('change', { originalEvent: event, value: newValue });\n }\n\n function moveToPrev(event: InputEvent | KeyboardEvent) {\n const prevInput: HTMLInputElement = findPrevInput(event.target as HTMLInputElement);\n\n if (prevInput) {\n prevInput.focus();\n prevInput.select();\n }\n }\n\n function moveToNext(event: InputEvent | KeyboardEvent) {\n const nextInput: HTMLInputElement = findNextInput(event.target as HTMLInputElement);\n\n if (nextInput) {\n nextInput.focus();\n nextInput.select();\n }\n }\n\n function findPrevInput(element: HTMLInputElement) {\n const prevElement = element.previousElementSibling;\n\n if (!prevElement) return;\n\n return prevElement.nodeName === 'INPUT' ? prevElement : findPrevInput(prevElement as HTMLInputElement);\n }\n\n function findNextInput(element: HTMLInputElement) {\n const nextElement = element.nextElementSibling;\n\n if (!nextElement) return;\n\n return nextElement.nodeName === 'INPUT' ? nextElement : findNextInput(nextElement as HTMLInputElement);\n }\n\n function handleFocus(event) {\n event.target.select();\n emit('focus', event);\n }\n\n function handleBlur(event: Event) {\n emit('blur', event);\n }\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey) {\n return;\n }\n\n switch (event.code) {\n case 'ArrowLeft':\n moveToPrev(event);\n event.preventDefault();\n break;\n\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n\n case 'Backspace':\n if (event.target?.['value'].length === 0) {\n moveToPrev(event);\n event.preventDefault();\n }\n break;\n\n case 'ArrowRight':\n moveToNext(event);\n event.preventDefault();\n\n break;\n\n case 'Enter':\n case 'NumpadEnter':\n case 'Tab':\n break;\n\n default:\n if (\n !(event.code !== 'Space' && Number(event.key) >= 0 && Number(event.key) <= 9) ||\n (data.value.join('').length >= props.digitCount && event.code !== 'Delete')\n ) {\n event.preventDefault();\n }\n\n break;\n }\n }\n\n function handlePaste(event: ClipboardEvent) {\n const paste = event.clipboardData?.getData('text');\n\n if (paste?.length) {\n const pastedCode = paste?.substring(0, props.digitCount);\n\n const parsed = parseInt(pastedCode);\n\n if (!isNaN(parsed)) {\n data.value = pastedCode.split('');\n updateModel(event);\n }\n }\n\n event.preventDefault();\n }\n\n watch(\n () => props.modelValue,\n (newValue) => {\n data.value = newValue ? newValue.split('') : new Array(props.digitCount);\n },\n );\n</script>\n\n<template>\n <div\n class=\"stash-confirmation-code-input inline-block\"\n data-test=\"stash-confirmation-code-input\"\n :class=\"[classes['stash-confirmation-code-input-container']]\"\n >\n <div class=\"mb-3 flex gap-6\">\n <template v-for=\"field in props.digitCount\" :key=\"field\">\n <input\n data-test=\"stash-confirmation-code-input__otp\"\n class=\"border bg-white p-2 text-center text-base font-medium text-ice-900 focus:border-blue-500\"\n :class=\"[\n classes['otp-code-input'],\n { [classes['has-error']]: !!props.errorText },\n { [classes['has-success']]: !!props.successText },\n ]\"\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"1\"\n :value=\"data[field - 1]\"\n pattern=\"[0-9]\"\n autocomplete=\"one-time-code\"\n @input=\"handleInput($event as InputEvent, field - 1)\"\n @keydown=\"handleKeyDown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n />\n </template>\n </div>\n <small\n v-if=\"props.errorText\"\n class=\"mt-1 block whitespace-pre-line pr-6 text-center text-red-500\"\n data-test=\"field-error\"\n >\n {{ props.errorText }}\n </small>\n <small\n v-if=\"props.successText\"\n class=\"mt-1 block whitespace-pre-line pr-6 text-center text-green-500\"\n data-test=\"field-success\"\n >\n {{ props.successText }}\n </small>\n <small\n v-if=\"props.hintText\"\n class=\"mt-1 block whitespace-pre-line pr-6 text-center text-ice-700\"\n data-test=\"field-hint\"\n >\n {{ props.hintText }}\n </small>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n .stash-confirmation-code-input-container {\n --otp-digits: v-bind(digitCount);\n --otp-container-width: calc(var(--otp-digits) * 60px);\n\n width: var(--otp-container-width);\n }\n\n .otp-code-input {\n border-radius: 4px;\n caret-color: transparent;\n height: 36px;\n width: 36px;\n }\n\n .otp-code-input.has-error:not(:focus) {\n border-color: var(--color-red-500);\n }\n\n .otp-code-input.has-success:not(:focus) {\n border-color: var(--color-green-500);\n }\n\n .otp-code-input:focus {\n box-shadow: 0 0 0 3px rgb(0 114 240 / 15%);\n outline: none;\n }\n }\n</style>\n"],"names":["classes","useCssModule","props","__props","emit","__emit","data","ref","onMounted","_a","handleInput","event","index","updateModel","moveToPrev","moveToNext","newValue","prevInput","findPrevInput","nextInput","findNextInput","element","prevElement","nextElement","handleFocus","handleBlur","handleKeyDown","handlePaste","paste","pastedCode","parsed","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGE,UAAMA,IAAUC,EAAA,GAsBVC,IAAQC,GAQRC,IAAOC,GAOPC,IAA2BC,EAAI,EAAE;AAEvC,IAAAC,EAAU,MAAM;;AACd,MAAIN,EAAM,eACRI,EAAK,SAAQG,IAAAP,EAAM,eAAN,gBAAAO,EAAkB,MAAM;AAAA,IAEzC,CAAC;AAED,aAASC,EAAYC,GAAmBC,GAAO;;AAC7C,MAAAN,EAAK,MAAMM,CAAK,KAAIH,IAAAE,EAAM,WAAN,gBAAAF,EAAe,OACnCI,EAAYF,CAAK,GAEbA,EAAM,cAAc,0BACtBG,EAAWH,CAAK,KACPA,EAAM,cAAc,gBAAgBA,EAAM,cAAc,2BACjEI,EAAWJ,CAAK;AAAA,IAEpB;AAEA,aAASE,EAAYF,GAAc;AACjC,YAAMK,IAAWV,EAAK,MAAM,KAAK,EAAE;AACnC,MAAAF,EAAK,sBAAsBY,CAAQ,GACnCZ,EAAK,UAAU,EAAE,eAAeO,GAAO,OAAOK,GAAU;AAAA,IAC1D;AAEA,aAASF,EAAWH,GAAmC;AACrD,YAAMM,IAA8BC,EAAcP,EAAM,MAA0B;AAElF,MAAIM,MACFA,EAAU,MAAA,GACVA,EAAU,OAAA;AAAA,IAEd;AAEA,aAASF,EAAWJ,GAAmC;AACrD,YAAMQ,IAA8BC,EAAcT,EAAM,MAA0B;AAElF,MAAIQ,MACFA,EAAU,MAAA,GACVA,EAAU,OAAA;AAAA,IAEd;AAEA,aAASD,EAAcG,GAA2B;AAChD,YAAMC,IAAcD,EAAQ;AAE5B,UAAKC;AAEL,eAAOA,EAAY,aAAa,UAAUA,IAAcJ,EAAcI,CAA+B;AAAA,IACvG;AAEA,aAASF,EAAcC,GAA2B;AAChD,YAAME,IAAcF,EAAQ;AAE5B,UAAKE;AAEL,eAAOA,EAAY,aAAa,UAAUA,IAAcH,EAAcG,CAA+B;AAAA,IACvG;AAEA,aAASC,EAAYb,GAAO;AAC1B,MAAAA,EAAM,OAAO,OAAA,GACbP,EAAK,SAASO,CAAK;AAAA,IACrB;AAEA,aAASc,EAAWd,GAAc;AAChC,MAAAP,EAAK,QAAQO,CAAK;AAAA,IACpB;AAEA,aAASe,EAAcf,GAAsB;;AAC3C,UAAI,EAAAA,EAAM,WAAWA,EAAM;AAI3B,gBAAQA,EAAM,MAAA;AAAA,UACZ,KAAK;AACH,YAAAG,EAAWH,CAAK,GAChBA,EAAM,eAAA;AACN;AAAA,UAEF,KAAK;AAAA,UACL,KAAK;AACH,YAAAA,EAAM,eAAA;AACN;AAAA,UAEF,KAAK;AACH,cAAIF,IAAAE,EAAM,WAAN,gBAAAF,EAAe,MAAS,YAAW,MACrCK,EAAWH,CAAK,GAChBA,EAAM,eAAA;AAER;AAAA,UAEF,KAAK;AACH,YAAAI,EAAWJ,CAAK,GAChBA,EAAM,eAAA;AAEN;AAAA,UAEF,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AACH;AAAA,UAEF;AACE,aACE,EAAEA,EAAM,SAAS,WAAW,OAAOA,EAAM,GAAG,KAAK,KAAK,OAAOA,EAAM,GAAG,KAAK,MAC1EL,EAAK,MAAM,KAAK,EAAE,EAAE,UAAUJ,EAAM,cAAcS,EAAM,SAAS,aAElEA,EAAM,eAAA;AAGR;AAAA,QAAA;AAAA,IAEN;AAEA,aAASgB,EAAYhB,GAAuB;;AAC1C,YAAMiB,KAAQnB,IAAAE,EAAM,kBAAN,gBAAAF,EAAqB,QAAQ;AAE3C,UAAImB,KAAA,QAAAA,EAAO,QAAQ;AACjB,cAAMC,IAAaD,KAAA,gBAAAA,EAAO,UAAU,GAAG1B,EAAM,aAEvC4B,IAAS,SAASD,CAAU;AAElC,QAAK,MAAMC,CAAM,MACfxB,EAAK,QAAQuB,EAAW,MAAM,EAAE,GAChChB,EAAYF,CAAK;AAAA,MAErB;AAEA,MAAAA,EAAM,eAAA;AAAA,IACR;AAEA,WAAAoB;AAAA,MACE,MAAM7B,EAAM;AAAA,MACZ,CAACc,MAAa;AACZ,QAAAV,EAAK,QAAQU,IAAWA,EAAS,MAAM,EAAE,IAAI,IAAI,MAAMd,EAAM,UAAU;AAAA,MACzE;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
- import { defineComponent as _, computed as C, resolveComponent as g, createElementBlock as l, openBlock as s, Fragment as u, renderList as x, createBlock as E, normalizeClass as d, toDisplayString as f, withCtx as S, createTextVNode as b } from "vue";
1
+ import { defineComponent as _, computed as C, resolveComponent as g, createElementBlock as l, openBlock as s, Fragment as d, renderList as x, createBlock as E, normalizeClass as f, toDisplayString as h, withCtx as S, createTextVNode as b } from "vue";
2
2
  import { APPS as a } from "./constants.js";
3
3
  import { setPersistentItem as T, getPersistentItem as v, removePersistentItem as R } from "./utils/storage.js";
4
4
  const N = {
5
- class: "stash-context-switcher tw-mx-auto tw-flex tw-w-64 tw-rounded-full tw-border tw-border-white/10 tw-bg-purple-700 tw-p-1.5 tw-text-center",
5
+ class: "stash-context-switcher mx-auto flex w-64 rounded-full border border-white/10 bg-purple-700 p-1.5 text-center",
6
6
  "data-test": "stash-context-switcher"
7
- }, B = ["href", "onClick"], h = "-last-session", L = /* @__PURE__ */ _({
7
+ }, B = ["href", "onClick"], A = "-last-session", L = /* @__PURE__ */ _({
8
8
  name: "ll-context-switcher",
9
9
  __name: "ContextSwitcher",
10
10
  props: {
@@ -17,52 +17,52 @@ const N = {
17
17
  routeQuery: { default: () => ({}) }
18
18
  },
19
19
  emits: ["click", "switch"],
20
- setup(A, { emit: y }) {
21
- const e = A, p = y, P = C(() => [
20
+ setup(y, { emit: w }) {
21
+ const t = y, p = w, P = C(() => [
22
22
  {
23
23
  app: a.MARKETPLACE,
24
- name: e.portalAccess.commercePortal ? "dashboard" : e.limitedAccessUrl,
25
- hasBaseRoute: e.portalAccess.commercePortal
24
+ name: t.portalAccess.commercePortal ? "dashboard" : t.limitedAccessUrl,
25
+ hasBaseRoute: t.portalAccess.commercePortal
26
26
  },
27
27
  {
28
28
  app: a.PAYMENTS,
29
- name: e.portalAccess.paymentsPortal ? "payments" : e.limitedAccessUrl,
29
+ name: t.portalAccess.paymentsPortal ? "payments" : t.limitedAccessUrl,
30
30
  hasBaseRoute: !1
31
31
  }
32
32
  ]);
33
33
  function m(o, n) {
34
- if (n === e.activeApp)
34
+ if (n === t.activeApp)
35
35
  return;
36
36
  const r = window.location.href;
37
- let t = o.target.href;
38
- if (e.portalAccess.paymentsPortal && e.portalAccess.commercePortal) {
39
- const k = `${n === a.PAYMENTS ? a.MARKETPLACE : a.PAYMENTS}${h}`, w = `${n}${h}`;
37
+ let e = o.target.href;
38
+ if (t.portalAccess.paymentsPortal && t.portalAccess.commercePortal) {
39
+ const k = `${n === a.PAYMENTS ? a.MARKETPLACE : a.PAYMENTS}${A}`, u = `${n}${A}`;
40
40
  T(k, r, { global: !0 });
41
- const i = v(w, { global: !0 });
42
- i && (o.preventDefault(), t = i, window.location.href = i, R(w, { global: !0 }));
41
+ const i = v(u, { global: !0 });
42
+ i && (o.preventDefault(), e = i, window.location.href = i, R(u, { global: !0 }));
43
43
  }
44
- p("click", { from: r, to: t }), p("switch", o, { from: r, to: t });
44
+ p("click", { from: r, to: e }), p("switch", o, { from: r, to: e });
45
45
  }
46
46
  return (o, n) => {
47
47
  const r = g("router-link");
48
48
  return s(), l("div", N, [
49
- (s(!0), l(u, null, x(P.value, (t) => (s(), l(u, {
50
- key: t.app
49
+ (s(!0), l(d, null, x(P.value, (e) => (s(), l(d, {
50
+ key: e.app
51
51
  }, [
52
- t.hasBaseRoute ? (s(), l("a", {
52
+ e.hasBaseRoute ? (s(), l("a", {
53
53
  key: 0,
54
- class: d(["tw-w-1/2 tw-cursor-pointer tw-rounded-full tw-py-2.5 tw-font-semibold !tw-capitalize tw-leading-none !tw-no-underline", e.activeApp === t.app ? "tw-text-white tw-bg-royal-500" : "tw-text-ice-500"]),
55
- href: `/${t.name}`,
56
- onClick: (c) => m(c, t.app)
57
- }, f(t.app), 11, B)) : (s(), E(r, {
54
+ class: f(["w-1/2 cursor-pointer rounded-full py-2.5 font-semibold !capitalize leading-none !no-underline", t.activeApp === e.app ? "text-white bg-royal-500" : "text-ice-500"]),
55
+ href: `/${e.name}`,
56
+ onClick: (c) => m(c, e.app)
57
+ }, h(e.app), 11, B)) : (s(), E(r, {
58
58
  key: 1,
59
- class: d(["tw-w-1/2 tw-cursor-pointer tw-rounded-full tw-py-2.5 tw-font-semibold !tw-capitalize tw-leading-none !tw-no-underline", e.activeApp === t.app ? "tw-text-white tw-bg-royal-500" : "tw-text-ice-500"]),
60
- to: { name: t.name, query: o.routeQuery },
61
- "data-test-route": JSON.stringify({ name: t.name, query: o.routeQuery }),
62
- onClick: (c) => m(c, t.app)
59
+ class: f(["w-1/2 cursor-pointer rounded-full py-2.5 font-semibold !capitalize leading-none !no-underline", t.activeApp === e.app ? "text-white bg-royal-500" : "text-ice-500"]),
60
+ to: { name: e.name, query: o.routeQuery },
61
+ "data-test-route": JSON.stringify({ name: e.name, query: o.routeQuery }),
62
+ onClick: (c) => m(c, e.app)
63
63
  }, {
64
64
  default: S(() => [
65
- b(f(t.app), 1)
65
+ b(h(e.app), 1)
66
66
  ]),
67
67
  _: 2
68
68
  }, 1032, ["class", "to", "data-test-route", "onClick"]))
@@ -1 +1 @@
1
- {"version":3,"file":"ContextSwitcher.js","sources":["../src/components/ContextSwitcher/ContextSwitcher.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n import type { LocationQuery } from 'vue-router';\n\n import { APPS } from '../../constants';\n import { getPersistentItem, removePersistentItem, setPersistentItem } from '../../utils/storage';\n\n defineOptions({\n name: 'll-context-switcher',\n });\n\n type AppValues = (typeof APPS)[keyof typeof APPS];\n\n export interface ContextSwitcherProps {\n /**\n * The current app that is active. Choices are 'marketplace' | 'payments'.\n */\n activeApp: AppValues;\n\n /**\n * Portal access to both marketplace and payments.\n */\n portalAccess?: {\n commercePortal: boolean;\n paymentsPortal: boolean;\n };\n\n /**\n * Url to replace the other app if current user does not have portal access.\n */\n limitedAccessUrl: string;\n\n routeQuery?: LocationQuery;\n }\n\n const props = withDefaults(defineProps<ContextSwitcherProps>(), {\n portalAccess: () => ({\n commercePortal: false,\n paymentsPortal: false,\n }),\n routeQuery: () => ({}),\n });\n\n const emit = defineEmits<{\n /**\n * Fires on click of the context switcher.\n * @deprecated Use `switch` instead.\n */\n (e: 'click', urlInfo: { from: string; to: string }): void;\n /**\n * Fires on click of the context switcher.\n */\n (e: 'switch', evt: MouseEvent, urlInfo: { from: string; to: string }): void;\n }>();\n\n interface ContextItem {\n app: AppValues;\n name: string;\n hasBaseRoute: boolean;\n }\n\n const CONTEXT_SWITCHER_STORAGE_KEY = '-last-session';\n\n const routes = computed<ContextItem[]>(() => {\n return [\n {\n app: APPS.MARKETPLACE,\n name: props.portalAccess.commercePortal ? 'dashboard' : props.limitedAccessUrl,\n hasBaseRoute: props.portalAccess.commercePortal,\n },\n {\n app: APPS.PAYMENTS,\n name: props.portalAccess.paymentsPortal ? 'payments' : props.limitedAccessUrl,\n hasBaseRoute: false,\n },\n ];\n });\n\n /**\n * Saves the current url in local storage before leaving the current app, if user has access to both apps\n * If a previous session url exists, redirect users there instead then remove the local storage item afterward.\n *\n * @param event - Event from user click.\n * @param app - App name of the clicked link, is a key of `APPS`.\n */\n function handleClick(event: MouseEvent, app: AppValues) {\n if (app === props.activeApp) {\n return;\n }\n\n const currentLocation = window.location.href;\n let destination = (event.target as HTMLAnchorElement).href;\n\n if (props.portalAccess.paymentsPortal && props.portalAccess.commercePortal) {\n const appRoute = app === APPS.PAYMENTS ? APPS.MARKETPLACE : APPS.PAYMENTS;\n const currentSessionName = `${appRoute}${CONTEXT_SWITCHER_STORAGE_KEY}`;\n const prevSessionName = `${app}${CONTEXT_SWITCHER_STORAGE_KEY}`;\n\n // save the current url in local storage\n setPersistentItem(currentSessionName, currentLocation, { global: true });\n\n // get the other app's url from local storage\n const prevSessionUrl = getPersistentItem(prevSessionName, { global: true });\n\n // if it exists, redirect users to such location and remove the item from local storage\n if (prevSessionUrl) {\n event.preventDefault();\n destination = prevSessionUrl;\n window.location.href = prevSessionUrl;\n removePersistentItem(prevSessionName, { global: true });\n }\n }\n\n emit('click', { from: currentLocation, to: destination });\n emit('switch', event, { from: currentLocation, to: destination });\n }\n</script>\n\n<template>\n <div\n class=\"stash-context-switcher tw-mx-auto tw-flex tw-w-64 tw-rounded-full tw-border tw-border-white/10 tw-bg-purple-700 tw-p-1.5 tw-text-center\"\n data-test=\"stash-context-switcher\"\n >\n <template v-for=\"route in routes\" :key=\"route.app\">\n <!-- render anchor tag to override base route in Payments -->\n <a\n v-if=\"route.hasBaseRoute\"\n class=\"tw-w-1/2 tw-cursor-pointer tw-rounded-full tw-py-2.5 tw-font-semibold !tw-capitalize tw-leading-none !tw-no-underline\"\n :class=\"props.activeApp === route.app ? 'tw-text-white tw-bg-royal-500' : 'tw-text-ice-500'\"\n :href=\"`/${route.name}`\"\n @click=\"(evt) => handleClick(evt, route.app)\"\n >\n {{ route.app }}\n </a>\n\n <router-link\n v-else\n class=\"tw-w-1/2 tw-cursor-pointer tw-rounded-full tw-py-2.5 tw-font-semibold !tw-capitalize tw-leading-none !tw-no-underline\"\n :class=\"props.activeApp === route.app ? 'tw-text-white tw-bg-royal-500' : 'tw-text-ice-500'\"\n :to=\"{ name: route.name, query: routeQuery }\"\n :data-test-route=\"JSON.stringify({ name: route.name, query: routeQuery })\"\n @click=\"(evt) => handleClick(evt, route.app)\"\n >\n {{ route.app }}\n </router-link>\n </template>\n </div>\n</template>\n"],"names":["CONTEXT_SWITCHER_STORAGE_KEY","props","__props","emit","__emit","routes","computed","APPS","handleClick","event","app","currentLocation","destination","currentSessionName","prevSessionName","setPersistentItem","prevSessionUrl","getPersistentItem","removePersistentItem"],"mappings":";;;;;;4BA6DQA,IAA+B;;;;;;;;;;;;;;AA1BrC,UAAMC,IAAQC,GAQRC,IAAOC,GAoBPC,IAASC,EAAwB,MAC9B;AAAA,MACL;AAAA,QACE,KAAKC,EAAK;AAAA,QACV,MAAMN,EAAM,aAAa,iBAAiB,cAAcA,EAAM;AAAA,QAC9D,cAAcA,EAAM,aAAa;AAAA,MAAA;AAAA,MAEnC;AAAA,QACE,KAAKM,EAAK;AAAA,QACV,MAAMN,EAAM,aAAa,iBAAiB,aAAaA,EAAM;AAAA,QAC7D,cAAc;AAAA,MAAA;AAAA,IAChB,CAEH;AASD,aAASO,EAAYC,GAAmBC,GAAgB;AACtD,UAAIA,MAAQT,EAAM;AAChB;AAGF,YAAMU,IAAkB,OAAO,SAAS;AACxC,UAAIC,IAAeH,EAAM,OAA6B;AAEtD,UAAIR,EAAM,aAAa,kBAAkBA,EAAM,aAAa,gBAAgB;AAE1E,cAAMY,IAAqB,GADVH,MAAQH,EAAK,WAAWA,EAAK,cAAcA,EAAK,QAC3B,GAAGP,CAA4B,IAC/Dc,IAAkB,GAAGJ,CAAG,GAAGV,CAA4B;AAG7D,QAAAe,EAAkBF,GAAoBF,GAAiB,EAAE,QAAQ,IAAM;AAGvE,cAAMK,IAAiBC,EAAkBH,GAAiB,EAAE,QAAQ,IAAM;AAG1E,QAAIE,MACFP,EAAM,eAAA,GACNG,IAAcI,GACd,OAAO,SAAS,OAAOA,GACvBE,EAAqBJ,GAAiB,EAAE,QAAQ,GAAA,CAAM;AAAA,MAE1D;AAEA,MAAAX,EAAK,SAAS,EAAE,MAAMQ,GAAiB,IAAIC,GAAa,GACxDT,EAAK,UAAUM,GAAO,EAAE,MAAME,GAAiB,IAAIC,GAAa;AAAA,IAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ContextSwitcher.js","sources":["../src/components/ContextSwitcher/ContextSwitcher.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n import type { LocationQuery } from 'vue-router';\n\n import { APPS } from '../../constants';\n import { getPersistentItem, removePersistentItem, setPersistentItem } from '../../utils/storage';\n\n defineOptions({\n name: 'll-context-switcher',\n });\n\n type AppValues = (typeof APPS)[keyof typeof APPS];\n\n export interface ContextSwitcherProps {\n /**\n * The current app that is active. Choices are 'marketplace' | 'payments'.\n */\n activeApp: AppValues;\n\n /**\n * Portal access to both marketplace and payments.\n */\n portalAccess?: {\n commercePortal: boolean;\n paymentsPortal: boolean;\n };\n\n /**\n * Url to replace the other app if current user does not have portal access.\n */\n limitedAccessUrl: string;\n\n routeQuery?: LocationQuery;\n }\n\n const props = withDefaults(defineProps<ContextSwitcherProps>(), {\n portalAccess: () => ({\n commercePortal: false,\n paymentsPortal: false,\n }),\n routeQuery: () => ({}),\n });\n\n const emit = defineEmits<{\n /**\n * Fires on click of the context switcher.\n * @deprecated Use `switch` instead.\n */\n (e: 'click', urlInfo: { from: string; to: string }): void;\n /**\n * Fires on click of the context switcher.\n */\n (e: 'switch', evt: MouseEvent, urlInfo: { from: string; to: string }): void;\n }>();\n\n interface ContextItem {\n app: AppValues;\n name: string;\n hasBaseRoute: boolean;\n }\n\n const CONTEXT_SWITCHER_STORAGE_KEY = '-last-session';\n\n const routes = computed<ContextItem[]>(() => {\n return [\n {\n app: APPS.MARKETPLACE,\n name: props.portalAccess.commercePortal ? 'dashboard' : props.limitedAccessUrl,\n hasBaseRoute: props.portalAccess.commercePortal,\n },\n {\n app: APPS.PAYMENTS,\n name: props.portalAccess.paymentsPortal ? 'payments' : props.limitedAccessUrl,\n hasBaseRoute: false,\n },\n ];\n });\n\n /**\n * Saves the current url in local storage before leaving the current app, if user has access to both apps\n * If a previous session url exists, redirect users there instead then remove the local storage item afterward.\n *\n * @param event - Event from user click.\n * @param app - App name of the clicked link, is a key of `APPS`.\n */\n function handleClick(event: MouseEvent, app: AppValues) {\n if (app === props.activeApp) {\n return;\n }\n\n const currentLocation = window.location.href;\n let destination = (event.target as HTMLAnchorElement).href;\n\n if (props.portalAccess.paymentsPortal && props.portalAccess.commercePortal) {\n const appRoute = app === APPS.PAYMENTS ? APPS.MARKETPLACE : APPS.PAYMENTS;\n const currentSessionName = `${appRoute}${CONTEXT_SWITCHER_STORAGE_KEY}`;\n const prevSessionName = `${app}${CONTEXT_SWITCHER_STORAGE_KEY}`;\n\n // save the current url in local storage\n setPersistentItem(currentSessionName, currentLocation, { global: true });\n\n // get the other app's url from local storage\n const prevSessionUrl = getPersistentItem(prevSessionName, { global: true });\n\n // if it exists, redirect users to such location and remove the item from local storage\n if (prevSessionUrl) {\n event.preventDefault();\n destination = prevSessionUrl;\n window.location.href = prevSessionUrl;\n removePersistentItem(prevSessionName, { global: true });\n }\n }\n\n emit('click', { from: currentLocation, to: destination });\n emit('switch', event, { from: currentLocation, to: destination });\n }\n</script>\n\n<template>\n <div\n class=\"stash-context-switcher mx-auto flex w-64 rounded-full border border-white/10 bg-purple-700 p-1.5 text-center\"\n data-test=\"stash-context-switcher\"\n >\n <template v-for=\"route in routes\" :key=\"route.app\">\n <!-- render anchor tag to override base route in Payments -->\n <a\n v-if=\"route.hasBaseRoute\"\n class=\"w-1/2 cursor-pointer rounded-full py-2.5 font-semibold !capitalize leading-none !no-underline\"\n :class=\"props.activeApp === route.app ? 'text-white bg-royal-500' : 'text-ice-500'\"\n :href=\"`/${route.name}`\"\n @click=\"(evt) => handleClick(evt, route.app)\"\n >\n {{ route.app }}\n </a>\n\n <router-link\n v-else\n class=\"w-1/2 cursor-pointer rounded-full py-2.5 font-semibold !capitalize leading-none !no-underline\"\n :class=\"props.activeApp === route.app ? 'text-white bg-royal-500' : 'text-ice-500'\"\n :to=\"{ name: route.name, query: routeQuery }\"\n :data-test-route=\"JSON.stringify({ name: route.name, query: routeQuery })\"\n @click=\"(evt) => handleClick(evt, route.app)\"\n >\n {{ route.app }}\n </router-link>\n </template>\n </div>\n</template>\n"],"names":["CONTEXT_SWITCHER_STORAGE_KEY","props","__props","emit","__emit","routes","computed","APPS","handleClick","event","app","currentLocation","destination","currentSessionName","prevSessionName","setPersistentItem","prevSessionUrl","getPersistentItem","removePersistentItem"],"mappings":";;;;;;4BA6DQA,IAA+B;;;;;;;;;;;;;;AA1BrC,UAAMC,IAAQC,GAQRC,IAAOC,GAoBPC,IAASC,EAAwB,MAC9B;AAAA,MACL;AAAA,QACE,KAAKC,EAAK;AAAA,QACV,MAAMN,EAAM,aAAa,iBAAiB,cAAcA,EAAM;AAAA,QAC9D,cAAcA,EAAM,aAAa;AAAA,MAAA;AAAA,MAEnC;AAAA,QACE,KAAKM,EAAK;AAAA,QACV,MAAMN,EAAM,aAAa,iBAAiB,aAAaA,EAAM;AAAA,QAC7D,cAAc;AAAA,MAAA;AAAA,IAChB,CAEH;AASD,aAASO,EAAYC,GAAmBC,GAAgB;AACtD,UAAIA,MAAQT,EAAM;AAChB;AAGF,YAAMU,IAAkB,OAAO,SAAS;AACxC,UAAIC,IAAeH,EAAM,OAA6B;AAEtD,UAAIR,EAAM,aAAa,kBAAkBA,EAAM,aAAa,gBAAgB;AAE1E,cAAMY,IAAqB,GADVH,MAAQH,EAAK,WAAWA,EAAK,cAAcA,EAAK,QAC3B,GAAGP,CAA4B,IAC/Dc,IAAkB,GAAGJ,CAAG,GAAGV,CAA4B;AAG7D,QAAAe,EAAkBF,GAAoBF,GAAiB,EAAE,QAAQ,IAAM;AAGvE,cAAMK,IAAiBC,EAAkBH,GAAiB,EAAE,QAAQ,IAAM;AAG1E,QAAIE,MACFP,EAAM,eAAA,GACNG,IAAcI,GACd,OAAO,SAAS,OAAOA,GACvBE,EAAqBJ,GAAiB,EAAE,QAAQ,GAAA,CAAM;AAAA,MAE1D;AAEA,MAAAX,EAAK,SAAS,EAAE,MAAMQ,GAAiB,IAAIC,GAAa,GACxDT,EAAK,UAAUM,GAAO,EAAE,MAAME,GAAiB,IAAIC,GAAa;AAAA,IAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Copy.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as m, useCssModule as _, ref as f, computed as h, createElementBlock as p, openBlock as e, normalizeClass as i, unref as s, renderSlot as v, withDirectives as x, createBlock as c, withCtx as C, createTextVNode as k, toDisplayString as w } from "vue";
1
+ import { defineComponent as _, useCssModule as m, ref as f, computed as h, createElementBlock as x, openBlock as o, normalizeClass as l, unref as p, renderSlot as v, createVNode as C, withCtx as i, createBlock as s, createTextVNode as k, toDisplayString as b } from "vue";
2
2
  import { UI_TIMEOUT as T } from "./constants.js";
3
- import b from "./directives/tooltip.js";
4
3
  import { t as n } from "./locale.js";
5
4
  import g from "./Button.js";
6
5
  import r from "./Icon.js";
6
+ import { _ as z } from "./Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js";
7
7
  import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- const M = /* @__PURE__ */ m({
8
+ const M = /* @__PURE__ */ _({
9
9
  __name: "Copy",
10
10
  props: {
11
11
  text: { default: void 0 },
@@ -13,60 +13,59 @@ const M = /* @__PURE__ */ m({
13
13
  visible: { type: Boolean, default: !1 }
14
14
  },
15
15
  setup(d) {
16
- const t = d, a = _(), o = f(!1), y = h(() => o.value ? n("ll.copy.copied") : t.text ? null : n("ll.copy.copyToClipboard"));
17
- function l() {
18
- navigator.clipboard.writeText(t.value), o.value = !0, setTimeout(() => {
19
- o.value = !1;
16
+ const t = d, c = m(), e = f(!1), y = h(() => e.value ? n("ll.copy.copied") : t.text ? null : n("ll.copy.copyToClipboard"));
17
+ function a() {
18
+ navigator.clipboard.writeText(t.value), e.value = !0, setTimeout(() => {
19
+ e.value = !1;
20
20
  }, T);
21
21
  }
22
- return (u, S) => (e(), p("div", {
23
- class: i(["stash-copy tw-flex tw-items-center", { [s(a).hidden]: !t.visible }]),
22
+ return (u, N) => (o(), x("div", {
23
+ class: l(["stash-copy flex items-center", { [p(c).hidden]: !t.visible }]),
24
24
  "data-test": "stash-copy"
25
25
  }, [
26
26
  v(u.$slots, "default"),
27
- x((e(), p("div", {
28
- class: i(["stash-copy__copy-zone tw-ml-3 tw-cursor-pointer", s(a).copy]),
27
+ C(z, {
28
+ side: "top",
29
+ text: y.value,
30
+ "is-disabled": !!t.text,
31
+ class: l(["stash-copy__copy-zone ml-3 cursor-pointer", p(c).copy]),
29
32
  "data-test": "stash-copy|copy-zone"
30
- }, [
31
- o.value ? (e(), c(r, {
32
- key: 0,
33
- class: "stash-copy__success-icon tw-text-green-500",
34
- name: "circle-check",
35
- "data-test": "stash-copy|success-icon"
36
- })) : t.text ? (e(), c(g, {
37
- key: 1,
38
- class: "stash-copy__copy-text",
39
- inline: "",
40
- "data-test": "stash-copy|copy-target",
41
- onClick: l
42
- }, {
43
- default: C(() => [
44
- k(w(t.text), 1)
45
- ]),
46
- _: 1
47
- })) : (e(), c(r, {
48
- key: 2,
49
- class: "stash-copy__copy-icon",
50
- name: "copy",
51
- title: "Copy to clipboard",
52
- "data-test": "stash-copy|copy-target",
53
- onClick: l
54
- }))
55
- ], 2)), [
56
- [
57
- s(b),
58
- y.value,
59
- void 0,
60
- { top: !0 }
61
- ]
62
- ])
33
+ }, {
34
+ default: i(() => [
35
+ e.value ? (o(), s(r, {
36
+ key: 0,
37
+ class: "stash-copy__success-icon text-green-500",
38
+ name: "circle-check",
39
+ "data-test": "stash-copy|success-icon"
40
+ })) : t.text ? (o(), s(g, {
41
+ key: 1,
42
+ class: "stash-copy__copy-text",
43
+ inline: "",
44
+ "data-test": "stash-copy|copy-target",
45
+ onClick: a
46
+ }, {
47
+ default: i(() => [
48
+ k(b(t.text), 1)
49
+ ]),
50
+ _: 1
51
+ })) : (o(), s(r, {
52
+ key: 2,
53
+ class: "stash-copy__copy-icon",
54
+ name: "copy",
55
+ title: "Copy to clipboard",
56
+ "data-test": "stash-copy|copy-target",
57
+ onClick: a
58
+ }))
59
+ ]),
60
+ _: 1
61
+ }, 8, ["text", "is-disabled", "class"])
63
62
  ], 2));
64
63
  }
65
- }), z = "_hidden_lkmi6_2", I = "_copy_lkmi6_3", D = {
66
- hidden: z,
67
- copy: I
64
+ }), I = "_hidden_z4re6_3", $ = "_copy_z4re6_4", w = {
65
+ hidden: I,
66
+ copy: $
68
67
  }, E = {
69
- $style: D
68
+ $style: w
70
69
  }, A = /* @__PURE__ */ B(M, [["__cssModules", E]]);
71
70
  export {
72
71
  A as default
package/dist/Copy.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Copy.js","sources":["../src/components/Copy/Copy.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useCssModule } from 'vue';\n\n import { UI_TIMEOUT } from '../../constants';\n import vTooltip from '../../directives/tooltip/tooltip';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export interface CopyProps {\n /**\n * Optional text to display instead of icon.\n */\n text?: string;\n\n /**\n * The value to copy to clipboard.\n */\n value?: string;\n\n /**\n * Sets the copy icon or text to always be visible. By default, icon/text only appears when hovering over slot content.\n */\n visible?: boolean;\n }\n\n const props = withDefaults(defineProps<CopyProps>(), {\n text: undefined,\n value: '', // Todo - We should default this to the content of the default slot so you can do <Copy>631f67a</Copy>.\n visible: false,\n });\n const classes = useCssModule();\n\n // Flag to indicate whether a user successfully copied the text to their clipboard.\n // Note: We reset this flag after a timeout to allow the user to copy the text multiple times.\n const isCopied = ref(false);\n\n const tooltip = computed(() => {\n return isCopied.value ? t('ll.copy.copied') : !props.text ? t('ll.copy.copyToClipboard') : null;\n });\n\n function handleCopy() {\n navigator.clipboard.writeText(props.value);\n isCopied.value = true;\n\n setTimeout(() => {\n isCopied.value = false;\n }, UI_TIMEOUT);\n }\n</script>\n\n<template>\n <div class=\"stash-copy tw-flex tw-items-center\" :class=\"{ [classes.hidden]: !props.visible }\" data-test=\"stash-copy\">\n <!-- @slot Anything you want to render. This is not what will be copied to the clipboard. -->\n <slot></slot>\n <div\n v-tooltip.top=\"tooltip\"\n class=\"stash-copy__copy-zone tw-ml-3 tw-cursor-pointer\"\n :class=\"classes.copy\"\n data-test=\"stash-copy|copy-zone\"\n >\n <Icon\n v-if=\"isCopied\"\n class=\"stash-copy__success-icon tw-text-green-500\"\n name=\"circle-check\"\n data-test=\"stash-copy|success-icon\"\n />\n <Button\n v-else-if=\"props.text\"\n class=\"stash-copy__copy-text\"\n inline\n data-test=\"stash-copy|copy-target\"\n @click=\"handleCopy\"\n >\n {{ props.text }}\n </Button>\n <Icon\n v-else\n class=\"stash-copy__copy-icon\"\n name=\"copy\"\n title=\"Copy to clipboard\"\n data-test=\"stash-copy|copy-target\"\n @click=\"handleCopy\"\n />\n </div>\n </div>\n</template>\n\n<style module>\n .hidden {\n .copy {\n visibility: hidden;\n }\n\n &:hover {\n .copy {\n visibility: visible;\n }\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","isCopied","ref","tooltip","computed","t","handleCopy","UI_TIMEOUT"],"mappings":";;;;;;;;;;;;;;;AA0BE,UAAMA,IAAQC,GAKRC,IAAUC,EAAA,GAIVC,IAAWC,EAAI,EAAK,GAEpBC,IAAUC,EAAS,MAChBH,EAAS,QAAQI,EAAE,gBAAgB,IAAKR,EAAM,OAAsC,OAA/BQ,EAAE,yBAAyB,CACxF;AAED,aAASC,IAAa;AACpB,gBAAU,UAAU,UAAUT,EAAM,KAAK,GACzCI,EAAS,QAAQ,IAEjB,WAAW,MAAM;AACf,QAAAA,EAAS,QAAQ;AAAA,MACnB,GAAGM,CAAU;AAAA,IACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Copy.js","sources":["../src/components/Copy/Copy.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useCssModule } from 'vue';\n\n import { UI_TIMEOUT } from '../../constants';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import Tooltip from '../Tooltip/Tooltip.vue';\n\n export interface CopyProps {\n /**\n * Optional text to display instead of icon.\n */\n text?: string;\n\n /**\n * The value to copy to clipboard.\n */\n value?: string;\n\n /**\n * Sets the copy icon or text to always be visible. By default, icon/text only appears when hovering over slot content.\n */\n visible?: boolean;\n }\n\n const props = withDefaults(defineProps<CopyProps>(), {\n text: undefined,\n value: '', // Todo - We should default this to the content of the default slot so you can do <Copy>631f67a</Copy>.\n visible: false,\n });\n const classes = useCssModule();\n\n // Flag to indicate whether a user successfully copied the text to their clipboard.\n // Note: We reset this flag after a timeout to allow the user to copy the text multiple times.\n const isCopied = ref(false);\n\n const tooltip = computed(() => {\n return isCopied.value ? t('ll.copy.copied') : !props.text ? t('ll.copy.copyToClipboard') : null;\n });\n\n function handleCopy() {\n navigator.clipboard.writeText(props.value);\n isCopied.value = true;\n\n setTimeout(() => {\n isCopied.value = false;\n }, UI_TIMEOUT);\n }\n</script>\n\n<template>\n <div class=\"stash-copy flex items-center\" :class=\"{ [classes.hidden]: !props.visible }\" data-test=\"stash-copy\">\n <!-- @slot Anything you want to render. This is not what will be copied to the clipboard. -->\n <slot></slot>\n <Tooltip\n side=\"top\"\n :text=\"tooltip\"\n :is-disabled=\"!!props.text\"\n class=\"stash-copy__copy-zone ml-3 cursor-pointer\"\n :class=\"classes.copy\"\n data-test=\"stash-copy|copy-zone\"\n >\n <Icon\n v-if=\"isCopied\"\n class=\"stash-copy__success-icon text-green-500\"\n name=\"circle-check\"\n data-test=\"stash-copy|success-icon\"\n />\n <Button\n v-else-if=\"props.text\"\n class=\"stash-copy__copy-text\"\n inline\n data-test=\"stash-copy|copy-target\"\n @click=\"handleCopy\"\n >\n {{ props.text }}\n </Button>\n <Icon\n v-else\n class=\"stash-copy__copy-icon\"\n name=\"copy\"\n title=\"Copy to clipboard\"\n data-test=\"stash-copy|copy-target\"\n @click=\"handleCopy\"\n />\n </Tooltip>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n .hidden {\n .copy {\n visibility: hidden;\n }\n\n &:hover {\n .copy {\n visibility: visible;\n }\n }\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","isCopied","ref","tooltip","computed","t","handleCopy","UI_TIMEOUT"],"mappings":";;;;;;;;;;;;;;;AA0BE,UAAMA,IAAQC,GAKRC,IAAUC,EAAA,GAIVC,IAAWC,EAAI,EAAK,GAEpBC,IAAUC,EAAS,MAChBH,EAAS,QAAQI,EAAE,gBAAgB,IAAKR,EAAM,OAAsC,OAA/BQ,EAAE,yBAAyB,CACxF;AAED,aAASC,IAAa;AACpB,gBAAU,UAAU,UAAUT,EAAM,KAAK,GACzCI,EAAS,QAAQ,IAEjB,WAAW,MAAM;AACf,QAAAA,EAAS,QAAQ;AAAA,MACnB,GAAGM,CAAU;AAAA,IACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -317,7 +317,7 @@ const ti = /* @__PURE__ */ C({
317
317
  __name: "CurrencyInput",
318
318
  props: {
319
319
  inputOptions: { default: void 0 },
320
- modelValue: { default: "" },
320
+ modelValue: { default: null },
321
321
  hidePrepend: { type: Boolean, default: !1 },
322
322
  autocomplete: {},
323
323
  value: {},