@leaflink/stash 48.16.1 → 48.17.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 (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 +128 -105
  56. package/dist/ConfirmationCodeInput.js.map +1 -1
  57. package/dist/ConfirmationCodeInput.vue.d.ts +36 -11
  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
package/dist/Modal.js CHANGED
@@ -1,17 +1,17 @@
1
- import { defineComponent as N, useSlots as K, ref as d, computed as k, watch as D, onBeforeUnmount as R, openBlock as i, createElementBlock as w, normalizeClass as n, withKeys as T, createVNode as x, withModifiers as L, createElementVNode as g, unref as f, renderSlot as m, toDisplayString as V, createCommentVNode as r, createBlock as j, withCtx as F } from "vue";
2
- import A from "lodash-es/uniqueId";
3
- import { FOCUS_ELEMENTS_SELECTOR as q } from "./constants.js";
1
+ import { defineComponent as R, useSlots as T, ref as d, computed as k, watch as D, onBeforeUnmount as V, openBlock as i, createElementBlock as m, normalizeClass as n, withKeys as A, createVNode as x, withModifiers as L, createElementVNode as g, unref as f, renderSlot as w, toDisplayString as K, createCommentVNode as r, createBlock as j, withCtx as F } from "vue";
2
+ import q from "lodash-es/uniqueId";
3
+ import { FOCUS_ELEMENTS_SELECTOR as P } from "./constants.js";
4
4
  import { t as H } from "./locale.js";
5
- import P from "./Backdrop.js";
5
+ import U from "./Backdrop.js";
6
6
  import I from "./Button.js";
7
7
  import M from "./Icon.js";
8
- import { _ as U } from "./_plugin-vue_export-helper-dad06003.js";
8
+ import { _ as W } from "./_plugin-vue_export-helper-dad06003.js";
9
9
  import "lodash-es/get";
10
10
  import "./Button.vue_used_vue_type_style_index_0_lang.module-a9290468.js";
11
11
  import "./index-9e1095ef.js";
12
12
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
13
- var W = /* @__PURE__ */ ((l) => (l.Narrow = "narrow", l.Medium = "medium", l.Wide = "wide", l))(W || {}), G = /* @__PURE__ */ ((l) => (l.Center = "center", l.Left = "left", l.Right = "right", l))(G || {});
14
- const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place-items-center" }, Y = ["id"], Z = { class: "stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row" }, ee = /* @__PURE__ */ N({
13
+ var G = /* @__PURE__ */ ((l) => (l.Narrow = "narrow", l.Medium = "medium", l.Wide = "wide", l))(G || {}), J = /* @__PURE__ */ ((l) => (l.Center = "center", l.Left = "left", l.Right = "right", l))(J || {});
14
+ const Q = ["aria-labelledby"], X = { class: "tw-flex tw-place-items-center" }, Y = ["id"], Z = { class: "stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row" }, ee = /* @__PURE__ */ R({
15
15
  name: "ll-modal",
16
16
  __name: "Modal",
17
17
  props: {
@@ -30,8 +30,8 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
30
30
  preventDismiss: { type: Boolean, default: !1 }
31
31
  },
32
32
  emits: ["update:open", "update:is-open", "dismiss"],
33
- setup(l, { emit: _ }) {
34
- const e = l, y = K(), u = d(), B = d(), p = d([]), b = d(), E = d(), c = d({ height: "", overflow: "" }), C = A("modal-header-"), z = k(() => !!y.actions || !!y.footer), o = k(() => e.open || e.isOpen), s = k(() => e.position === "left" || e.position === "right");
33
+ setup(l, { emit: N }) {
34
+ const e = l, _ = N, y = T(), u = d(), B = d(), p = d([]), b = d(), E = d(), c = d({ height: "", overflow: "" }), C = q("modal-header-"), z = k(() => !!y.actions || !!y.footer), o = k(() => e.open || e.isOpen), s = k(() => e.position === "left" || e.position === "right");
35
35
  function h() {
36
36
  return document.scrollingElement || document.body;
37
37
  }
@@ -49,7 +49,7 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
49
49
  });
50
50
  },
51
51
  { immediate: !0 }
52
- ), R(() => {
52
+ ), V(() => {
53
53
  var t;
54
54
  S("show"), Object.assign(h().style, {
55
55
  overflow: c.value.overflow,
@@ -60,7 +60,7 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
60
60
  e.preventDismiss || (_("update:open", !1), _("update:is-open", !1), _("dismiss"));
61
61
  }
62
62
  D(u, () => {
63
- u.value && (B.value = document.activeElement, u.value.focus(), p.value = Array.from(u.value.querySelectorAll(q)), b.value = p.value[0], E.value = p.value[p.value.length - 1], document.addEventListener("keydown", O));
63
+ u.value && (B.value = document.activeElement, u.value.focus(), p.value = Array.from(u.value.querySelectorAll(P)), b.value = p.value[0], E.value = p.value[p.value.length - 1], document.addEventListener("keydown", O));
64
64
  });
65
65
  function O(t) {
66
66
  var a, $;
@@ -70,7 +70,7 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
70
70
  const a = document.getElementById("launcher");
71
71
  !a || !a.parentElement || (a.parentElement.style.display = t === "show" ? "block" : "none");
72
72
  }
73
- return (t, a) => o.value ? (i(), w("div", {
73
+ return (t, a) => o.value ? (i(), m("div", {
74
74
  key: 0,
75
75
  ref_key: "rootRef",
76
76
  ref: u,
@@ -83,12 +83,12 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
83
83
  }]),
84
84
  "data-test": "ll-modal",
85
85
  tabindex: "0",
86
- onKeydown: T(v, ["esc"])
86
+ onKeydown: A(v, ["esc"])
87
87
  }, [
88
- x(P, {
88
+ x(U, {
89
89
  class: "stash-modal__backdrop",
90
90
  onClick: L(v, ["stop"])
91
- }, null, 8, ["onClick"]),
91
+ }),
92
92
  g("div", {
93
93
  "aria-modal": "true",
94
94
  role: "dialog",
@@ -113,19 +113,19 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
113
113
  onClick: a[0] || (a[0] = L(() => {
114
114
  }, ["stop"]))
115
115
  }, [
116
- e.hideHeader ? r("", !0) : (i(), w("header", {
116
+ e.hideHeader ? r("", !0) : (i(), m("header", {
117
117
  key: 0,
118
118
  "data-test": "stash-modal__header",
119
119
  class: n(["stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500", { "lg:tw-rounded-t": !s.value }])
120
120
  }, [
121
121
  g("div", X, [
122
- m(t.$slots, "headerAction", {}, void 0, !0)
122
+ w(t.$slots, "headerAction", {}, void 0, !0)
123
123
  ]),
124
- e.title ? (i(), w("h3", {
124
+ e.title ? (i(), m("h3", {
125
125
  key: 0,
126
126
  id: f(C),
127
127
  class: "tw-m-0 tw-flex-1 tw-leading-6 tw-text-white"
128
- }, V(e.title), 9, Y)) : r("", !0),
128
+ }, K(e.title), 9, Y)) : r("", !0),
129
129
  e.hideClose ? r("", !0) : (i(), j(I, {
130
130
  key: 1,
131
131
  icon: "",
@@ -160,13 +160,13 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
160
160
  ]),
161
161
  _: 1
162
162
  }, 8, ["title"])) : r("", !0),
163
- f(y)["featured-content"] ? (i(), w("div", {
163
+ f(y)["featured-content"] ? (i(), m("div", {
164
164
  key: 2,
165
165
  class: n(["stash-modal__featured-content tw-relative", {
166
166
  "tw-rounded-t": e.hideHeader
167
167
  }])
168
168
  }, [
169
- m(t.$slots, "featured-content", {}, void 0, !0)
169
+ w(t.$slots, "featured-content", {}, void 0, !0)
170
170
  ], 2)) : r("", !0),
171
171
  g("div", {
172
172
  class: n(["stash-modal__body tw-flex-1 tw-overflow-y-auto", [
@@ -180,26 +180,26 @@ const J = ["onKeydown"], Q = ["aria-labelledby"], X = { class: "tw-flex tw-place
180
180
  ]]),
181
181
  "data-test": "stash-modal__body"
182
182
  }, [
183
- m(t.$slots, "default", {}, void 0, !0)
183
+ w(t.$slots, "default", {}, void 0, !0)
184
184
  ], 2),
185
- z.value ? (i(), w("footer", {
185
+ z.value ? (i(), m("footer", {
186
186
  key: 3,
187
187
  class: n(["stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6", { "lg:tw-rounded-b": !s.value }])
188
188
  }, [
189
- m(t.$slots, "footer", {}, () => [
189
+ w(t.$slots, "footer", {}, () => [
190
190
  g("div", Z, [
191
- m(t.$slots, "actions", {}, void 0, !0)
191
+ w(t.$slots, "actions", {}, void 0, !0)
192
192
  ])
193
193
  ], !0)
194
194
  ], 2)) : r("", !0)
195
195
  ], 10, Q)
196
- ], 42, J)) : r("", !0);
196
+ ], 34)) : r("", !0);
197
197
  }
198
198
  });
199
- const fe = /* @__PURE__ */ U(ee, [["__scopeId", "data-v-783aa3aa"]]);
199
+ const fe = /* @__PURE__ */ W(ee, [["__scopeId", "data-v-4784534c"]]);
200
200
  export {
201
- G as ModalPosition,
202
- W as ModalSize,
201
+ J as ModalPosition,
202
+ G as ModalSize,
203
203
  fe as default
204
204
  };
205
205
  //# sourceMappingURL=Modal.js.map
package/dist/Modal.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n\n /**\n * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.\n * Example: There are in-flight api requests and you do not want the modal to close until they are done.\n */\n preventDismiss?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n preventDismiss: false,\n });\n\n const emit =\n defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n toggleHelpWidgetLauncher(isModalOpen.value ? 'hide' : 'show');\n\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n toggleHelpWidgetLauncher('show');\n\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n if (props.preventDismiss) {\n return;\n }\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n\n /**\n * The customer support \"help widget launcher\" covers the action buttons in the Modal when the Modal uses a position value of \"right\" (for drawers).\n */\n function toggleHelpWidgetLauncher(nextState: 'show' | 'hide') {\n const launcherElement = document.getElementById('launcher');\n\n if (!launcherElement || !launcherElement.parentElement) {\n return;\n }\n\n launcherElement.parentElement.style.display = nextState === 'show' ? 'block' : 'none';\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n 'tw-overflow-y-auto': !props.scrollable && !isDrawer,\n 'tw-overflow-y-hidden': isDrawer,\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n 'lg:tw-absolute lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: theme('spacing.3');\n order: 1;\n }\n\n @media screen('lg') {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","props","isDrawer","getPageScrollingElement","watch","toggleHelpWidgetLauncher","onBeforeUnmount","handleTab","_a","dismiss","emit","FOCUS_ELEMENTS_SELECTOR","e","_b","nextState","launcherElement"],"mappings":"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"}
1
+ {"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n\n /**\n * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.\n * Example: There are in-flight api requests and you do not want the modal to close until they are done.\n */\n preventDismiss?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n preventDismiss: false,\n });\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n toggleHelpWidgetLauncher(isModalOpen.value ? 'hide' : 'show');\n\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n toggleHelpWidgetLauncher('show');\n\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n if (props.preventDismiss) {\n return;\n }\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n\n /**\n * The customer support \"help widget launcher\" covers the action buttons in the Modal when the Modal uses a position value of \"right\" (for drawers).\n */\n function toggleHelpWidgetLauncher(nextState: 'show' | 'hide') {\n const launcherElement = document.getElementById('launcher');\n\n if (!launcherElement || !launcherElement.parentElement) {\n return;\n }\n\n launcherElement.parentElement.style.display = nextState === 'show' ? 'block' : 'none';\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n 'tw-overflow-y-auto': !props.scrollable && !isDrawer,\n 'tw-overflow-y-hidden': isDrawer,\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n 'lg:tw-absolute lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: theme('spacing.3');\n order: 1;\n }\n\n @media screen('lg') {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","props","__props","emit","__emit","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","isDrawer","getPageScrollingElement","watch","toggleHelpWidgetLauncher","onBeforeUnmount","handleTab","_a","dismiss","FOCUS_ELEMENTS_SELECTOR","e","_b","nextState","launcherElement"],"mappings":"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"}
@@ -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<ModalProps>, {
35
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
37
36
  hideClose: boolean;
38
37
  open: boolean;
39
38
  isOpen: boolean;
@@ -46,11 +45,11 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
46
45
  hideHeader: boolean;
47
46
  closeButtonColorClass: string;
48
47
  preventDismiss: boolean;
49
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
48
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
50
49
  "update:open": (isOpen?: boolean | undefined) => void;
51
50
  "update:is-open": (isOpen?: boolean | undefined) => void;
52
51
  dismiss: () => void;
53
- }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
52
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
54
53
  hideClose: boolean;
55
54
  open: boolean;
56
55
  isOpen: boolean;
@@ -63,11 +62,11 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
63
62
  hideHeader: boolean;
64
63
  closeButtonColorClass: string;
65
64
  preventDismiss: boolean;
66
- }>>> & {
65
+ }>>> & Readonly<{
67
66
  onDismiss?: (() => any) | undefined;
68
67
  "onUpdate:is-open"?: ((isOpen?: boolean | undefined) => any) | undefined;
69
68
  "onUpdate:open"?: ((isOpen?: boolean | undefined) => any) | undefined;
70
- }, {
69
+ }>, {
71
70
  title: string;
72
71
  size: "medium" | "narrow" | "wide";
73
72
  modelValue: boolean;
@@ -80,7 +79,7 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
80
79
  hideHeader: boolean;
81
80
  closeButtonColorClass: string;
82
81
  preventDismiss: boolean;
83
- }, {}>, {
82
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
84
83
  headerAction?(_: {}): any;
85
84
  "featured-content"?(_: {}): any;
86
85
  default?(_: {}): any;
package/dist/Modals.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as p, openBlock as s, createBlock as c, TransitionGroup as m, withCtx as a, createElementBlock as d, Fragment as f, renderList as l, unref as v, resolveDynamicComponent as M, mergeProps as L, toHandlers as b, createSlots as g, createElementVNode as k } from "vue";
1
+ import { defineComponent as p, openBlock as r, createBlock as c, TransitionGroup as m, withCtx as a, createElementBlock as d, Fragment as f, renderList as l, unref as v, resolveDynamicComponent as M, mergeProps as L, toHandlers as b, createSlots as g, createElementVNode as k } from "vue";
2
2
  import y from "./useModals.js";
3
3
  import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "lodash-es/merge";
@@ -6,19 +6,20 @@ const B = ["innerHTML"], C = /* @__PURE__ */ p({
6
6
  __name: "Modals",
7
7
  setup(H) {
8
8
  const t = y();
9
- function _(n, o) {
9
+ function _(s, o) {
10
10
  var e;
11
- return (e = n.options) != null && e.disableDefaultListeners ? {} : {
11
+ return (e = s.options) != null && e.disableDefaultListeners ? {} : {
12
12
  dismiss: () => t.close({ index: o }),
13
13
  close: () => t.close({ index: o }),
14
14
  cancel: () => t.close({ index: o })
15
15
  };
16
16
  }
17
- return (n, o) => (s(), c(m, { name: "modals" }, {
17
+ return (s, o) => (r(), c(m, { name: "modals" }, {
18
18
  default: a(() => [
19
- (s(!0), d(f, null, l(v(t).active, (e, r) => (s(), c(M(e.component), L({
20
- key: `modal-${r}`
21
- }, e.attributes, { "is-open": !0 }, b(_(e, r))), g({ _: 2 }, [
19
+ (r(!0), d(f, null, l(v(t).active, (e, n) => (r(), c(M(e.component), L({
20
+ key: `modal-${n}`,
21
+ ref_for: !0
22
+ }, e.attributes, { "is-open": !0 }, b(_(e, n))), g({ _: 2 }, [
22
23
  l(e.slots, (i, u) => ({
23
24
  name: u,
24
25
  fn: a(() => [
@@ -1 +1 @@
1
- {"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n /* @ts-ignore-file */\n import { DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n // @ts-ignore - Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n function getListeners(modal: DeepReadonly<Modal> | any, index: number) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index }),\n close: () => modals.close({ index }),\n cancel: () => modals.close({ index }),\n };\n }\n</script>\n\n<template>\n <TransitionGroup name=\"modals\">\n <component\n :is=\"modal.component\"\n v-for=\"(modal, index) in modals.active\"\n :key=\"`modal-${index}`\"\n v-bind=\"modal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(modal, index)\"\n >\n <template v-for=\"(value, name) in modal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </TransitionGroup>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","getListeners","modal","index","_a"],"mappings":";;;;;;;AAME,UAAMA,IAASC;AAGN,aAAAC,EAAaC,GAAkCC,GAAe;;AACjE,cAAAC,IAAAF,EAAM,YAAN,QAAAE,EAAe,0BACV,KAGF;AAAA,QACL,SAAS,MAAML,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACrC,OAAO,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACnC,QAAQ,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,MAAA;AAAA,IAExC;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n /* @ts-ignore-file */\n import { DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n // @ts-ignore - Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n function getListeners(modal: DeepReadonly<Modal> | any, index: number) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index }),\n close: () => modals.close({ index }),\n cancel: () => modals.close({ index }),\n };\n }\n</script>\n\n<template>\n <TransitionGroup name=\"modals\">\n <component\n :is=\"modal.component\"\n v-for=\"(modal, index) in modals.active\"\n :key=\"`modal-${index}`\"\n v-bind=\"modal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(modal, index)\"\n >\n <template v-for=\"(value, name) in modal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </TransitionGroup>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","getListeners","modal","index","_a"],"mappings":";;;;;;;AAME,UAAMA,IAASC;AAGN,aAAAC,EAAaC,GAAkCC,GAAe;;AACjE,cAAAC,IAAAF,EAAM,YAAN,QAAAE,EAAe,0BACV,KAGF;AAAA,QACL,SAAS,MAAML,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACrC,OAAO,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,QACnC,QAAQ,MAAMJ,EAAO,MAAM,EAAE,OAAAI,GAAO;AAAA,MAAA;AAAA,IAExC;;;;;;;;;;;;;;;;;;;;"}
@@ -1,11 +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
- import { ExtractPropTypes } from 'vue';
6
- import { VNodeProps } from 'vue';
4
+ import { PublicProps } from 'vue';
7
5
 
8
- declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}, {}>;
6
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
9
7
  export default _default;
10
8
 
11
9
  export { }
@@ -1 +1 @@
1
- {"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: 'box',\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["onMounted","props","logger","provide","MODULE_INJECTION","computed"],"mappings":";;;;;;;;;;;;;;;;;AA+BE,WAAAA,EAAU,MAAM;AACV,MAAAC,EAAM,YAAY,UACpBC,EAAO,KAAK,iGAAiG,GAG3GD,EAAM,YAAY,UACpBC,EAAO,KAAK,mGAAmG;AAAA,IACjH,CACD,GAEOC,EAAAC,EAAiB,KAAK,EAAE,SAASC,EAAS,MAAMJ,EAAM,OAAO,EAAA,CAAG;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: 'box',\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["props","__props","onMounted","logger","provide","MODULE_INJECTION","computed"],"mappings":";;;;;;;;;;;;;;;;AA2BE,UAAMA,IAAQC;AAId,WAAAC,EAAU,MAAM;AACV,MAAAF,EAAM,YAAY,UACpBG,EAAO,KAAK,iGAAiG,GAG3GH,EAAM,YAAY,UACpBG,EAAO,KAAK,mGAAmG;AAAA,IACjH,CACD,GAEOC,EAAAC,EAAiB,KAAK,EAAE,SAASC,EAAS,MAAMN,EAAM,OAAO,EAAA,CAAG;;;;;;;;;;;;;;;;;;"}
@@ -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
 
@@ -54,13 +53,13 @@ declare interface BoxProps {
54
53
  radius?: 'none' | 'rounded';
55
54
  }
56
55
 
57
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
56
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
58
57
  variant: string;
59
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
58
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleProps>, {
60
59
  variant: string;
61
- }>>>, {
62
- variant: "table" | "list" | "box" | "card";
63
- }, {}>, {
60
+ }>>> & Readonly<{}>, {
61
+ variant: "table" | "box" | "card" | "list";
62
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
64
63
  default?(_: {}): any;
65
64
  }>;
66
65
  export default _default;
@@ -1,9 +1,7 @@
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
- import { ExtractPropTypes } from 'vue';
6
- import { VNodeProps } from 'vue';
4
+ import { PublicProps } from 'vue';
7
5
 
8
6
  declare type __VLS_WithTemplateSlots<T, S> = T & {
9
7
  new (): {
@@ -11,7 +9,7 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
11
9
  };
12
10
  };
13
11
 
14
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}, {}>, {
12
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
15
13
  "top-left"?(_: {}): any;
16
14
  "top-right"?(_: {}): any;
17
15
  default?(_: {}): any;
@@ -1,9 +1,7 @@
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
- import { ExtractPropTypes } from 'vue';
6
- import { VNodeProps } from 'vue';
4
+ import { PublicProps } from 'vue';
7
5
 
8
6
  declare type __VLS_WithTemplateSlots<T, S> = T & {
9
7
  new (): {
@@ -11,7 +9,7 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
11
9
  };
12
10
  };
13
11
 
14
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}, {}>, {
12
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
15
13
  default?(_: {}): any;
16
14
  }>;
17
15
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n\n // get the module variant from the parent module\n const moduleVariant = ref();\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('<ModuleHeader> must be used within a <Module> component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n\n const is = computed(() => {\n let component: string;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const isDefaultSlotSimpleString = computed(() => {\n if (!slots.default) {\n return false;\n }\n\n const defaultSlot = slots.default();\n return (\n defaultSlot.length === 1 &&\n typeof slots.default()[0].children === 'string' &&\n typeof slots.default()[0].type === 'symbol'\n );\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList = ['box', 'table', 'list'].includes(moduleVariant.value);\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n 'tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6': props.underline,\n }\"\n data-test=\"stash-module-header\"\n >\n <div\n class=\"stash-module-header__content tw-mr-6\"\n :class=\"marginBottomClasses\"\n data-test=\"stash-module-header|content\"\n >\n <div class=\"tw-flex tw-items-center\">\n <div\n v-if=\"slots.media && props.size === 'large'\"\n class=\"stash-module-header__content__media tw-mr-3\"\n :class=\"classes.media\"\n data-test=\"stash-module-header|content-media\"\n >\n <!-- @slot Place an illustration that sits next to the header title & description. -->\n <slot name=\"media\"></slot>\n </div>\n\n <div class=\"stash-module-header__content__text\" data-test=\"stash-module-header|content-text\">\n <!--\n @slot Header title. **Deprecated**: Use the default slot or the `title` prop instead.\n -->\n <slot v-if=\"slots.title\" name=\"title\"></slot>\n\n <template v-else-if=\"isDefaultSlotSimpleString\">\n <component\n :is=\"is\"\n class=\"stash-module-header__default_slot_string tw-my-0\"\n data-test=\"stash-module-header|default-slot-text\"\n >\n <!-- @slot Header title. -->\n <slot></slot>\n </component>\n </template>\n <!-- @slot Header title. Falls back to the `title` prop. -->\n <slot v-else>\n <component :is=\"is\" class=\"tw-my-0\">{{ props.title }}</component>\n </slot>\n\n <!--\n @slot Header description, aka subtitle. Falls back to the `description` prop.\n -->\n <slot name=\"description\">\n <p v-if=\"props.description\" class=\"tw-mb-0 tw-mt-3\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n </div>\n\n <!-- todo: how can we pass a prop/class to actions in order to top align vs middle align? -->\n <div\n v-if=\"slots.actions\"\n class=\"stash-module-header__actions tw-self-center\"\n :class=\"[\n marginBottomClasses,\n {\n 'tw-w-full lg:tw-w-auto': !props.preventActionsWrap,\n },\n ]\"\n data-test=\"stash-module-header|actions\"\n >\n <!-- @slot Add action buttons or other CTAs. -->\n <slot name=\"actions\"></slot>\n </div>\n </header>\n</template>\n\n<style module>\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media {\n max-height: 58px;\n max-width: 58px;\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots","moduleVariant","ref","moduleInjectedValues","inject","MODULE_INJECTION","is","computed","component","props","isDefaultSlotSimpleString","marginBottomClasses","isBoxOrTableOrList"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAUC,KACVC,IAAQC,KAGRC,IAAgBC,KAChBC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,QAAA,CAACF,EAAqB;AAClB,YAAA,IAAI,MAAM,0DAA0D;AAE9D,IAAAF,EAAA,QAAQE,EAAqB,QAAQ;AAE7C,UAAAG,IAAKC,EAAS,MAAM;AACpB,UAAAC;AAEJ,cAAQC,EAAM,MAAM;AAAA,QAClB,KAAK;AACS,UAAAD,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF;AACc,UAAAA,IAAA;AACZ;AAAA,MACJ;AAEO,aAAAA;AAAA,IAAA,CACR,GAEKE,IAA4BH,EAAS,MACpCR,EAAM,UAISA,EAAM,UAEZ,WAAW,KACvB,OAAOA,EAAM,QAAU,EAAA,CAAC,EAAE,YAAa,YACvC,OAAOA,EAAM,UAAU,CAAC,EAAE,QAAS,WAP5B,EASV,GAEKY,IAAsBJ,EAAS,MAAM;AACnC,YAAAK,IAAqB,CAAC,OAAO,SAAS,MAAM,EAAE,SAASX,EAAc,KAAK;AAE5E,aAAAW,KAAsB,CAACH,EAAM,YACxB,uBACEG,KAAsBH,EAAM,YAC9B,YAEA;AAAA,IACT,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ModuleHeader.js","sources":["../src/components/ModuleHeader/ModuleHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref, useCssModule, useSlots } from 'vue';\n\n import { MODULE_INJECTION } from '../Module/Module.keys';\n import { ModuleVariant } from '../Module/Module.types';\n\n defineOptions({\n name: 'll-module-header',\n });\n\n export interface ModuleHeaderProps {\n /**\n * Header title. Will get overridden by the `title` slot if provided.\n */\n title?: string;\n\n /**\n * Size of the header.\n *\n * - `small` = `h4`\n * - `medium` = `h3`\n * - `large` = `h2`\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Header description, aka subtitle. Will get overridden by the `description` slot if provided.\n */\n description?: string;\n\n /**\n * Stop the actions slot from force-wrapping on medium and smalls screens.\n */\n preventActionsWrap?: boolean;\n\n /**\n * Displays a border at the bottom\n */\n underline?: boolean;\n }\n\n const props = withDefaults(defineProps<ModuleHeaderProps>(), {\n title: '',\n size: 'medium',\n description: '',\n preventActionsWrap: false,\n underline: false,\n });\n const classes = useCssModule();\n const slots = useSlots();\n\n // get the module variant from the parent module\n const moduleVariant = ref();\n const moduleInjectedValues = inject(MODULE_INJECTION.key, MODULE_INJECTION.defaults);\n if (!moduleInjectedValues.variant) {\n throw new Error('<ModuleHeader> must be used within a <Module> component.');\n }\n moduleVariant.value = moduleInjectedValues.variant.value;\n\n const is = computed(() => {\n let component: string;\n\n switch (props.size) {\n case 'small':\n component = 'h4';\n break;\n\n case 'medium':\n component = 'h3';\n break;\n\n case 'large':\n component = 'h2';\n break;\n\n default:\n component = 'h3';\n break;\n }\n\n return component;\n });\n\n const isDefaultSlotSimpleString = computed(() => {\n if (!slots.default) {\n return false;\n }\n\n const defaultSlot = slots.default();\n return (\n defaultSlot.length === 1 &&\n typeof slots.default()[0].children === 'string' &&\n typeof slots.default()[0].type === 'symbol'\n );\n });\n\n const marginBottomClasses = computed(() => {\n const isBoxOrTableOrList = ['box', 'table', 'list'].includes(moduleVariant.value);\n\n if (isBoxOrTableOrList && !props.underline) {\n return 'tw-mb-3 lg:tw-mb-6';\n } else if (isBoxOrTableOrList && props.underline) {\n return 'tw-mb-3';\n } else {\n return '';\n }\n });\n</script>\n\n<template>\n <header\n class=\"stash-module-header tw-flex tw-flex-wrap tw-justify-between\"\n :class=\"{\n 'tw-rounded-t tw-border-b tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-px-6':\n moduleVariant === ModuleVariant.Card,\n 'tw-mb-6 tw-rounded tw-bg-white tw-px-3 tw-pt-3 tw-shadow lg:tw-mb-0 lg:tw-rounded-b-none lg:tw-px-6 lg:tw-pt-6 lg:tw-shadow-none':\n moduleVariant === ModuleVariant.Table || moduleVariant === ModuleVariant.List,\n 'tw-mb-3 tw-border-b tw-border-ice-200 lg:tw-mb-6': props.underline,\n }\"\n data-test=\"stash-module-header\"\n >\n <div\n class=\"stash-module-header__content tw-mr-6\"\n :class=\"marginBottomClasses\"\n data-test=\"stash-module-header|content\"\n >\n <div class=\"tw-flex tw-items-center\">\n <div\n v-if=\"slots.media && props.size === 'large'\"\n class=\"stash-module-header__content__media tw-mr-3\"\n :class=\"classes.media\"\n data-test=\"stash-module-header|content-media\"\n >\n <!-- @slot Place an illustration that sits next to the header title & description. -->\n <slot name=\"media\"></slot>\n </div>\n\n <div class=\"stash-module-header__content__text\" data-test=\"stash-module-header|content-text\">\n <!--\n @slot Header title. **Deprecated**: Use the default slot or the `title` prop instead.\n -->\n <slot v-if=\"slots.title\" name=\"title\"></slot>\n\n <template v-else-if=\"isDefaultSlotSimpleString\">\n <component\n :is=\"is\"\n class=\"stash-module-header__default_slot_string tw-my-0\"\n data-test=\"stash-module-header|default-slot-text\"\n >\n <!-- @slot Header title. -->\n <slot></slot>\n </component>\n </template>\n <!-- @slot Header title. Falls back to the `title` prop. -->\n <slot v-else>\n <component :is=\"is\" class=\"tw-my-0\">{{ props.title }}</component>\n </slot>\n\n <!--\n @slot Header description, aka subtitle. Falls back to the `description` prop.\n -->\n <slot name=\"description\">\n <p v-if=\"props.description\" class=\"tw-mb-0 tw-mt-3\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n </div>\n\n <!-- todo: how can we pass a prop/class to actions in order to top align vs middle align? -->\n <div\n v-if=\"slots.actions\"\n class=\"stash-module-header__actions tw-self-center\"\n :class=\"[\n marginBottomClasses,\n {\n 'tw-w-full lg:tw-w-auto': !props.preventActionsWrap,\n },\n ]\"\n data-test=\"stash-module-header|actions\"\n >\n <!-- @slot Add action buttons or other CTAs. -->\n <slot name=\"actions\"></slot>\n </div>\n </header>\n</template>\n\n<style module>\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media {\n max-height: 58px;\n max-width: 58px;\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","slots","useSlots","moduleVariant","ref","moduleInjectedValues","inject","MODULE_INJECTION","is","computed","component","isDefaultSlotSimpleString","marginBottomClasses","isBoxOrTableOrList"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyCE,UAAMA,IAAQC,GAORC,IAAUC,KACVC,IAAQC,KAGRC,IAAgBC,KAChBC,IAAuBC,EAAOC,EAAiB,KAAKA,EAAiB,QAAQ;AAC/E,QAAA,CAACF,EAAqB;AAClB,YAAA,IAAI,MAAM,0DAA0D;AAE9D,IAAAF,EAAA,QAAQE,EAAqB,QAAQ;AAE7C,UAAAG,IAAKC,EAAS,MAAM;AACpB,UAAAC;AAEJ,cAAQb,EAAM,MAAM;AAAA,QAClB,KAAK;AACS,UAAAa,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF,KAAK;AACS,UAAAA,IAAA;AACZ;AAAA,QAEF;AACc,UAAAA,IAAA;AACZ;AAAA,MACJ;AAEO,aAAAA;AAAA,IAAA,CACR,GAEKC,IAA4BF,EAAS,MACpCR,EAAM,UAISA,EAAM,UAEZ,WAAW,KACvB,OAAOA,EAAM,QAAU,EAAA,CAAC,EAAE,YAAa,YACvC,OAAOA,EAAM,UAAU,CAAC,EAAE,QAAS,WAP5B,EASV,GAEKW,IAAsBH,EAAS,MAAM;AACnC,YAAAI,IAAqB,CAAC,OAAO,SAAS,MAAM,EAAE,SAASV,EAAc,KAAK;AAE5E,aAAAU,KAAsB,CAAChB,EAAM,YACxB,uBACEgB,KAAsBhB,EAAM,YAC9B,YAEA;AAAA,IACT,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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,25 +32,25 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
33
32
  };
34
33
  };
35
34
 
36
- declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleHeaderProps>, {
35
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleHeaderProps>, {
37
36
  title: string;
38
37
  size: string;
39
38
  description: string;
40
39
  preventActionsWrap: boolean;
41
40
  underline: boolean;
42
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleHeaderProps>, {
41
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModuleHeaderProps>, {
43
42
  title: string;
44
43
  size: string;
45
44
  description: string;
46
45
  preventActionsWrap: boolean;
47
46
  underline: boolean;
48
- }>>>, {
47
+ }>>> & Readonly<{}>, {
49
48
  title: string;
50
49
  size: "small" | "large" | "medium";
51
50
  description: string;
52
51
  preventActionsWrap: boolean;
53
52
  underline: boolean;
54
- }, {}>, {
53
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
55
54
  media?(_: {}): any;
56
55
  title?(_: {}): any;
57
56
  default?(_: {}): any;
@@ -22,7 +22,7 @@ const k = {
22
22
  showToggle: { type: Boolean, default: !1 }
23
23
  },
24
24
  setup(l) {
25
- const t = l, e = u(!1), n = c(() => {
25
+ const e = u(!1), t = l, n = c(() => {
26
26
  if (t.showToggle && e.value)
27
27
  return t.text;
28
28
  if (t.obfuscateAll || !t.lengthToKeep)
@@ -1 +1 @@
1
- {"version":3,"file":"ObfuscateText.js","sources":["../src/components/ObfuscateText/ObfuscateText.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-obfuscate-text' });\n\n export interface ObfuscateTextProps {\n /**\n * The full text\n */\n text: string;\n\n /**\n * Character to obfuscate text with\n */\n maskChar?: string;\n\n /**\n * The number of masked characters to display\n */\n maskCharCount?: number;\n\n /**\n * Num of characters to keep revealed.\n * Default will obfuscate entire string\n * with length of maskCharCount.\n */\n lengthToKeep?: number;\n\n /**\n * Position to start obfuscating text\n */\n position?: 'start' | 'end';\n\n /**\n * Whether to obfuscate all characters.\n * @deprecated omit the lengthToKeep prop to achieve the same result\n */\n obfuscateAll?: boolean;\n\n /**\n * Displays a button for toggling text visibility\n */\n showToggle?: boolean;\n }\n\n const isFullTextVisible = ref(false);\n\n const props = withDefaults(defineProps<ObfuscateTextProps>(), {\n maskChar: '•',\n maskCharCount: 10,\n lengthToKeep: 0,\n position: 'start',\n obfuscateAll: false,\n showToggle: false,\n });\n\n const obfuscatedText = computed(() => {\n if (props.showToggle && isFullTextVisible.value) {\n return props.text;\n }\n\n if (props.obfuscateAll || !props.lengthToKeep) {\n return props.maskChar.repeat(props.maskCharCount);\n }\n\n let charsToKeep;\n\n if (props.position === 'end') {\n charsToKeep = props.text.substring(0, props.lengthToKeep);\n\n return charsToKeep + props.maskChar.repeat(props.maskCharCount);\n } else {\n charsToKeep = props.text.substring(props.text.length - props.lengthToKeep);\n\n return props.maskChar.repeat(props.maskCharCount) + charsToKeep;\n }\n });\n</script>\n\n<template>\n <span class=\"stash-obfuscate-text\" data-test=\"stash-obfuscate-text\">\n {{ obfuscatedText }}\n <Button\n v-if=\"showToggle\"\n class=\"tw-ml-1 tw-h-auto tw-w-auto tw-p-0\"\n icon\n type=\"button\"\n @click=\"isFullTextVisible = !isFullTextVisible\"\n >\n <Icon\n :name=\"isFullTextVisible ? 'hide' : 'show'\"\n class=\"tw-cursor-pointer\"\n :class=\"isFullTextVisible ? 'stash-obfuscate-text__hide-toggle-icon' : 'stash-obfuscate-text__show-toggle-icon'\"\n :data-test=\"\n isFullTextVisible ? 'stash-obfuscate-text|hide-toggle-icon' : 'stash-obfuscate-text|show-toggle-icon'\n \"\n />\n </Button>\n </span>\n</template>\n"],"names":["isFullTextVisible","ref","obfuscatedText","computed","props","charsToKeep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAoBC,EAAI,EAAK,GAW7BC,IAAiBC,EAAS,MAAM;AAChC,UAAAC,EAAM,cAAcJ,EAAkB;AACxC,eAAOI,EAAM;AAGf,UAAIA,EAAM,gBAAgB,CAACA,EAAM;AAC/B,eAAOA,EAAM,SAAS,OAAOA,EAAM,aAAa;AAG9C,UAAAC;AAEA,aAAAD,EAAM,aAAa,SACrBC,IAAcD,EAAM,KAAK,UAAU,GAAGA,EAAM,YAAY,GAEjDC,IAAcD,EAAM,SAAS,OAAOA,EAAM,aAAa,MAE9DC,IAAcD,EAAM,KAAK,UAAUA,EAAM,KAAK,SAASA,EAAM,YAAY,GAElEA,EAAM,SAAS,OAAOA,EAAM,aAAa,IAAIC;AAAA,IACtD,CACD;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ObfuscateText.js","sources":["../src/components/ObfuscateText/ObfuscateText.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-obfuscate-text' });\n\n export interface ObfuscateTextProps {\n /**\n * The full text\n */\n text: string;\n\n /**\n * Character to obfuscate text with\n */\n maskChar?: string;\n\n /**\n * The number of masked characters to display\n */\n maskCharCount?: number;\n\n /**\n * Num of characters to keep revealed.\n * Default will obfuscate entire string\n * with length of maskCharCount.\n */\n lengthToKeep?: number;\n\n /**\n * Position to start obfuscating text\n */\n position?: 'start' | 'end';\n\n /**\n * Whether to obfuscate all characters.\n * @deprecated omit the lengthToKeep prop to achieve the same result\n */\n obfuscateAll?: boolean;\n\n /**\n * Displays a button for toggling text visibility\n */\n showToggle?: boolean;\n }\n\n const isFullTextVisible = ref(false);\n\n const props = withDefaults(defineProps<ObfuscateTextProps>(), {\n maskChar: '•',\n maskCharCount: 10,\n lengthToKeep: 0,\n position: 'start',\n obfuscateAll: false,\n showToggle: false,\n });\n\n const obfuscatedText = computed(() => {\n if (props.showToggle && isFullTextVisible.value) {\n return props.text;\n }\n\n if (props.obfuscateAll || !props.lengthToKeep) {\n return props.maskChar.repeat(props.maskCharCount);\n }\n\n let charsToKeep;\n\n if (props.position === 'end') {\n charsToKeep = props.text.substring(0, props.lengthToKeep);\n\n return charsToKeep + props.maskChar.repeat(props.maskCharCount);\n } else {\n charsToKeep = props.text.substring(props.text.length - props.lengthToKeep);\n\n return props.maskChar.repeat(props.maskCharCount) + charsToKeep;\n }\n });\n</script>\n\n<template>\n <span class=\"stash-obfuscate-text\" data-test=\"stash-obfuscate-text\">\n {{ obfuscatedText }}\n <Button\n v-if=\"showToggle\"\n class=\"tw-ml-1 tw-h-auto tw-w-auto tw-p-0\"\n icon\n type=\"button\"\n @click=\"isFullTextVisible = !isFullTextVisible\"\n >\n <Icon\n :name=\"isFullTextVisible ? 'hide' : 'show'\"\n class=\"tw-cursor-pointer\"\n :class=\"isFullTextVisible ? 'stash-obfuscate-text__hide-toggle-icon' : 'stash-obfuscate-text__show-toggle-icon'\"\n :data-test=\"\n isFullTextVisible ? 'stash-obfuscate-text|hide-toggle-icon' : 'stash-obfuscate-text|show-toggle-icon'\n \"\n />\n </Button>\n </span>\n</template>\n"],"names":["isFullTextVisible","ref","props","__props","obfuscatedText","computed","charsToKeep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgDQ,UAAAA,IAAoBC,EAAI,EAAK,GAE7BC,IAAQC,GASRC,IAAiBC,EAAS,MAAM;AAChC,UAAAH,EAAM,cAAcF,EAAkB;AACxC,eAAOE,EAAM;AAGf,UAAIA,EAAM,gBAAgB,CAACA,EAAM;AAC/B,eAAOA,EAAM,SAAS,OAAOA,EAAM,aAAa;AAG9C,UAAAI;AAEA,aAAAJ,EAAM,aAAa,SACrBI,IAAcJ,EAAM,KAAK,UAAU,GAAGA,EAAM,YAAY,GAEjDI,IAAcJ,EAAM,SAAS,OAAOA,EAAM,aAAa,MAE9DI,IAAcJ,EAAM,KAAK,UAAUA,EAAM,KAAK,SAASA,EAAM,YAAY,GAElEA,EAAM,SAAS,OAAOA,EAAM,aAAa,IAAII;AAAA,IACtD,CACD;;;;;;;;;;;;;;;;;;;;;;"}