@leaflink/stash 52.0.3 → 53.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +50 -49
  2. package/dist/Accordion.js +16 -16
  3. package/dist/Accordion.js.map +1 -1
  4. package/dist/AccordionGroup.js +7 -7
  5. package/dist/AccordionGroup.js.map +1 -1
  6. package/dist/ActionsDropdown.js +16 -16
  7. package/dist/ActionsDropdown.js.map +1 -1
  8. package/dist/AddressSelect.js.map +1 -1
  9. package/dist/AddressSelect.vue.d.ts +1 -1
  10. package/dist/Alert.js +34 -34
  11. package/dist/Alert.js.map +1 -1
  12. package/dist/AppNavigationItem.js +31 -31
  13. package/dist/AppNavigationItem.js.map +1 -1
  14. package/dist/AppSidebar.js +19 -19
  15. package/dist/AppSidebar.js.map +1 -1
  16. package/dist/AppTopbar.js +32 -32
  17. package/dist/AppTopbar.js.map +1 -1
  18. package/dist/Avatar.js +18 -18
  19. package/dist/Avatar.js.map +1 -1
  20. package/dist/Backdrop.js +5 -5
  21. package/dist/Backdrop.js.map +1 -1
  22. package/dist/Badge.js +38 -38
  23. package/dist/Badge.js.map +1 -1
  24. package/dist/Box.js +1 -1
  25. package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js} +6 -6
  26. package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js.map} +1 -1
  27. package/dist/Button.js +21 -21
  28. package/dist/Button.js.map +1 -1
  29. package/dist/ButtonGroup.js +26 -26
  30. package/dist/ButtonGroup.js.map +1 -1
  31. package/dist/Card.js +14 -14
  32. package/dist/Card.js.map +1 -1
  33. package/dist/CardContent.js +1 -1
  34. package/dist/CardContent.js.map +1 -1
  35. package/dist/CardFooter.js +1 -1
  36. package/dist/CardFooter.js.map +1 -1
  37. package/dist/CardHeader.js +4 -4
  38. package/dist/CardHeader.js.map +1 -1
  39. package/dist/CardMedia.js +20 -20
  40. package/dist/CardMedia.js.map +1 -1
  41. package/dist/Carousel.js +60 -60
  42. package/dist/Carousel.js.map +1 -1
  43. package/dist/Checkbox.js +30 -30
  44. package/dist/Checkbox.js.map +1 -1
  45. package/dist/Checkbox.vue.d.ts +0 -3
  46. package/dist/Chip.js +33 -33
  47. package/dist/Chip.js.map +1 -1
  48. package/dist/ConfirmationCodeInput.js +72 -72
  49. package/dist/ConfirmationCodeInput.js.map +1 -1
  50. package/dist/ContextSwitcher.js +27 -27
  51. package/dist/ContextSwitcher.js.map +1 -1
  52. package/dist/Copy.js +47 -48
  53. package/dist/Copy.js.map +1 -1
  54. package/dist/CurrencyInput.js +1 -1
  55. package/dist/CurrencyInput.js.map +1 -1
  56. package/dist/CurrencyInput.vue.d.ts +5 -5
  57. package/dist/DataView.js +23 -23
  58. package/dist/DataView.js.map +1 -1
  59. package/dist/DataViewFilters.js +26 -26
  60. package/dist/DataViewFilters.js.map +1 -1
  61. package/dist/DataViewSortButton.js +22 -22
  62. package/dist/DataViewSortButton.js.map +1 -1
  63. package/dist/DataViewToolbar.js +52 -52
  64. package/dist/DataViewToolbar.js.map +1 -1
  65. package/dist/DatePicker.js +10 -10
  66. package/dist/DatePicker.js.map +1 -1
  67. package/dist/DescriptionList.js +2 -2
  68. package/dist/DescriptionList.js.map +1 -1
  69. package/dist/DescriptionListDetail.js +2 -2
  70. package/dist/DescriptionListDetail.js.map +1 -1
  71. package/dist/DescriptionListGroup.js +9 -9
  72. package/dist/DescriptionListGroup.js.map +1 -1
  73. package/dist/DescriptionListTerm.js +8 -8
  74. package/dist/DescriptionListTerm.js.map +1 -1
  75. package/dist/Dialog.js +47 -47
  76. package/dist/Dialog.js.map +1 -1
  77. package/dist/Divider.js +6 -6
  78. package/dist/Divider.js.map +1 -1
  79. package/dist/Dropdown.js +20 -20
  80. package/dist/Dropdown.js.map +1 -1
  81. package/dist/EmptyState.js +26 -26
  82. package/dist/EmptyState.js.map +1 -1
  83. package/dist/Field.js +1 -1
  84. package/dist/{Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js → Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js} +17 -17
  85. package/dist/Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js.map +1 -0
  86. package/dist/FileUpload.js +47 -49
  87. package/dist/FileUpload.js.map +1 -1
  88. package/dist/FilterChip.js +20 -20
  89. package/dist/FilterChip.js.map +1 -1
  90. package/dist/FilterDrawerItem.js +13 -13
  91. package/dist/FilterDrawerItem.js.map +1 -1
  92. package/dist/FilterDropdown.js +27 -27
  93. package/dist/FilterDropdown.js.map +1 -1
  94. package/dist/FilterSelect.js +33 -33
  95. package/dist/FilterSelect.js.map +1 -1
  96. package/dist/Filters.js +29 -29
  97. package/dist/Filters.js.map +1 -1
  98. package/dist/Filters.vue.d.ts +2 -8
  99. package/dist/HttpError.js +29 -29
  100. package/dist/HttpError.js.map +1 -1
  101. package/dist/HttpError.vue.d.ts +0 -3
  102. package/dist/Icon.js +12 -12
  103. package/dist/Icon.js.map +1 -1
  104. package/dist/IconLabel.js +19 -19
  105. package/dist/IconLabel.js.map +1 -1
  106. package/dist/IconLabel.vue.d.ts +1 -1
  107. package/dist/Illustration.js +2 -2
  108. package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js} +4 -4
  109. package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js.map} +1 -1
  110. package/dist/Image.js +2 -2
  111. package/dist/Image.vue.d.ts +0 -3
  112. package/dist/{Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js → Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js} +11 -11
  113. package/dist/Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js.map +1 -0
  114. package/dist/InlineEdit.js +8 -8
  115. package/dist/InlineEdit.js.map +1 -1
  116. package/dist/Input.js +29 -29
  117. package/dist/Input.js.map +1 -1
  118. package/dist/InputOptions.js +87 -84
  119. package/dist/InputOptions.js.map +1 -1
  120. package/dist/InputOptions.vue.d.ts +2 -2
  121. package/dist/IntegrationIcon.js +11 -11
  122. package/dist/IntegrationIcon.js.map +1 -1
  123. package/dist/Label.js +1 -1
  124. package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js} +16 -16
  125. package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js.map → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js.map} +1 -1
  126. package/dist/ListItem.js +14 -14
  127. package/dist/ListItem.js.map +1 -1
  128. package/dist/ListItem.vue.d.ts +0 -6
  129. package/dist/ListItemCell.js +9 -9
  130. package/dist/ListItemCell.js.map +1 -1
  131. package/dist/ListView.js +138 -141
  132. package/dist/ListView.js.map +1 -1
  133. package/dist/ListView.vue.d.ts +2 -26
  134. package/dist/Loading.js +8 -8
  135. package/dist/Loading.js.map +1 -1
  136. package/dist/Logo.js +1 -1
  137. package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js} +3 -3
  138. package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js.map} +1 -1
  139. package/dist/Menu.js +5 -5
  140. package/dist/Menu.js.map +1 -1
  141. package/dist/MenuItem.js +12 -12
  142. package/dist/MenuItem.js.map +1 -1
  143. package/dist/Metric.js +24 -24
  144. package/dist/Metric.js.map +1 -1
  145. package/dist/Modal.js +60 -60
  146. package/dist/Modal.js.map +1 -1
  147. package/dist/Modals.js +1 -1
  148. package/dist/Modals.js.map +1 -1
  149. package/dist/Module.js +6 -6
  150. package/dist/Module.js.map +1 -1
  151. package/dist/ModuleContent.js +16 -16
  152. package/dist/ModuleContent.js.map +1 -1
  153. package/dist/ModuleFooter.js +13 -13
  154. package/dist/ModuleFooter.js.map +1 -1
  155. package/dist/ModuleHeader.js +29 -29
  156. package/dist/ModuleHeader.js.map +1 -1
  157. package/dist/MoreActions.js +81 -84
  158. package/dist/MoreActions.js.map +1 -1
  159. package/dist/ObfuscateText.js +4 -4
  160. package/dist/ObfuscateText.js.map +1 -1
  161. package/dist/PageContent.js +13 -13
  162. package/dist/PageContent.js.map +1 -1
  163. package/dist/PageHeader.js +28 -28
  164. package/dist/PageHeader.js.map +1 -1
  165. package/dist/PageNavigation.js +1 -1
  166. package/dist/Paginate.js +45 -45
  167. package/dist/Paginate.js.map +1 -1
  168. package/dist/QuickAction.js +18 -18
  169. package/dist/QuickAction.js.map +1 -1
  170. package/dist/Radio.js +17 -17
  171. package/dist/Radio.js.map +1 -1
  172. package/dist/RadioGroup.js +121 -121
  173. package/dist/RadioGroup.js.map +1 -1
  174. package/dist/RadioNew.js +80 -80
  175. package/dist/RadioNew.js.map +1 -1
  176. package/dist/RadioNew.vue.d.ts +0 -3
  177. package/dist/RangeInput.js +2 -2
  178. package/dist/RangeInput.js.map +1 -1
  179. package/dist/SearchBar.js +9 -9
  180. package/dist/SearchBar.js.map +1 -1
  181. package/dist/SectionHeader.js +14 -14
  182. package/dist/SectionHeader.js.map +1 -1
  183. package/dist/Select.js +369 -366
  184. package/dist/Select.js.map +1 -1
  185. package/dist/SelectStatus.js +26 -26
  186. package/dist/SelectStatus.js.map +1 -1
  187. package/dist/Skeleton.js +20 -20
  188. package/dist/Skeleton.js.map +1 -1
  189. package/dist/Step.js +37 -40
  190. package/dist/Step.js.map +1 -1
  191. package/dist/Stepper.js +17 -17
  192. package/dist/Stepper.js.map +1 -1
  193. package/dist/Switch.js +57 -57
  194. package/dist/Switch.js.map +1 -1
  195. package/dist/Tab.js +17 -19
  196. package/dist/Tab.js.map +1 -1
  197. package/dist/TabPanel.js +1 -1
  198. package/dist/TabPanel.js.map +1 -1
  199. package/dist/Table.js +22 -22
  200. package/dist/Table.js.map +1 -1
  201. package/dist/TableCell.js +32 -32
  202. package/dist/TableCell.js.map +1 -1
  203. package/dist/TableHeaderCell.js +35 -35
  204. package/dist/TableHeaderCell.js.map +1 -1
  205. package/dist/TableHeaderRow.js +10 -10
  206. package/dist/TableHeaderRow.js.map +1 -1
  207. package/dist/TableRow.js +51 -51
  208. package/dist/TableRow.js.map +1 -1
  209. package/dist/Tabs.js +2 -2
  210. package/dist/{Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js → Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js} +33 -33
  211. package/dist/Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js.map +1 -0
  212. package/dist/TextEditor.js +8 -8
  213. package/dist/TextEditor.js.map +1 -1
  214. package/dist/Textarea.js +15 -15
  215. package/dist/Textarea.js.map +1 -1
  216. package/dist/Thumbnail.js +41 -41
  217. package/dist/Thumbnail.js.map +1 -1
  218. package/dist/ThumbnailEmpty.js +3 -3
  219. package/dist/ThumbnailEmpty.js.map +1 -1
  220. package/dist/ThumbnailGroup.js +22 -22
  221. package/dist/ThumbnailGroup.js.map +1 -1
  222. package/dist/Timeline.js +3 -3
  223. package/dist/Timeline.js.map +1 -1
  224. package/dist/TimelineItem.js +22 -22
  225. package/dist/TimelineItem.js.map +1 -1
  226. package/dist/Toast.js +29 -29
  227. package/dist/Toast.js.map +1 -1
  228. package/dist/Toast.vue.d.ts +3 -0
  229. package/dist/Toasts.js +11 -11
  230. package/dist/Toasts.js.map +1 -1
  231. package/dist/Tooltip.js +2 -81
  232. package/dist/Tooltip.js.map +1 -1
  233. package/dist/Tooltip.vue.d.ts +1 -1
  234. package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js +84 -0
  235. package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js.map +1 -0
  236. package/dist/components.css +2 -2
  237. package/dist/constants.d.ts +9 -9
  238. package/dist/constants.js +17 -17
  239. package/dist/constants.js.map +1 -1
  240. package/dist/directives/tooltip.js +2 -2
  241. package/dist/directives/tooltip.js.map +1 -1
  242. package/dist/{index-C14LhAwV.js → index-DBV9Uz0C.js} +3 -3
  243. package/dist/{index-C14LhAwV.js.map → index-DBV9Uz0C.js.map} +1 -1
  244. package/dist/tailwind-base.js.d.ts +12 -0
  245. package/dist/tailwind-base.js.map +1 -1
  246. package/dist/useSortable.js +1 -1
  247. package/dist/utils/helpers.js +15 -15
  248. package/dist/utils/helpers.js.map +1 -1
  249. package/package.json +15 -15
  250. package/styles/backwards-compat.css +373 -2851
  251. package/styles/main.css +8 -0
  252. package/styles/sofia-font.css +23 -27
  253. package/styles/theme.css +1033 -0
  254. package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +0 -1
  255. package/dist/Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map +0 -1
  256. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js.map +0 -1
  257. package/dist/tailwind-base.d.ts +0 -333
  258. package/styles/base.css +0 -902
  259. package/tailwind-base.ts +0 -455
