@leaflink/stash 48.16.1 → 48.16.2

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 (270) hide show
  1. package/dist/Accordion.js +1 -1
  2. package/dist/Accordion.js.map +1 -1
  3. package/dist/Accordion.vue.d.ts +8 -9
  4. package/dist/ActionsDropdown.js.map +1 -1
  5. package/dist/ActionsDropdown.vue.d.ts +7 -8
  6. package/dist/AddressSelect.js +42 -38
  7. package/dist/AddressSelect.js.map +1 -1
  8. package/dist/AddressSelect.vue.d.ts +10 -11
  9. package/dist/Alert.js.map +1 -1
  10. package/dist/Alert.vue.d.ts +6 -7
  11. package/dist/AppNavigationItem.js +2 -2
  12. package/dist/AppNavigationItem.js.map +1 -1
  13. package/dist/AppNavigationItem.vue.d.ts +7 -8
  14. package/dist/AppSidebar.js +42 -42
  15. package/dist/AppSidebar.js.map +1 -1
  16. package/dist/AppSidebar.vue.d.ts +8 -9
  17. package/dist/AppTopbar.js +16 -16
  18. package/dist/AppTopbar.js.map +1 -1
  19. package/dist/AppTopbar.vue.d.ts +8 -9
  20. package/dist/Avatar.js.map +1 -1
  21. package/dist/Avatar.vue.d.ts +7 -8
  22. package/dist/Backdrop.vue.d.ts +3 -5
  23. package/dist/Badge.js +1 -1
  24. package/dist/Badge.js.map +1 -1
  25. package/dist/Badge.vue.d.ts +7 -8
  26. package/dist/Box.vue.d.ts +6 -7
  27. package/dist/Box.vue_vue_type_script_setup_true_lang-69e5176b.js.map +1 -1
  28. package/dist/Button.js.map +1 -1
  29. package/dist/Button.vue.d.ts +7 -8
  30. package/dist/ButtonGroup.js +29 -29
  31. package/dist/ButtonGroup.js.map +1 -1
  32. package/dist/ButtonGroup.vue.d.ts +8 -9
  33. package/dist/Card.js.map +1 -1
  34. package/dist/Card.vue.d.ts +6 -7
  35. package/dist/CardContent.vue.d.ts +3 -5
  36. package/dist/CardFooter.vue.d.ts +3 -5
  37. package/dist/CardHeader.js.map +1 -1
  38. package/dist/CardHeader.vue.d.ts +3 -4
  39. package/dist/CardMedia.js +6 -6
  40. package/dist/CardMedia.js.map +1 -1
  41. package/dist/CardMedia.vue.d.ts +3 -4
  42. package/dist/Carousel.js +249 -249
  43. package/dist/Carousel.js.map +1 -1
  44. package/dist/Carousel.vue.d.ts +9 -9
  45. package/dist/Checkbox.js +27 -27
  46. package/dist/Checkbox.js.map +1 -1
  47. package/dist/Checkbox.vue.d.ts +11 -12
  48. package/dist/ChevronToggle.js +1 -1
  49. package/dist/ChevronToggle.vue.d.ts +8 -9
  50. package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js → ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js} +11 -11
  51. package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js.map → ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js.map} +1 -1
  52. package/dist/Chip.js +30 -30
  53. package/dist/Chip.js.map +1 -1
  54. package/dist/Chip.vue.d.ts +9 -10
  55. package/dist/ConfirmationCodeInput.js +25 -25
  56. package/dist/ConfirmationCodeInput.js.map +1 -1
  57. package/dist/ConfirmationCodeInput.vue.d.ts +8 -9
  58. package/dist/ContextSwitcher.js +18 -18
  59. package/dist/ContextSwitcher.js.map +1 -1
  60. package/dist/ContextSwitcher.vue.d.ts +9 -10
  61. package/dist/Copy.js.map +1 -1
  62. package/dist/Copy.vue.d.ts +6 -7
  63. package/dist/CurrencyInput.js +93 -93
  64. package/dist/CurrencyInput.js.map +1 -1
  65. package/dist/CurrencyInput.vue.d.ts +10 -11
  66. package/dist/CustomRender.vue.d.ts +3 -15
  67. package/dist/DataView.js +97 -97
  68. package/dist/DataView.js.map +1 -1
  69. package/dist/DataView.vue.d.ts +9 -10
  70. package/dist/DataViewFilters.js +153 -150
  71. package/dist/DataViewFilters.js.map +1 -1
  72. package/dist/DataViewFilters.vue.d.ts +9 -10
  73. package/dist/DataViewSortButton.js.map +1 -1
  74. package/dist/DataViewSortButton.vue.d.ts +6 -7
  75. package/dist/DataViewToolbar.js +27 -27
  76. package/dist/DataViewToolbar.js.map +1 -1
  77. package/dist/DataViewToolbar.vue.d.ts +8 -9
  78. package/dist/DatePicker.js +738 -738
  79. package/dist/DatePicker.js.map +1 -1
  80. package/dist/DatePicker.vue.d.ts +11 -12
  81. package/dist/DescriptionList.js.map +1 -1
  82. package/dist/DescriptionList.vue.d.ts +6 -7
  83. package/dist/DescriptionListDetail.vue.d.ts +3 -5
  84. package/dist/DescriptionListGroup.vue.d.ts +3 -5
  85. package/dist/DescriptionListTerm.vue.d.ts +3 -5
  86. package/dist/Dialog.js +44 -44
  87. package/dist/Dialog.js.map +1 -1
  88. package/dist/Dialog.vue.d.ts +10 -11
  89. package/dist/Divider.vue.d.ts +3 -5
  90. package/dist/Dropdown.js +38 -38
  91. package/dist/Dropdown.js.map +1 -1
  92. package/dist/Dropdown.vue.d.ts +9 -10
  93. package/dist/EmptyState.js +20 -20
  94. package/dist/EmptyState.js.map +1 -1
  95. package/dist/EmptyState.vue.d.ts +6 -7
  96. package/dist/Expand.js +1 -1
  97. package/dist/Expand.vue.d.ts +8 -9
  98. package/dist/{Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js → Expand.vue_vue_type_script_setup_true_lang-0f236267.js} +19 -19
  99. package/dist/Expand.vue_vue_type_script_setup_true_lang-0f236267.js.map +1 -0
  100. package/dist/Field.vue.d.ts +6 -7
  101. package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js.map +1 -1
  102. package/dist/FileUpload.js +65 -65
  103. package/dist/FileUpload.js.map +1 -1
  104. package/dist/FileUpload.vue.d.ts +10 -11
  105. package/dist/FilterChip.js +27 -27
  106. package/dist/FilterChip.js.map +1 -1
  107. package/dist/FilterChip.vue.d.ts +8 -9
  108. package/dist/FilterDrawerItem.js +26 -26
  109. package/dist/FilterDrawerItem.js.map +1 -1
  110. package/dist/FilterDrawerItem.vue.d.ts +5 -6
  111. package/dist/FilterDropdown.js +49 -49
  112. package/dist/FilterDropdown.js.map +1 -1
  113. package/dist/FilterDropdown.vue.d.ts +8 -9
  114. package/dist/FilterSelect.js +23 -23
  115. package/dist/FilterSelect.js.map +1 -1
  116. package/dist/FilterSelect.vue.d.ts +8 -9
  117. package/dist/Filters.js +112 -104
  118. package/dist/Filters.js.map +1 -1
  119. package/dist/Filters.vue.d.ts +2204 -65
  120. package/dist/HttpError.js +42 -42
  121. package/dist/HttpError.js.map +1 -1
  122. package/dist/HttpError.vue.d.ts +6 -7
  123. package/dist/Icon.js.map +1 -1
  124. package/dist/Icon.vue.d.ts +7 -8
  125. package/dist/IconLabel.js.map +1 -1
  126. package/dist/IconLabel.vue.d.ts +8 -9
  127. package/dist/Illustration.vue.d.ts +6 -7
  128. package/dist/Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js.map +1 -1
  129. package/dist/Image.js +47 -47
  130. package/dist/Image.js.map +1 -1
  131. package/dist/Image.vue.d.ts +6 -7
  132. package/dist/InlineEdit.js +34 -34
  133. package/dist/InlineEdit.js.map +1 -1
  134. package/dist/InlineEdit.vue.d.ts +9 -10
  135. package/dist/Input.js +35 -35
  136. package/dist/Input.js.map +1 -1
  137. package/dist/Input.vue.d.ts +13 -14
  138. package/dist/InputOptions.js +33 -33
  139. package/dist/InputOptions.js.map +1 -1
  140. package/dist/InputOptions.vue.d.ts +8 -9
  141. package/dist/IntegrationIcon.js.map +1 -1
  142. package/dist/IntegrationIcon.vue.d.ts +7 -8
  143. package/dist/Label.vue.d.ts +6 -7
  144. package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -1
  145. package/dist/LicenseChip.js.map +1 -1
  146. package/dist/LicenseChip.vue.d.ts +6 -7
  147. package/dist/ListItem.vue.d.ts +225 -95
  148. package/dist/ListItemCell.vue.d.ts +4 -16
  149. package/dist/ListView.js +1 -1
  150. package/dist/ListView.vue.d.ts +5072 -470
  151. package/dist/Loading.js +16 -16
  152. package/dist/Loading.js.map +1 -1
  153. package/dist/Loading.vue.d.ts +3 -5
  154. package/dist/Logo.js +1 -1
  155. package/dist/Logo.vue.d.ts +9 -10
  156. package/dist/Logo.vue_vue_type_script_setup_true_lang-2a2597cb.js +196 -0
  157. package/dist/Logo.vue_vue_type_script_setup_true_lang-2a2597cb.js.map +1 -0
  158. package/dist/Menu.vue.d.ts +3 -5
  159. package/dist/MenuItem.vue.d.ts +3 -5
  160. package/dist/Metric.js.map +1 -1
  161. package/dist/Metric.vue.d.ts +6 -7
  162. package/dist/Modal.js +29 -29
  163. package/dist/Modal.js.map +1 -1
  164. package/dist/Modal.vue.d.ts +8 -9
  165. package/dist/Modals.js +8 -7
  166. package/dist/Modals.js.map +1 -1
  167. package/dist/Modals.vue.d.ts +3 -5
  168. package/dist/Module.js.map +1 -1
  169. package/dist/Module.vue.d.ts +7 -8
  170. package/dist/ModuleContent.vue.d.ts +3 -5
  171. package/dist/ModuleFooter.vue.d.ts +3 -5
  172. package/dist/ModuleHeader.js.map +1 -1
  173. package/dist/ModuleHeader.vue.d.ts +6 -7
  174. package/dist/ObfuscateText.js +1 -1
  175. package/dist/ObfuscateText.js.map +1 -1
  176. package/dist/ObfuscateText.vue.d.ts +6 -7
  177. package/dist/PageContent.vue.d.ts +3 -5
  178. package/dist/PageHeader.js.map +1 -1
  179. package/dist/PageHeader.vue.d.ts +6 -7
  180. package/dist/PageNavigation.js +30 -27
  181. package/dist/PageNavigation.js.map +1 -1
  182. package/dist/PageNavigation.vue.d.ts +8 -9
  183. package/dist/Paginate.js +32 -32
  184. package/dist/Paginate.js.map +1 -1
  185. package/dist/Paginate.vue.d.ts +8 -9
  186. package/dist/PlaidLink.js +29 -29
  187. package/dist/PlaidLink.js.map +1 -1
  188. package/dist/PlaidLink.vue.d.ts +11 -12
  189. package/dist/QuickAction.js.map +1 -1
  190. package/dist/QuickAction.vue.d.ts +4 -5
  191. package/dist/Radio.vue.d.ts +20 -1
  192. package/dist/RadioGroup.js +123 -123
  193. package/dist/RadioGroup.js.map +1 -1
  194. package/dist/RadioGroup.vue.d.ts +10 -11
  195. package/dist/RadioNew.js +102 -102
  196. package/dist/RadioNew.js.map +1 -1
  197. package/dist/RadioNew.vue.d.ts +10 -11
  198. package/dist/RangeInput.vue.d.ts +3 -5
  199. package/dist/SearchBar.js +36 -36
  200. package/dist/SearchBar.js.map +1 -1
  201. package/dist/SearchBar.vue.d.ts +9 -10
  202. package/dist/Select.js +792 -774
  203. package/dist/Select.js.map +1 -1
  204. package/dist/Select.vue.d.ts +14 -15
  205. package/dist/SelectStatus.js +27 -27
  206. package/dist/SelectStatus.js.map +1 -1
  207. package/dist/SelectStatus.vue.d.ts +12 -13
  208. package/dist/Skeleton.js.map +1 -1
  209. package/dist/Skeleton.vue.d.ts +7 -8
  210. package/dist/Step.js.map +1 -1
  211. package/dist/Step.vue.d.ts +7 -8
  212. package/dist/Stepper.js +19 -19
  213. package/dist/Stepper.js.map +1 -1
  214. package/dist/Stepper.vue.d.ts +9 -10
  215. package/dist/Switch.js +25 -25
  216. package/dist/Switch.js.map +1 -1
  217. package/dist/Switch.vue.d.ts +11 -12
  218. package/dist/Tab.js +2 -2
  219. package/dist/Tab.vue.d.ts +3 -4
  220. package/dist/{Tab.vue_vue_type_script_setup_true_lang-69d1b046.js → Tab.vue_vue_type_script_setup_true_lang-9aa53203.js} +5 -3
  221. package/dist/Tab.vue_vue_type_script_setup_true_lang-9aa53203.js.map +1 -0
  222. package/dist/Table.js +3 -3
  223. package/dist/Table.js.map +1 -1
  224. package/dist/{Table.keys-cf93df19.js → Table.keys-83e4f09b.js} +11 -11
  225. package/dist/{Table.keys-cf93df19.js.map → Table.keys-83e4f09b.js.map} +1 -1
  226. package/dist/Table.vue.d.ts +6 -7
  227. package/dist/TableCell.js +1 -1
  228. package/dist/TableCell.js.map +1 -1
  229. package/dist/TableCell.vue.d.ts +6 -7
  230. package/dist/TableHeaderCell.js +12 -12
  231. package/dist/TableHeaderCell.js.map +1 -1
  232. package/dist/TableHeaderCell.vue.d.ts +6 -7
  233. package/dist/TableHeaderRow.js +21 -21
  234. package/dist/TableHeaderRow.js.map +1 -1
  235. package/dist/TableHeaderRow.vue.d.ts +8 -9
  236. package/dist/TableRow.js +42 -42
  237. package/dist/TableRow.js.map +1 -1
  238. package/dist/TableRow.vue.d.ts +8 -9
  239. package/dist/Tabs.js +2 -2
  240. package/dist/Tabs.vue.d.ts +8 -9
  241. package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js → Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js} +37 -37
  242. package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js.map +1 -0
  243. package/dist/TextEditor.js +565 -565
  244. package/dist/TextEditor.js.map +1 -1
  245. package/dist/TextEditor.vue.d.ts +12 -13
  246. package/dist/Textarea.js +28 -28
  247. package/dist/Textarea.js.map +1 -1
  248. package/dist/Textarea.vue.d.ts +10 -11
  249. package/dist/Timeline.js.map +1 -1
  250. package/dist/Timeline.vue.d.ts +6 -7
  251. package/dist/TimelineItem.js +21 -21
  252. package/dist/TimelineItem.js.map +1 -1
  253. package/dist/TimelineItem.vue.d.ts +13 -6
  254. package/dist/Toast.js +134 -134
  255. package/dist/Toast.js.map +1 -1
  256. package/dist/Toast.vue.d.ts +6 -7
  257. package/dist/Toasts.vue.d.ts +3 -5
  258. package/dist/components.css +1 -1
  259. package/dist/index.js.map +1 -1
  260. package/dist/tailwind-base.js.map +1 -1
  261. package/dist/usePlaidLink.d.ts +1 -6
  262. package/dist/useScriptTag.d.ts +3 -8
  263. package/dist/useStepper.d.ts +7 -2
  264. package/package.json +1 -1
  265. package/tailwind-base.ts +13 -6
  266. package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +0 -1
  267. package/dist/Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js +0 -196
  268. package/dist/Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js.map +0 -1
  269. package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +0 -1
  270. package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sources":["../src/components/Stepper/Stepper.vue"],"sourcesContent":["<script lang=\"ts\">\n import { StepperOrientation, StepperTheme } from './Stepper.types';\n export * from './Stepper.types';\n\n export interface StepperProps {\n /**\n * The current step index\n */\n step?: number;\n /**\n * The current substep index\n */\n substep?: number;\n /**\n * A linear stepper prevents navigation to steps that are ahead of the completed ones\n */\n linear?: boolean;\n /**\n * Determines whether the stepper is horizontal or vertical\n */\n orientation?: StepperOrientation;\n /**\n * Force responsive view on horizontal orientation\n */\n useResponsiveNav?: boolean;\n /**\n * Determines the theme of the stepper\n */\n theme?: StepperTheme;\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, watch, watchEffect } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import useStepper from '../../composables/useStepper/useStepper';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import { STEPPER_INJECTION_KEY } from './keys';\n\n const props = withDefaults(defineProps<StepperProps>(), {\n step: -1,\n substep: -1,\n linear: false,\n orientation: 'vertical',\n theme: 'dark',\n useResponsiveNav: false,\n });\n\n const emit =\n defineEmits<{\n /**\n * Emitted when the step changes\n */\n (e: 'update:step', step: number): void;\n /**\n * Emitted when the substep changes\n */\n (e: 'update:substep', substep: number): void;\n }>();\n\n const stepperListRef = ref();\n const stepper = useStepper({\n linear: props.linear,\n activeStep: props.step,\n activeSubstep: props.substep,\n ref: stepperListRef,\n });\n\n const isLargeScreen = useMediaQuery('screen and (min-width: 961px)');\n const showResponsiveNav = computed(\n () => props.orientation === 'horizontal' && (!isLargeScreen.value || props.useResponsiveNav),\n );\n const isPrevArrowDisabled = computed(() => stepper.activeStepIndex.value <= 0);\n const isNextArrowDisabled = computed(\n () =>\n !stepper.isStepCompleted(stepper.activeStepIndex.value) ||\n stepper.activeStepIndex.value === stepper.steps.value.length - 1,\n );\n\n watch(\n () => props.step,\n (value) => (stepper.activeStepIndex.value = value),\n );\n\n watch(\n () => props.substep,\n (value) => (stepper.activeSubstepIndex.value = value),\n );\n\n watch(\n () => stepper.activeStepIndex.value,\n (value) => {\n emit('update:step', value);\n scrollToStep();\n },\n );\n\n watch(\n () => stepper.activeSubstepIndex.value,\n (value) => emit('update:substep', value),\n );\n\n /**\n * Watches for media query changes to determine if the mobile horizontal stepper is active.\n * This is done to ensure the mobile stepper remains in sync with any step changes at the desktop view.\n */\n watchEffect(() => {\n if (showResponsiveNav.value) {\n scrollToStep();\n }\n });\n\n provide(STEPPER_INJECTION_KEY, {\n registerStep: stepper.registerStep,\n orientation: props.orientation,\n stepCount: stepper.stepCount,\n theme: props.theme,\n showResponsiveNav,\n });\n\n defineExpose({\n back: stepper.back,\n next: stepper.next,\n goTo: stepper.goTo,\n isStepCompleted: stepper.isStepCompleted,\n isStepActive: stepper.isStepActive,\n });\n\n /**\n * Scrolls to the active step when the horizontal stepper is active.\n * This limited to top-level steps only.\n */\n async function scrollToStep() {\n if (!showResponsiveNav.value) {\n return;\n }\n\n // allows the DOM to update before scrolling to the active step.\n await nextTick();\n\n const step = stepper.activeStepElement.value;\n\n if (step) {\n step.scrollIntoView({ behavior: 'instant', inline: 'start', block: 'nearest' });\n }\n }\n</script>\n\n<template>\n <div class=\"tw-relative\">\n <ul\n ref=\"stepperListRef\"\n class=\"stash-stepper tw-flex\"\n :class=\"{\n 'tw-flex-col': props.orientation === 'vertical',\n 'stash-stepper--vertical': props.orientation === 'vertical',\n 'stash-stepper--horizontal': props.orientation === 'horizontal',\n 'tw-mx-9 tw-snap-x tw-snap-mandatory tw-overflow-x-hidden': showResponsiveNav,\n }\"\n data-test=\"stash-stepper\"\n >\n <!-- @slot Default slot to compose multiple steps -->\n <slot></slot>\n </ul>\n <Button\n v-if=\"showResponsiveNav\"\n class=\"stash-stepper__arrow stash-stepper__arrow--prev\"\n :class=\"props.theme === 'light' ? 'tw-text-blue-500' : 'tw-text-white'\"\n data-test=\"stash-stepper|prev-arrow\"\n :disabled=\"isPrevArrowDisabled\"\n icon\n @click=\"stepper.back\"\n >\n <Icon name=\"chevron-left\" size=\"dense\" />\n </Button>\n <Button\n v-if=\"showResponsiveNav\"\n class=\"stash-stepper__arrow stash-stepper__arrow--next\"\n :class=\"props.theme === 'light' ? 'tw-text-blue-500' : 'tw-text-white'\"\n data-test=\"stash-stepper|next-arrow\"\n :disabled=\"isNextArrowDisabled\"\n icon\n @click=\"stepper.next\"\n >\n <Icon name=\"chevron-right\" size=\"dense\" />\n </Button>\n </div>\n</template>\n\n<style>\n .stash-stepper--vertical .stash-step:last-child .stash-step--nested-steps {\n @apply tw-hidden;\n }\n\n .stash-stepper__arrow {\n @apply tw-absolute\n tw-top-0\n tw-flex\n tw-h-6\n tw-w-6\n tw-min-w-auto\n tw-items-center\n tw-justify-center\n tw-rounded-full\n tw-border\n tw-border-solid\n tw-border-ice-500\n tw-text-center\n disabled:tw-text-ice-500 disabled:tw-opacity-50;\n }\n\n .stash-stepper__arrow--prev {\n @apply tw-left-0;\n }\n\n .stash-stepper__arrow--next {\n @apply tw-right-0;\n }\n</style>\n"],"names":["stepperListRef","ref","stepper","useStepper","props","isLargeScreen","useMediaQuery","showResponsiveNav","computed","isPrevArrowDisabled","isNextArrowDisabled","watch","value","emit","scrollToStep","watchEffect","provide","STEPPER_INJECTION_KEY","__expose","nextTick","step"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBA8DQA,IAAiBC,KACjBC,IAAUC,EAAW;AAAA,MACzB,QAAQC,EAAM;AAAA,MACd,YAAYA,EAAM;AAAA,MAClB,eAAeA,EAAM;AAAA,MACrB,KAAKJ;AAAA,IAAA,CACN,GAEKK,IAAgBC,EAAc,+BAA+B,GAC7DC,IAAoBC;AAAA,MACxB,MAAMJ,EAAM,gBAAgB,iBAAiB,CAACC,EAAc,SAASD,EAAM;AAAA,IAAA,GAEvEK,IAAsBD,EAAS,MAAMN,EAAQ,gBAAgB,SAAS,CAAC,GACvEQ,IAAsBF;AAAA,MAC1B,MACE,CAACN,EAAQ,gBAAgBA,EAAQ,gBAAgB,KAAK,KACtDA,EAAQ,gBAAgB,UAAUA,EAAQ,MAAM,MAAM,SAAS;AAAA,IAAA;AAGnE,IAAAS;AAAA,MACE,MAAMP,EAAM;AAAA,MACZ,CAACQ,MAAWV,EAAQ,gBAAgB,QAAQU;AAAA,IAAA,GAG9CD;AAAA,MACE,MAAMP,EAAM;AAAA,MACZ,CAACQ,MAAWV,EAAQ,mBAAmB,QAAQU;AAAA,IAAA,GAGjDD;AAAA,MACE,MAAMT,EAAQ,gBAAgB;AAAA,MAC9B,CAACU,MAAU;AACT,QAAAC,EAAK,eAAeD,CAAK,GACZE;MACf;AAAA,IAAA,GAGFH;AAAA,MACE,MAAMT,EAAQ,mBAAmB;AAAA,MACjC,CAACU,MAAUC,EAAK,kBAAkBD,CAAK;AAAA,IAAA,GAOzCG,EAAY,MAAM;AAChB,MAAIR,EAAkB,SACPO;IACf,CACD,GAEDE,EAAQC,GAAuB;AAAA,MAC7B,cAAcf,EAAQ;AAAA,MACtB,aAAaE,EAAM;AAAA,MACnB,WAAWF,EAAQ;AAAA,MACnB,OAAOE,EAAM;AAAA,MACb,mBAAAG;AAAA,IAAA,CACD,GAEYW,EAAA;AAAA,MACX,MAAMhB,EAAQ;AAAA,MACd,MAAMA,EAAQ;AAAA,MACd,MAAMA,EAAQ;AAAA,MACd,iBAAiBA,EAAQ;AAAA,MACzB,cAAcA,EAAQ;AAAA,IAAA,CACvB;AAMD,mBAAeY,IAAe;AACxB,UAAA,CAACP,EAAkB;AACrB;AAIF,YAAMY,EAAS;AAET,YAAAC,IAAOlB,EAAQ,kBAAkB;AAEvC,MAAIkB,KACGA,EAAA,eAAe,EAAE,UAAU,WAAW,QAAQ,SAAS,OAAO,WAAW;AAAA,IAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Stepper.js","sources":["../src/components/Stepper/Stepper.vue"],"sourcesContent":["<script lang=\"ts\">\n import { StepperOrientation, StepperTheme } from './Stepper.types';\n export * from './Stepper.types';\n\n export interface StepperProps {\n /**\n * The current step index\n */\n step?: number;\n /**\n * The current substep index\n */\n substep?: number;\n /**\n * A linear stepper prevents navigation to steps that are ahead of the completed ones\n */\n linear?: boolean;\n /**\n * Determines whether the stepper is horizontal or vertical\n */\n orientation?: StepperOrientation;\n /**\n * Force responsive view on horizontal orientation\n */\n useResponsiveNav?: boolean;\n /**\n * Determines the theme of the stepper\n */\n theme?: StepperTheme;\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, watch, watchEffect } from 'vue';\n\n import useMediaQuery from '../../composables/useMediaQuery/useMediaQuery';\n import useStepper from '../../composables/useStepper/useStepper';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import { STEPPER_INJECTION_KEY } from './keys';\n\n const props = withDefaults(defineProps<StepperProps>(), {\n step: -1,\n substep: -1,\n linear: false,\n orientation: 'vertical',\n theme: 'dark',\n useResponsiveNav: false,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the step changes\n */\n (e: 'update:step', step: number): void;\n /**\n * Emitted when the substep changes\n */\n (e: 'update:substep', substep: number): void;\n }>();\n\n const stepperListRef = ref();\n const stepper = useStepper({\n linear: props.linear,\n activeStep: props.step,\n activeSubstep: props.substep,\n ref: stepperListRef,\n });\n\n const isLargeScreen = useMediaQuery('screen and (min-width: 961px)');\n const showResponsiveNav = computed(\n () => props.orientation === 'horizontal' && (!isLargeScreen.value || props.useResponsiveNav),\n );\n const isPrevArrowDisabled = computed(() => stepper.activeStepIndex.value <= 0);\n const isNextArrowDisabled = computed(\n () =>\n !stepper.isStepCompleted(stepper.activeStepIndex.value) ||\n stepper.activeStepIndex.value === stepper.steps.value.length - 1,\n );\n\n watch(\n () => props.step,\n (value) => (stepper.activeStepIndex.value = value),\n );\n\n watch(\n () => props.substep,\n (value) => (stepper.activeSubstepIndex.value = value),\n );\n\n watch(\n () => stepper.activeStepIndex.value,\n (value) => {\n emit('update:step', value);\n scrollToStep();\n },\n );\n\n watch(\n () => stepper.activeSubstepIndex.value,\n (value) => emit('update:substep', value),\n );\n\n /**\n * Watches for media query changes to determine if the mobile horizontal stepper is active.\n * This is done to ensure the mobile stepper remains in sync with any step changes at the desktop view.\n */\n watchEffect(() => {\n if (showResponsiveNav.value) {\n scrollToStep();\n }\n });\n\n provide(STEPPER_INJECTION_KEY, {\n registerStep: stepper.registerStep,\n orientation: props.orientation,\n stepCount: stepper.stepCount,\n theme: props.theme,\n showResponsiveNav,\n });\n\n defineExpose({\n back: stepper.back,\n next: stepper.next,\n goTo: stepper.goTo,\n isStepCompleted: stepper.isStepCompleted,\n isStepActive: stepper.isStepActive,\n });\n\n /**\n * Scrolls to the active step when the horizontal stepper is active.\n * This limited to top-level steps only.\n */\n async function scrollToStep() {\n if (!showResponsiveNav.value) {\n return;\n }\n\n // allows the DOM to update before scrolling to the active step.\n await nextTick();\n\n const step = stepper.activeStepElement.value;\n\n if (step) {\n step.scrollIntoView({ behavior: 'instant', inline: 'start', block: 'nearest' });\n }\n }\n</script>\n\n<template>\n <div class=\"tw-relative\">\n <ul\n ref=\"stepperListRef\"\n class=\"stash-stepper tw-flex\"\n :class=\"{\n 'tw-flex-col': props.orientation === 'vertical',\n 'stash-stepper--vertical': props.orientation === 'vertical',\n 'stash-stepper--horizontal': props.orientation === 'horizontal',\n 'tw-mx-9 tw-snap-x tw-snap-mandatory tw-overflow-x-hidden': showResponsiveNav,\n }\"\n data-test=\"stash-stepper\"\n >\n <!-- @slot Default slot to compose multiple steps -->\n <slot></slot>\n </ul>\n <Button\n v-if=\"showResponsiveNav\"\n class=\"stash-stepper__arrow stash-stepper__arrow--prev\"\n :class=\"props.theme === 'light' ? 'tw-text-blue-500' : 'tw-text-white'\"\n data-test=\"stash-stepper|prev-arrow\"\n :disabled=\"isPrevArrowDisabled\"\n icon\n @click=\"stepper.back\"\n >\n <Icon name=\"chevron-left\" size=\"dense\" />\n </Button>\n <Button\n v-if=\"showResponsiveNav\"\n class=\"stash-stepper__arrow stash-stepper__arrow--next\"\n :class=\"props.theme === 'light' ? 'tw-text-blue-500' : 'tw-text-white'\"\n data-test=\"stash-stepper|next-arrow\"\n :disabled=\"isNextArrowDisabled\"\n icon\n @click=\"stepper.next\"\n >\n <Icon name=\"chevron-right\" size=\"dense\" />\n </Button>\n </div>\n</template>\n\n<style>\n .stash-stepper--vertical .stash-step:last-child .stash-step--nested-steps {\n @apply tw-hidden;\n }\n\n .stash-stepper__arrow {\n @apply tw-absolute\n tw-top-0\n tw-flex\n tw-h-6\n tw-w-6\n tw-min-w-auto\n tw-items-center\n tw-justify-center\n tw-rounded-full\n tw-border\n tw-border-solid\n tw-border-ice-500\n tw-text-center\n disabled:tw-text-ice-500 disabled:tw-opacity-50;\n }\n\n .stash-stepper__arrow--prev {\n @apply tw-left-0;\n }\n\n .stash-stepper__arrow--next {\n @apply tw-right-0;\n }\n</style>\n"],"names":["props","__props","emit","__emit","stepperListRef","ref","stepper","useStepper","isLargeScreen","useMediaQuery","showResponsiveNav","computed","isPrevArrowDisabled","isNextArrowDisabled","watch","value","scrollToStep","watchEffect","provide","STEPPER_INJECTION_KEY","__expose","nextTick","step"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCE,UAAMA,IAAQC,GASRC,IAAOC,GAWPC,IAAiBC,KACjBC,IAAUC,EAAW;AAAA,MACzB,QAAQP,EAAM;AAAA,MACd,YAAYA,EAAM;AAAA,MAClB,eAAeA,EAAM;AAAA,MACrB,KAAKI;AAAA,IAAA,CACN,GAEKI,IAAgBC,EAAc,+BAA+B,GAC7DC,IAAoBC;AAAA,MACxB,MAAMX,EAAM,gBAAgB,iBAAiB,CAACQ,EAAc,SAASR,EAAM;AAAA,IAAA,GAEvEY,IAAsBD,EAAS,MAAML,EAAQ,gBAAgB,SAAS,CAAC,GACvEO,IAAsBF;AAAA,MAC1B,MACE,CAACL,EAAQ,gBAAgBA,EAAQ,gBAAgB,KAAK,KACtDA,EAAQ,gBAAgB,UAAUA,EAAQ,MAAM,MAAM,SAAS;AAAA,IAAA;AAGnE,IAAAQ;AAAA,MACE,MAAMd,EAAM;AAAA,MACZ,CAACe,MAAWT,EAAQ,gBAAgB,QAAQS;AAAA,IAAA,GAG9CD;AAAA,MACE,MAAMd,EAAM;AAAA,MACZ,CAACe,MAAWT,EAAQ,mBAAmB,QAAQS;AAAA,IAAA,GAGjDD;AAAA,MACE,MAAMR,EAAQ,gBAAgB;AAAA,MAC9B,CAACS,MAAU;AACT,QAAAb,EAAK,eAAea,CAAK,GACZC;MACf;AAAA,IAAA,GAGFF;AAAA,MACE,MAAMR,EAAQ,mBAAmB;AAAA,MACjC,CAACS,MAAUb,EAAK,kBAAkBa,CAAK;AAAA,IAAA,GAOzCE,EAAY,MAAM;AAChB,MAAIP,EAAkB,SACPM;IACf,CACD,GAEDE,EAAQC,GAAuB;AAAA,MAC7B,cAAcb,EAAQ;AAAA,MACtB,aAAaN,EAAM;AAAA,MACnB,WAAWM,EAAQ;AAAA,MACnB,OAAON,EAAM;AAAA,MACb,mBAAAU;AAAA,IAAA,CACD,GAEYU,EAAA;AAAA,MACX,MAAMd,EAAQ;AAAA,MACd,MAAMA,EAAQ;AAAA,MACd,MAAMA,EAAQ;AAAA,MACd,iBAAiBA,EAAQ;AAAA,MACzB,cAAcA,EAAQ;AAAA,IAAA,CACvB;AAMD,mBAAeU,IAAe;AACxB,UAAA,CAACN,EAAkB;AACrB;AAIF,YAAMW,EAAS;AAET,YAAAC,IAAOhB,EAAQ,kBAAkB;AAEvC,MAAIgB,KACGA,EAAA,eAAe,EAAE,UAAU,WAAW,QAAQ,SAAS,OAAO,WAAW;AAAA,IAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,11 +1,10 @@
1
- import { AllowedComponentProps } from 'vue';
2
- import { ComponentCustomProps } from 'vue';
3
1
  import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
4
3
  import { DefineComponent } from 'vue';
5
4
  import { ExtractPropTypes } from 'vue';
6
5
  import { PropType } from 'vue';
6
+ import { PublicProps } from 'vue';
7
7
  import type { Ref } from 'vue';
8
- import { VNodeProps } from 'vue';
9
8
 
10
9
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
11
10
 
@@ -34,40 +33,40 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
34
33
  };
