@adyen/bento-vue2 1.42.0 → 1.44.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 (169) hide show
  1. package/dist/@types/index.d.ts +136 -53
  2. package/dist/action-bar.js +1 -1
  3. package/dist/assets/accordion-item.css +1 -1
  4. package/dist/assets/action-bar.css +1 -1
  5. package/dist/assets/base-modal.css +1 -1
  6. package/dist/assets/button-actions-with-menu.css +1 -1
  7. package/dist/assets/button-actions.css +1 -1
  8. package/dist/assets/card.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/date-range-picker.css +1 -1
  11. package/dist/assets/dialog-page.css +1 -1
  12. package/dist/assets/dropdown-default-textbox.css +1 -1
  13. package/dist/assets/dropdown.css +1 -1
  14. package/dist/assets/file-uploader.css +1 -1
  15. package/dist/assets/filter-bar.css +1 -1
  16. package/dist/assets/header.css +1 -1
  17. package/dist/assets/inspector.css +1 -1
  18. package/dist/assets/menu.css +1 -1
  19. package/dist/assets/modal-fullscreen.css +1 -1
  20. package/dist/assets/popover.css +1 -1
  21. package/dist/assets/selection-card-group.css +1 -1
  22. package/dist/assets/sidepanel.css +1 -1
  23. package/dist/assets/textarea.css +1 -1
  24. package/dist/assets/typography.css +1 -1
  25. package/dist/button.js +7 -8
  26. package/dist/button.js.map +1 -1
  27. package/dist/card.js +1 -1
  28. package/dist/checkbox.js +2 -2
  29. package/dist/chunks/{action-bar.C1iwQWyj.js → action-bar.Dx12xlEW.js} +16 -16
  30. package/dist/chunks/action-bar.Dx12xlEW.js.map +1 -0
  31. package/dist/chunks/{base-modal.DroVbSCn.js → base-modal.BrqNR-ah.js} +2 -2
  32. package/dist/chunks/{base-modal.DroVbSCn.js.map → base-modal.BrqNR-ah.js.map} +1 -1
  33. package/dist/chunks/{button-actions-with-menu.dp6C-PKX.js → button-actions-with-menu.ptKgeQEb.js} +38 -29
  34. package/dist/chunks/button-actions-with-menu.ptKgeQEb.js.map +1 -0
  35. package/dist/chunks/button-actions.BIQ3qA8q.js +252 -0
  36. package/dist/chunks/button-actions.BIQ3qA8q.js.map +1 -0
  37. package/dist/chunks/{card.BcjxzwZV.js → card.D9g7fZDX.js} +2 -2
  38. package/dist/chunks/{card.BcjxzwZV.js.map → card.D9g7fZDX.js.map} +1 -1
  39. package/dist/chunks/{checkbox-group.B1FsPVSl.js → checkbox-group.Bcqac3y8.js} +2 -2
  40. package/dist/chunks/{checkbox-group.B1FsPVSl.js.map → checkbox-group.Bcqac3y8.js.map} +1 -1
  41. package/dist/chunks/{checkbox.kd1EnszA.js → checkbox.B1qjI4R_.js} +15 -15
  42. package/dist/chunks/{checkbox.kd1EnszA.js.map → checkbox.B1qjI4R_.js.map} +1 -1
  43. package/dist/chunks/{code-snippet.DGMVhQoj.js → code-snippet.rmKiWrIv.js} +4 -4
  44. package/dist/chunks/{code-snippet.DGMVhQoj.js.map → code-snippet.rmKiWrIv.js.map} +1 -1
  45. package/dist/chunks/{dashboard-section.D8ey7nzl.js → dashboard-section._KVy37B0.js} +3 -3
  46. package/dist/chunks/{dashboard-section.D8ey7nzl.js.map → dashboard-section._KVy37B0.js.map} +1 -1
  47. package/dist/chunks/{dashed-underline.dGO33Q_E.js → dashed-underline.DX5QlK14.js} +2 -2
  48. package/dist/chunks/{dashed-underline.dGO33Q_E.js.map → dashed-underline.DX5QlK14.js.map} +1 -1
  49. package/dist/chunks/{data-grid-template.BF7JMfoJ.js → data-grid-template.BgTUIoak.js} +2 -2
  50. package/dist/chunks/{data-grid-template.BF7JMfoJ.js.map → data-grid-template.BgTUIoak.js.map} +1 -1
  51. package/dist/chunks/data-grid.sAbzCVND.js +2556 -0
  52. package/dist/chunks/data-grid.sAbzCVND.js.map +1 -0
  53. package/dist/chunks/{date-picker.Dfg1_eo6.js → date-picker.DrSWxADA.js} +3 -3
  54. package/dist/chunks/{date-picker.Dfg1_eo6.js.map → date-picker.DrSWxADA.js.map} +1 -1
  55. package/dist/chunks/{date-range-picker.BvHFTptS.js → date-range-picker.CFIOD59O.js} +178 -175
  56. package/dist/chunks/date-range-picker.CFIOD59O.js.map +1 -0
  57. package/dist/chunks/{dropdown-default-textbox.DPZmj7xJ.js → dropdown-default-textbox.ZAFh7KqG.js} +111 -103
  58. package/dist/chunks/{dropdown-default-textbox.DPZmj7xJ.js.map → dropdown-default-textbox.ZAFh7KqG.js.map} +1 -1
  59. package/dist/chunks/{dropdown-tag.DqgJnpjk.js → dropdown-tag.Ntdp7P7W.js} +2 -2
  60. package/dist/chunks/{dropdown-tag.DqgJnpjk.js.map → dropdown-tag.Ntdp7P7W.js.map} +1 -1
  61. package/dist/chunks/{dropdown.2tXfuDlU.js → dropdown.DC9un4VJ.js} +240 -234
  62. package/dist/chunks/{dropdown.2tXfuDlU.js.map → dropdown.DC9un4VJ.js.map} +1 -1
  63. package/dist/chunks/es6.C-HLzYPA.js +11 -0
  64. package/dist/chunks/es6.C-HLzYPA.js.map +1 -0
  65. package/dist/chunks/{file-uploader.CK-Frs_q.js → file-uploader.ItCr8Ezn.js} +228 -227
  66. package/dist/chunks/file-uploader.ItCr8Ezn.js.map +1 -0
  67. package/dist/chunks/{filter-bar.DP_nQeeo.js → filter-bar.Dowrph-Z.js} +21 -22
  68. package/dist/chunks/filter-bar.Dowrph-Z.js.map +1 -0
  69. package/dist/chunks/{footer-actions.DwnLB4NW.js → footer-actions.B3GJ1wNP.js} +2 -2
  70. package/dist/chunks/{footer-actions.DwnLB4NW.js.map → footer-actions.B3GJ1wNP.js.map} +1 -1
  71. package/dist/chunks/{header.CAJtHW1k.js → header.BLjdXtYJ.js} +4 -4
  72. package/dist/chunks/{header.CAJtHW1k.js.map → header.BLjdXtYJ.js.map} +1 -1
  73. package/dist/chunks/index.Gcw_BUVh.js +367 -0
  74. package/dist/chunks/index.Gcw_BUVh.js.map +1 -0
  75. package/dist/chunks/{input-field-password.ijBN-aVx.js → input-field-password.CgxF9jhq.js} +4 -4
  76. package/dist/chunks/{input-field-password.ijBN-aVx.js.map → input-field-password.CgxF9jhq.js.map} +1 -1
  77. package/dist/chunks/{input-field.BoElSWuV.js → input-field.CcjqGkLs.js} +2 -2
  78. package/dist/chunks/{input-field.BoElSWuV.js.map → input-field.CcjqGkLs.js.map} +1 -1
  79. package/dist/chunks/{layout-row.6jCBhtd4.js → layout-row.DzS_XyyF.js} +2 -2
  80. package/dist/chunks/{layout-row.6jCBhtd4.js.map → layout-row.DzS_XyyF.js.map} +1 -1
  81. package/dist/chunks/{menu.N41WnXc8.js → menu.B78fzH_k.js} +81 -54
  82. package/dist/chunks/menu.B78fzH_k.js.map +1 -0
  83. package/dist/chunks/{modal-fullscreen.BbNe6M9T.js → modal-fullscreen.DgftXCJe.js} +2 -2
  84. package/dist/chunks/{modal-fullscreen.BbNe6M9T.js.map → modal-fullscreen.DgftXCJe.js.map} +1 -1
  85. package/dist/chunks/{modal.Cb4zg5fN.js → modal.BA745pfv.js} +4 -4
  86. package/dist/chunks/{modal.Cb4zg5fN.js.map → modal.BA745pfv.js.map} +1 -1
  87. package/dist/chunks/{pagination.FbkfItkS.js → pagination.CfwtuZ7R.js} +2 -2
  88. package/dist/chunks/{pagination.FbkfItkS.js.map → pagination.CfwtuZ7R.js.map} +1 -1
  89. package/dist/chunks/{popover.Uy-vuQq5.js → popover.ZlmaSYms.js} +2 -2
  90. package/dist/chunks/{popover.Uy-vuQq5.js.map → popover.ZlmaSYms.js.map} +1 -1
  91. package/dist/chunks/{promo-banner.CGz3MVPw.js → promo-banner.cTUF9seG.js} +2 -2
  92. package/dist/chunks/{promo-banner.CGz3MVPw.js.map → promo-banner.cTUF9seG.js.map} +1 -1
  93. package/dist/chunks/{search-bar.DD6eA0jG.js → search-bar.lYuXPzBX.js} +3 -3
  94. package/dist/chunks/{search-bar.DD6eA0jG.js.map → search-bar.lYuXPzBX.js.map} +1 -1
  95. package/dist/chunks/{secondary-nav.C56_jw55.js → secondary-nav.CF6WPYn4.js} +4 -4
  96. package/dist/chunks/{secondary-nav.C56_jw55.js.map → secondary-nav.CF6WPYn4.js.map} +1 -1
  97. package/dist/chunks/{selection-card-group.DwkH9xJd.js → selection-card-group.CjuBQ2UA.js} +11 -11
  98. package/dist/chunks/{selection-card-group.DwkH9xJd.js.map → selection-card-group.CjuBQ2UA.js.map} +1 -1
  99. package/dist/chunks/{sidepanel.CRJN9Acz.js → sidepanel.NUx7L5f1.js} +2 -2
  100. package/dist/chunks/{sidepanel.CRJN9Acz.js.map → sidepanel.NUx7L5f1.js.map} +1 -1
  101. package/dist/chunks/{teleport.CQKBJZU5.js → teleport.B5fwsT5y.js} +26 -17
  102. package/dist/chunks/teleport.B5fwsT5y.js.map +1 -0
  103. package/dist/chunks/textarea.F-JyRtIw.js +196 -0
  104. package/dist/chunks/{textarea.Y3yd_3ll.js.map → textarea.F-JyRtIw.js.map} +1 -1
  105. package/dist/chunks/{timeline-item.CCV4U3Zx.js → timeline-item.BJyB8-Wv.js} +3 -3
  106. package/dist/chunks/{timeline-item.CCV4U3Zx.js.map → timeline-item.BJyB8-Wv.js.map} +1 -1
  107. package/dist/chunks/{tutorial.4r7MKNEU.js → tutorial.DFvMZAN5.js} +4 -4
  108. package/dist/chunks/{tutorial.4r7MKNEU.js.map → tutorial.DFvMZAN5.js.map} +1 -1
  109. package/dist/chunks/{use-cached-selected-values.-_Gk6HO_.js → use-cached-selected-values.BiqVX5O7.js} +32 -29
  110. package/dist/chunks/{use-cached-selected-values.-_Gk6HO_.js.map → use-cached-selected-values.BiqVX5O7.js.map} +1 -1
  111. package/dist/code-snippet.js +1 -1
  112. package/dist/dashboard-template.js +1 -1
  113. package/dist/dashed-underline.js +1 -1
  114. package/dist/data-grid-template.js +1 -1
  115. package/dist/data-grid.js +1 -1
  116. package/dist/date-picker.js +1 -1
  117. package/dist/date-range-picker.js +1 -1
  118. package/dist/dropdown.js +4 -4
  119. package/dist/file-uploader.js +1 -1
  120. package/dist/filter-bar.js +1 -1
  121. package/dist/header.js +1 -1
  122. package/dist/index.js +88 -89
  123. package/dist/index.js.map +1 -1
  124. package/dist/input-field-password.js +1 -1
  125. package/dist/input-field.js +1 -1
  126. package/dist/internal.js +28 -24
  127. package/dist/internal.js.map +1 -1
  128. package/dist/layout.js +1 -1
  129. package/dist/menu.js +1 -1
  130. package/dist/modal-fullscreen.js +1 -1
  131. package/dist/modal.js +2 -2
  132. package/dist/pagination.js +1 -1
  133. package/dist/popover.js +1 -1
  134. package/dist/promo-banner.js +1 -1
  135. package/dist/search-bar.js +2 -2
  136. package/dist/secondary-nav.js +1 -1
  137. package/dist/selection-card.js +1 -1
  138. package/dist/sidepanel.js +1 -1
  139. package/dist/styles/bento-dark.css +3 -0
  140. package/dist/styles/bento-light.css +3 -0
  141. package/dist/styles/bento.css +3 -0
  142. package/dist/styles/legacy.css +3 -0
  143. package/dist/styles/styleguide.css +3 -0
  144. package/dist/textarea.js +1 -1
  145. package/dist/timeline.js +1 -1
  146. package/dist/tutorial.js +1 -1
  147. package/dist/web-types.json +122 -2
  148. package/package.json +7 -4
  149. package/dist/assets/loading-button.css +0 -1
  150. package/dist/chunks/action-bar.C1iwQWyj.js.map +0 -1
  151. package/dist/chunks/button-actions-with-menu.dp6C-PKX.js.map +0 -1
  152. package/dist/chunks/button-actions.Cpx4PQp0.js +0 -111
  153. package/dist/chunks/button-actions.Cpx4PQp0.js.map +0 -1
  154. package/dist/chunks/data-grid.bti50Fs6.js +0 -2373
  155. package/dist/chunks/data-grid.bti50Fs6.js.map +0 -1
  156. package/dist/chunks/date-range-picker.BvHFTptS.js.map +0 -1
  157. package/dist/chunks/es6.b4enG1py.js +0 -10
  158. package/dist/chunks/es6.b4enG1py.js.map +0 -1
  159. package/dist/chunks/file-uploader.CK-Frs_q.js.map +0 -1
  160. package/dist/chunks/filter-bar.DP_nQeeo.js.map +0 -1
  161. package/dist/chunks/index.BiaBX5uu.js +0 -345
  162. package/dist/chunks/index.BiaBX5uu.js.map +0 -1
  163. package/dist/chunks/loading-button.CiPmvU7F.js +0 -113
  164. package/dist/chunks/loading-button.CiPmvU7F.js.map +0 -1
  165. package/dist/chunks/menu.N41WnXc8.js.map +0 -1
  166. package/dist/chunks/teleport.CQKBJZU5.js.map +0 -1
  167. package/dist/chunks/textarea.Y3yd_3ll.js +0 -192
  168. package/dist/chunks/use-click-outside.D6aIgS15.js +0 -14
  169. package/dist/chunks/use-click-outside.D6aIgS15.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { c as n, b as o, a as p, B as a } from "./chunks/code-snippet.DGMVhQoj.js";