package/dist/Step.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineComponent as x, useSlots as g, useCssModule as y, inject as k, computed as d, onBeforeMount as b, createElementBlock as r, openBlock as i, normalizeClass as a, unref as t, createCommentVNode as u, createElementVNode as n, createBlock as B, toDisplayString as _, createTextVNode as N, renderSlot as C } from "vue";
1
+ import { defineComponent as k, useSlots as g, useCssModule as y, inject as w, computed as d, onBeforeMount as b, createElementBlock as r, openBlock as i, normalizeClass as a, unref as t, createCommentVNode as u, createElementVNode as n, createBlock as B, toDisplayString as _, createTextVNode as N, renderSlot as C } from "vue";
2
2
  import { t as E } from "./locale.js";
3
3
  import T from "./Icon.js";
4
4
  import { S as z } from "./keys-C8Zfr_By.js";
5
5
  import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- const S = { key: 1 }, I = /* @__PURE__ */ x({
6
+ const S = { key: 1 }, I = /* @__PURE__ */ k({
7
7
  __name: "Step",
8
8
  props: {
9
9
  active: { type: Boolean, default: !1 },
@@ -15,27 +15,27 @@ const S = { key: 1 }, I = /* @__PURE__ */ x({
15
15
  disabled: { type: Boolean, default: !1 },
16
16
  loading: { type: Boolean, default: !1 }
17
17
  },
18
- setup(m) {
19
- const e = m, w = g(), s = y(), l = k(z), c = d(() => (l == null ? void 0 : l.orientation) === "horizontal"), p = d(() => (l == null ? void 0 : l.theme) === "light"), o = l == null ? void 0 : l.showResponsiveNav, v = d(() => e.loading ? "working" : e.completed ? "circle-check" : "circle-info"), h = d(
18
+ setup(v) {
19
+ const e = v, f = g(), s = y(), l = w(z), c = d(() => (l == null ? void 0 : l.orientation) === "horizontal"), p = d(() => (l == null ? void 0 : l.theme) === "light"), o = l == null ? void 0 : l.showResponsiveNav, h = d(() => e.loading ? "working" : e.completed ? "circle-check" : "circle-info"), x = d(
20
20
  () => E("ll.stepper.currentStep", { num: e.step, total: String(l == null ? void 0 : l.stepCount.value) })
21
21
  );
22
22
  return b(() => {
23
23
  l && l.registerStep(e.nested);
24
- }), (f, K) => (i(), r("li", {
25
- class: a(["stash-step tw-relative tw-flex tw-w-full", [
24
+ }), (m, K) => (i(), r("li", {
25
+ class: a(["stash-step relative flex w-full", [
26
26
  t(s).step,
27
27
  {
28
28
  [t(s)["nested-step--active"]]: e.nested && e.active,
29
- "last:tw-w-auto": c.value && !t(o),
29
+ "last:w-auto": c.value && !t(o),
30
30
  [t(s)["stash-step--singular"]]: t(o),
31
- "tw-relative tw-w-full tw-shrink-0 tw-snap-start tw-flex-col tw-justify-center": t(o)
31
+ "relative w-full shrink-0 snap-start flex-col justify-center": t(o)
32
32
  }
33
33
  ]]),
34
34
  "data-test": "stash-step"
35
35
  }, [
36
36
  e.nested ? u("", !0) : (i(), r("div", {
37
37
  key: 0,
38
- class: a(["stash-step__indicator tw-flex tw-flex-col tw-items-center", { "tw-mr-3": !t(o) }]),
38
+ class: a(["stash-step__indicator flex flex-col items-center", { "mr-3": !t(o) }]),
39
39
  "data-test": "stash-step|indicator"
40
40
  }, [
41
41
  n("div", {
@@ -52,24 +52,21 @@ const S = { key: 1 }, I = /* @__PURE__ */ x({
52
52
  }, [
53
53
  (e.completed || e.error || e.loading) && !e.active ? (i(), B(T, {
54
54
  key: 0,
55
- name: v.value,
55
+ name: h.value,
56
56
  class: a({ "fx-spin": e.loading }),
57
57
  size: "dense"
58
58
  }, null, 8, ["name", "class"])) : (i(), r("span", S, _(e.step), 1))
59
59
  ], 2),
60
60
  n("div", {
61
- class: a(["tw-my-1.5 tw-w-px tw-bg-ice-500", [
62
- t(s).line,
63
- { [t(s)["line--expanded"]]: e.completed || e.active, "tw-hidden": c.value }
64
- ]])
61
+ class: a(["my-1.5 w-px bg-ice-500", [t(s).line, { [t(s)["line--expanded"]]: e.completed || e.active, hidden: c.value }]])
65
62
  }, null, 2)
66
63
  ], 2)),
67
64
  n("div", {
68
- class: a(["tw-flex", [
65
+ class: a(["flex", [
69
66
  {
70
- "tw-w-full tw-flex-row tw-items-center": c.value,
71
- "tw-mt-1.5 tw-justify-center": t(o),
72
- "tw-flex-col": !c.value || t(o)
67
+ "w-full flex-row items-center": c.value,
68
+ "mt-1.5 justify-center": t(o),
69
+ "flex-col": !c.value || t(o)
73
70
  }
74
71
  ]])
75
72
  }, [
@@ -77,13 +74,13 @@ const S = { key: 1 }, I = /* @__PURE__ */ x({
77
74
  class: a(["stash-step__title", [
78
75
  t(s).title,
79
76
  {
80
- "tw-whitespace-nowrap": c.value,
81
- "tw-cursor-pointer": !e.active && (e.completed || e.error),
82
- "tw-cursor-not-allowed": e.disabled,
83
- "tw-text-ice-900": p.value,
84
- "!tw-font-semibold": e.active,
85
- "tw-text-white": !e.disabled && !p.value,
86
- "tw-place-self-center": t(o)
77
+ "whitespace-nowrap": c.value,
78
+ "cursor-pointer": !e.active && (e.completed || e.error),
79
+ "cursor-not-allowed": e.disabled,
80
+ "text-ice-900": p.value,
81
+ "!font-semibold": e.active,
82
+ "text-white": !e.disabled && !p.value,
83
+ "place-self-center": t(o)
87
84
  }
88
85
  ]]),
89
86
  "data-test": "stash-step|title"
@@ -91,9 +88,9 @@ const S = { key: 1 }, I = /* @__PURE__ */ x({
91
88
  N(_(e.text) + " ", 1),
92
89
  t(o) ? (i(), r("p", {
93
90
  key: 0,
94
- class: a(["stash-step__pagination-label tw-mb-0 tw-text-center tw-text-xs", p.value ? "tw-text-ice-700" : "tw-text-white"]),
91
+ class: a(["stash-step__pagination-label mb-0 text-center text-xs", p.value ? "text-ice-700" : "text-white"]),
95
92
  "data-test": "stash-step|pagination-label"
96
- }, _(h.value), 3)) : u("", !0)
93
+ }, _(x.value), 3)) : u("", !0)
97
94
  ], 2),
98
95
  c.value ? (i(), r("div", {
99
96
  key: 0,
@@ -101,35 +98,35 @@ const S = { key: 1 }, I = /* @__PURE__ */ x({
101
98
  t(s).line,
102
99
  {
103
100
  [t(s)["line--expanded"]]: e.completed || e.active,
104
- "tw-mx-1.5 tw-border-t group-last:tw-hidden": !t(o)
101
+ "mx-1.5 border-t group-last:hidden": !t(o)
105
102
  }
106
103
  ])
107
104
  }, null, 2)) : u("", !0),
108
105
  n("div", {
109
- class: a(["stash-step--nested-steps", { "tw-pb-9": !f.nested && !t(w).default, "tw-hidden": c.value }])
106
+ class: a(["stash-step--nested-steps", { "pb-9": !m.nested && !t(f).default, hidden: c.value }])
110
107
  }, [
111
108
  n("ul", {
112
- class: a([t(s).nested, { "tw-hidden": !t(w).default }])
109
+ class: a([t(s).nested, { hidden: !t(f).default }])
113
110
  }, [
114
- C(f.$slots, "default")
111
+ C(m.$slots, "default")
115
112
  ], 2)
116
113
  ], 2)
117
114
  ], 2)
118
115
  ], 2));
119
116
  }
120
- }), R = "_step_73127_2", V = "_title_73127_11", P = "_line_73127_22", $ = "_circle_73127_62", D = "_nested_73127_18", H = {
117
+ }), R = "_step_1tkd1_5", V = "_title_1tkd1_14", P = "_line_1tkd1_25", $ = "_circle_1tkd1_65", D = "_nested_1tkd1_21", H = {
121
118
  step: R,
122
119
  title: V,
123
- "nested-step--active": "_nested-step--active_73127_18",
120
+ "nested-step--active": "_nested-step--active_1tkd1_21",
124
121
  line: P,
125
- "line--expanded": "_line--expanded_73127_27",
126
- "stash-step--singular": "_stash-step--singular_73127_31",
122
+ "line--expanded": "_line--expanded_1tkd1_30",
123
+ "stash-step--singular": "_stash-step--singular_1tkd1_34",
127
124
  circle: $,
128
- "circle--todo": "_circle--todo_73127_75",
129
- "circle--active": "_circle--active_73127_81",
130
- "circle--loading": "_circle--loading_73127_87",
131
- "circle--completed": "_circle--completed_73127_94",
132
- "circle--error": "_circle--error_73127_101",
125
+ "circle--todo": "_circle--todo_1tkd1_78",
126
+ "circle--active": "_circle--active_1tkd1_84",
127
+ "circle--loading": "_circle--loading_1tkd1_90",
128
+ "circle--completed": "_circle--completed_1tkd1_97",
129
+ "circle--error": "_circle--error_1tkd1_104",
133
130
  nested: D
134
131
  }, J = {
135
132
  $style: H
package/dist/Step.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","sources":["../src/components/Step/Step.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Icon from '../Icon/Icon.vue';\n import { STEPPER_INJECTION_KEY } from '../Stepper/keys';\n\n export interface StepProps {\n /**\n * Indicates if the step is currently active.\n * This takes precedence over `completed` and `error`\n */\n active?: boolean;\n /**\n * Indicates if the step is completed\n */\n completed?: boolean;\n /**\n * Indicates if the step has an error\n * This takes precedence over `completed`\n */\n error?: boolean;\n /**\n * The text to display in the step.\n */\n text: string;\n /**\n * Indicates if the step is nested\n */\n nested?: boolean;\n /**\n * The text to display in the step circle\n */\n step?: string;\n /**\n * Indicates if the step is disabled\n */\n disabled?: boolean;\n /**\n * Indicates if the step is in a loading state\n */\n loading?: boolean;\n }\n\n const props = withDefaults(defineProps<StepProps>(), {\n active: false,\n completed: false,\n error: false,\n nested: false,\n step: undefined,\n disabled: false,\n loading: false,\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n\n const injectedStepper = inject(STEPPER_INJECTION_KEY);\n\n const isHorizontal = computed(() => injectedStepper?.orientation === 'horizontal');\n\n const isLightThemed = computed(() => injectedStepper?.theme === 'light');\n\n const showResponsiveNav = injectedStepper?.showResponsiveNav;\n\n const iconName = computed(() => {\n if (props.loading) {\n return 'working';\n }\n return props.completed ? 'circle-check' : 'circle-info';\n });\n\n const currentStepText = computed(() =>\n t('ll.stepper.currentStep', { num: props.step, total: String(injectedStepper?.stepCount.value) }),\n );\n\n // OnBeforeMount ensures that steps and substeps are registered in the correct order\n onBeforeMount(() => {\n if (injectedStepper) {\n injectedStepper.registerStep(props.nested);\n }\n });\n</script>\n\n<template>\n <li\n class=\"stash-step tw-relative tw-flex tw-w-full\"\n data-test=\"stash-step\"\n :class=\"[\n classes.step,\n {\n [classes['nested-step--active']]: props.nested && props.active,\n 'last:tw-w-auto': isHorizontal && !showResponsiveNav,\n [classes['stash-step--singular']]: showResponsiveNav,\n 'tw-relative tw-w-full tw-shrink-0 tw-snap-start tw-flex-col tw-justify-center': showResponsiveNav,\n },\n ]\"\n >\n <div\n v-if=\"!props.nested\"\n class=\"stash-step__indicator tw-flex tw-flex-col tw-items-center\"\n :class=\"{ 'tw-mr-3': !showResponsiveNav }\"\n data-test=\"stash-step|indicator\"\n >\n <div\n :class=\"[\n classes.circle,\n {\n [classes['circle--todo']]: !props.error && !props.active && !props.completed,\n [classes['circle--error']]: props.error && !props.active,\n [classes['circle--completed']]: props.completed && !props.active,\n [classes['circle--active']]: props.active,\n [classes['circle--loading']]: props.loading,\n },\n ]\"\n >\n <Icon\n v-if=\"(props.completed || props.error || props.loading) && !props.active\"\n :name=\"iconName\"\n :class=\"{ 'fx-spin': props.loading }\"\n size=\"dense\"\n />\n <span v-else>{{ props.step }}</span>\n </div>\n <div\n class=\"tw-my-1.5 tw-w-px tw-bg-ice-500\"\n :class=\"[\n classes.line,\n { [classes['line--expanded']]: props.completed || props.active, 'tw-hidden': isHorizontal },\n ]\"\n />\n </div>\n <!-- step title, line(s), and nested steps -->\n <div\n class=\"tw-flex\"\n :class=\"[\n {\n 'tw-w-full tw-flex-row tw-items-center': isHorizontal,\n 'tw-mt-1.5 tw-justify-center': showResponsiveNav,\n 'tw-flex-col': !isHorizontal || showResponsiveNav,\n },\n ]\"\n >\n <div\n class=\"stash-step__title\"\n data-test=\"stash-step|title\"\n :class=\"[\n classes.title,\n {\n 'tw-whitespace-nowrap': isHorizontal,\n 'tw-cursor-pointer': !props.active && (props.completed || props.error),\n 'tw-cursor-not-allowed': props.disabled,\n 'tw-text-ice-900': isLightThemed,\n '!tw-font-semibold': props.active,\n 'tw-text-white': !props.disabled && !isLightThemed,\n 'tw-place-self-center': showResponsiveNav,\n },\n ]\"\n >\n {{ props.text }}\n <p\n v-if=\"showResponsiveNav\"\n class=\"stash-step__pagination-label tw-mb-0 tw-text-center tw-text-xs\"\n data-test=\"stash-step|pagination-label\"\n :class=\"isLightThemed ? 'tw-text-ice-700' : 'tw-text-white'\"\n >\n {{ currentStepText }}\n </p>\n </div>\n <div\n v-if=\"isHorizontal\"\n :class=\"[\n classes.line,\n {\n [classes['line--expanded']]: props.completed || props.active,\n 'tw-mx-1.5 tw-border-t group-last:tw-hidden': !showResponsiveNav,\n },\n ]\"\n />\n <div\n class=\"stash-step--nested-steps\"\n :class=\"{ 'tw-pb-9': !nested && !slots.default, 'tw-hidden': isHorizontal }\"\n >\n <ul :class=\"[classes.nested, { 'tw-hidden': !slots.default }]\">\n <!-- @slot Default slot to compose multiple nested steps -->\n <slot></slot>\n </ul>\n </div>\n </div>\n </li>\n</template>\n\n<style module>\n .step::before {\n content: '●';\n position: absolute;\n color: theme('colors.white');\n left: -28px;\n opacity: 0;\n transition: opacity 500ms cubic-bezier(0.85, 0, 0.15, 1);\n }\n\n .title {\n font-weight: theme('fontWeight.medium');\n font-size: 1rem;\n margin-top: 1px;\n user-select: none;\n }\n\n .nested-step--active::before {\n opacity: 1;\n }\n\n .line {\n flex-grow: 0;\n transition: flex-grow 500ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n\n .line--expanded {\n flex-grow: 1;\n }\n\n .stash-step--singular .line {\n @apply tw-absolute\n tw-inset-x-0\n tw-top-3\n tw-h-px\n tw-border-t-0\n before:tw-absolute\n before:tw-left-0\n before:tw-right-2/4\n before:tw-mr-16\n before:tw-block\n before:tw-h-px\n before:tw-bg-ice-500\n after:tw-absolute\n after:tw-left-2/4\n after:tw-right-0\n after:tw-ml-16\n after:tw-block\n after:tw-h-px\n after:tw-bg-ice-500;\n }\n\n .stash-step--singular .line::after,\n .stash-step--singular .line::before {\n content: '';\n }\n\n .step:not(.stash-step--singular):last-child .line {\n display: none;\n }\n\n .circle {\n width: theme('spacing.6');\n height: theme('spacing.6');\n line-height: theme('spacing.6');\n border-radius: theme('borderRadius.full');\n display: grid;\n place-items: center;\n font-weight: theme('fontWeight.medium');\n transition:\n background-color 500ms,\n color 500ms;\n }\n\n .circle--todo {\n background-color: rgb(255 255 255 / 50%);\n color: #4d4a69;\n border: 1px solid #747293;\n }\n\n .circle--active {\n background-color: var(--color-blue-500);\n color: theme('colors.white');\n border: 1px solid transparent;\n }\n\n .circle--loading {\n background-color: theme('colors.white');\n border: 1px solid var(--color-ice-500);\n color: var(--color-ice-700);\n cursor: pointer;\n }\n\n .circle--completed {\n background-color: theme('colors.white');\n border: 1px solid var(--color-ice-500);\n color: var(--color-green-500);\n cursor: pointer;\n }\n\n .circle--error {\n background-color: theme('colors.white');\n border: 1px solid var(--color-ice-500);\n color: var(--color-red-500);\n cursor: pointer;\n }\n\n .nested {\n padding: calc(theme('spacing.3') + theme('spacing[1.5]')) 0;\n }\n\n .nested li + li {\n margin-top: theme('spacing.3');\n }\n\n .nested .title {\n font-weight: theme('fontWeight.normal');\n font-size: 0.9rem;\n }\n</style>\n"],"names":["props","__props","slots","useSlots","classes","useCssModule","injectedStepper","inject","STEPPER_INJECTION_KEY","isHorizontal","computed","isLightThemed","showResponsiveNav","iconName","currentStepText","t","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;AA4CE,UAAMA,IAAQC,GAURC,IAAQC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAkBC,EAAOC,CAAqB,GAE9CC,IAAeC,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,iBAAgB,YAAY,GAE3EK,IAAgBD,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,WAAU,OAAO,GAEjEM,IAAoBN,KAAA,gBAAAA,EAAiB,mBAErCO,IAAWH,EAAS,MACpBV,EAAM,UACD,YAEFA,EAAM,YAAY,iBAAiB,aAC3C,GAEKc,IAAkBJ;AAAA,MAAS,MAC/BK,EAAE,0BAA0B,EAAE,KAAKf,EAAM,MAAM,OAAO,OAAOM,KAAA,gBAAAA,EAAiB,UAAU,KAAK,GAAG;AAAA,IAAA;AAIlG,WAAAU,EAAc,MAAM;AAClB,MAAIV,KACFA,EAAgB,aAAaN,EAAM,MAAM;AAAA,IAE7C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Step.js","sources":["../src/components/Step/Step.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Icon from '../Icon/Icon.vue';\n import { STEPPER_INJECTION_KEY } from '../Stepper/keys';\n\n export interface StepProps {\n /**\n * Indicates if the step is currently active.\n * This takes precedence over `completed` and `error`\n */\n active?: boolean;\n /**\n * Indicates if the step is completed\n */\n completed?: boolean;\n /**\n * Indicates if the step has an error\n * This takes precedence over `completed`\n */\n error?: boolean;\n /**\n * The text to display in the step.\n */\n text: string;\n /**\n * Indicates if the step is nested\n */\n nested?: boolean;\n /**\n * The text to display in the step circle\n */\n step?: string;\n /**\n * Indicates if the step is disabled\n */\n disabled?: boolean;\n /**\n * Indicates if the step is in a loading state\n */\n loading?: boolean;\n }\n\n const props = withDefaults(defineProps<StepProps>(), {\n active: false,\n completed: false,\n error: false,\n nested: false,\n step: undefined,\n disabled: false,\n loading: false,\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n\n const injectedStepper = inject(STEPPER_INJECTION_KEY);\n\n const isHorizontal = computed(() => injectedStepper?.orientation === 'horizontal');\n\n const isLightThemed = computed(() => injectedStepper?.theme === 'light');\n\n const showResponsiveNav = injectedStepper?.showResponsiveNav;\n\n const iconName = computed(() => {\n if (props.loading) {\n return 'working';\n }\n return props.completed ? 'circle-check' : 'circle-info';\n });\n\n const currentStepText = computed(() =>\n t('ll.stepper.currentStep', { num: props.step, total: String(injectedStepper?.stepCount.value) }),\n );\n\n // OnBeforeMount ensures that steps and substeps are registered in the correct order\n onBeforeMount(() => {\n if (injectedStepper) {\n injectedStepper.registerStep(props.nested);\n }\n });\n</script>\n\n<template>\n <li\n class=\"stash-step relative flex w-full\"\n data-test=\"stash-step\"\n :class=\"[\n classes.step,\n {\n [classes['nested-step--active']]: props.nested && props.active,\n 'last:w-auto': isHorizontal && !showResponsiveNav,\n [classes['stash-step--singular']]: showResponsiveNav,\n 'relative w-full shrink-0 snap-start flex-col justify-center': showResponsiveNav,\n },\n ]\"\n >\n <div\n v-if=\"!props.nested\"\n class=\"stash-step__indicator flex flex-col items-center\"\n :class=\"{ 'mr-3': !showResponsiveNav }\"\n data-test=\"stash-step|indicator\"\n >\n <div\n :class=\"[\n classes.circle,\n {\n [classes['circle--todo']]: !props.error && !props.active && !props.completed,\n [classes['circle--error']]: props.error && !props.active,\n [classes['circle--completed']]: props.completed && !props.active,\n [classes['circle--active']]: props.active,\n [classes['circle--loading']]: props.loading,\n },\n ]\"\n >\n <Icon\n v-if=\"(props.completed || props.error || props.loading) && !props.active\"\n :name=\"iconName\"\n :class=\"{ 'fx-spin': props.loading }\"\n size=\"dense\"\n />\n <span v-else>{{ props.step }}</span>\n </div>\n <div\n class=\"my-1.5 w-px bg-ice-500\"\n :class=\"[classes.line, { [classes['line--expanded']]: props.completed || props.active, hidden: isHorizontal }]\"\n />\n </div>\n <!-- step title, line(s), and nested steps -->\n <div\n class=\"flex\"\n :class=\"[\n {\n 'w-full flex-row items-center': isHorizontal,\n 'mt-1.5 justify-center': showResponsiveNav,\n 'flex-col': !isHorizontal || showResponsiveNav,\n },\n ]\"\n >\n <div\n class=\"stash-step__title\"\n data-test=\"stash-step|title\"\n :class=\"[\n classes.title,\n {\n 'whitespace-nowrap': isHorizontal,\n 'cursor-pointer': !props.active && (props.completed || props.error),\n 'cursor-not-allowed': props.disabled,\n 'text-ice-900': isLightThemed,\n '!font-semibold': props.active,\n 'text-white': !props.disabled && !isLightThemed,\n 'place-self-center': showResponsiveNav,\n },\n ]\"\n >\n {{ props.text }}\n <p\n v-if=\"showResponsiveNav\"\n class=\"stash-step__pagination-label mb-0 text-center text-xs\"\n data-test=\"stash-step|pagination-label\"\n :class=\"isLightThemed ? 'text-ice-700' : 'text-white'\"\n >\n {{ currentStepText }}\n </p>\n </div>\n <div\n v-if=\"isHorizontal\"\n :class=\"[\n classes.line,\n {\n [classes['line--expanded']]: props.completed || props.active,\n 'mx-1.5 border-t group-last:hidden': !showResponsiveNav,\n },\n ]\"\n />\n <div class=\"stash-step--nested-steps\" :class=\"{ 'pb-9': !nested && !slots.default, hidden: isHorizontal }\">\n <ul :class=\"[classes.nested, { hidden: !slots.default }]\">\n <!-- @slot Default slot to compose multiple nested steps -->\n <slot></slot>\n </ul>\n </div>\n </div>\n </li>\n</template>\n\n<style module>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .step::before {\n content: '●';\n position: absolute;\n color: var(--color-white);\n left: -28px;\n opacity: 0;\n transition: opacity 500ms cubic-bezier(0.85, 0, 0.15, 1);\n }\n\n .title {\n font-weight: var(--font-weight-medium);\n font-size: 1rem;\n margin-top: 1px;\n user-select: none;\n }\n\n .nested-step--active::before {\n opacity: 1;\n }\n\n .line {\n flex-grow: 0;\n transition: flex-grow 500ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n\n .line--expanded {\n flex-grow: 1;\n }\n\n .stash-step--singular .line {\n @apply absolute\n inset-x-0\n top-3\n h-px\n border-t-0\n before:absolute\n before:left-0\n before:right-2/4\n before:mr-16\n before:block\n before:h-px\n before:bg-ice-500\n after:absolute\n after:left-2/4\n after:right-0\n after:ml-16\n after:block\n after:h-px\n after:bg-ice-500;\n }\n\n .stash-step--singular .line::after,\n .stash-step--singular .line::before {\n content: '';\n }\n\n .step:not(.stash-step--singular):last-child .line {\n display: none;\n }\n\n .circle {\n width: --spacing(6);\n height: --spacing(6);\n line-height: --spacing(6);\n border-radius: calc(infinity * 1px);\n display: grid;\n place-items: center;\n font-weight: var(--font-weight-medium);\n transition:\n background-color 500ms,\n color 500ms;\n }\n\n .circle--todo {\n background-color: rgb(255 255 255 / 50%);\n color: #4d4a69;\n border: 1px solid #747293;\n }\n\n .circle--active {\n background-color: var(--color-blue-500);\n color: var(--color-white);\n border: 1px solid transparent;\n }\n\n .circle--loading {\n background-color: var(--color-white);\n border: 1px solid var(--color-ice-500);\n color: var(--color-ice-700);\n cursor: pointer;\n }\n\n .circle--completed {\n background-color: var(--color-white);\n border: 1px solid var(--color-ice-500);\n color: var(--color-green-500);\n cursor: pointer;\n }\n\n .circle--error {\n background-color: var(--color-white);\n border: 1px solid var(--color-ice-500);\n color: var(--color-red-500);\n cursor: pointer;\n }\n\n .nested {\n padding: calc(--spacing(3) + --spacing(1.5)) 0;\n }\n\n .nested li + li {\n margin-top: --spacing(3);\n }\n\n .nested .title {\n font-weight: var(--font-weight-normal);\n font-size: 0.9rem;\n }\n }\n</style>\n"],"names":["props","__props","slots","useSlots","classes","useCssModule","injectedStepper","inject","STEPPER_INJECTION_KEY","isHorizontal","computed","isLightThemed","showResponsiveNav","iconName","currentStepText","t","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;AA4CE,UAAMA,IAAQC,GAURC,IAAQC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAkBC,EAAOC,CAAqB,GAE9CC,IAAeC,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,iBAAgB,YAAY,GAE3EK,IAAgBD,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,WAAU,OAAO,GAEjEM,IAAoBN,KAAA,gBAAAA,EAAiB,mBAErCO,IAAWH,EAAS,MACpBV,EAAM,UACD,YAEFA,EAAM,YAAY,iBAAiB,aAC3C,GAEKc,IAAkBJ;AAAA,MAAS,MAC/BK,EAAE,0BAA0B,EAAE,KAAKf,EAAM,MAAM,OAAO,OAAOM,KAAA,gBAAAA,EAAiB,UAAU,KAAK,GAAG;AAAA,IAAA;AAIlG,WAAAU,EAAc,MAAM;AAClB,MAAIV,KACFA,EAAgB,aAAaN,EAAM,MAAM;AAAA,IAE7C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Stepper.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as I, ref as N, computed as i, watch as o, watchEffect as g, provide as y, nextTick as E, createElementBlock as R, openBlock as n, createElementVNode as T, createBlock as d, createCommentVNode as v, normalizeClass as p, renderSlot as z, unref as f, withCtx as m, createVNode as h } from "vue";
2
2
  import A from "./useMediaQuery.js";
3
3
  import B from "./useStepper.js";
4
- import w from "./Button.js";
5
- import x from "./Icon.js";
4
+ import x from "./Button.js";
5
+ import S from "./Icon.js";
6
6
  import { S as L } from "./keys-C8Zfr_By.js";
7
7
  var V = /* @__PURE__ */ ((r) => (r.VERTICAL = "vertical", r.HORIZONTAL = "horizontal", r))(V || {});
8
- const P = { class: "tw-relative" }, Y = /* @__PURE__ */ I({
8
+ const P = { class: "relative" }, Y = /* @__PURE__ */ I({
9
9
  __name: "Stepper",
10
10
  props: {
11
11
  step: { default: -1 },
@@ -16,14 +16,14 @@ const P = { class: "tw-relative" }, Y = /* @__PURE__ */ I({
16
16
  theme: { default: "dark" }
17
17
  },
18
18
  emits: ["update:step", "update:substep"],
19
- setup(r, { expose: S, emit: b }) {
20
- const t = r, l = b, c = N(), e = B({
19
+ setup(r, { expose: b, emit: _ }) {
20
+ const t = r, l = _, c = N(), e = B({
21
21
  linear: t.linear,
22
22
  activeStep: t.step,
23
23
  activeSubstep: t.substep,
24
24
  ref: c
25
- }), _ = A("screen and (min-width: 961px)"), a = i(
26
- () => t.orientation === "horizontal" && (!_.value || t.useResponsiveNav)
25
+ }), w = A("screen and (min-width: 961px)"), a = i(
26
+ () => t.orientation === "horizontal" && (!w.value || t.useResponsiveNav)
27
27
  ), k = i(() => e.activeStepIndex.value <= 0), C = i(
28
28
  () => !e.isStepCompleted(e.activeStepIndex.value) || e.activeStepIndex.value === e.steps.value.length - 1
29
29
  );
@@ -49,7 +49,7 @@ const P = { class: "tw-relative" }, Y = /* @__PURE__ */ I({
49
49
  stepCount: e.stepCount,
50
50
  theme: t.theme,
51
51
  showResponsiveNav: a
52
- }), S({
52
+ }), b({
53
53
  back: e.back,
54
54
  next: e.next,
55
55
  goTo: e.goTo,
@@ -67,42 +67,42 @@ const P = { class: "tw-relative" }, Y = /* @__PURE__ */ I({
67
67
  T("ul", {
68
68
  ref_key: "stepperListRef",
69
69
  ref: c,
70
- class: p(["stash-stepper tw-flex", {
71
- "tw-flex-col": t.orientation === "vertical",
70
+ class: p(["stash-stepper flex", {
71
+ "flex-col": t.orientation === "vertical",
72
72
  "stash-stepper--vertical": t.orientation === "vertical",
73
73
  "stash-stepper--horizontal": t.orientation === "horizontal",
74
- "tw-mx-9 tw-snap-x tw-snap-mandatory tw-overflow-x-hidden": a.value
74
+ "mx-9 snap-x snap-mandatory overflow-x-hidden": a.value
75
75
  }]),
76
76
  "data-test": "stash-stepper"
77
77
  }, [
78
78
  z(s.$slots, "default")
79
79
  ], 2),
80
- a.value ? (n(), d(w, {
80
+ a.value ? (n(), d(x, {
81
81
  key: 0,
82
- class: p(["stash-stepper__arrow stash-stepper__arrow--prev", t.theme === "light" ? "tw-text-blue-500" : "tw-text-white"]),
82
+ class: p(["stash-stepper__arrow stash-stepper__arrow--prev", t.theme === "light" ? "text-blue-500" : "text-white"]),
83
83
  "data-test": "stash-stepper|prev-arrow",
84
84
  disabled: k.value,
85
85
  icon: "",
86
86
  onClick: f(e).back
87
87
  }, {
88
88
  default: m(() => [
89
- h(x, {
89
+ h(S, {
90
90
  name: "chevron-left",
91
91
  size: "dense"
92
92
  })
93
93
  ]),
94
94
  _: 1
95
95
  }, 8, ["class", "disabled", "onClick"])) : v("", !0),
96
- a.value ? (n(), d(w, {
96
+ a.value ? (n(), d(x, {
97
97
  key: 1,
98
- class: p(["stash-stepper__arrow stash-stepper__arrow--next", t.theme === "light" ? "tw-text-blue-500" : "tw-text-white"]),
98
+ class: p(["stash-stepper__arrow stash-stepper__arrow--next", t.theme === "light" ? "text-blue-500" : "text-white"]),
99
99
  "data-test": "stash-stepper|next-arrow",
100
100
  disabled: C.value,
101
101
  icon: "",
102
102
  onClick: f(e).next
103
103
  }, {
104
104
  default: m(() => [
105
- h(x, {
105
+ h(S, {
106
106
  name: "chevron-right",
107
107
  size: "dense"
108
108
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sources":["../src/components/Stepper/Stepper.types.ts","../src/components/Stepper/Stepper.vue"],"sourcesContent":["import type { Ref } from 'vue';\n\nimport Stepper from './Stepper.vue';\n\n/**\n * Helper type for the template ref (the \"ref\" attribute) on a Stepper instance\n * @see: https://vuejs.org/guide/typescript/composition-api.html#typing-component-template-refs\n */\nexport type StepperRef = Ref<InstanceType<typeof Stepper> | null>;\n\nexport enum StepperOrientationEnum {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n}\nexport type StepperOrientation = `${StepperOrientationEnum}`;\n\nexport type StepperTheme = 'dark' | 'light';\n","<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":["StepperOrientationEnum","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":";;;;;;AAUO,IAAKA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,aAAa,cAFHA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;AC+BV,UAAMC,IAAQC,GASRC,IAAOC,GAWPC,IAAiBC,EAAA,GACjBC,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,GACzBC,EAAA;AAAA,MACF;AAAA,IAAA,GAGFF;AAAA,MACE,MAAMR,EAAQ,mBAAmB;AAAA,MACjC,CAACS,MAAUb,EAAK,kBAAkBa,CAAK;AAAA,IAAA,GAOzCE,EAAY,MAAM;AAChB,MAAIP,EAAkB,SACpBM,EAAA;AAAA,IAEJ,CAAC,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,GAEDU,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;AAC5B,UAAI,CAACN,EAAkB;AACrB;AAIF,YAAMW,EAAA;AAEN,YAAMC,IAAOhB,EAAQ,kBAAkB;AAEvC,MAAIgB,KACFA,EAAK,eAAe,EAAE,UAAU,WAAW,QAAQ,SAAS,OAAO,WAAW;AAAA,IAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Stepper.js","sources":["../src/components/Stepper/Stepper.types.ts","../src/components/Stepper/Stepper.vue"],"sourcesContent":["import type { Ref } from 'vue';\n\nimport Stepper from './Stepper.vue';\n\n/**\n * Helper type for the template ref (the \"ref\" attribute) on a Stepper instance\n * @see: https://vuejs.org/guide/typescript/composition-api.html#typing-component-template-refs\n */\nexport type StepperRef = Ref<InstanceType<typeof Stepper> | null>;\n\nexport enum StepperOrientationEnum {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n}\nexport type StepperOrientation = `${StepperOrientationEnum}`;\n\nexport type StepperTheme = 'dark' | 'light';\n","<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=\"relative\">\n <ul\n ref=\"stepperListRef\"\n class=\"stash-stepper flex\"\n :class=\"{\n 'flex-col': props.orientation === 'vertical',\n 'stash-stepper--vertical': props.orientation === 'vertical',\n 'stash-stepper--horizontal': props.orientation === 'horizontal',\n 'mx-9 snap-x snap-mandatory 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' ? 'text-blue-500' : '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' ? 'text-blue-500' : '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 @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .stash-stepper--vertical .stash-step:last-child .stash-step--nested-steps {\n @apply hidden;\n }\n\n .stash-stepper__arrow {\n @apply absolute\n top-0\n flex\n h-6\n w-6\n min-w-auto\n items-center\n justify-center\n rounded-full\n border\n border-solid\n border-ice-500\n text-center\n disabled:text-ice-500 disabled:opacity-50;\n }\n\n .stash-stepper__arrow--prev {\n @apply left-0;\n }\n\n .stash-stepper__arrow--next {\n @apply right-0;\n }\n }\n</style>\n"],"names":["StepperOrientationEnum","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":";;;;;;AAUO,IAAKA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,aAAa,cAFHA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;AC+BV,UAAMC,IAAQC,GASRC,IAAOC,GAWPC,IAAiBC,EAAA,GACjBC,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,GACzBC,EAAA;AAAA,MACF;AAAA,IAAA,GAGFF;AAAA,MACE,MAAMR,EAAQ,mBAAmB;AAAA,MACjC,CAACS,MAAUb,EAAK,kBAAkBa,CAAK;AAAA,IAAA,GAOzCE,EAAY,MAAM;AAChB,MAAIP,EAAkB,SACpBM,EAAA;AAAA,IAEJ,CAAC,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,GAEDU,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;AAC5B,UAAI,CAACN,EAAkB;AACrB;AAIF,YAAMW,EAAA;AAEN,YAAMC,IAAOhB,EAAQ,kBAAkB;AAEvC,MAAIgB,KACFA,EAAK,eAAe,EAAE,UAAU,WAAW,QAAQ,SAAS,OAAO,WAAW;AAAA,IAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Switch.js CHANGED
@@ -1,8 +1,8 @@
1
- import { defineComponent as v, useAttrs as g, useSlots as y, useCssModule as C, computed as o, createElementBlock as i, openBlock as d, unref as a, normalizeClass as s, createElementVNode as c, createCommentVNode as u, mergeProps as S, withDirectives as A, vModelCheckbox as V, toDisplayString as _, renderSlot as B, createTextVNode as M } from "vue";
1
+ import { defineComponent as v, useAttrs as g, useSlots as y, useCssModule as C, computed as o, createElementBlock as i, openBlock as d, unref as a, normalizeClass as s, createElementVNode as l, createCommentVNode as _, mergeProps as S, withDirectives as A, vModelCheckbox as V, toDisplayString as b, renderSlot as B, createTextVNode as M } from "vue";
2
2
  import T from "@leaflink/snitch";
3
- import E from "lodash-es/uniqueId";
4
- import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- const z = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $ = /* @__PURE__ */ v({
3
+ import q from "lodash-es/uniqueId";
4
+ import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const N = ["data-test"], z = ["for"], D = ["id", "disabled", "name", "value"], I = /* @__PURE__ */ v({
6
6
  name: "ll-switch",
7
7
  inheritAttrs: !1,
8
8
  __name: "Switch",
@@ -16,96 +16,96 @@ const z = ["data-test"], D = ["for"], I = ["id", "disabled", "name", "value"], $
16
16
  value: { default: "" }
17
17
  },
18
18
  emits: ["update:checked"],
19
- setup(b, { emit: p }) {
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)
19
+ setup(p, { emit: w }) {
20
+ const e = p, c = g(), f = y(), n = C(), m = w;
21
+ if (typeof e.value == "boolean" && T.warn("Switch: use `checked` to toggle the state; `value` is what will be set if `checked` is true"), c.onChange)
22
22
  throw new Error("ll-switch: use the @update:checked event instead of @change.");
23
23
  const k = o(() => {
24
- const e = { ...l };
25
- return delete e["data-test"], delete e.class, e;
24
+ const t = { ...c };
25
+ return delete t["data-test"], delete t.class, t;
26
26
  }), h = o({
27
27
  get() {
28
- return t.checked;
28
+ return e.checked;
29
29
  },
30
- set(e) {
31
- m("update:checked", e);
30
+ set(t) {
31
+ m("update:checked", t);
32
32
  }
33
- }), r = o(() => t.id || E("switch-"));
34
- return (e, w) => (d(), i("div", {
35
- class: s(["stash-switch", a(l).class]),
36
- "data-test": a(l)["data-test"] || "stash-switch"
33
+ }), r = o(() => e.id || q("switch-"));
34
+ return (t, u) => (d(), i("div", {
35
+ class: s(["stash-switch", a(c).class]),
36
+ "data-test": a(c)["data-test"] || "stash-switch"
37
37
  }, [
38
- c("label", S({
38
+ l("label", S({
39
39
  for: r.value,
40
- class: [{ "tw-pointer-events-none": t.disabled }, "tw-flex tw-cursor-pointer"],
40
+ class: [{ "pointer-events-none": e.disabled }, "flex cursor-pointer"],
41
41
  "data-test": "stash-switch|label"
42
42
  }, k.value), [
43
- c("span", {
44
- class: s(["tw-relative tw-inline-block tw-h-5 tw-w-[34px] tw-min-w-[34px]", { [a(n).active]: t.checked }])
43
+ l("span", {
44
+ class: s(["relative inline-block h-5 w-[34px] min-w-[34px]", { [a(n).active]: e.checked }])
45
45
  }, [
46
- c("span", {
47
- class: s(["stash-switch__track tw-absolute tw-top-0.5 tw-h-4 tw-w-full tw-rounded-[10px]", {
48
- "tw-bg-blue-500": t.checked && !t.disabled,
49
- "tw-bg-ice-700": !t.checked && !t.disabled,
50
- "stash-switch__track--disabled tw-bg-ice-500": t.disabled,
51
- "stash-switch__track--on": t.checked,
52
- "stash-switch__track--off": !t.checked
46
+ l("span", {
47
+ class: s(["stash-switch__track absolute top-0.5 h-4 w-full rounded-[10px]", {
48
+ "bg-blue-500": e.checked && !e.disabled,
49
+ "bg-ice-700": !e.checked && !e.disabled,
50
+ "stash-switch__track--disabled bg-ice-500": e.disabled,
51
+ "stash-switch__track--on": e.checked,
52
+ "stash-switch__track--off": !e.checked
53
53
  }]),
54
54
  "data-test": "stash-switch|track"
55
55
  }, null, 2),
56
- c("span", {
57
- class: s(["stash-switch__control tw-absolute tw-left-0 tw-size-5 tw-rounded-[10px] tw-border tw-border-solid tw-border-ice-500 tw-bg-white tw-shadow", [
56
+ l("span", {
57
+ class: s(["stash-switch__control absolute left-0 size-5 rounded-[10px] border border-solid border-ice-500 bg-white shadow", [
58
58
  a(n).control,
59
59
  {
60
- "stash-switch__control--on": t.checked,
61
- "stash-switch__control--off": !t.checked,
62
- "stash-switch__control--disabled": t.disabled
60
+ "stash-switch__control--on": e.checked,
61
+ "stash-switch__control--off": !e.checked,
62
+ "stash-switch__control--disabled": e.disabled
63
63
  }
64
64
  ]]),
65
65
  "data-test": "stash-switch|control"
66
66
  }, null, 2)
67
67
  ], 2),
68
- A(c("input", {
68
+ A(l("input", {
69
69
  id: r.value,
70
- "onUpdate:modelValue": w[0] || (w[0] = (x) => h.value = x),
70
+ "onUpdate:modelValue": u[0] || (u[0] = (x) => h.value = x),
71
71
  type: "checkbox",
72
- disabled: t.disabled,
73
- name: t.name,
72
+ disabled: e.disabled,
73
+ name: e.name,
74
74
  tabindex: "0",
75
- value: e.value,
76
- class: "tw-sr-only"
77
- }, null, 8, I), [
75
+ value: t.value,
76
+ class: "sr-only"
77
+ }, null, 8, D), [
78
78
  [V, h.value]
79
79
  ]),
80
- t.label ? (d(), i("span", {
80
+ e.label ? (d(), i("span", {
81
81
  key: 0,
82
82
  class: s([{
83
- "tw-text-ice-900": t.checked && !t.disabled,
84
- "tw-text-ice-700": !t.checked && !t.disabled,
85
- "stash-switch__label-text--on": t.checked,
86
- "stash-switch__label-text--off": !t.checked,
87
- "stash-switch__label-text--disabled tw-text-ice-500": t.disabled
88
- }, "stash-switch__label-text tw-relative tw-top-px tw-ml-1.5"]),
83
+ "text-ice-900": e.checked && !e.disabled,
84
+ "text-ice-700": !e.checked && !e.disabled,
85
+ "stash-switch__label-text--on": e.checked,
86
+ "stash-switch__label-text--off": !e.checked,
87
+ "stash-switch__label-text--disabled text-ice-500": e.disabled
88
+ }, "stash-switch__label-text relative top-px ml-1.5"]),
89
89
  "data-test": "stash-switch|label-text"
90
- }, _(t.label), 3)) : u("", !0)
91
- ], 16, D),
92
- t.hintText || a(f).hint ? (d(), i("span", {
90
+ }, b(e.label), 3)) : _("", !0)
91
+ ], 16, z),
92
+ e.hintText || a(f).hint ? (d(), i("span", {
93
93
  key: 0,
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 }]),
94
+ class: s(["stash-switch__hint ml-[40px] mt-1.5 block whitespace-pre-line text-xs", { "stash-switch__hint--disabled text-ice-500": e.disabled }]),
95
95
  "data-test": "stash-switch|hint"
96
96
  }, [
97
- B(e.$slots, "hint", {}, () => [
98
- M(_(t.hintText), 1)
97
+ B(t.$slots, "hint", {}, () => [
98
+ M(b(e.hintText), 1)
99
99
  ])
100
- ], 2)) : u("", !0)
101
- ], 10, z));
100
+ ], 2)) : _("", !0)
101
+ ], 10, N));
102
102
  }
103
- }), q = "_control_8a1ic_2", P = "_active_8a1ic_5", U = {
104
- control: q,
103
+ }), $ = "_control_qbv7l_3", P = "_active_qbv7l_6", U = {
104
+ control: $,
105
105
  active: P
106
106
  }, j = {
107
107
  $style: U
108
- }, K = /* @__PURE__ */ N($, [["__cssModules", j]]);
108
+ }, K = /* @__PURE__ */ E(I, [["__cssModules", j]]);
109
109
  export {
110
110
  K as default
111
111
  };
@@ -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 = 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-size-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,EAAA,GACRC,IAAQC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAOC;AAQb,QAJI,OAAOT,EAAM,SAAU,aACzBU,EAAO,KAAK,6FAA6F,GAGvGR,EAAM;AACR,YAAM,IAAI,MAAM,8DAA8D;AAGhF,UAAMS,IAAcC,EAAS,MAAM;AACjC,YAAMC,IAAY,EAAE,GAAGX,EAAA;AAEvB,oBAAOW,EAAU,WAAW,GAC5B,OAAOA,EAAU,OAEVA;AAAA,IACT,CAAC,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
+ {"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=\"{ 'pointer-events-none': props.disabled }\"\n class=\"flex cursor-pointer\"\n data-test=\"stash-switch|label\"\n v-bind=\"switchAttrs\"\n >\n <span class=\"relative inline-block h-5 w-[34px] min-w-[34px]\" :class=\"{ [classes.active]: props.checked }\">\n <span\n class=\"stash-switch__track absolute top-0.5 h-4 w-full rounded-[10px]\"\n :class=\"{\n 'bg-blue-500': props.checked && !props.disabled,\n 'bg-ice-700': !props.checked && !props.disabled,\n 'stash-switch__track--disabled 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 absolute left-0 size-5 rounded-[10px] border border-solid border-ice-500 bg-white 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=\"sr-only\"\n />\n <span\n v-if=\"props.label\"\n :class=\"{\n 'text-ice-900': props.checked && !props.disabled,\n '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 text-ice-500': props.disabled,\n }\"\n class=\"stash-switch__label-text relative top-px 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 ml-[40px] mt-1.5 block whitespace-pre-line text-xs\"\n :class=\"{ 'stash-switch__hint--disabled 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 @layer utilities {\n .control {\n transition: left 0.2s ease-in-out;\n\n .active & {\n left: calc(var(--spacing) * 3.5); /* track width - switch width (14px) */\n }\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,EAAA,GACRC,IAAQC,EAAA,GACRC,IAAUC,EAAA,GAEVC,IAAOC;AAQb,QAJI,OAAOT,EAAM,SAAU,aACzBU,EAAO,KAAK,6FAA6F,GAGvGR,EAAM;AACR,YAAM,IAAI,MAAM,8DAA8D;AAGhF,UAAMS,IAAcC,EAAS,MAAM;AACjC,YAAMC,IAAY,EAAE,GAAGX,EAAA;AAEvB,oBAAOW,EAAU,WAAW,GAC5B,OAAOA,EAAU,OAEVA;AAAA,IACT,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}