35
34
  };
36
35
 
37
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<StepperProps>, {
36
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<StepperProps>, {
38
37
  step: number;
39
38
  substep: number;
40
39
  linear: boolean;
41
40
  orientation: string;
42
41
  theme: string;
43
42
  useResponsiveNav: boolean;
44
- }>, {
43
+ }>>, {
45
44
  back: () => void;
46
45
  next: () => void;
47
46
  goTo: (stepIndex: number, substepIndex?: number) => void;
48
47
  isStepCompleted: (stepIndex: number, substepIndex?: number) => boolean;
49
48
  isStepActive: (stepIndex: number, substepIndex?: number) => boolean;
50
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
49
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
51
50
  "update:step": (step: number) => void;
52
51
  "update:substep": (substep: number) => void;
53
- }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<StepperProps>, {
52
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<StepperProps>, {
54
53
  step: number;
55
54
  substep: number;
56
55
  linear: boolean;
57
56
  orientation: string;
58
57
  theme: string;
59
58
  useResponsiveNav: boolean;
60
- }>>> & {
59
+ }>>> & Readonly<{
61
60
  "onUpdate:step"?: ((step: number) => any) | undefined;
62
61
  "onUpdate:substep"?: ((substep: number) => any) | undefined;
63
- }, {
62
+ }>, {
64
63
  step: number;
65
64
  theme: StepperTheme;
66
65
  substep: number;
67
66
  linear: boolean;
68
67
  orientation: StepperOrientation;
69
68
  useResponsiveNav: boolean;
70
- }, {}>, {
69
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
71
70
  default?(_: {}): any;
72
71
  }>;
73
72
  export default _default;
package/dist/Switch.js CHANGED
@@ -1,8 +1,8 @@
1
- import { defineComponent as x, useAttrs as v, useSlots as g, useCssModule as y, computed as o, openBlock as i, createElementBlock as d, normalizeClass as s, unref as a, createElementVNode as c, mergeProps as C, withDirectives as S, vModelCheckbox as A, toDisplayString as u, createCommentVNode as _, renderSlot as V, createTextVNode as B } from "vue";
2
- import M from "@leaflink/snitch";
3
- import T from "lodash-es/uniqueId";
4
- import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
5
- const N = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $ = /* @__PURE__ */ x({
1
+ import { defineComponent as v, useAttrs as g, useSlots as y, useCssModule as C, computed as o, openBlock as i, createElementBlock as d, normalizeClass as s, unref as a, createElementVNode as c, mergeProps as S, withDirectives as A, vModelCheckbox as V, toDisplayString as u, createCommentVNode as _, renderSlot as B, createTextVNode as M } from "vue";
2
+ import T from "@leaflink/snitch";
3
+ import E from "lodash-es/uniqueId";
4
+ import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
5
+ const D = ["data-test"], I = ["for"], $ = ["id", "disabled", "name", "value"], q = /* @__PURE__ */ v({
6
6
  name: "ll-switch",
7
7
  inheritAttrs: !1,
8
8
  __name: "Switch",
@@ -17,8 +17,8 @@ const N = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $
17
17
  },
18
18
  emits: ["update:checked"],
19
19
  setup(b, { emit: p }) {
20
- const t = b, l = v(), f = g(), n = y();
21
- if (typeof t.value == "boolean" && M.warn("Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true"), l.onChange)
20
+ const t = b, l = g(), f = y(), n = C(), m = p;
21
+ if (typeof t.value == "boolean" && T.warn("Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true"), l.onChange)
22
22
  throw new Error("ll-switch: use the @update:checked event instead of @change.");
23
23
  const k = o(() => {
24
24
  const e = { ...l };
@@ -28,14 +28,14 @@ const N = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $
28
28
  return t.checked;
29
29
  },
30
30
  set(e) {
31
- p("update:checked", e);
31
+ m("update:checked", e);
32
32
  }
33
- }), r = o(() => t.id || T("switch-"));
33
+ }), r = o(() => t.id || E("switch-"));
34
34
  return (e, w) => (i(), d("div", {
35
35
  class: s(["stash-switch", a(l).class]),
36
36
  "data-test": a(l)["data-test"] || "stash-switch"
37
37
  }, [
38
- c("label", C({
38
+ c("label", S({
39
39
  for: r.value,
40
40
  class: [{ "tw-pointer-events-none": t.disabled }, "tw-flex tw-cursor-pointer"],
41
41
  "data-test": "stash-switch|label"
@@ -65,17 +65,17 @@ const N = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $
65
65
  "data-test": "stash-switch|control"
66
66
  }, null, 2)
67
67
  ], 2),
68
- S(c("input", {
68
+ A(c("input", {
69
69
  id: r.value,
70
- "onUpdate:modelValue": w[0] || (w[0] = (m) => h.value = m),
70
+ "onUpdate:modelValue": w[0] || (w[0] = (x) => h.value = x),
71
71
  type: "checkbox",
72
72
  disabled: t.disabled,
73
73
  name: t.name,
74
74
  tabindex: "0",
75
75
  value: e.value,
76
76
  class: "tw-sr-only"
77
- }, null, 8, I), [
78
- [A, h.value]
77
+ }, null, 8, $), [
78
+ [V, h.value]
79
79
  ]),
80
80
  t.label ? (i(), d("span", {
81
81
  key: 0,
@@ -88,25 +88,25 @@ const N = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $
88
88
  }, "stash-switch__label-text tw-relative tw-top-px tw-ml-1.5"]),
89
89
  "data-test": "stash-switch|label-text"
90
90
  }, u(t.label), 3)) : _("", !0)
91
- ], 16, D),
91
+ ], 16, I),
92
92
  t.hintText || a(f).hint ? (i(), d("span", {
93
93
  key: 0,
94
94
  class: s(["stash-switch__hint tw-ml-[40px] tw-mt-1.5 tw-block tw-whitespace-pre-line tw-text-xs", { "stash-switch__hint--disabled tw-text-ice-500": t.disabled }]),
95
95
  "data-test": "stash-switch|hint"
96
96
  }, [
97
- V(e.$slots, "hint", {}, () => [
98
- B(u(t.hintText), 1)
97
+ B(e.$slots, "hint", {}, () => [
98
+ M(u(t.hintText), 1)
99
99
  ])
100
100
  ], 2)) : _("", !0)
101
- ], 10, N));
101
+ ], 10, D));
102
102
  }