1
+ import { c as n, b as o, a as p, B as a } from "./chunks/code-snippet.rmKiWrIv.js";
2
2
  export {
3
3
  n as BentoCodeSnippet,
4
4
  o as BentoCodeSnippetEvent,
@@ -1,4 +1,4 @@
1
- import { a as e, d as t } from "./chunks/dashboard-section.D8ey7nzl.js";
1
+ import { a as e, d as t } from "./chunks/dashboard-section._KVy37B0.js";
2
2
  export {
3
3
  e as BentoDashboardSection,
4
4
  t as BentoDashboardTemplate
@@ -1,4 +1,4 @@
1
- import { d as n } from "./chunks/dashed-underline.dGO33Q_E.js";
1
+ import { d as n } from "./chunks/dashed-underline.DX5QlK14.js";
2
2
  export {
3
3
  n as BentoDashedUnderline
4
4
  };
@@ -1,4 +1,4 @@
1
- import { d as t } from "./chunks/data-grid-template.BF7JMfoJ.js";
1
+ import { d as t } from "./chunks/data-grid-template.BgTUIoak.js";
2
2
  export {
3
3
  t as BentoDataGridTemplate
4
4
  };
package/dist/data-grid.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as e, d as o, a as r, f as n, e as i, c as B, b as d } from "./chunks/data-grid.bti50Fs6.js";
1
+ import { B as e, d as o, a as r, f as n, e as i, c as B, b as d } from "./chunks/data-grid.sAbzCVND.js";
2
2
  export {
3
3
  e as BentoColumnOverflow,
4
4
  o as BentoDataGrid,
@@ -1,4 +1,4 @@
1
- import { B as a, a as r } from "./chunks/date-picker.Dfg1_eo6.js";
1
+ import { B as a, a as r } from "./chunks/date-picker.DrSWxADA.js";
2
2
  import { C as i } from "./chunks/calendar.B9WZ8ub3.js";
3
3
  export {
4
4
  a as BentoDatePicker,
@@ -1,4 +1,4 @@
1
- import { B as t, a as r } from "./chunks/date-range-picker.BvHFTptS.js";
1
+ import { B as t, a as r } from "./chunks/date-range-picker.CFIOD59O.js";
2
2
  import { C as o } from "./chunks/calendar.B9WZ8ub3.js";
3
3
  export {
4
4
  t as BentoDateRangePicker,
package/dist/dropdown.js CHANGED
@@ -1,7 +1,7 @@
1
- import { B as r } from "./chunks/dropdown.2tXfuDlU.js";
2
- import { B as t } from "./chunks/dropdown-default-textbox.DPZmj7xJ.js";
3
- import { a as p, B as d } from "./chunks/use-cached-selected-values.-_Gk6HO_.js";
4
- import { d as s, a as w, b as D, c as m, e as y } from "./chunks/dropdown-tag.DqgJnpjk.js";
1
+ import { B as r } from "./chunks/dropdown.DC9un4VJ.js";
2
+ import { B as t } from "./chunks/dropdown-default-textbox.ZAFh7KqG.js";
3
+ import { a as p, B as d } from "./chunks/use-cached-selected-values.BiqVX5O7.js";
4
+ import { d as s, a as w, b as D, c as m, e as y } from "./chunks/dropdown-tag.Ntdp7P7W.js";
5
5
  export {
6
6
  r as BentoDropdown,
7
7
  s as BentoDropdownAvatar,
@@ -1,4 +1,4 @@
1
- import { f as r } from "./chunks/file-uploader.CK-Frs_q.js";
1
+ import { f as r } from "./chunks/file-uploader.ItCr8Ezn.js";
2
2
  export {
3
3
  r as BentoFileUploader
4
4
  };
@@ -1,4 +1,4 @@
1
- import { B as r, b as a, a as B, c as n } from "./chunks/filter-bar.DP_nQeeo.js";
1
+ import { B as r, b as a, a as B, c as n } from "./chunks/filter-bar.Dowrph-Z.js";
2
2
  export {
3
3
  r as BentoFilterBar,
4
4
  a as BentoFilterBarEvent,
package/dist/header.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as r } from "./chunks/header.CAJtHW1k.js";
1
+ import { B as r } from "./chunks/header.BLjdXtYJ.js";
2
2
  export {
3
3
  r as BentoHeader
4
4
  };
package/dist/index.js CHANGED
@@ -1,86 +1,85 @@
1
1
  import "./chunks/index.Cl4_42j5.js";
2
2
  import { t as T, c as y } from "./chunks/use-bento-toast-controller.BVVMh0wc.js";
3
3
  import { u as N } from "./chunks/use-bento-toast-controller.BVVMh0wc.js";
4
- import { p as g, d as u } from "./chunks/typography.Bu_WAKdf.js";
4
+ import { p as g, d as l } from "./chunks/typography.Bu_WAKdf.js";
5
5
  import { B as _, c as Y, b as j, a as U } from "./chunks/typography.Bu_WAKdf.js";
6
6
  import { a as K, b as H } from "./chunks/accordion-item.BjXzREaK.js";
7
- import { B as W } from "./chunks/action-bar.C1iwQWyj.js";
7
+ import { B as W } from "./chunks/action-bar.Dx12xlEW.js";
8
8
  import { B as J, c as Q, b as X, a as $ } from "./chunks/alert.D2Z_aiFC.js";
9
9
  import { B as te } from "./chunks/avatar.DXzyWKsI.js";
10
10
  import { B as ae, b as ne, a as re } from "./chunks/button.CufUNBkv.js";
11
- import { d as Be } from "./chunks/dashed-underline.dGO33Q_E.js";
12
- import { B as me, d as pe, a as le, f as ue, e as de, c as ce, b as fe } from "./chunks/data-grid.bti50Fs6.js";
13
- import { c as Se, B as Te, a as ye } from "./chunks/card.BcjxzwZV.js";
14
- import { B as be, a as he } from "./chunks/date-picker.Dfg1_eo6.js";
15
- import { B as Ce, a as De } from "./chunks/date-range-picker.BvHFTptS.js";
16
- import { B as Ie, u as Le } from "./chunks/dropdown.2tXfuDlU.js";
17
- import { B as Fe } from "./chunks/dropdown-default-textbox.DPZmj7xJ.js";
18
- import { B as Oe, a as ke } from "./chunks/checkbox.kd1EnszA.js";
11
+ import { d as Be } from "./chunks/dashed-underline.DX5QlK14.js";
12
+ import { B as me, d as pe, a as de, f as le, e as ue, c as ce, b as fe } from "./chunks/data-grid.sAbzCVND.js";
13
+ import { c as Se, B as Te, a as ye } from "./chunks/card.D9g7fZDX.js";
14
+ import { B as be, a as he } from "./chunks/date-picker.DrSWxADA.js";
15
+ import { B as Ce, a as De } from "./chunks/date-range-picker.CFIOD59O.js";
16
+ import { B as Ie, u as Le } from "./chunks/dropdown.DC9un4VJ.js";
17
+ import { B as Fe } from "./chunks/dropdown-default-textbox.ZAFh7KqG.js";
18
+ import { B as Oe, a as ke } from "./chunks/checkbox.B1qjI4R_.js";
19
19
  import { B as Me } from "./chunks/click-outside.DSszkIvs.js";
20
- import { c as Ae, b as Ne, a as Re, B as _e } from "./chunks/code-snippet.DGMVhQoj.js";
20
+ import { c as Ae, b as Ne, a as Re, B as _e } from "./chunks/code-snippet.rmKiWrIv.js";
21
21
  import { c as je } from "./chunks/country.CM5oZOyZ.js";
22
22
  import { a as ze, B as Ke, u as He, b as qe, c as We } from "./chunks/country.types.Br0AjxGy.js";
23
23
  import { c as Je, B as Qe } from "./chunks/currency.P7Psn_SK.js";
24
24
  import { B as $e, a as et } from "./chunks/date.BQ29-2L1.js";
25
25
  import { B as ot } from "./chunks/divider.BZfeYmB9.js";
26
26
  import { B as nt, b as rt, c as st, a as Bt } from "./chunks/empty-state.B8ZeRgDi.js";
27
- import { f as mt } from "./chunks/file-uploader.CK-Frs_q.js";
28
- import { B as lt, b as ut, a as dt, c as ct } from "./chunks/filter-bar.DP_nQeeo.js";
27
+ import { f as mt } from "./chunks/file-uploader.ItCr8Ezn.js";
28
+ import { B as dt, b as lt, a as ut, c as ct } from "./chunks/filter-bar.Dowrph-Z.js";
29
29
  import { f as xt, a as St, c as Tt, b as yt } from "./chunks/form-layout-title.BarHgyjC.js";
30
30
  import { B as bt, a as ht, b as Et } from "./chunks/image.C2D2hKat.js";
31
31
  import { B as Dt } from "./chunks/info-icon.p-28zHUJ.js";
32
- import { B as It, b as Lt, e as Pt, c as Ft, d as Gt, a as Ot } from "./chunks/input-field.BoElSWuV.js";
33
- import { i as wt, m as Mt, r as Vt, b as At, c as Nt, a as Rt } from "./chunks/input-field-password.ijBN-aVx.js";
32
+ import { B as It, b as Lt, e as Pt, c as Ft, d as Gt, a as Ot } from "./chunks/input-field.CcjqGkLs.js";
33
+ import { i as wt, m as Mt, r as Vt, b as At, c as Nt, a as Rt } from "./chunks/input-field-password.CgxF9jhq.js";
34
34
  import { i as Yt, B as jt } from "./chunks/inspector.types.DaY6OOzz.js";
35
- import { l as zt, a as Kt } from "./chunks/layout-row.6jCBhtd4.js";
35
+ import { l as zt, a as Kt } from "./chunks/layout-row.DzS_XyyF.js";
36
36
  import { B as qt, a as Wt } from "./chunks/loading-indicator.z8COalOc.js";
37
37
  import { B as Jt, a as Qt } from "./chunks/link.v-y0fKjn.js";
38
- import { B as $t, a as eo } from "./chunks/menu.N41WnXc8.js";
39
- import { d as oo, f as ao, g as no, B as ro, e as so, c as Bo, a as io, b as mo } from "./chunks/base-modal.DroVbSCn.js";
40
- import { B as lo } from "./chunks/modal.Cb4zg5fN.js";
41
- import { m as co, B as fo } from "./chunks/modal-fullscreen.BbNe6M9T.js";
42
- import { B as So } from "./chunks/header.CAJtHW1k.js";
43
- import { B as yo } from "./chunks/pagination.FbkfItkS.js";
38
+ import { B as $t, a as eo } from "./chunks/menu.B78fzH_k.js";
39
+ import { d as oo, f as ao, g as no, B as ro, e as so, c as Bo, a as io, b as mo } from "./chunks/base-modal.BrqNR-ah.js";
40
+ import { B as lo } from "./chunks/modal.BA745pfv.js";
41
+ import { m as co, B as fo } from "./chunks/modal-fullscreen.DgftXCJe.js";
42
+ import { B as So } from "./chunks/header.BLjdXtYJ.js";
43
+ import { B as yo } from "./chunks/pagination.CfwtuZ7R.js";
44
44
  import { B as bo } from "./chunks/payment-method.CoXB0ZAW.js";
45
45
  import { B as Eo } from "./chunks/payment-method.types.CJKfZQN5.js";
46
- import { B as Do, a as vo } from "./chunks/popover.Uy-vuQq5.js";
47
- import { p as Lo, B as Po, a as Fo } from "./chunks/promo-banner.CGz3MVPw.js";
46
+ import { B as Do, a as vo } from "./chunks/popover.ZlmaSYms.js";
47
+ import { p as Lo, B as Po, a as Fo } from "./chunks/promo-banner.cTUF9seG.js";
48
48
  import { b as Oo, B as ko, a as wo } from "./chunks/radio-group.EnMXbuly.js";
49
- import { B as Vo, b as Ao, a as No } from "./chunks/search-bar.DD6eA0jG.js";
50
- import { s as _o } from "./chunks/secondary-nav.C56_jw55.js";
51
- import { B as jo, s as Uo, a as zo } from "./chunks/selection-card-group.DwkH9xJd.js";
49
+ import { B as Vo, b as Ao, a as No } from "./chunks/search-bar.lYuXPzBX.js";
50
+ import { s as _o } from "./chunks/secondary-nav.CF6WPYn4.js";
51
+ import { B as jo, s as Uo, a as zo } from "./chunks/selection-card-group.CjuBQ2UA.js";
52
52
  import { B as Ho } from "./chunks/segmented-control.CVeUROYR.js";
53
53
  import { B as Wo } from "./chunks/segmented-control.types.BHRLV8KU.js";
54
- import { a as Jo, B as Qo, s as Xo } from "./chunks/sidepanel.CRJN9Acz.js";
54
+ import { a as Jo, B as Qo, s as Xo } from "./chunks/sidepanel.NUx7L5f1.js";
55
55
  import { s as ea, B as ta } from "./chunks/status.types.B0jtv0c7.js";
56
56
  import { a as aa, s as na, B as ra, b as sa } from "./chunks/step.5g9BIi15.js";
57
57
  import { B as ia, a as ma } from "./chunks/structured-list-item.BEhWyaVP.js";
58
- import { s as la, a as ua, e as da, b as ca, c as fa, B as xa, d as Sa, f as Ta } from "./chunks/summary-grid-item-custom.CSXo4NjY.js";
58
+ import { s as da, a as la, e as ua, b as ca, c as fa, B as xa, d as Sa, f as Ta } from "./chunks/summary-grid-item-custom.CSXo4NjY.js";
59
59
  import { B as ga, a as ba } from "./chunks/tabs.Casntai-.js";
60
60
  import { B as Ea, a as Ca } from "./chunks/tag.wTXg-O7i.js";
61
- import { B as va } from "./chunks/textarea.Y3yd_3ll.js";
62
- import { t as La, b as Pa, a as Fa, c as Ga, B as Oa, d as ka } from "./chunks/timeline-item.CCV4U3Zx.js";
61
+ import { B as va } from "./chunks/textarea.F-JyRtIw.js";
62
+ import { t as La, b as Pa, a as Fa, c as Ga, B as Oa, d as ka } from "./chunks/timeline-item.BJyB8-Wv.js";
63
63
  import { t as Ma } from "./chunks/toast.BEipTIrz.js";
64
64
  import { B as Aa, b as Na, a as Ra } from "./chunks/toggle.INRYdQzz.js";
65
- import { t as Ya } from "./chunks/tutorial.4r7MKNEU.js";
66
- import { a as Ua, d as za } from "./chunks/dashboard-section.D8ey7nzl.js";
67
- import { d as Ha } from "./chunks/data-grid-template.BF7JMfoJ.js";
68
- import { B as Wa, c as Za, a as Ja, b as Qa } from "./chunks/button-actions.Cpx4PQp0.js";
69
- import { B as $a, a as en } from "./chunks/loading-button.CiPmvU7F.js";
70
- import { B as on } from "./chunks/toggle-button.CYplDIO-.js";
71
- import { C as nn, C as rn } from "./chunks/calendar.B9WZ8ub3.js";
72
- import { a as Bn, B as mn, a as pn, B as ln } from "./chunks/use-cached-selected-values.-_Gk6HO_.js";
73
- import { d as dn, a as cn, b as fn, c as xn, e as Sn } from "./chunks/dropdown-tag.DqgJnpjk.js";
74
- import { C as yn } from "./chunks/checkbox-input.Bo4NxNOh.js";
75
- import { c as bn, B as hn } from "./chunks/checkbox-group.B1FsPVSl.js";
76
- import { R as Cn } from "./chunks/radio-input.q980f8Uf.js";
77
- import { shallowRef as b, ref as d, getCurrentInstance as h } from "vue";
65
+ import { t as Ya } from "./chunks/tutorial.DFvMZAN5.js";
66
+ import { a as Ua, d as za } from "./chunks/dashboard-section._KVy37B0.js";
67
+ import { d as Ha } from "./chunks/data-grid-template.BgTUIoak.js";
68
+ import { B as Wa, c as Za, a as Ja, b as Qa, d as Xa, e as $a } from "./chunks/button-actions.BIQ3qA8q.js";
69
+ import { B as tn } from "./chunks/toggle-button.CYplDIO-.js";
70
+ import { C as an, C as nn } from "./chunks/calendar.B9WZ8ub3.js";
71
+ import { a as sn, B as Bn, a as mn, B as pn } from "./chunks/use-cached-selected-values.BiqVX5O7.js";
72
+ import { d as ln, a as un, b as cn, c as fn, e as xn } from "./chunks/dropdown-tag.Ntdp7P7W.js";
73
+ import { C as Tn } from "./chunks/checkbox-input.Bo4NxNOh.js";
74
+ import { c as gn, B as bn } from "./chunks/checkbox-group.Bcqac3y8.js";
75
+ import { R as En } from "./chunks/radio-input.q980f8Uf.js";
76
+ import { shallowRef as b, ref as u, getCurrentInstance as h } from "vue";
78
77
  import * as s from "zod";
79
- import { u as vn } from "./chunks/use-click-outside.D6aIgS15.js";
80
- import { D as Ln } from "./chunks/date-input.BqBdAO1E.js";
81
- import { a as Fn, B as Gn } from "./chunks/keyboard-navigation.Clz1jOaA.js";
82
- import { B as kn } from "./chunks/directive.O3yEdalv.js";
83
- import { B as Mn, a as Vn, b as An } from "./chunks/tooltip.DH8TqpYV.js";
78
+ import { u as Dn } from "./chunks/teleport.B5fwsT5y.js";
79
+ import { D as In } from "./chunks/date-input.BqBdAO1E.js";
80
+ import { a as Pn, B as Fn } from "./chunks/keyboard-navigation.Clz1jOaA.js";
81
+ import { B as On } from "./chunks/directive.O3yEdalv.js";
82
+ import { B as wn, a as Mn, b as Vn } from "./chunks/tooltip.DH8TqpYV.js";
84
83
  function O(e) {
85
84
  return e;
86
85
  }
@@ -96,7 +95,7 @@ function E(e) {
96
95
  function k({
97
96
  validationSchema: e
98
97
  }) {
99
- const t = b({}), a = d({}), n = d(p(e)), i = () => {
98
+ const t = b({}), a = u({}), n = u(p(e)), i = () => {
100
99
  t.value = {}, a.value = {};
101
100
  }, x = () => {
102
101
  i(), n.value = p(e);
@@ -110,8 +109,8 @@ function k({
110
109
  handleReset: () => x(),
111
110
  submitForm: (S) => () => {
112
111
  i();
113
- const l = e.safeParse(n.value);
114
- l.success ? S(n.value) : l.error.issues.forEach((m) => {
112
+ const d = e.safeParse(n.value);
113
+ d.success ? S(n.value) : d.error.issues.forEach((m) => {
115
114
  const B = E(m);
116
115
  t.value[B] || (t.value[B] = m.message), a.value[B] ? a.value[B].push(m.message) : a.value[B] = [m.message];
117
116
  });
@@ -153,12 +152,12 @@ const r = (e) => {
153
152
  withUtilityClasses: n = !1,
154
153
  withDesignTokensCSSInjection: i = !0
155
154
  }) => {
156
- v(e), a && C(e), i && (u(
155
+ v(e), a && C(e), i && (l(
157
156
  "Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin",
158
157
  `Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:
159
158
  https://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables`,
160
159
  "2.0.0"
161
- ), t === o.LEGACY ? await import("@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css") : t === o.STYLEGUIDE ? await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css") : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css"), n && await import("@adyen/bento-design-tokens/dist/css/bento/utility.css")), t === o.LEGACY ? r(o.LEGACY) : t === o.STYLEGUIDE ? r(o.STYLEGUIDE) : t === o.BENTO_SYSTEM ? r(o.BENTO_SYSTEM) : t === o.BENTO_DARK ? r(o.BENTO_DARK) : (t === o.BENTO && u("Using `BentoTheme.BENTO`", "Please use `BentoTheme.BENTO_LIGHT` instead", "2.0.0"), r(o.BENTO_LIGHT));
160
+ ), t === o.LEGACY ? await import("@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css") : t === o.STYLEGUIDE ? await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css") : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css"), n && await import("@adyen/bento-design-tokens/dist/css/bento/utility.css")), t === o.LEGACY ? r(o.LEGACY) : t === o.STYLEGUIDE ? r(o.STYLEGUIDE) : t === o.BENTO_SYSTEM ? r(o.BENTO_SYSTEM) : t === o.BENTO_DARK ? r(o.BENTO_DARK) : (t === o.BENTO && l("Using `BentoTheme.BENTO`", "Please use `BentoTheme.BENTO_LIGHT` instead", "2.0.0"), r(o.BENTO_LIGHT));
162
161
  }
163
162
  };
164
163
  export {
@@ -182,11 +181,11 @@ export {
182
181
  ye as BentoCardTitleSize,
183
182
  Oe as BentoCheckbox,
184
183
  ke as BentoCheckboxEvent,
185
- bn as BentoCheckboxGroup,
186
- hn as BentoCheckboxGroupVariant,
187
- yn as BentoCheckboxState,
184
+ gn as BentoCheckboxGroup,
185
+ bn as BentoCheckboxGroupVariant,
186
+ Tn as BentoCheckboxState,
188
187
  Me as BentoClickOutside,
189
- kn as BentoClickOutsideDirective,
188
+ On as BentoClickOutsideDirective,
190
189
  Ae as BentoCodeSnippet,
191
190
  Ne as BentoCodeSnippetEvent,
192
191
  Re as BentoCodeSnippetSupportedLanguage,
@@ -201,38 +200,38 @@ export {
201
200
  za as BentoDashboardTemplate,
202
201
  Be as BentoDashedUnderline,
203
202
  pe as BentoDataGrid,
204
- le as BentoDataGridStaticIcon,
203
+ de as BentoDataGridStaticIcon,
205
204
  Ha as BentoDataGridTemplate,
206
- ue as BentoDatagridAriaSortValue,
207
- de as BentoDatagridEvent,
205
+ le as BentoDatagridAriaSortValue,
206
+ ue as BentoDatagridEvent,
208
207
  ce as BentoDatagridSortDirection,
209
208
  fe as BentoDatagridStyleState,
210
209
  $e as BentoDate,
211
210
  et as BentoDateFormat,
212
211
  be as BentoDatePicker,
213
212
  he as BentoDatePickerEvent,
214
- nn as BentoDatePickerFirstDayOfWeek,
213
+ an as BentoDatePickerFirstDayOfWeek,
215
214
  Ce as BentoDateRangePicker,
216
215
  De as BentoDateRangePickerEvent,
217
- rn as BentoDateRangePickerFirstDayOfWeek,
216
+ nn as BentoDateRangePickerFirstDayOfWeek,
218
217
  ot as BentoDivider,
219
218
  Ie as BentoDropdown,
220
- dn as BentoDropdownAvatar,
221
- cn as BentoDropdownCountry,
222
- fn as BentoDropdownCurrency,
223
- Bn as BentoDropdownEvent,
224
- mn as BentoDropdownLazyLoadType,
225
- xn as BentoDropdownPaymentMethod,
219
+ ln as BentoDropdownAvatar,
220
+ un as BentoDropdownCountry,
221
+ cn as BentoDropdownCurrency,
222
+ sn as BentoDropdownEvent,
223
+ Bn as BentoDropdownLazyLoadType,
224
+ fn as BentoDropdownPaymentMethod,
226
225
  Fe as BentoDropdownSize,
227
- Sn as BentoDropdownTag,
226
+ xn as BentoDropdownTag,
228
227
  nt as BentoEmptyState,
229
228
  rt as BentoEmptyStateImage,
230
229
  st as BentoEmptyStateImageVariant,
231
230
  Bt as BentoEmptyStateVariant,
232
231
  mt as BentoFileUploader,
233
- lt as BentoFilterBar,
234
- ut as BentoFilterBarEvent,
235
- dt as BentoFilterEvent,
232
+ dt as BentoFilterBar,
233
+ lt as BentoFilterBarEvent,
234
+ ut as BentoFilterEvent,
236
235
  ct as BentoFilterItemType,
237
236
  xt as BentoFormLayout,
238
237
  St as BentoFormLayoutFieldTip,
@@ -252,16 +251,16 @@ export {
252
251
  Ot as BentoInputFieldVariant,
253
252
  Yt as BentoInspector,
254
253
  jt as BentoInspectorSizeOptions,
255
- Fn as BentoKeyboardNavigationDirective,
256
- Gn as BentoKeyboardNavigationKeyDownEvent,
254
+ Pn as BentoKeyboardNavigationDirective,
255
+ Fn as BentoKeyboardNavigationKeyDownEvent,
257
256
  zt as BentoLayout,
258
257
  Kt as BentoLayoutRow,
259
258
  Jt as BentoLink,
260
259
  Qt as BentoLinkVariant,
261
- pn as BentoListboxEvent,
262
- ln as BentoListboxLazyLoadType,
263
- $a as BentoLoadingButton,
264
- en as BentoLoadingButtonState,
260
+ mn as BentoListboxEvent,
261
+ pn as BentoListboxLazyLoadType,
262
+ Xa as BentoLoadingButton,
263
+ $a as BentoLoadingButtonState,
265
264
  qt as BentoLoadingIndicator,
266
265
  Wt as BentoLoadingIndicatorEvent,
267
266
  $t as BentoMenu,
@@ -286,7 +285,7 @@ export {
286
285
  Po as BentoPromoBannerColor,
287
286
  Fo as BentoPromoBannerLayout,
288
287
  Oo as BentoRadioButton,
289
- Cn as BentoRadioButtonStateClass,
288
+ En as BentoRadioButtonStateClass,
290
289
  ko as BentoRadioGroup,
291
290
  wo as BentoRadioGroupVariant,
292
291
  Vo as BentoSearchBar,
@@ -309,9 +308,9 @@ export {
309
308
  sa as BentoStepperVariantOption,
310
309
  ia as BentoStructuredList,
311
310
  ma as BentoStructuredListItem,
312
- la as BentoSummaryGrid,
313
- ua as BentoSummaryGridItemAmount,
314
- da as BentoSummaryGridItemCustom,
311
+ da as BentoSummaryGrid,
312
+ la as BentoSummaryGridItemAmount,
313
+ ua as BentoSummaryGridItemCustom,
315
314
  ca as BentoSummaryGridItemNumeric,
316
315
  fa as BentoSummaryGridItemPercentage,
317
316
  xa as BentoSummaryGridItemSize,
@@ -331,18 +330,18 @@ export {
331
330
  ka as BentoTimelineStatus,
332
331
  Ma as BentoToast,
333
332
  Aa as BentoToggle,
334
- on as BentoToggleButton,
333
+ tn as BentoToggleButton,
335
334
  Na as BentoToggleLabelPosition,
336
335
  Ra as BentoTogglePropClass,
337
- Mn as BentoTooltipDirective,
338
- Vn as BentoTooltipPosition,
339
- An as BentoTooltipState,
336
+ wn as BentoTooltipDirective,
337
+ Mn as BentoTooltipPosition,
338
+ Vn as BentoTooltipState,
340
339
  Ya as BentoTutorial,
341
340
  _ as BentoTypography,
342
341
  Y as BentoTypographyElement,
343
342
  j as BentoTypographyModifier,
344
343
  U as BentoTypographyVariant,
345
- Ln as DateFormat,
344
+ In as DateFormat,
346
345
  M as default,
347
346
  Mt as minLength,
348
347
  Vt as requireLowercase,
@@ -353,7 +352,7 @@ export {
353
352
  w as useBentoTheme,
354
353
  c as useBentoThemeKey,
355
354
  N as useBentoToastController,
356
- vn as useClickOutside,
355
+ Dn as useClickOutside,
357
356
  He as useCountryCapital,
358
357
  qe as useCountryName,
359
358
  We as useCountryPhoneCode,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-theme/use-bento-theme.types.ts","../src/composables/use-bento-theme/use-bento-theme.ts","../src/composables/use-bento-toast-controller/install.ts","../src/composables/use-bento-theme/install.ts","../src/install.ts"],"sourcesContent":["import { type Ref, ref, type ShallowRef, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { ErrorBag, UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @param {T extends ZodSchema} formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns {UseForm<T>} schema Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param {ZodSchema} schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @param {UseForm<T>} props Form configuration object\n * @param {T extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns {Object} response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns {Ref<ErrorBag<T>>} response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns {Ref<T>} response.errors Object with all the form values and the first error found for that field (if any)\n * @returns {Ref<T>} response.values Object with all the form values and their current value\n * @returns {() => void} response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns {(callback: (values: T) => void) => () => void} response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<ErrorBag<z.TypeOf<T>>>;\n errors: Ref<z.TypeOf<T>> | ShallowRef<z.TypeOf<T>>;\n values: Ref<z.TypeOf<T>>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { BentoTheme } from './install';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import type { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { BentoTheme, setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.LEGACY) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n } else if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","_a","getCurrentInstance","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","getTheme","getThemeForSystemPreference","BentoTheme","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAASA,EAAmCC,GAAe;AACvD,SAAAA;AACX;AA4BA,SAASC,EAA0CC,GAAmC;AAClF,MAAMC,KAAKD,aAAkBC,EAAE;AAC3B,WAAO,OAAO;AAAA,MACV,OAAO,QAAQD,EAAO,KAAK,EAAE,IAAI,CAAC,CAACE,GAAKC,CAAK,MACnCF,KAAKE,aAAiBF,EAAE,aAEnB,CAACC,GAAKC,EAAM,KAAK,cAAc,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AAqB;AAAA,IACrB,8BAAAC,IAA+B;AAAA,EAAA,MAElC;AACD,IAAAL,EAAaX,CAAG,GAEZc,KACAf,EAAaC,CAAG,GAEhBgB,MACAC;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MACA;AAAA,IACJ,GAEIV,MAAUF,EAAW,SACrB,MAAM,OAAO,gEAAgE,IACtEE,MAAUF,EAAW,aAC5B,MAAM,OAAO,oEAAoE,IAEjF,MAAM,OAAO,yDAAyD,GAGtEU,KACA,MAAM,OAAO,uDAAuD,IAIxER,MAAUF,EAAW,SACrBC,EAASD,EAAW,MAAM,IACnBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,IACvBE,MAAUF,EAAW,eAC5BC,EAASD,EAAW,YAAY,IACzBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,KACvBE,MAAUF,EAAW,SAClBY,EAAA,4BAA4B,+CAA+C,OAAO,GAC5FX,EAASD,EAAW,WAAW;AAAA,EAGnC;AAER;"}
1
+ {"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-theme/use-bento-theme.types.ts","../src/composables/use-bento-theme/use-bento-theme.ts","../src/composables/use-bento-toast-controller/install.ts","../src/composables/use-bento-theme/install.ts","../src/install.ts"],"sourcesContent":["import { type Ref, ref, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { allKeys, ErrorBag, UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @param {T extends ZodSchema} formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns {UseForm<T>} schema Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param {ZodSchema} schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @param {UseForm<T>} props Form configuration object\n * @param {T extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns {Object} response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns {Ref<ErrorBag<T>>} response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns {Ref<T>} response.errors Object with all the form values and the first error found for that field (if any)\n * @returns {Ref<T>} response.values Object with all the form values and their current value\n * @returns {() => void} response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns {(callback: (values: T) => void) => () => void} response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string[];\n }>;\n errors: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string;\n }>;\n values: Ref<(typeof validationSchema)['_type']>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { BentoTheme } from './install';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import type { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { BentoTheme, setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.LEGACY) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n } else if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","_a","getCurrentInstance","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","getTheme","getThemeForSystemPreference","BentoTheme","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAASA,EAAmCC,GAAe;AACvD,SAAAA;AACX;AA4BA,SAASC,EAA0CC,GAAmC;AAClF,MAAMC,KAAKD,aAAkBC,EAAE;AAC3B,WAAO,OAAO;AAAA,MACV,OAAO,QAAQD,EAAO,KAAK,EAAE,IAAI,CAAC,CAACE,GAAKC,CAAK,MACnCF,KAAKE,aAAiBF,EAAE,aAEnB,CAACC,GAAKC,EAAM,KAAK,cAAc,IAGpCF,KAAKE,aAAiBF,EAAE,YACnB,CAACC,GAAKH,EAAqBI,CAAK,CAAC,IAGrC,CAACD,GAAK,MAAS,CACzB;AAAA,IACL;AAIR;AAOA,SAASE,EAAkBC,GAAmB;AACnC,SAAAA,EAAM,KAAK,KAAK,GAAG;AAC9B;AA2CO,SAASC,EAA6B;AAAA,EACzC,kBAAAC;AACJ,GAUE;AAEQ,QAAAC,IAASC,EAA6C,EAAE,GAExDC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AO,yDAAyD,GAGtEU,KACA,MAAM,OAAO,uDAAuD,IAIxER,MAAUF,EAAW,SACrBC,EAASD,EAAW,MAAM,IACnBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,IACvBE,MAAUF,EAAW,eAC5BC,EAASD,EAAW,YAAY,IACzBE,MAAUF,EAAW,aAC5BC,EAASD,EAAW,UAAU,KACvBE,MAAUF,EAAW,SAClBY,EAAA,4BAA4B,+CAA+C,OAAO,GAC5FX,EAASD,EAAW,WAAW;AAAA,EAGnC;AAER;"}
@@ -1,4 +1,4 @@
1
- import { i as a, m as s, r as i, b as c, c as u, a as o } from "./chunks/input-field-password.ijBN-aVx.js";
1
+ import { i as a, m as s, r as i, b as c, c as u, a as o } from "./chunks/input-field-password.CgxF9jhq.js";
2
2
  export {
3
3
  a as BentoInputFieldPassword,
4
4
  s as minLength,
@@ -1,4 +1,4 @@
1
- import { B as n, b as a, e as o, c as i, d as s, a as l } from "./chunks/input-field.BoElSWuV.js";
1
+ import { B as n, b as a, e as o, c as i, d as s, a as l } from "./chunks/input-field.CcjqGkLs.js";
2
2
  export {
3
3
  n as BentoInputField,
4
4
  a as BentoInputFieldElementPosition,
package/dist/internal.js CHANGED
@@ -1,35 +1,39 @@
1
1
  import { a as e, b as r, C as t } from "./chunks/calendar.B9WZ8ub3.js";
2
- import { C as p, a as l } from "./chunks/copy.DgzxvExj.js";
3
- import { C as x } from "./chunks/controls-group.J8shO_JL.js";
4
- import { B as m, b as n, a as f, D as E } from "./chunks/dialog-page.CplkzZGZ.js";
5
- import { E as d, F as I } from "./chunks/error-message.B7uoqQpq.js";
6
- import { F as T } from "./chunks/fixed-scroller.B880PL1J.js";
7
- import { G as u, a as O } from "./chunks/grid-layout.HvTAa4to.js";
8
- import { b as g, c as y, u as A } from "./chunks/use-cached-selected-values.-_Gk6HO_.js";
9
- import { L as F } from "./chunks/listbox-option-tag.BnX0H4HE.js";
10
- import { B as N } from "./chunks/teleport.CQKBJZU5.js";
11
- import { T as c } from "./chunks/tooltip.DH8TqpYV.js";
2
+ import { C as p, a as i } from "./chunks/copy.DgzxvExj.js";
3
+ import { C } from "./chunks/controls-group.J8shO_JL.js";
4
+ import { B as x, b as E, a as f, D as m } from "./chunks/dialog-page.CplkzZGZ.js";
5
+ import { E as _, F as I } from "./chunks/error-message.B7uoqQpq.js";
6
+ import { F as G } from "./chunks/fixed-scroller.B880PL1J.js";
7
+ import { G as u, a as d } from "./chunks/grid-layout.HvTAa4to.js";
8
+ import { b as L, c as B, u as b } from "./chunks/use-cached-selected-values.BiqVX5O7.js";
9
+ import { L as y } from "./chunks/listbox-option-tag.BnX0H4HE.js";
10
+ import { B as F } from "./chunks/teleport.B5fwsT5y.js";
11
+ import { T as P } from "./chunks/tooltip.DH8TqpYV.js";
12
+ import { B as M } from "./chunks/button-actions-with-menu.ptKgeQEb.js";
13
+ import { f as K } from "./chunks/button-actions.BIQ3qA8q.js";
12
14
  export {
13
- m as BentoDialogPageAnimation,
14
- g as BentoListbox,
15
- N as BentoTeleport,
15
+ K as BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY,
16
+ x as BentoDialogPageAnimation,
17
+ L as BentoListbox,
18
+ F as BentoTeleport,
19
+ M as ButtonActionsWithMenu,
16
20
  e as Calendar,
17
21
  r as CalendarEvent,
18
22
  t as CalendarFirstDayOfWeek,
19
- x as ControlsGroup,
23
+ C as ControlsGroup,
20
24
  p as Copy,
21
- l as CopyTooltipState,
22
- n as DIALOG_PAGE_CONFIG_INJECTION_KEY,
25
+ i as CopyTooltipState,
26
+ E as DIALOG_PAGE_CONFIG_INJECTION_KEY,
23
27
  f as DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,
24
- E as DialogPage,
25
- d as ErrorMessage,
28
+ m as DialogPage,
29
+ _ as ErrorMessage,
26
30
  I as FieldLabel,
27
- T as FixedScroller,
31
+ G as FixedScroller,
28
32
  u as GridLayout,
29
- O as GridLayoutContainerType,
30
- F as ListboxOptionTag,
31
- c as Tooltip,
32
- y as useCachedSelectedValues,
33
- A as useMultiLevelItems
33
+ d as GridLayoutContainerType,
34
+ y as ListboxOptionTag,
35
+ P as Tooltip,
36
+ B as useCachedSelectedValues,
37
+ b as useMultiLevelItems
34
38
  };
35
39
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"internal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
package/dist/layout.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l as t, a as e } from "./chunks/layout-row.6jCBhtd4.js";
1
+ import { l as t, a as e } from "./chunks/layout-row.DzS_XyyF.js";
2
2
  export {
3
3
  t as BentoLayout,
4
4
  e as BentoLayoutRow
package/dist/menu.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as o, a as t } from "./chunks/menu.N41WnXc8.js";
1
+ import { B as o, a as t } from "./chunks/menu.B78fzH_k.js";
2
2
  export {
3
3
  o as BentoMenu,
4
4
  t as BentoMenuEvent
@@ -1,4 +1,4 @@
1
- import { m as o, B as a } from "./chunks/modal-fullscreen.BbNe6M9T.js";
1
+ import { m as o, B as a } from "./chunks/modal-fullscreen.DgftXCJe.js";
2
2
  export {
3
3
  o as BentoModalFullscreen,
4
4
  a as BentoModalFullscreenPage
package/dist/modal.js CHANGED
@@ -1,5 +1,5 @@
1
- import { d as e, f as t, g as n, B as l, e as B, c as d, a as M, b as s } from "./chunks/base-modal.DroVbSCn.js";
2
- import { B as i } from "./chunks/modal.Cb4zg5fN.js";
1
+ import { d as e, f as t, g as n, B as l, e as B, c as d, a as M, b as s } from "./chunks/base-modal.BrqNR-ah.js";
2
+ import { B as i } from "./chunks/modal.BA745pfv.js";
3
3
  export {
4
4
  i as BentoModal,
5
5
  e as BentoModalColumnLayoutVariant,