103
- }), q = "_control_8a1ic_2", z = "_active_8a1ic_5", P = {
104
- control: q,
105
- active: z
106
- }, U = {
107
- $style: P
108
- }, J = /* @__PURE__ */ E($, [["__cssModules", U]]);
103
+ }), z = "_control_8a1ic_2", P = "_active_8a1ic_5", U = {
104
+ control: z,
105
+ active: P
106
+ }, j = {
107
+ $style: U
108
+ }, K = /* @__PURE__ */ N(q, [["__cssModules", j]]);
109
109
  export {
110
- J as default
110
+ K as default
111
111
  };
112
112
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../src/components/Switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useCssModule, useSlots } from 'vue';\n\n export interface SwitchProps {\n /**\n * The current checked value, can be a boolean or an array of values\n */\n checked?: boolean | Array<string | number>;\n\n /**\n * Prevent the user from changing the switch state.\n */\n disabled?: boolean;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * Unique ID for the switch, required for accessibility purposes\n */\n id?: string;\n\n /**\n * Label text to display with switch\n */\n label?: string;\n\n /**\n * HTML name property\n */\n name?: string;\n\n /**\n * Value associated with switch when it is `checked`. This value is\n * used to compare against `checked` property when passed as an array.\n */\n value?: string | number;\n }\n\n defineOptions({\n name: 'll-switch',\n inheritAttrs: false,\n });\n\n const props = withDefaults(defineProps<SwitchProps>(), {\n checked: false,\n disabled: false,\n hintText: '',\n id: undefined,\n label: '',\n name: '',\n value: '',\n });\n\n const attrs = useAttrs();\n const slots = useSlots();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'update:checked', value: SwitchProps['checked']): void;\n }>();\n\n if (typeof props.value === 'boolean') {\n logger.warn('Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true');\n }\n\n if (attrs.onChange) {\n throw new Error('ll-switch: use the @update:checked event instead of @change.');\n }\n\n const switchAttrs = computed(() => {\n const tempAttrs = { ...attrs };\n\n delete tempAttrs['data-test'];\n delete tempAttrs.class;\n\n return tempAttrs;\n });\n\n const internalValue = computed({\n get() {\n return props.checked;\n },\n set(value) {\n emit('update:checked', value);\n },\n });\n\n const switchId = computed(() => props.id || uniqueId('switch-'));\n</script>\n\n<template>\n <div class=\"stash-switch\" :class=\"attrs['class']\" :data-test=\"attrs['data-test'] || 'stash-switch'\">\n <label\n :for=\"switchId\"\n :class=\"{ 'tw-pointer-events-none': props.disabled }\"\n class=\"tw-flex tw-cursor-pointer\"\n data-test=\"stash-switch|label\"\n v-bind=\"switchAttrs\"\n >\n <span\n class=\"tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]\"\n :class=\"{ [classes.active]: props.checked }\"\n >\n <span\n class=\"stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]\"\n :class=\"{\n 'tw-bg-blue-500': props.checked && !props.disabled,\n 'tw-bg-ice-700': !props.checked && !props.disabled,\n 'stash-switch__track--disabled tw-bg-ice-500': props.disabled,\n 'stash-switch__track--on': props.checked,\n 'stash-switch__track--off': !props.checked,\n }\"\n data-test=\"stash-switch|track\"\n ></span>\n <span\n class=\"\n stash-switch__control\n tw-absolute\n tw-left-0\n tw-h-5\n tw-w-5\n tw-rounded-[10px]\n tw-border\n tw-border-solid\n tw-border-ice-500\n tw-bg-white\n tw-shadow\n \"\n :class=\"[\n classes.control,\n {\n 'stash-switch__control--on': props.checked,\n 'stash-switch__control--off': !props.checked,\n 'stash-switch__control--disabled': props.disabled,\n },\n ]\"\n data-test=\"stash-switch|control\"\n ></span>\n </span>\n <input\n :id=\"switchId\"\n v-model=\"internalValue\"\n type=\"checkbox\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n tabindex=\"0\"\n :value=\"value\"\n class=\"tw-sr-only\"\n />\n <span\n v-if=\"props.label\"\n :class=\"{\n 'tw-text-ice-900': props.checked && !props.disabled,\n 'tw-text-ice-700': !props.checked && !props.disabled,\n 'stash-switch__label-text--on': props.checked,\n 'stash-switch__label-text--off': !props.checked,\n 'stash-switch__label-text--disabled tw-text-ice-500': props.disabled,\n }\"\n class=\"stash-switch__label-text tw-relative tw-top-px tw-ml-1.5\"\n data-test=\"stash-switch|label-text\"\n >\n {{ props.label }}\n </span>\n </label>\n <span\n v-if=\"props.hintText || slots.hint\"\n class=\"stash-switch__hint tw-ml-[40px] tw-mt-1.5 tw-block tw-whitespace-pre-line tw-text-xs\"\n :class=\"{ 'stash-switch__hint--disabled tw-text-ice-500': props.disabled }\"\n data-test=\"stash-switch|hint\"\n >\n <!-- @slot for displaying hint text -->\n <slot name=\"hint\">{{ props.hintText }}</slot>\n </span>\n </div>\n</template>\n\n<style module>\n .control {\n transition: left 0.2s ease-in-out;\n\n .active & {\n @apply tw-left-3.5; /* track width - switch width */\n }\n }\n</style>\n"],"names":["attrs","useAttrs","slots","useSlots","classes","useCssModule","props","logger","switchAttrs","computed","tempAttrs","internalValue","value","emit","switchId","uniqueId"],"mappings":";;;;;;;;;;;;;;;;;;;iBA0DQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC;AAWhB,QAJI,OAAOC,EAAM,SAAU,aACzBC,EAAO,KAAK,6FAA6F,GAGvGP,EAAM;AACF,YAAA,IAAI,MAAM,8DAA8D;AAG1E,UAAAQ,IAAcC,EAAS,MAAM;AAC3B,YAAAC,IAAY,EAAE,GAAGV;AAEvB,oBAAOU,EAAU,WAAW,GAC5B,OAAOA,EAAU,OAEVA;AAAA,IAAA,CACR,GAEKC,IAAgBF,EAAS;AAAA,MAC7B,MAAM;AACJ,eAAOH,EAAM;AAAA,MACf;AAAA,MACA,IAAIM,GAAO;AACT,QAAAC,EAAK,kBAAkBD,CAAK;AAAA,MAC9B;AAAA,IAAA,CACD,GAEKE,IAAWL,EAAS,MAAMH,EAAM,MAAMS,EAAS,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Switch.js","sources":["../src/components/Switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useCssModule, useSlots } from 'vue';\n\n export interface SwitchProps {\n /**\n * The current checked value, can be a boolean or an array of values\n */\n checked?: boolean | Array<string | number>;\n\n /**\n * Prevent the user from changing the switch state.\n */\n disabled?: boolean;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * Unique ID for the switch, required for accessibility purposes\n */\n id?: string;\n\n /**\n * Label text to display with switch\n */\n label?: string;\n\n /**\n * HTML name property\n */\n name?: string;\n\n /**\n * Value associated with switch when it is `checked`. This value is\n * used to compare against `checked` property when passed as an array.\n */\n value?: string | number;\n }\n\n defineOptions({\n name: 'll-switch',\n inheritAttrs: false,\n });\n\n const props = withDefaults(defineProps<SwitchProps>(), {\n checked: false,\n disabled: false,\n hintText: '',\n id: undefined,\n label: '',\n name: '',\n value: '',\n });\n\n const attrs = useAttrs();\n const slots = useSlots();\n const classes = useCssModule();\n\n const emit = defineEmits<{\n (e: 'update:checked', value: SwitchProps['checked']): void;\n }>();\n\n if (typeof props.value === 'boolean') {\n logger.warn('Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true');\n }\n\n if (attrs.onChange) {\n throw new Error('ll-switch: use the @update:checked event instead of @change.');\n }\n\n const switchAttrs = computed(() => {\n const tempAttrs = { ...attrs };\n\n delete tempAttrs['data-test'];\n delete tempAttrs.class;\n\n return tempAttrs;\n });\n\n const internalValue = computed({\n get() {\n return props.checked;\n },\n set(value) {\n emit('update:checked', value);\n },\n });\n\n const switchId = computed(() => props.id || uniqueId('switch-'));\n</script>\n\n<template>\n <div class=\"stash-switch\" :class=\"attrs['class']\" :data-test=\"attrs['data-test'] || 'stash-switch'\">\n <label\n :for=\"switchId\"\n :class=\"{ 'tw-pointer-events-none': props.disabled }\"\n class=\"tw-flex tw-cursor-pointer\"\n data-test=\"stash-switch|label\"\n v-bind=\"switchAttrs\"\n >\n <span\n class=\"tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]\"\n :class=\"{ [classes.active]: props.checked }\"\n >\n <span\n class=\"stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]\"\n :class=\"{\n 'tw-bg-blue-500': props.checked && !props.disabled,\n 'tw-bg-ice-700': !props.checked && !props.disabled,\n 'stash-switch__track--disabled tw-bg-ice-500': props.disabled,\n 'stash-switch__track--on': props.checked,\n 'stash-switch__track--off': !props.checked,\n }\"\n data-test=\"stash-switch|track\"\n ></span>\n <span\n class=\"stash-switch__control tw-absolute tw-left-0 tw-h-5 tw-w-5 tw-rounded-[10px] tw-border tw-border-solid tw-border-ice-500 tw-bg-white tw-shadow\"\n :class=\"[\n classes.control,\n {\n 'stash-switch__control--on': props.checked,\n 'stash-switch__control--off': !props.checked,\n 'stash-switch__control--disabled': props.disabled,\n },\n ]\"\n data-test=\"stash-switch|control\"\n ></span>\n </span>\n <input\n :id=\"switchId\"\n v-model=\"internalValue\"\n type=\"checkbox\"\n :disabled=\"props.disabled\"\n :name=\"props.name\"\n tabindex=\"0\"\n :value=\"value\"\n class=\"tw-sr-only\"\n />\n <span\n v-if=\"props.label\"\n :class=\"{\n 'tw-text-ice-900': props.checked && !props.disabled,\n 'tw-text-ice-700': !props.checked && !props.disabled,\n 'stash-switch__label-text--on': props.checked,\n 'stash-switch__label-text--off': !props.checked,\n 'stash-switch__label-text--disabled tw-text-ice-500': props.disabled,\n }\"\n class=\"stash-switch__label-text tw-relative tw-top-px tw-ml-1.5\"\n data-test=\"stash-switch|label-text\"\n >\n {{ props.label }}\n </span>\n </label>\n <span\n v-if=\"props.hintText || slots.hint\"\n class=\"stash-switch__hint tw-ml-[40px] tw-mt-1.5 tw-block tw-whitespace-pre-line tw-text-xs\"\n :class=\"{ 'stash-switch__hint--disabled tw-text-ice-500': props.disabled }\"\n data-test=\"stash-switch|hint\"\n >\n <!-- @slot for displaying hint text -->\n <slot name=\"hint\">{{ props.hintText }}</slot>\n </span>\n </div>\n</template>\n\n<style module>\n .control {\n transition: left 0.2s ease-in-out;\n\n .active & {\n @apply tw-left-3.5; /* track width - switch width */\n }\n }\n</style>\n"],"names":["props","__props","attrs","useAttrs","slots","useSlots","classes","useCssModule","emit","__emit","logger","switchAttrs","computed","tempAttrs","internalValue","value","switchId","uniqueId"],"mappings":";;;;;;;;;;;;;;;;;;;AAgDE,UAAMA,IAAQC,GAURC,IAAQC,KACRC,IAAQC,KACRC,IAAUC,KAEVC,IAAOC;AAQb,QAJI,OAAOT,EAAM,SAAU,aACzBU,EAAO,KAAK,6FAA6F,GAGvGR,EAAM;AACF,YAAA,IAAI,MAAM,8DAA8D;AAG1E,UAAAS,IAAcC,EAAS,MAAM;AAC3B,YAAAC,IAAY,EAAE,GAAGX;AAEvB,oBAAOW,EAAU,WAAW,GAC5B,OAAOA,EAAU,OAEVA;AAAA,IAAA,CACR,GAEKC,IAAgBF,EAAS;AAAA,MAC7B,MAAM;AACJ,eAAOZ,EAAM;AAAA,MACf;AAAA,MACA,IAAIe,GAAO;AACT,QAAAP,EAAK,kBAAkBO,CAAK;AAAA,MAC9B;AAAA,IAAA,CACD,GAEKC,IAAWJ,EAAS,MAAMZ,EAAM,MAAMiB,EAAS,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,9 @@
1
- import { AllowedComponentProps } from 'vue';
2
- import { ComponentCustomProps } from 'vue';
3
1
  import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
4
3
  import { DefineComponent } from 'vue';
5
4
  import { ExtractPropTypes } from 'vue';
6
5
  import { PropType } from 'vue';
7
- import { VNodeProps } from 'vue';
6
+ import { PublicProps } from 'vue';
8
7
 
9
8
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
9
 
@@ -33,7 +32,7 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
33
32
  };
34
33
  };
35
34
 
36
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SwitchProps>, {
35
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SwitchProps>, {
37
36
  checked: boolean;
38
37
  disabled: boolean;
39
38
  hintText: string;
@@ -41,9 +40,9 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
41
40
  label: string;
42
41
  name: string;
43
42
  value: string;
44
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
43
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
45
44
  "update:checked": (value: boolean | (string | number)[] | undefined) => void;
46
- }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SwitchProps>, {
45
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SwitchProps>, {
47
46
  checked: boolean;
48
47
  disabled: boolean;
49
48
  hintText: string;
@@ -51,17 +50,17 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
51
50
  label: string;
52
51
  name: string;
53
52
  value: string;
54
- }>>> & {
53
+ }>>> & Readonly<{
55
54
  "onUpdate:checked"?: ((value: boolean | (string | number)[] | undefined) => any) | undefined;
56
- }, {
55
+ }>, {
57
56
  name: string;
57
+ disabled: boolean;
58
58
  label: string;
59
59
  id: string;
60
- checked: boolean | (string | number)[];
61
- disabled: boolean;
62
- value: string | number;
63
60
  hintText: string;
64
- }, {}>, {
61
+ value: string | number;
62
+ checked: boolean | (string | number)[];
63
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
65
64
  hint?(_: {}): any;
66
65
  }>;
67
66
  export default _default;
package/dist/Tab.js CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as o } from "./Tab.vue_vue_type_script_setup_true_lang-69d1b046.js";
1
+ import { _ as o } from "./Tab.vue_vue_type_script_setup_true_lang-9aa53203.js";
2
2
  import "vue";
3
3
  import "@leaflink/snitch";
4
4
  import "./Badge.js";
5
5
  import "./_plugin-vue_export-helper-dad06003.js";
6
- import "./Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js";
6
+ import "./Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js";
7
7
  import "lodash-es/debounce";
8
8
  import "lodash-es/uniqueId";
9
9
  import "./constants.js";
package/dist/Tab.vue.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- import { AllowedComponentProps } from 'vue';
2
- import { ComponentCustomProps } from 'vue';
3
1
  import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
4
3
  import { DefineComponent } from 'vue';
5
4
  import { ExtractPropTypes } from 'vue';
6
5
  import { PropType } from 'vue';
6
+ import { PublicProps } from 'vue';
7
7
  import { RouteLocationRaw } from 'vue-router';
8
8
  import { RouterLinkProps } from 'vue-router';
9
- import { VNodeProps } from 'vue';
10
9
 
11
10
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
11
 
@@ -30,7 +29,7 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
30
29
  */
31
30
  declare type AnchorAttrs = HTMLAnchorElement['download'] | HTMLAnchorElement['hreflang'] | HTMLAnchorElement['ping'] | HTMLAnchorElement['referrerPolicy'] | HTMLAnchorElement['rel'] | HTMLAnchorElement['target'] | HTMLAnchorElement['type'];
32
31
 
33
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_TypePropsToRuntimeProps<TabProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TabProps>>>, {}, {}>, {
32
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TabProps>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TabProps>>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
34
33
  default?(_: {
35
34
  isActive: boolean;
36
35
  isDisabled: boolean;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as x, inject as T, computed as o, onMounted as k, nextTick as g, toRefs as u, openBlock as c, createElementBlock as y, normalizeClass as _, unref as n, withKeys as C, createBlock as P, resolveDynamicComponent as B, mergeProps as E, withCtx as b, createElementVNode as $, createVNode as N, renderSlot as A } from "vue";
2
2
  import I from "@leaflink/snitch";
3
3
  import j from "./Badge.js";
4
- import { T as D } from "./Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js";
4
+ import { T as D } from "./Tabs.vue_used_vue_type_style_index_0_lang.module-3aa36673.js";
5
5
  const L = ["id", "aria-selected", "aria-controls", "aria-disabled"], V = { class: "tw-mt-0.5" }, J = /* @__PURE__ */ x({
6
6
  __name: "Tab",
7
7
  props: {
@@ -23,7 +23,9 @@ const L = ["id", "aria-selected", "aria-controls", "aria-disabled"], V = { class
23
23
  }
24
24
  const s = o(() => `tabpanel-${e.value}`);
25
25
  k(async () => {
26
- await g(), process.env.NODE_ENV !== "test" && t.value && !document.getElementById(s.value) && I.warn(`The <Tab> with value "${e.value}" is active, but its corresponding tab panel cannot be found. Please ensure that the corresponding tab panel has an "id" attribute with value "${s.value}" and a "role" attribute with value "tabpanel".`);
26
+ await g(), process.env.NODE_ENV !== "test" && t.value && !document.getElementById(s.value) && I.warn(
27
+ `The <Tab> with value "${e.value}" is active, but its corresponding tab panel cannot be found. Please ensure that the corresponding tab panel has an "id" attribute with value "${s.value}" and a "role" attribute with value "tabpanel".`
28
+ );
27
29
  });
28
30
  const h = o(() => e.to && e.routerLinkProps ? u(e.routerLinkProps) : e.href && e.anchorProps ? u(e.anchorProps) : {});
29
31
  return (i, r) => (c(), y("li", {
@@ -88,4 +90,4 @@ const L = ["id", "aria-selected", "aria-controls", "aria-disabled"], V = { class
88
90
  export {
89
91
  J as _
90
92
  };
91
- //# sourceMappingURL=Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map
93
+ //# sourceMappingURL=Tab.vue_vue_type_script_setup_true_lang-9aa53203.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tab.vue_vue_type_script_setup_true_lang-9aa53203.js","sources":["../src/components/Tab/Tab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, inject, nextTick, onMounted, toRefs } from 'vue';\n import { type RouteLocationRaw, type RouterLinkProps } from 'vue-router';\n\n import Badge from '../Badge/Badge.vue';\n import { TABS_INJECTION } from '../Tabs/Tabs.vue';\n\n /**\n * Allowed attributes for the `<a>` element when the `href` prop is used.\n */\n type AnchorAttrs =\n | HTMLAnchorElement['download']\n | HTMLAnchorElement['hreflang']\n | HTMLAnchorElement['ping']\n | HTMLAnchorElement['referrerPolicy']\n | HTMLAnchorElement['rel']\n | HTMLAnchorElement['target']\n | HTMLAnchorElement['type'];\n\n export interface TabProps {\n /**\n * The tab identifier\n */\n value: string;\n\n /**\n * Router link `to` prop\n */\n to?: RouteLocationRaw;\n\n /**\n * Anchor tag href. Used for navigating to non-vue pages, such as Django pages in marketplace.\n */\n href?: string;\n\n /**\n * The badge's content\n */\n badge?: string | number;\n\n /**\n * Will render a plain text item if true.\n */\n disabled?: boolean;\n\n /**\n * Props for the `<a>` element when the `href` prop is used\n */\n anchorProps?: Record<AnchorAttrs, string>;\n\n /**\n * Props for the `<RouterLink>` element when the `to` prop is used\n */\n routerLinkProps?: Omit<RouterLinkProps, 'to'>;\n }\n\n const props = defineProps<TabProps>();\n\n const tabsInjection = inject(TABS_INJECTION.key);\n\n if (!tabsInjection) {\n throw Error('The Tab component must be a child of the Tabs component.');\n }\n\n const { setActiveTab, activeTab, variant } = tabsInjection;\n\n const isTabActive = computed(() => {\n return props.value === activeTab.value;\n });\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'button';\n });\n\n /**\n * Note: this click handler gets ignored when the `href` prop is used; `preventDefault()` is intentionally omitted in order to enable the `href` prop to work correctly. The `href` prop is used for navigation to non-vue pages, such as Django pages in marketplace.\n */\n function onClick(tabValue: string) {\n if (props.disabled) {\n return;\n }\n\n setActiveTab(tabValue);\n }\n\n const panelId = computed(() => `tabpanel-${props.value}`);\n\n onMounted(async () => {\n await nextTick();\n\n if (process.env.NODE_ENV !== 'test' && isTabActive.value && !document.getElementById(panelId.value)) {\n // The following warning ensures optimal accessibility is maintained when using the Tabs component. See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tab_role#example\n logger.warn(\n `The <Tab> with value \"${props.value}\" is active, but its corresponding tab panel cannot be found. Please ensure that the corresponding tab panel has an \"id\" attribute with value \"${panelId.value}\" and a \"role\" attribute with value \"tabpanel\".`,\n );\n }\n });\n\n const dynamicComponentAttrs = computed(() => {\n if (props.to && props.routerLinkProps) {\n return toRefs(props.routerLinkProps);\n }\n\n if (props.href && props.anchorProps) {\n return toRefs(props.anchorProps);\n }\n\n return {};\n });\n</script>\n\n<template>\n <li\n :id=\"`tab-${props.value}`\"\n role=\"tab\"\n :aria-selected=\"isTabActive\"\n :aria-controls=\"panelId\"\n :aria-disabled=\"props.disabled\"\n class=\"stash-tab\"\n :class=\"[\n {\n 'stash-tab--active is-active': isTabActive,\n 'stash-tab--disabled': props.disabled,\n 'stash-tab--variant-line': variant === 'line',\n 'stash-tab--variant-enclosed': variant === 'enclosed',\n },\n ]\"\n @click=\"onClick(props.value)\"\n @keypress.enter=\"onClick(props.value)\"\n >\n <component\n v-bind=\"dynamicComponentAttrs\"\n :is=\"is\"\n :to=\"props.to\"\n :href=\"props.href\"\n class=\"tw-flex tw-cursor-pointer tw-items-center tw-justify-center tw-whitespace-nowrap tw-border-solid tw-py-1.5 tw-text-sm tw-font-medium hover:tw-no-underline\"\n :class=\"[\n {\n 'tw-border-b-2': variant === 'line',\n 'tw-border-t-4 tw-px-6': variant === 'enclosed',\n 'tw-rounded-t tw-bg-white': isTabActive && variant === 'enclosed',\n 'focus:tw-no-underline': props.href,\n 'tw-pointer-events-none tw-text-ice-500': props.disabled,\n 'tw-text-ice-700': !props.disabled && !isTabActive,\n },\n [\n isTabActive\n ? 'tw-border-blue-500 tw-text-blue-500'\n : 'tw-border-transparent hover:tw-text-blue-500 focus:tw-text-blue-500',\n ],\n ]\"\n :tabindex=\"props.disabled ? -1 : 0\"\n >\n <!-- The margin-top on the <div> below is necessary to fix the vertical alignment of text in the default slot since our Sofia font has extra space under the baseline -->\n <div class=\"tw-mt-0.5\">\n <Badge :content=\"props.badge\" position=\"inline\" color=\"red\" :is-disabled=\"props.disabled\">\n <slot :is-active=\"isTabActive\" :is-disabled=\"props.disabled\" :variant=\"variant\"></slot>\n </Badge>\n </div>\n </component>\n </li>\n</template>\n"],"names":["props","__props","tabsInjection","inject","TABS_INJECTION","setActiveTab","activeTab","variant","isTabActive","computed","is","onClick","tabValue","panelId","onMounted","nextTick","logger","dynamicComponentAttrs","toRefs"],"mappings":";;;;;;;;;;;;;;;;AAyDE,UAAMA,IAAQC,GAERC,IAAgBC,EAAOC,EAAe,GAAG;AAE/C,QAAI,CAACF;AACH,YAAM,MAAM,0DAA0D;AAGxE,UAAM,EAAE,cAAAG,GAAc,WAAAC,GAAW,SAAAC,EAAA,IAAYL,GAEvCM,IAAcC,EAAS,MACpBT,EAAM,UAAUM,EAAU,KAClC,GAEKI,IAAKD,EAAS,MACdT,EAAM,KACD,gBAGLA,EAAM,OACD,MAGF,QACR;AAKD,aAASW,EAAQC,GAAkB;AACjC,MAAIZ,EAAM,YAIVK,EAAaO,CAAQ;AAAA,IACvB;AAEA,UAAMC,IAAUJ,EAAS,MAAM,YAAYT,EAAM,OAAO;AAExD,IAAAc,EAAU,YAAY;AACpB,YAAMC,EAAS,GAEX,QAAQ,IAAI,aAAa,UAAUP,EAAY,SAAS,CAAC,SAAS,eAAeK,EAAQ,KAAK,KAEzFG,EAAA;AAAA,QACL,yBAAyBhB,EAAM,uJAAuJa,EAAQ;AAAA,MAAA;AAAA,IAElM,CACD;AAEK,UAAAI,IAAwBR,EAAS,MACjCT,EAAM,MAAMA,EAAM,kBACbkB,EAAOlB,EAAM,eAAe,IAGjCA,EAAM,QAAQA,EAAM,cACfkB,EAAOlB,EAAM,WAAW,IAG1B,EACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Table.js CHANGED
@@ -9,7 +9,7 @@ import A from "./EmptyState.js";
9
9
  import D from "./Loading.js";
10
10
  import x from "./TableCell.js";
11
11
  import _ from "./TableRow.js";
12
- import { T as O } from "./Table.keys-cf93df19.js";
12
+ import { T as O } from "./Table.keys-83e4f09b.js";
13
13
  import { S as V } from "./misc-76697f61.js";
14
14
  import "./locale.js";
15
15
  import "lodash-es/get";
@@ -22,10 +22,10 @@ import "@leaflink/snitch";
22
22
  import "./Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js";
23
23
  import "./Button.vue_used_vue_type_style_index_0_lang.module-a9290468.js";
24
24
  import "./Checkbox.js";
25
- import "./ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js";
25
+ import "./ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js";
26
26
  import "./Button.js";
27
27
  import "./Icon.js";
28
- import "./Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js";
28
+ import "./Expand.vue_vue_type_script_setup_true_lang-0f236267.js";
29
29
  var J = /* @__PURE__ */ ((e) => (e.Scroll = "scroll", e.Stack = "stack", e))(J || {}), $ = /* @__PURE__ */ ((e) => (e.None = "none", e.Rounded = "rounded", e.RoundedBottom = "rounded-bottom", e))($ || {});
30
30
  const z = { class: "tw-relative tw-min-w-full tw-max-w-initial tw-border-separate" }, ft = /* @__PURE__ */ C({
31
31
  __name: "Table",
package/dist/Table.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../src/components/Table/Table.types.ts","../src/components/Table/Table.vue"],"sourcesContent":["import { ComputedRef } from 'vue';\n\nimport { SpacingDensities } from '../../../types/misc';\n\nexport enum Layout {\n Scroll = 'scroll',\n Stack = 'stack',\n}\n\nexport type Layouts = `${Layout}`;\n\nexport enum TableRadius {\n None = 'none',\n Rounded = 'rounded',\n RoundedBottom = 'rounded-bottom',\n}\n\nexport type TableRadiuses = `${TableRadius}`;\n\n/**\n * Properties and utilities provided to children of a Table instance\n */\nexport interface TableInjection {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, the density will always be \"compact\".\n */\n density: ComputedRef<SpacingDensities>;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions: ComputedRef<boolean>;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle: ComputedRef<boolean>;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable: ComputedRef<boolean>;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable: ComputedRef<boolean>;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout: ComputedRef<Layouts>;\n}\n","<script lang=\"ts\">\n import { SpacingDensities, SpacingDensity } from '../../../types/misc';\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { Layouts, TableRadiuses } from './Table.types';\n\n export * from './Table.keys';\n export * from './Table.types';\n\n export interface TableProps {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, \"compact\" density is applied regardless of this prop's value.\n */\n density?: SpacingDensities;\n\n /**\n * Sets the text for the empty state; the default value is \"No Results\".\n */\n emptyStateText?: string;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions?: boolean;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle?: boolean;\n\n /**\n * Shows the empty state\n */\n isEmpty?: boolean;\n\n /**\n * Shows the loading state\n */\n isLoading?: boolean;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable?: boolean;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable?: boolean;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout?: Layouts;\n\n /**\n * Controls the corners of the table with the \"border-radius\" CSS property. The default value is \"rounded\".\n */\n radius?: TableRadiuses;\n\n /**\n * Allows the table head to be sticky when scrolling inside the table body\n */\n stickyHeader?: {\n listLength: number;\n maxHeight: string;\n };\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, watchEffect } from 'vue';\n\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import EmptyState from '../EmptyState/EmptyState.vue';\n import Loading from '../Loading/Loading.vue';\n import TableCell from '../TableCell/TableCell.vue';\n import TableRow from '../TableRow/TableRow.vue';\n import { TABLE_INJECTION } from './Table.keys';\n\n const props = withDefaults(defineProps<TableProps>(), {\n density: undefined,\n emptyStateText: '',\n hasActions: false,\n hasCustomExpandToggle: false,\n isEmpty: false,\n isLoading: false,\n isExpandable: false,\n isSelectable: false,\n layout: 'scroll',\n radius: 'rounded',\n stickyHeader: undefined,\n });\n\n const {\n density: dataViewDensity,\n variant: dataViewVariant,\n isEmpty: isDataViewEmpty,\n isLoading: isDataViewLoading,\n isSelectable: isDataViewSelectable,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n const { variant: moduleVariant } = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n\n const computedRadius = computed<TableRadiuses>(() => {\n // Will work for tables when rendered inside of a Module with OR without a DataView.\n if (moduleVariant?.value === 'table') {\n return 'rounded-bottom';\n }\n\n if (dataViewVariant.value === 'table') {\n return 'rounded-bottom';\n }\n\n return props.radius;\n });\n\n const computedLayout = computed<Layouts>(() => {\n if (props.stickyHeader) {\n return 'scroll';\n }\n\n return props.layout;\n });\n\n const isStickyHeaderEnabled = computed<boolean>(() => {\n return !!(\n (\n props.stickyHeader?.maxHeight && // table can't scroll without a max height; sticky headers only needed for a scrollable table\n props.stickyHeader?.listLength > 3\n ) // scrollable table and sticky headers not needed when list is small\n );\n });\n\n const rootStyle = computed(() => ({\n maxHeight: isStickyHeaderEnabled.value ? props.stickyHeader?.maxHeight : '',\n }));\n\n provide(TABLE_INJECTION.key, {\n density: computed(() => props.density || dataViewDensity.value || SpacingDensity.Comfortable),\n hasCustomExpandToggle: computed(() => props.hasCustomExpandToggle),\n hasActions: computed(() => props.hasActions),\n isExpandable: computed(() => props.isExpandable),\n isSelectable: computed(\n () =>\n props.isSelectable &&\n !props.isLoading &&\n !isDataViewLoading?.value &&\n !props.isEmpty &&\n !isDataViewEmpty?.value,\n ),\n layout: computedLayout,\n });\n\n watchEffect(() => {\n // Table can be both casted within a DataView or standalone. useSelection is still possible to be used on both cases,\n // making it important to have Table to control selection props.\n // To avoid breaking changes and developer experience, a DataView injection is passed down and updated whenever it exists,\n // and move the information up into DataView, that sometimes aren't used.\n if (isDataViewSelectable) {\n isDataViewSelectable.value = props.isSelectable;\n }\n });\n</script>\n\n<template>\n <div\n class=\"stash-table tw-relative\"\n :class=\"[\n { 'tw-rounded': computedRadius === 'rounded' },\n { 'tw-rounded-b': computedRadius === 'rounded-bottom' },\n { 'tw-border-t tw-border-ice-200': dataViewVariant === 'table' },\n { 'tw-overflow-auto tw-shadow': computedLayout === 'scroll' },\n { 'tw-overflow-visble lg:tw-overflow-auto lg:tw-shadow': computedLayout === 'stack' },\n { 'tw-min-h-[300px]': isStickyHeaderEnabled && !props.isLoading }, // prevent the table from collapsing on small screen heights when the max-height is dynamic\n ]\"\n data-test=\"stash-table\"\n :style=\"rootStyle\"\n >\n <table class=\"tw-relative tw-min-w-full tw-max-w-initial tw-border-separate\">\n <thead\n class=\"tw-border-b tw-border-ice-200\"\n :class=\"{\n 'tw-hidden lg:tw-table-header-group': computedLayout === 'stack',\n }\"\n >\n <!-- @slot head -->\n <slot name=\"head\"> </slot>\n </thead>\n <tbody>\n <!-- \n tw-col-span-12 makes the td span all columns only when layout === 'stack' and the viewport is below lg (when table elements are using display: grid ).\n The colspan attr does the same in all other cases when the table elements are using their native table styles.\n These are necessary in order to properly horizontally center Loading, and EmptyState \n -->\n <TableRow v-if=\"props.isLoading || isDataViewLoading\">\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <Loading />\n </TableCell>\n </TableRow>\n <!-- @slot empty -->\n <template v-else-if=\"props.isEmpty || isDataViewEmpty\">\n <TableRow>\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <slot name=\"empty\">\n <EmptyState class=\"tw-w-full tw-bg-white\" :text=\"props.emptyStateText\" />\n </slot>\n </TableCell>\n </TableRow>\n </template>\n <!-- @slot body -->\n <slot v-else name=\"body\"></slot>\n </tbody>\n </table>\n </div>\n</template>\n"],"names":["Layout","TableRadius","dataViewDensity","dataViewVariant","isDataViewEmpty","isDataViewLoading","isDataViewSelectable","inject","DATA_VIEW_INJECTION","moduleVariant","MODULE_INJECTION","computedRadius","computed","props","computedLayout","isStickyHeaderEnabled","_a","_b","rootStyle","provide","TABLE_INJECTION","SpacingDensity","watchEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,gBAAgB,kBAHNA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;iBCkFJ;AAAA,MACJ,SAASC;AAAA,MACT,SAASC;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,cAAcC;AAAA,IACZ,IAAAC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ,GAE1D,EAAE,SAASC,MAAkBF,EAAOG,EAAiB,KAAKA,EAAiB,QAAQ,GAEnFC,IAAiBC,EAAwB,OAEzCH,KAAA,gBAAAA,EAAe,WAAU,WAIzBN,EAAgB,UAAU,UACrB,mBAGFU,EAAM,MACd,GAEKC,IAAiBF,EAAkB,MACnCC,EAAM,eACD,WAGFA,EAAM,MACd,GAEKE,IAAwBH,EAAkB,MAAM;;AAC7C,aAAA,CAAC,GAEJI,IAAAH,EAAM,iBAAN,QAAAG,EAAoB;AAAA,QACpBC,IAAAJ,EAAM,iBAAN,gBAAAI,EAAoB,cAAa;AAAA,IAAA,CAGtC,GAEKC,IAAYN,EAAS,MAAO;;AAAA;AAAA,QAChC,WAAWG,EAAsB,SAAQC,IAAAH,EAAM,iBAAN,gBAAAG,EAAoB,YAAY;AAAA,MACzE;AAAA,KAAA;AAEF,WAAAG,EAAQC,EAAgB,KAAK;AAAA,MAC3B,SAASR,EAAS,MAAMC,EAAM,WAAWX,EAAgB,SAASmB,EAAe,WAAW;AAAA,MAC5F,uBAAuBT,EAAS,MAAMC,EAAM,qBAAqB;AAAA,MACjE,YAAYD,EAAS,MAAMC,EAAM,UAAU;AAAA,MAC3C,cAAcD,EAAS,MAAMC,EAAM,YAAY;AAAA,MAC/C,cAAcD;AAAA,QACZ,MACEC,EAAM,gBACN,CAACA,EAAM,aACP,EAACR,KAAA,QAAAA,EAAmB,UACpB,CAACQ,EAAM,WACP,EAACT,KAAA,QAAAA,EAAiB;AAAA,MACtB;AAAA,MACA,QAAQU;AAAA,IAAA,CACT,GAEDQ,EAAY,MAAM;AAKhB,MAAIhB,MACFA,EAAqB,QAAQO,EAAM;AAAA,IACrC,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Table.js","sources":["../src/components/Table/Table.types.ts","../src/components/Table/Table.vue"],"sourcesContent":["import { ComputedRef } from 'vue';\n\nimport { SpacingDensities } from '../../../types/misc';\n\nexport enum Layout {\n Scroll = 'scroll',\n Stack = 'stack',\n}\n\nexport type Layouts = `${Layout}`;\n\nexport enum TableRadius {\n None = 'none',\n Rounded = 'rounded',\n RoundedBottom = 'rounded-bottom',\n}\n\nexport type TableRadiuses = `${TableRadius}`;\n\n/**\n * Properties and utilities provided to children of a Table instance\n */\nexport interface TableInjection {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, the density will always be \"compact\".\n */\n density: ComputedRef<SpacingDensities>;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions: ComputedRef<boolean>;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle: ComputedRef<boolean>;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable: ComputedRef<boolean>;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable: ComputedRef<boolean>;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout: ComputedRef<Layouts>;\n}\n","<script lang=\"ts\">\n import { SpacingDensities, SpacingDensity } from '../../../types/misc';\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { Layouts, TableRadiuses } from './Table.types';\n\n export * from './Table.keys';\n export * from './Table.types';\n\n export interface TableProps {\n /**\n * Controls the Table's padding; the default value is \"comfortable\". On small screens, \"compact\" density is applied regardless of this prop's value.\n */\n density?: SpacingDensities;\n\n /**\n * Sets the text for the empty state; the default value is \"No Results\".\n */\n emptyStateText?: string;\n\n /**\n * Styles the last column for \"row actions\"\n */\n hasActions?: boolean;\n\n /**\n * If true, hides the default expansion toggle column\n */\n hasCustomExpandToggle?: boolean;\n\n /**\n * Shows the empty state\n */\n isEmpty?: boolean;\n\n /**\n * Shows the loading state\n */\n isLoading?: boolean;\n\n /**\n * Adds a toggle column for row expansion. This is primarily needed for ensuring the corresponding empty TableHeaderRow is included.\n */\n isExpandable?: boolean;\n\n /**\n * Adds a checkbox column for selecting rows; intended for use with the `useSelection` composable.\n */\n isSelectable?: boolean;\n\n /**\n * Sets the table layout; the default value is \"scroll\".\n */\n layout?: Layouts;\n\n /**\n * Controls the corners of the table with the \"border-radius\" CSS property. The default value is \"rounded\".\n */\n radius?: TableRadiuses;\n\n /**\n * Allows the table head to be sticky when scrolling inside the table body\n */\n stickyHeader?: {\n listLength: number;\n maxHeight: string;\n };\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, watchEffect } from 'vue';\n\n import { DATA_VIEW_INJECTION } from '../DataView/DataView.vue';\n import EmptyState from '../EmptyState/EmptyState.vue';\n import Loading from '../Loading/Loading.vue';\n import TableCell from '../TableCell/TableCell.vue';\n import TableRow from '../TableRow/TableRow.vue';\n import { TABLE_INJECTION } from './Table.keys';\n\n const props = withDefaults(defineProps<TableProps>(), {\n density: undefined,\n emptyStateText: '',\n hasActions: false,\n hasCustomExpandToggle: false,\n isEmpty: false,\n isLoading: false,\n isExpandable: false,\n isSelectable: false,\n layout: 'scroll',\n radius: 'rounded',\n stickyHeader: undefined,\n });\n\n const {\n density: dataViewDensity,\n variant: dataViewVariant,\n isEmpty: isDataViewEmpty,\n isLoading: isDataViewLoading,\n isSelectable: isDataViewSelectable,\n } = inject(DATA_VIEW_INJECTION.key, DATA_VIEW_INJECTION.defaults);\n\n const { variant: moduleVariant } = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n\n const computedRadius = computed<TableRadiuses>(() => {\n // Will work for tables when rendered inside of a Module with OR without a DataView.\n if (moduleVariant?.value === 'table') {\n return 'rounded-bottom';\n }\n\n if (dataViewVariant.value === 'table') {\n return 'rounded-bottom';\n }\n\n return props.radius;\n });\n\n const computedLayout = computed<Layouts>(() => {\n if (props.stickyHeader) {\n return 'scroll';\n }\n\n return props.layout;\n });\n\n const isStickyHeaderEnabled = computed<boolean>(() => {\n return !!(\n (\n props.stickyHeader?.maxHeight && // table can't scroll without a max height; sticky headers only needed for a scrollable table\n props.stickyHeader?.listLength > 3\n ) // scrollable table and sticky headers not needed when list is small\n );\n });\n\n const rootStyle = computed(() => ({\n maxHeight: isStickyHeaderEnabled.value ? props.stickyHeader?.maxHeight : '',\n }));\n\n provide(TABLE_INJECTION.key, {\n density: computed(() => props.density || dataViewDensity.value || SpacingDensity.Comfortable),\n hasCustomExpandToggle: computed(() => props.hasCustomExpandToggle),\n hasActions: computed(() => props.hasActions),\n isExpandable: computed(() => props.isExpandable),\n isSelectable: computed(\n () =>\n props.isSelectable &&\n !props.isLoading &&\n !isDataViewLoading?.value &&\n !props.isEmpty &&\n !isDataViewEmpty?.value,\n ),\n layout: computedLayout,\n });\n\n watchEffect(() => {\n // Table can be both casted within a DataView or standalone. useSelection is still possible to be used on both cases,\n // making it important to have Table to control selection props.\n // To avoid breaking changes and developer experience, a DataView injection is passed down and updated whenever it exists,\n // and move the information up into DataView, that sometimes aren't used.\n if (isDataViewSelectable) {\n isDataViewSelectable.value = props.isSelectable;\n }\n });\n</script>\n\n<template>\n <div\n class=\"stash-table tw-relative\"\n :class=\"[\n { 'tw-rounded': computedRadius === 'rounded' },\n { 'tw-rounded-b': computedRadius === 'rounded-bottom' },\n { 'tw-border-t tw-border-ice-200': dataViewVariant === 'table' },\n { 'tw-overflow-auto tw-shadow': computedLayout === 'scroll' },\n { 'tw-overflow-visble lg:tw-overflow-auto lg:tw-shadow': computedLayout === 'stack' },\n { 'tw-min-h-[300px]': isStickyHeaderEnabled && !props.isLoading }, // prevent the table from collapsing on small screen heights when the max-height is dynamic\n ]\"\n data-test=\"stash-table\"\n :style=\"rootStyle\"\n >\n <table class=\"tw-relative tw-min-w-full tw-max-w-initial tw-border-separate\">\n <thead\n class=\"tw-border-b tw-border-ice-200\"\n :class=\"{\n 'tw-hidden lg:tw-table-header-group': computedLayout === 'stack',\n }\"\n >\n <!-- @slot head -->\n <slot name=\"head\"> </slot>\n </thead>\n <tbody>\n <!-- \n tw-col-span-12 makes the td span all columns only when layout === 'stack' and the viewport is below lg (when table elements are using display: grid ).\n The colspan attr does the same in all other cases when the table elements are using their native table styles.\n These are necessary in order to properly horizontally center Loading, and EmptyState \n -->\n <TableRow v-if=\"props.isLoading || isDataViewLoading\">\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <Loading />\n </TableCell>\n </TableRow>\n <!-- @slot empty -->\n <template v-else-if=\"props.isEmpty || isDataViewEmpty\">\n <TableRow>\n <TableCell colspan=\"100%\" :class=\"{ 'tw-col-span-12': computedLayout === 'stack' }\">\n <slot name=\"empty\">\n <EmptyState class=\"tw-w-full tw-bg-white\" :text=\"props.emptyStateText\" />\n </slot>\n </TableCell>\n </TableRow>\n </template>\n <!-- @slot body -->\n <slot v-else name=\"body\"></slot>\n </tbody>\n </table>\n </div>\n</template>\n"],"names":["Layout","TableRadius","props","__props","dataViewDensity","dataViewVariant","isDataViewEmpty","isDataViewLoading","isDataViewSelectable","inject","DATA_VIEW_INJECTION","moduleVariant","MODULE_INJECTION","computedRadius","computed","computedLayout","isStickyHeaderEnabled","_a","_b","rootStyle","provide","TABLE_INJECTION","SpacingDensity","watchEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,gBAAgB,kBAHNA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;ACoEV,UAAMC,IAAQC,GAcR;AAAA,MACJ,SAASC;AAAA,MACT,SAASC;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,cAAcC;AAAA,IACZ,IAAAC,EAAOC,EAAoB,KAAKA,EAAoB,QAAQ,GAE1D,EAAE,SAASC,MAAkBF,EAAOG,EAAiB,KAAKA,EAAiB,QAAQ,GAEnFC,IAAiBC,EAAwB,OAEzCH,KAAA,gBAAAA,EAAe,WAAU,WAIzBN,EAAgB,UAAU,UACrB,mBAGFH,EAAM,MACd,GAEKa,IAAiBD,EAAkB,MACnCZ,EAAM,eACD,WAGFA,EAAM,MACd,GAEKc,IAAwBF,EAAkB,MAAM;;AAC7C,aAAA,CAAC,GAEJG,IAAAf,EAAM,iBAAN,QAAAe,EAAoB;AAAA,QACpBC,IAAAhB,EAAM,iBAAN,gBAAAgB,EAAoB,cAAa;AAAA,IAAA,CAGtC,GAEKC,IAAYL,EAAS,MAAO;;AAAA;AAAA,QAChC,WAAWE,EAAsB,SAAQC,IAAAf,EAAM,iBAAN,gBAAAe,EAAoB,YAAY;AAAA,MACzE;AAAA,KAAA;AAEF,WAAAG,EAAQC,EAAgB,KAAK;AAAA,MAC3B,SAASP,EAAS,MAAMZ,EAAM,WAAWE,EAAgB,SAASkB,EAAe,WAAW;AAAA,MAC5F,uBAAuBR,EAAS,MAAMZ,EAAM,qBAAqB;AAAA,MACjE,YAAYY,EAAS,MAAMZ,EAAM,UAAU;AAAA,MAC3C,cAAcY,EAAS,MAAMZ,EAAM,YAAY;AAAA,MAC/C,cAAcY;AAAA,QACZ,MACEZ,EAAM,gBACN,CAACA,EAAM,aACP,EAACK,KAAA,QAAAA,EAAmB,UACpB,CAACL,EAAM,WACP,EAACI,KAAA,QAAAA,EAAiB;AAAA,MACtB;AAAA,MACA,QAAQS;AAAA,IAAA,CACT,GAEDQ,EAAY,MAAM;AAKhB,MAAIf,MACFA,EAAqB,QAAQN,EAAM;AAAA,IACrC,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,11 +1,11 @@
1
- const o = "_root_9c99g_2", t = {
1
+ const o = "_root_rmarx_2", t = {
2
2
  root: o,
3
- "layout--scroll": "_layout--scroll_9c99g_6",
4
- "has-actions": "_has-actions_9c99g_12",
5
- "layout--stack": "_layout--stack_9c99g_16",
6
- "is-control": "_is-control_9c99g_28",
7
- "root--density-comfortable": "_root--density-comfortable_9c99g_52"
8
- }, _ = "_root_ngiw1_2", n = {
3
+ "layout--scroll": "_layout--scroll_rmarx_6",
4
+ "has-actions": "_has-actions_rmarx_12",
5
+ "layout--stack": "_layout--stack_rmarx_16",
6
+ "is-control": "_is-control_rmarx_28",
7
+ "root--density-comfortable": "_root--density-comfortable_rmarx_52"
8
+ }, _ = "_root_ngiw1_2", r = {
9
9
  root: _,
10
10
  "is-expandable": "_is-expandable_ngiw1_9",
11
11
  "root--hidden-divider": "_root--hidden-divider_ngiw1_14",
@@ -16,12 +16,12 @@ const o = "_root_9c99g_2", t = {
16
16
  "row-control-cell": "_row-control-cell_ngiw1_62",
17
17
  "row-expansion-content": "_row-expansion-content_ngiw1_73",
18
18
  "row-expansion": "_row-expansion_ngiw1_73"
19
- }, c = Object.freeze({
19
+ }, n = Object.freeze({
20
20
  key: Symbol("TABLE_INJECTION_KEY")
21
21
  });
22
22
  export {
23
- c as T,
24
- n as a,
23
+ n as T,
24
+ r as a,
25
25
  t as s
26
26
  };
27
- //# sourceMappingURL=Table.keys-cf93df19.js.map
27
+ //# sourceMappingURL=Table.keys-83e4f09b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.keys-cf93df19.js","sources":["../src/components/Table/Table.keys.ts"],"sourcesContent":["import { Injection } from '../../../types/utils';\nimport { TableInjection } from './Table.types';\n\nexport const TABLE_INJECTION: Injection<TableInjection> = Object.freeze({\n key: Symbol('TABLE_INJECTION_KEY'),\n});\n"],"names":["TABLE_INJECTION"],"mappings":";;;;;;;;;;;;;;;;;;GAGaA,IAA6C,OAAO,OAAO;AAAA,EACtE,KAAK,OAAO,qBAAqB;AACnC,CAAC;"}
1
+ {"version":3,"file":"Table.keys-83e4f09b.js","sources":["../src/components/Table/Table.keys.ts"],"sourcesContent":["import { Injection } from '../../../types/utils';\nimport { TableInjection } from './Table.types';\n\nexport const TABLE_INJECTION: Injection<TableInjection> = Object.freeze({\n key: Symbol('TABLE_INJECTION_KEY'),\n});\n"],"names":["TABLE_INJECTION"],"mappings":";;;;;;;;;;;;;;;;;;GAGaA,IAA6C,OAAO,OAAO;AAAA,EACtE,KAAK,OAAO,qBAAqB;AACnC,CAAC;"}
@@ -1,12 +1,11 @@
1
- import { AllowedComponentProps } from 'vue';
2
- import { ComponentCustomProps } from 'vue';
3
1
  import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
4
3
  import { ComputedRef } from 'vue';
5
4
  import { DefineComponent } from 'vue';
6
5
  import { ExtractPropTypes } from 'vue';
7
6
  import { InjectionKey } from 'vue';
8
7
  import { PropType } from 'vue';
9
- import { VNodeProps } from 'vue';
8
+ import { PublicProps } from 'vue';
10
9
 
11
10
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
11
 
@@ -35,7 +34,7 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
35
34
  };
36
35
  };
37
36
 
38
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TableProps>, {
37
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TableProps>, {
39
38
  density: undefined;
40
39
  emptyStateText: string;
41
40
  hasActions: boolean;
@@ -47,7 +46,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
47
46
  layout: string;
48
47
  radius: string;
49
48
  stickyHeader: undefined;
50
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TableProps>, {
49
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TableProps>, {
51
50
  density: undefined;
52
51
  emptyStateText: string;
53
52
  hasActions: boolean;
@@ -59,7 +58,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
59
58
  layout: string;
60
59
  radius: string;
61
60
  stickyHeader: undefined;
62
- }>>>, {
61
+ }>>> & Readonly<{}>, {
63
62
  radius: "none" | "rounded" | "rounded-bottom";
64
63
  isLoading: boolean;
65
64
  density: "compact" | "comfortable";
@@ -74,7 +73,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
74
73
  listLength: number;
75
74
  maxHeight: string;
76
75
  };
77
- }, {}>, {
76
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
78
77
  head?(_: {}): any;
79
78
  empty?(_: {}): any;
80
79
  body?(_: {}): any;
package/dist/TableCell.js CHANGED
@@ -8,7 +8,7 @@ import "lodash-es/get";
8
8
  import "./Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js";
9
9
  import "./EmptyState.vue_used_vue_type_style_index_0_lang.module-f5d89366.js";
10
10
  import "./Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js";
11
- import { T as y, s as C } from "./Table.keys-cf93df19.js";
11
+ import { T as y, s as C } from "./Table.keys-83e4f09b.js";
12
12
  import "@leaflink/snitch";
13
13
  import "./Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js";
14
14
  import "./Button.vue_used_vue_type_style_index_0_lang.module-a9290468.js";
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sources":["../src/components/TableCell/TableCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { TABLE_INJECTION } from '../Table/Table.vue';\n\n export interface TableCellProps {\n /**\n * If true, displays the cell as a control (vs data) cell without a background color on mobile when Table is in the stacked layout\n */\n isControl?: boolean;\n /**\n * If true, displays the header inside the cell on mobile and tablet screens when Table is in the stacked layout\n */\n mobileHeader?: string;\n }\n\n const props = withDefaults(defineProps<TableCellProps>(), {\n isControl: false,\n mobileHeader: '',\n });\n const classes = useCssModule();\n\n const tableInjection = inject(TABLE_INJECTION.key);\n if (!tableInjection) {\n throw new Error('TableCell must be used within a Table component');\n }\n\n const { density, hasActions, layout } = tableInjection;\n</script>\n\n<template>\n <td\n class=\"stash-table-cell\"\n data-test=\"stash-table-cell\"\n :class=\"[\n classes.root,\n classes[`layout--${layout}`],\n {\n [classes['root--density-compact']]: density === 'compact',\n [classes['root--density-comfortable']]: density === 'comfortable',\n [classes['has-actions']]: hasActions,\n 'tw-p-3': layout === 'scroll',\n 'tw-p-1.5': layout === 'stack',\n 'lg:tw-p-3': density === 'compact',\n 'lg:tw-px-3 lg:tw-py-6': density === 'comfortable',\n [classes['is-control']]: props.isControl,\n },\n ]\"\n >\n <div v-if=\"props.mobileHeader && layout === 'stack'\" class=\"tw-text-xs tw-font-medium tw-text-ice-900 lg:tw-hidden\">\n {{ props.mobileHeader }}\n </div>\n <!-- @slot default -->\n <slot></slot>\n </td>\n</template>\n\n<style module>\n .root {\n border: 0;\n }\n\n .layout--scroll {\n background-color: var(--color-white);\n border: none;\n border-bottom: 1px solid var(--color-ice-200);\n }\n\n .layout--scroll.has-actions:last-of-type {\n text-align: center;\n }\n\n .layout--stack {\n background-color: var(--color-ice-100);\n border-radius: theme('borderRadius.DEFAULT');\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: transparent;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .layout--stack.is-control {\n background-color: transparent;\n }\n\n /* On large screens, layout--stack should match layout--scroll */\n @media screen('lg') {\n .layout--stack {\n background-color: var(--color-white);\n border-bottom: 1px solid var(--color-ice-200);\n border-radius: initial;\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: var(--color-white);\n position: initial;\n right: initial;\n text-align: center;\n top: initial;\n }\n\n .layout--stack.is-control {\n background-color: var(--color-white);\n }\n\n .root--density-comfortable:last-of-type:not(.has-actions) {\n padding-right: 24px;\n }\n\n .root--density-comfortable:first-of-type:not(:global(.stash-table-header-row__selection-cell), :global(.stash-table-row__selection-cell), :global(.stash-table-row__toggle-expansion-cell)) {\n padding-left: 24px;\n }\n }\n</style>\n"],"names":["classes","useCssModule","tableInjection","inject","TABLE_INJECTION","density","hasActions","layout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBQA,IAAUC,KAEVC,IAAiBC,EAAOC,EAAgB,GAAG;AACjD,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,iDAAiD;AAGnE,UAAM,EAAE,SAAAG,GAAS,YAAAC,GAAY,QAAAC,EAAA,IAAWL;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TableCell.js","sources":["../src/components/TableCell/TableCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { TABLE_INJECTION } from '../Table/Table.vue';\n\n export interface TableCellProps {\n /**\n * If true, displays the cell as a control (vs data) cell without a background color on mobile when Table is in the stacked layout\n */\n isControl?: boolean;\n /**\n * If true, displays the header inside the cell on mobile and tablet screens when Table is in the stacked layout\n */\n mobileHeader?: string;\n }\n\n const props = withDefaults(defineProps<TableCellProps>(), {\n isControl: false,\n mobileHeader: '',\n });\n const classes = useCssModule();\n\n const tableInjection = inject(TABLE_INJECTION.key);\n if (!tableInjection) {\n throw new Error('TableCell must be used within a Table component');\n }\n\n const { density, hasActions, layout } = tableInjection;\n</script>\n\n<template>\n <td\n class=\"stash-table-cell\"\n data-test=\"stash-table-cell\"\n :class=\"[\n classes.root,\n classes[`layout--${layout}`],\n {\n [classes['root--density-compact']]: density === 'compact',\n [classes['root--density-comfortable']]: density === 'comfortable',\n [classes['has-actions']]: hasActions,\n 'tw-p-3': layout === 'scroll',\n 'tw-p-1.5': layout === 'stack',\n 'lg:tw-p-3': density === 'compact',\n 'lg:tw-px-3 lg:tw-py-6': density === 'comfortable',\n [classes['is-control']]: props.isControl,\n },\n ]\"\n >\n <div v-if=\"props.mobileHeader && layout === 'stack'\" class=\"tw-text-xs tw-font-medium tw-text-ice-900 lg:tw-hidden\">\n {{ props.mobileHeader }}\n </div>\n <!-- @slot default -->\n <slot></slot>\n </td>\n</template>\n\n<style module>\n .root {\n border: 0;\n }\n\n .layout--scroll {\n background-color: var(--color-white);\n border: none;\n border-bottom: 1px solid var(--color-ice-200);\n }\n\n .layout--scroll.has-actions:last-of-type {\n text-align: center;\n }\n\n .layout--stack {\n background-color: var(--color-ice-100);\n border-radius: theme('borderRadius.DEFAULT');\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: transparent;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .layout--stack.is-control {\n background-color: transparent;\n }\n\n /* On large screens, layout--stack should match layout--scroll */\n @media screen('lg') {\n .layout--stack {\n background-color: var(--color-white);\n border-bottom: 1px solid var(--color-ice-200);\n border-radius: initial;\n }\n\n .layout--stack.has-actions:last-of-type {\n background-color: var(--color-white);\n position: initial;\n right: initial;\n text-align: center;\n top: initial;\n }\n\n .layout--stack.is-control {\n background-color: var(--color-white);\n }\n\n .root--density-comfortable:last-of-type:not(.has-actions) {\n padding-right: 24px;\n }\n\n .root--density-comfortable:first-of-type:not(\n :global(.stash-table-header-row__selection-cell),\n :global(.stash-table-row__selection-cell),\n :global(.stash-table-row__toggle-expansion-cell)\n ) {\n padding-left: 24px;\n }\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","tableInjection","inject","TABLE_INJECTION","density","hasActions","layout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBE,UAAMA,IAAQC,GAIRC,IAAUC,KAEVC,IAAiBC,EAAOC,EAAgB,GAAG;AACjD,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,iDAAiD;AAGnE,UAAM,EAAE,SAAAG,GAAS,YAAAC,GAAY,QAAAC,EAAA,IAAWL;;;;;;;;;;;;;;;;;;;;;;;;;"}