@adyen/bento-vue2 1.24.0 → 1.26.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 (190) hide show
  1. package/dist/@types/index.d.ts +484 -629
  2. package/dist/accordion.js +2 -2
  3. package/dist/action-bar.js +6 -6
  4. package/dist/alert.js +69 -104
  5. package/dist/alert.js.map +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/dialog-page.css +1 -1
  8. package/dist/assets/dropdown.css +1 -1
  9. package/dist/assets/index10.css +1 -1
  10. package/dist/assets/index11.css +1 -1
  11. package/dist/assets/index12.css +1 -1
  12. package/dist/assets/index13.css +1 -1
  13. package/dist/assets/index14.css +1 -1
  14. package/dist/assets/index15.css +1 -1
  15. package/dist/assets/index16.css +1 -1
  16. package/dist/assets/index17.css +1 -1
  17. package/dist/assets/index18.css +1 -1
  18. package/dist/assets/index19.css +1 -1
  19. package/dist/assets/index2.css +1 -1
  20. package/dist/assets/index20.css +1 -1
  21. package/dist/assets/index21.css +1 -1
  22. package/dist/assets/index22.css +1 -1
  23. package/dist/assets/index23.css +1 -1
  24. package/dist/assets/index24.css +1 -1
  25. package/dist/assets/index25.css +1 -1
  26. package/dist/assets/index26.css +1 -1
  27. package/dist/assets/index27.css +1 -1
  28. package/dist/assets/index28.css +1 -1
  29. package/dist/assets/index29.css +1 -1
  30. package/dist/assets/index3.css +1 -1
  31. package/dist/assets/index30.css +1 -1
  32. package/dist/assets/index31.css +1 -1
  33. package/dist/assets/index32.css +1 -1
  34. package/dist/assets/index33.css +1 -1
  35. package/dist/assets/index34.css +1 -1
  36. package/dist/assets/index35.css +1 -1
  37. package/dist/assets/index36.css +1 -1
  38. package/dist/assets/index37.css +1 -1
  39. package/dist/assets/index38.css +1 -1
  40. package/dist/assets/index39.css +1 -1
  41. package/dist/assets/index4.css +1 -1
  42. package/dist/assets/index40.css +1 -1
  43. package/dist/assets/index41.css +1 -1
  44. package/dist/assets/index42.css +1 -1
  45. package/dist/assets/index43.css +1 -1
  46. package/dist/assets/index44.css +1 -1
  47. package/dist/assets/index45.css +1 -1
  48. package/dist/assets/index47.css +1 -1
  49. package/dist/assets/index48.css +1 -1
  50. package/dist/assets/index5.css +1 -1
  51. package/dist/assets/index6.css +1 -1
  52. package/dist/assets/index7.css +1 -1
  53. package/dist/assets/index8.css +1 -1
  54. package/dist/assets/index9.css +1 -1
  55. package/dist/assets/{listbox.css → use-cached-selected-values.css} +1 -1
  56. package/dist/avatar-image.js +1 -1
  57. package/dist/button.js +5 -5
  58. package/dist/card.js +83 -180
  59. package/dist/card.js.map +1 -1
  60. package/dist/checkbox.js +5 -5
  61. package/dist/chunks/{base-button.090f511d.js → base-button.ad74b6f8.js} +2 -2
  62. package/dist/chunks/{base-button.090f511d.js.map → base-button.ad74b6f8.js.map} +1 -1
  63. package/dist/chunks/{base-modal.aa09a60c.js → base-modal.1fff7abe.js} +6 -6
  64. package/dist/chunks/{base-modal.aa09a60c.js.map → base-modal.1fff7abe.js.map} +1 -1
  65. package/dist/chunks/{button-actions-with-menu.879c4573.js → button-actions-with-menu.e845d77a.js} +4 -4
  66. package/dist/chunks/{button-actions-with-menu.879c4573.js.map → button-actions-with-menu.e845d77a.js.map} +1 -1
  67. package/dist/chunks/{button-actions.239456cb.js → button-actions.81db18e8.js} +3 -3
  68. package/dist/chunks/{button-actions.239456cb.js.map → button-actions.81db18e8.js.map} +1 -1
  69. package/dist/chunks/{button.6e6324f0.js → button.9d6435ae.js} +3 -3
  70. package/dist/chunks/{button.6e6324f0.js.map → button.9d6435ae.js.map} +1 -1
  71. package/dist/chunks/{calendar.1e416969.js → calendar.640b8d25.js} +4 -4
  72. package/dist/chunks/{calendar.1e416969.js.map → calendar.640b8d25.js.map} +1 -1
  73. package/dist/chunks/{checkbox.f38276e6.js → checkbox.bfed007c.js} +3 -3
  74. package/dist/chunks/{checkbox.f38276e6.js.map → checkbox.bfed007c.js.map} +1 -1
  75. package/dist/chunks/{controls-group.f1dfa419.js → controls-group.4fb50009.js} +3 -3
  76. package/dist/chunks/{controls-group.f1dfa419.js.map → controls-group.4fb50009.js.map} +1 -1
  77. package/dist/chunks/{copy.acc9f1b0.js → copy.f85700c6.js} +4 -4
  78. package/dist/chunks/{copy.acc9f1b0.js.map → copy.f85700c6.js.map} +1 -1
  79. package/dist/chunks/dialog-page.73da22cf.js +133 -0
  80. package/dist/chunks/dialog-page.73da22cf.js.map +1 -0
  81. package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js → dropdown-default-textbox.54ca1b18.js} +2 -2
  82. package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js.map → dropdown-default-textbox.54ca1b18.js.map} +1 -1
  83. package/dist/chunks/dropdown.10c034aa.js +775 -0
  84. package/dist/chunks/dropdown.10c034aa.js.map +1 -0
  85. package/dist/chunks/{error-message.8734e591.js → error-message.31ec12b7.js} +2 -2
  86. package/dist/chunks/{error-message.8734e591.js.map → error-message.31ec12b7.js.map} +1 -1
  87. package/dist/chunks/{fixed-scroller.772ad033.js → fixed-scroller.4eb9a9ac.js} +2 -2
  88. package/dist/chunks/{fixed-scroller.772ad033.js.map → fixed-scroller.4eb9a9ac.js.map} +1 -1
  89. package/dist/chunks/{footer-actions.11071f12.js → footer-actions.a1e09b4f.js} +4 -4
  90. package/dist/chunks/{footer-actions.11071f12.js.map → footer-actions.a1e09b4f.js.map} +1 -1
  91. package/dist/chunks/{index.5d5f2200.js → index.15b088b9.js} +6 -6
  92. package/dist/chunks/{index.5d5f2200.js.map → index.15b088b9.js.map} +1 -1
  93. package/dist/chunks/{index.87180cdd.js → index.1ea85d4a.js} +138 -119
  94. package/dist/chunks/index.1ea85d4a.js.map +1 -0
  95. package/dist/chunks/{index.8e6bc325.js → index.317fca12.js} +3 -3
  96. package/dist/chunks/{index.8e6bc325.js.map → index.317fca12.js.map} +1 -1
  97. package/dist/chunks/{index.51308a21.js → index.671768a1.js} +3 -3
  98. package/dist/chunks/{index.51308a21.js.map → index.671768a1.js.map} +1 -1
  99. package/dist/chunks/{index.49ce3f6a.js → index.7eefc59c.js} +3 -3
  100. package/dist/chunks/{index.49ce3f6a.js.map → index.7eefc59c.js.map} +1 -1
  101. package/dist/chunks/{index.f19887a1.js → index.885d05a9.js} +2 -2
  102. package/dist/chunks/{index.f19887a1.js.map → index.885d05a9.js.map} +1 -1
  103. package/dist/chunks/{index.73abb1a9.js → index.8b8c3b16.js} +9 -9
  104. package/dist/chunks/{index.73abb1a9.js.map → index.8b8c3b16.js.map} +1 -1
  105. package/dist/chunks/{index.ff09389c.js → index.aaf965f8.js} +6 -6
  106. package/dist/chunks/{index.ff09389c.js.map → index.aaf965f8.js.map} +1 -1
  107. package/dist/chunks/{index.03ae22b4.js → index.b21197ca.js} +2 -2
  108. package/dist/chunks/{index.03ae22b4.js.map → index.b21197ca.js.map} +1 -1
  109. package/dist/chunks/{index.94980f50.js → index.d553d3d1.js} +2 -2
  110. package/dist/chunks/{index.94980f50.js.map → index.d553d3d1.js.map} +1 -1
  111. package/dist/chunks/{index.ba6c1040.js → index.dd30e538.js} +3 -3
  112. package/dist/chunks/index.dd30e538.js.map +1 -0
  113. package/dist/chunks/{listbox-option-tag.c0a56a95.js → listbox-option-tag.6bbb6bbe.js} +3 -3
  114. package/dist/chunks/{listbox-option-tag.c0a56a95.js.map → listbox-option-tag.6bbb6bbe.js.map} +1 -1
  115. package/dist/chunks/{loading-button.84a5529d.js → loading-button.eafc9e1b.js} +2 -2
  116. package/dist/chunks/{loading-button.84a5529d.js.map → loading-button.eafc9e1b.js.map} +1 -1
  117. package/dist/chunks/{payment-method.faa302de.js → payment-method.6c1ce07c.js} +2 -2
  118. package/dist/chunks/{payment-method.faa302de.js.map → payment-method.6c1ce07c.js.map} +1 -1
  119. package/dist/chunks/{tooltip.8e9d733c.js → tooltip.58ef3f4a.js} +3 -3
  120. package/dist/chunks/{tooltip.8e9d733c.js.map → tooltip.58ef3f4a.js.map} +1 -1
  121. package/dist/chunks/{use-bento-toast-controller.7d4436ad.js → use-bento-toast-controller.c3277f73.js} +2 -2
  122. package/dist/chunks/{use-bento-toast-controller.7d4436ad.js.map → use-bento-toast-controller.c3277f73.js.map} +1 -1
  123. package/dist/chunks/{listbox.e6e1bc90.js → use-cached-selected-values.69297473.js} +510 -448
  124. package/dist/chunks/use-cached-selected-values.69297473.js.map +1 -0
  125. package/dist/code-snippet.js +7 -7
  126. package/dist/code-snippet.js.map +1 -1
  127. package/dist/country.js +2 -2
  128. package/dist/currency.js +1 -1
  129. package/dist/data-grid-template.js +1 -1
  130. package/dist/data-grid.js +947 -885
  131. package/dist/data-grid.js.map +1 -1
  132. package/dist/date-picker.js +8 -8
  133. package/dist/date-range-picker.js +2 -2
  134. package/dist/date.js +1 -1
  135. package/dist/divider.js +1 -1
  136. package/dist/dropdown.js +7 -7
  137. package/dist/empty-state.js +3 -3
  138. package/dist/filter-bar.js +1115 -955
  139. package/dist/filter-bar.js.map +1 -1
  140. package/dist/focus-trap.js +1 -1
  141. package/dist/form-layout.js +15 -14
  142. package/dist/form-layout.js.map +1 -1
  143. package/dist/header.js +4 -4
  144. package/dist/index.js +177 -169
  145. package/dist/index.js.map +1 -1
  146. package/dist/info-icon.js +3 -3
  147. package/dist/input-field.js +31 -29
  148. package/dist/input-field.js.map +1 -1
  149. package/dist/internal.js +31 -78
  150. package/dist/internal.js.map +1 -1
  151. package/dist/link.js +1 -1
  152. package/dist/loading-indicator.js +1 -1
  153. package/dist/menu.js +1 -1
  154. package/dist/modal-fullscreen.js +6 -6
  155. package/dist/modal.js +6 -6
  156. package/dist/pagination.js +4 -4
  157. package/dist/payment-method.js +1 -1
  158. package/dist/popover.js +1 -1
  159. package/dist/popper-container.js +1 -1
  160. package/dist/radio-group.js +62 -62
  161. package/dist/radio-group.js.map +1 -1
  162. package/dist/search-bar.js +2 -2
  163. package/dist/secondary-nav.js +2 -2
  164. package/dist/segmented-control.js +2 -2
  165. package/dist/selection-card.js +4 -4
  166. package/dist/sidepanel.js +52 -50
  167. package/dist/sidepanel.js.map +1 -1
  168. package/dist/status.js +2 -2
  169. package/dist/stepper.js +3 -3
  170. package/dist/structured-list.js +1 -1
  171. package/dist/summary-grid.js +3 -3
  172. package/dist/tabs.js +52 -52
  173. package/dist/tabs.js.map +1 -1
  174. package/dist/tag.js +3 -3
  175. package/dist/textarea.js +4 -4
  176. package/dist/timeline.js +7 -7
  177. package/dist/toast.js +4 -4
  178. package/dist/toggle.js +2 -2
  179. package/dist/tutorial.js +88 -67
  180. package/dist/tutorial.js.map +1 -1
  181. package/dist/typography.js +1 -1
  182. package/dist/web-types.json +550 -266
  183. package/package.json +3 -2
  184. package/dist/chunks/dialog-page.75b295b7.js +0 -133
  185. package/dist/chunks/dialog-page.75b295b7.js.map +0 -1
  186. package/dist/chunks/dropdown.669b858b.js +0 -797
  187. package/dist/chunks/dropdown.669b858b.js.map +0 -1
  188. package/dist/chunks/index.87180cdd.js.map +0 -1
  189. package/dist/chunks/index.ba6c1040.js.map +0 -1
  190. package/dist/chunks/listbox.e6e1bc90.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,133 +1,140 @@
1
1
  import "./chunks/index.4c062058.js";
2
- import { t as c, c as x } from "./chunks/use-bento-toast-controller.7d4436ad.js";
3
- import { u as P } from "./chunks/use-bento-toast-controller.7d4436ad.js";
4
- import { BentoAccordion as w, BentoAccordionItem as G } from "./accordion.js";
5
- import { BentoActionBar as k } from "./action-bar.js";
6
- import { BentoAlert as O, BentoAlertEvent as R, BentoAlertTypeOption as j, BentoAlertVariant as z } from "./alert.js";
7
- import { a as K, b as U, B as Z } from "./chunks/button.6e6324f0.js";
2
+ import { t as f, c } from "./chunks/use-bento-toast-controller.c3277f73.js";
3
+ import { u as P } from "./chunks/use-bento-toast-controller.c3277f73.js";
4
+ import { BentoAccordion as k, BentoAccordionItem as w } from "./accordion.js";
5
+ import { BentoActionBar as M } from "./action-bar.js";
6
+ import { BentoAlert as O, BentoAlertEvent as R, BentoAlertTypeOption as z, BentoAlertVariant as j } from "./alert.js";
7
+ import { a as K, b as U, B as Z } from "./chunks/button.9d6435ae.js";
8
8
  import { BentoColumnOverflow as Y, BentoDataGrid as H, BentoDatagridAriaSortValue as _, BentoDatagridEvent as q, BentoDatagridSortDirection as J, BentoDatagridStyleState as Q } from "./data-grid.js";
9
9
  import { BentoCard as $, BentoCardBackground as ee, BentoCardTitleSize as te } from "./card.js";
10
- import { BentoDatePicker as re, BentoDatePickerEvent as ne } from "./date-picker.js";
11
- import { B as Be, a as ie } from "./chunks/index.73abb1a9.js";
12
- import { B as pe, a as se, u as ue } from "./chunks/dropdown.669b858b.js";
13
- import { B as de, a as fe } from "./chunks/checkbox.f38276e6.js";
10
+ import { BentoDatePicker as ne, BentoDatePickerEvent as re } from "./date-picker.js";
11
+ import { B as Be, a as ie } from "./chunks/index.8b8c3b16.js";
12
+ import { B as se, a as pe, u as ue } from "./chunks/dropdown.10c034aa.js";
13
+ import { B as de, a as fe } from "./chunks/checkbox.bfed007c.js";
14
14
  import { BentoClickOutside as xe } from "./click-outside.js";
15
- import { BentoCodeSnippet as Se, BentoCodeSnippetEvent as ge, BentoCodeSnippetSupportedLanguage as Te, BentoCodeSnippetVariant as Ce } from "./code-snippet.js";
16
- import { BentoCountry as be } from "./country.js";
17
- import { c as Ee, B as Ie, a as he, u as Fe, b as Le } from "./chunks/country.types.002caff2.js";
18
- import { BentoCurrency as Ve, BentoCurrencyISOCode as we } from "./currency.js";
19
- import { B as Me, a as ke } from "./chunks/index.03ae22b4.js";
20
- import { B as Oe } from "./chunks/index.f19887a1.js";
21
- import { BentoEmptyState as je, BentoEmptyStateImage as ze, BentoEmptyStateImageVariant as Ne, BentoEmptyStateVariant as Ke } from "./empty-state.js";
15
+ import { BentoCodeSnippet as ge, BentoCodeSnippetEvent as Se, BentoCodeSnippetSupportedLanguage as Ce, BentoCodeSnippetVariant as Te } from "./code-snippet.js";
16
+ import { BentoCountry as De } from "./country.js";
17
+ import { c as he, B as Ee, a as Ie, u as Fe, b as Le } from "./chunks/country.types.002caff2.js";
18
+ import { BentoCurrency as Ve, BentoCurrencyISOCode as ke } from "./currency.js";
19
+ import { B as Ge, a as Me } from "./chunks/index.b21197ca.js";
20
+ import { B as Oe } from "./chunks/index.885d05a9.js";
21
+ import { BentoEmptyState as ze, BentoEmptyStateImage as je, BentoEmptyStateImageVariant as Ne, BentoEmptyStateVariant as Ke } from "./empty-state.js";
22
22
  import { BentoFilterBar as Ze, BentoFilterBarEvent as We, BentoFilterEvent as Ye, BentoFilterItemType as He } from "./filter-bar.js";
23
23
  import { BentoFormLayout as qe, BentoFormLayoutFieldTip as Je, BentoFormLayoutGroup as Qe, BentoFormLayoutTitle as Xe } from "./form-layout.js";
24
24
  import { BentoImage as et, BentoImageAspectRatio as tt, BentoImageObjectFit as ot } from "./image.js";
25
- import { BentoInfoIcon as nt } from "./info-icon.js";
26
- import { BentoInputField as Bt, BentoInputFieldElementPosition as it, BentoInputFieldEvent as mt, BentoInputFieldStateClass as pt, BentoInputFieldType as st, BentoInputFieldVariant as ut } from "./input-field.js";
25
+ import { BentoInfoIcon as rt } from "./info-icon.js";
26
+ import { BentoInputField as Bt, BentoInputFieldElementPosition as it, BentoInputFieldEvent as mt, BentoInputFieldStateClass as st, BentoInputFieldType as pt, BentoInputFieldVariant as ut } from "./input-field.js";
27
27
  import { BentoLoadingIndicator as dt, BentoLoadingIndicatorEvent as ft } from "./loading-indicator.js";
28
- import { B as xt, a as yt } from "./chunks/index.8e6bc325.js";
29
- import { B as gt, a as Tt } from "./chunks/index.87180cdd.js";
30
- import { d as vt, f as bt, g as Dt, B as Et, e as It, c as ht, a as Ft, b as Lt } from "./chunks/base-modal.aa09a60c.js";
28
+ import { B as xt, a as yt } from "./chunks/index.317fca12.js";
29
+ import { B as St, a as Ct } from "./chunks/index.1ea85d4a.js";
30
+ import { d as vt, f as Dt, g as bt, B as ht, e as Et, c as It, a as Ft, b as Lt } from "./chunks/base-modal.1fff7abe.js";
31
31
  import { BentoModal as Vt } from "./modal.js";
32
- import { BentoModalFullscreen as Gt, BentoModalFullscreenPage as Mt } from "./modal-fullscreen.js";
32
+ import { BentoModalFullscreen as wt, BentoModalFullscreenPage as Gt } from "./modal-fullscreen.js";
33
33
  import { BentoHeader as At } from "./header.js";
34
34
  import { BentoPagination as Rt } from "./pagination.js";
35
- import { B as zt } from "./chunks/payment-method.faa302de.js";
35
+ import { B as jt } from "./chunks/payment-method.6c1ce07c.js";
36
36
  import { BentoPaymentMethodType as Kt } from "./payment-method.js";
37
- import { a as Zt, B as Wt } from "./chunks/index.5d5f2200.js";
37
+ import { a as Zt, B as Wt } from "./chunks/index.15b088b9.js";
38
38
  import { BentoRadioButton as Ht, BentoRadioGroup as _t, BentoRadioGroupVariant as qt } from "./radio-group.js";
39
39
  import { BentoSearchBar as Qt, BentoSearchBarEvent as Xt, BentoSearchBarInternalEvent as $t } from "./search-bar.js";
40
40
  import { BentoSecondaryNav as to } from "./secondary-nav.js";
41
- import { BentoSelectionCard as ro, BentoSelectionCardGroup as no, BentoSelectionCardState as ao } from "./selection-card.js";
41
+ import { BentoSelectionCard as no, BentoSelectionCardGroup as ro, BentoSelectionCardState as ao } from "./selection-card.js";
42
42
  import { BentoSegmentedControl as io, BentoSegmentedControlEvent as mo } from "./segmented-control.js";
43
- import { BentoSidepanel as so, BentoSidepanelEvent as uo, BentoSidepanelPage as lo } from "./sidepanel.js";
43
+ import { BentoSidepanel as po, BentoSidepanelEvent as uo, BentoSidepanelPage as lo } from "./sidepanel.js";
44
44
  import { BentoStatus as co, BentoStatusVariant as xo } from "./status.js";
45
- import { BentoStep as So, BentoStepper as go, BentoStepperTypeOption as To, BentoStepperVariantOption as Co } from "./stepper.js";
46
- import { B as bo, a as Do } from "./chunks/index.ff09389c.js";
47
- import { BentoSummaryGrid as Io, BentoSummaryGridItemAmount as ho, BentoSummaryGridItemCustom as Fo, BentoSummaryGridItemNumeric as Lo, BentoSummaryGridItemPercentage as Po, BentoSummaryGridItemSize as Vo, BentoSummaryGridItemText as wo, BentoSummaryGridItemTrendDirection as Go } from "./summary-grid.js";
48
- import { BentoTab as ko, BentoTabs as Ao } from "./tabs.js";
49
- import { BentoTag as Ro, BentoTagVariant as jo } from "./tag.js";
45
+ import { BentoStep as go, BentoStepper as So, BentoStepperTypeOption as Co, BentoStepperVariantOption as To } from "./stepper.js";
46
+ import { B as Do, a as bo } from "./chunks/index.aaf965f8.js";
47
+ import { BentoSummaryGrid as Eo, BentoSummaryGridItemAmount as Io, BentoSummaryGridItemCustom as Fo, BentoSummaryGridItemNumeric as Lo, BentoSummaryGridItemPercentage as Po, BentoSummaryGridItemSize as Vo, BentoSummaryGridItemText as ko, BentoSummaryGridItemTrendDirection as wo } from "./summary-grid.js";
48
+ import { BentoTab as Mo, BentoTabs as Ao } from "./tabs.js";
49
+ import { BentoTag as Ro, BentoTagVariant as zo } from "./tag.js";
50
50
  import { BentoTextarea as No } from "./textarea.js";
51
51
  import { BentoTimeline as Uo, BentoTimelineGapUnit as Zo, BentoTimelineItem as Wo, BentoTimelineItemVariant as Yo, BentoTimelineShowMorePlacement as Ho, BentoTimelineStatus as _o } from "./timeline.js";
52
52
  import { BentoToast as Jo } from "./toast.js";
53
- import { BentoToggle as Xo, BentoToggleLabelPosition as $o, BentoTogglePropClass as er } from "./toggle.js";
54
- import { BentoTutorial as or } from "./tutorial.js";
55
- import { B as nr, c as ar, b as Br, a as ir } from "./chunks/index.ba6c1040.js";
56
- import { BentoDataGridTemplate as pr } from "./data-grid-template.js";
57
- import { B as ur, c as lr, a as dr, b as fr } from "./chunks/button-actions.239456cb.js";
58
- import { B as xr, a as yr } from "./chunks/loading-button.84a5529d.js";
59
- import { BentoToggleButton as gr } from "./button.js";
60
- import { b as Cr, b as vr } from "./chunks/calendar.1e416969.js";
61
- import { b as Dr, a as Er, b as Ir, a as hr } from "./chunks/listbox.e6e1bc90.js";
62
- import { BentoDropdownAvatar as Lr, BentoDropdownCountry as Pr, BentoDropdownCurrency as Vr, BentoDropdownPaymentMethod as wr, BentoDropdownTag as Gr } from "./dropdown.js";
63
- import { C as kr } from "./chunks/checkbox-input.1c3cc8ed.js";
64
- import { BentoCheckboxGroup as Or, BentoCheckboxGroupVariant as Rr } from "./checkbox.js";
65
- import { R as zr } from "./chunks/radio-input.c6550a9c.js";
66
- import { shallowRef as y, ref as p } from "vue";
67
- import * as r from "zod";
68
- import { D as Kr } from "./chunks/date-input.9186a0bf.js";
69
- import { a as Zr, B as Wr } from "./chunks/keyboard-navigation.ca47dfa8.js";
70
- import { B as Hr } from "./chunks/dropdown-default-textbox.c1f8fe5f.js";
71
- import { b as qr, B as Jr, a as Qr } from "./chunks/tooltip.8e9d733c.js";
72
- function E(t) {
73
- return t;
53
+ import { BentoToggle as Xo, BentoToggleLabelPosition as $o, BentoTogglePropClass as en } from "./toggle.js";
54
+ import { BentoTutorial as on } from "./tutorial.js";
55
+ import { B as rn, c as an, b as Bn, a as mn } from "./chunks/index.dd30e538.js";
56
+ import { BentoDataGridTemplate as pn } from "./data-grid-template.js";
57
+ import { B as ln, c as dn, a as fn, b as cn } from "./chunks/button-actions.81db18e8.js";
58
+ import { B as yn, a as gn } from "./chunks/loading-button.eafc9e1b.js";
59
+ import { BentoToggleButton as Cn } from "./button.js";
60
+ import { b as vn, b as Dn } from "./chunks/calendar.640b8d25.js";
61
+ import { c as hn, b as En, c as In, b as Fn } from "./chunks/use-cached-selected-values.69297473.js";
62
+ import { BentoDropdownAvatar as Pn, BentoDropdownCountry as Vn, BentoDropdownCurrency as kn, BentoDropdownPaymentMethod as wn, BentoDropdownTag as Gn } from "./dropdown.js";
63
+ import { C as An } from "./chunks/checkbox-input.1c3cc8ed.js";
64
+ import { BentoCheckboxGroup as Rn, BentoCheckboxGroupVariant as zn } from "./checkbox.js";
65
+ import { R as Nn } from "./chunks/radio-input.c6550a9c.js";
66
+ import { shallowRef as x, ref as p } from "vue";
67
+ import * as n from "zod";
68
+ import { u as Un } from "./chunks/use-click-outside.941d1600.js";
69
+ import { D as Wn } from "./chunks/date-input.9186a0bf.js";
70
+ import { a as Hn, B as _n } from "./chunks/keyboard-navigation.ca47dfa8.js";
71
+ import { B as Jn } from "./chunks/dropdown-default-textbox.54ca1b18.js";
72
+ import { b as Xn, B as $n, a as er } from "./chunks/tooltip.58ef3f4a.js";
73
+ function h(e) {
74
+ return e;
74
75
  }
75
- function a(t) {
76
- if (r && t instanceof r.ZodObject)
76
+ function i(e) {
77
+ if (n && e instanceof n.ZodObject)
77
78
  return Object.fromEntries(
78
- Object.entries(t.shape).map(([e, o]) => r && o instanceof r.ZodDefault ? [e, o._def.defaultValue()] : r && o instanceof r.ZodObject ? [e, a(o)] : [e, void 0])
79
+ Object.entries(e.shape).map(([t, o]) => n && o instanceof n.ZodDefault ? [t, o._def.defaultValue()] : n && o instanceof n.ZodObject ? [t, i(o)] : [t, void 0])
79
80
  );
80
81
  }
81
- function I({ validationSchema: t }) {
82
- const e = y({}), o = p({}), n = p(a(t)), B = () => {
83
- e.value = {}, o.value = {};
84
- }, u = () => {
85
- B(), n.value = a(t);
82
+ function y(e) {
83
+ return e.path.join(".");
84
+ }
85
+ function E({ validationSchema: e }) {
86
+ const t = x({}), o = p({}), a = p(i(e)), m = () => {
87
+ t.value = {}, o.value = {};
88
+ }, l = () => {
89
+ m(), a.value = i(e);
86
90
  };
87
91
  return {
88
92
  // Values
89
93
  errorBag: o,
90
- errors: e,
91
- values: n,
94
+ errors: t,
95
+ values: a,
92
96
  // Methods
93
- handleReset: () => u(),
94
- submitForm: (l) => () => {
95
- B();
96
- const i = t.safeParse(n.value);
97
- i.success ? l(n.value) : (o.value = i.error.flatten().fieldErrors, e.value = Object.entries(o.value).reduce((m, [d, f]) => (m[d] = f[0], m), {}));
97
+ handleReset: () => l(),
98
+ submitForm: (d) => () => {
99
+ m();
100
+ const s = e.safeParse(a.value);
101
+ s.success ? d(a.value) : s.error.issues.forEach((B) => {
102
+ const r = y(B);
103
+ t.value[r] || (t.value[r] = B.message), o.value[r] ? o.value[r].push(B.message) : o.value[r] = [B.message];
104
+ });
98
105
  }
99
106
  };
100
107
  }
101
- const S = (t) => {
102
- t.prototype[c] = x();
108
+ const g = (e) => {
109
+ e.prototype[f] = c();
103
110
  };
104
- var g = /* @__PURE__ */ ((t) => (t.LEGACY = "b-legacy-theme", t.STYLEGUIDE = "b-styleguide-theme", t.BENTO = "", t))(g || {});
105
- const s = (t) => {
106
- document.body.classList.add(t);
107
- }, T = {
108
- install: async (t, e) => {
109
- e != null && e.withToast && S(t), (e == null ? void 0 : e.theme) === "b-legacy-theme" ? (s(
111
+ var S = /* @__PURE__ */ ((e) => (e.LEGACY = "b-legacy-theme", e.STYLEGUIDE = "b-styleguide-theme", e.BENTO = "", e))(S || {});
112
+ const u = (e) => {
113
+ document.body.classList.add(e);
114
+ }, C = {
115
+ install: async (e, t) => {
116
+ t != null && t.withToast && g(e), (t == null ? void 0 : t.theme) === "b-legacy-theme" ? (u(
110
117
  "b-legacy-theme"
111
118
  /* LEGACY */
112
- ), await import("@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css?used")) : (e == null ? void 0 : e.theme) === "b-styleguide-theme" ? (s(
119
+ ), await import("@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css?used")) : (t == null ? void 0 : t.theme) === "b-styleguide-theme" ? (u(
113
120
  "b-styleguide-theme"
114
121
  /* STYLEGUIDE */
115
- ), await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css?used")) : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css?used"), e != null && e.withUtilityClasses && await import("@adyen/bento-design-tokens/dist/css/bento/utility.css?used");
122
+ ), await import("@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css?used")) : await import("@adyen/bento-design-tokens/dist/css/bento/variables.css?used"), t != null && t.withUtilityClasses && await import("@adyen/bento-design-tokens/dist/css/bento/utility.css?used");
116
123
  }
117
- }, h = T;
124
+ }, I = C;
118
125
  export {
119
- w as BentoAccordion,
120
- G as BentoAccordionItem,
121
- k as BentoActionBar,
126
+ k as BentoAccordion,
127
+ w as BentoAccordionItem,
128
+ M as BentoActionBar,
122
129
  O as BentoAlert,
123
130
  R as BentoAlertEvent,
124
- j as BentoAlertTypeOption,
125
- z as BentoAlertVariant,
131
+ z as BentoAlertTypeOption,
132
+ j as BentoAlertVariant,
126
133
  K as BentoButton,
127
- ur as BentoButtonActions,
128
- lr as BentoButtonActionsLayout,
129
- dr as BentoButtonActionsLayoutBasic,
130
- fr as BentoButtonActionsLayoutExtended,
134
+ ln as BentoButtonActions,
135
+ dn as BentoButtonActionsLayout,
136
+ fn as BentoButtonActionsLayoutBasic,
137
+ cn as BentoButtonActionsLayoutExtended,
131
138
  U as BentoButtonPropClass,
132
139
  Z as BentoButtonVariant,
133
140
  $ as BentoCard,
@@ -135,47 +142,47 @@ export {
135
142
  te as BentoCardTitleSize,
136
143
  de as BentoCheckbox,
137
144
  fe as BentoCheckboxEvent,
138
- Or as BentoCheckboxGroup,
139
- Rr as BentoCheckboxGroupVariant,
140
- kr as BentoCheckboxState,
145
+ Rn as BentoCheckboxGroup,
146
+ zn as BentoCheckboxGroupVariant,
147
+ An as BentoCheckboxState,
141
148
  xe as BentoClickOutside,
142
- Hr as BentoClickOutsideDirective,
143
- Se as BentoCodeSnippet,
144
- ge as BentoCodeSnippetEvent,
145
- Te as BentoCodeSnippetSupportedLanguage,
146
- Ce as BentoCodeSnippetVariant,
149
+ Jn as BentoClickOutsideDirective,
150
+ ge as BentoCodeSnippet,
151
+ Se as BentoCodeSnippetEvent,
152
+ Ce as BentoCodeSnippetSupportedLanguage,
153
+ Te as BentoCodeSnippetVariant,
147
154
  Y as BentoColumnOverflow,
148
- be as BentoCountry,
149
- Ee as BentoCountryCode,
150
- Ie as BentoCountryVariant,
155
+ De as BentoCountry,
156
+ he as BentoCountryCode,
157
+ Ee as BentoCountryVariant,
151
158
  Ve as BentoCurrency,
152
- we as BentoCurrencyISOCode,
159
+ ke as BentoCurrencyISOCode,
153
160
  H as BentoDataGrid,
154
- pr as BentoDataGridTemplate,
161
+ pn as BentoDataGridTemplate,
155
162
  _ as BentoDatagridAriaSortValue,
156
163
  q as BentoDatagridEvent,
157
164
  J as BentoDatagridSortDirection,
158
165
  Q as BentoDatagridStyleState,
159
- Me as BentoDate,
160
- ke as BentoDateFormat,
161
- re as BentoDatePicker,
162
- ne as BentoDatePickerEvent,
163
- Cr as BentoDatePickerFirstDayOfWeek,
166
+ Ge as BentoDate,
167
+ Me as BentoDateFormat,
168
+ ne as BentoDatePicker,
169
+ re as BentoDatePickerEvent,
170
+ vn as BentoDatePickerFirstDayOfWeek,
164
171
  Be as BentoDateRangePicker,
165
172
  ie as BentoDateRangePickerEvent,
166
- vr as BentoDateRangePickerFirstDayOfWeek,
173
+ Dn as BentoDateRangePickerFirstDayOfWeek,
167
174
  Oe as BentoDivider,
168
- pe as BentoDropdown,
169
- Lr as BentoDropdownAvatar,
170
- Pr as BentoDropdownCountry,
171
- Vr as BentoDropdownCurrency,
172
- Dr as BentoDropdownEvent,
173
- Er as BentoDropdownLazyLoadType,
174
- wr as BentoDropdownPaymentMethod,
175
- se as BentoDropdownSize,
176
- Gr as BentoDropdownTag,
177
- je as BentoEmptyState,
178
- ze as BentoEmptyStateImage,
175
+ se as BentoDropdown,
176
+ Pn as BentoDropdownAvatar,
177
+ Vn as BentoDropdownCountry,
178
+ kn as BentoDropdownCurrency,
179
+ hn as BentoDropdownEvent,
180
+ En as BentoDropdownLazyLoadType,
181
+ wn as BentoDropdownPaymentMethod,
182
+ pe as BentoDropdownSize,
183
+ Gn as BentoDropdownTag,
184
+ ze as BentoEmptyState,
185
+ je as BentoEmptyStateImage,
179
186
  Ne as BentoEmptyStateImageVariant,
180
187
  Ke as BentoEmptyStateVariant,
181
188
  Ze as BentoFilterBar,
@@ -190,43 +197,43 @@ export {
190
197
  et as BentoImage,
191
198
  tt as BentoImageAspectRatio,
192
199
  ot as BentoImageObjectFit,
193
- nt as BentoInfoIcon,
200
+ rt as BentoInfoIcon,
194
201
  Bt as BentoInputField,
195
202
  it as BentoInputFieldElementPosition,
196
203
  mt as BentoInputFieldEvent,
197
- pt as BentoInputFieldStateClass,
198
- st as BentoInputFieldType,
204
+ st as BentoInputFieldStateClass,
205
+ pt as BentoInputFieldType,
199
206
  ut as BentoInputFieldVariant,
200
- Zr as BentoKeyboardNavigationDirective,
201
- Wr as BentoKeyboardNavigationKeyDownEvent,
207
+ Hn as BentoKeyboardNavigationDirective,
208
+ _n as BentoKeyboardNavigationKeyDownEvent,
202
209
  xt as BentoLink,
203
210
  yt as BentoLinkVariant,
204
- Ir as BentoListboxEvent,
205
- hr as BentoListboxLazyLoadType,
206
- xr as BentoLoadingButton,
207
- yr as BentoLoadingButtonState,
211
+ In as BentoListboxEvent,
212
+ Fn as BentoListboxLazyLoadType,
213
+ yn as BentoLoadingButton,
214
+ gn as BentoLoadingButtonState,
208
215
  dt as BentoLoadingIndicator,
209
216
  ft as BentoLoadingIndicatorEvent,
210
- gt as BentoMenu,
211
- Tt as BentoMenuEvent,
217
+ St as BentoMenu,
218
+ Ct as BentoMenuEvent,
212
219
  Vt as BentoModal,
213
220
  vt as BentoModalColumnLayoutVariant,
214
- bt as BentoModalDialogType,
215
- Dt as BentoModalEvent,
216
- Gt as BentoModalFullscreen,
217
- Mt as BentoModalFullscreenPage,
218
- Et as BentoModalPage,
219
- It as BentoModalRole,
220
- ht as BentoModalSize,
221
+ Dt as BentoModalDialogType,
222
+ bt as BentoModalEvent,
223
+ wt as BentoModalFullscreen,
224
+ Gt as BentoModalFullscreenPage,
225
+ ht as BentoModalPage,
226
+ Et as BentoModalRole,
227
+ It as BentoModalSize,
221
228
  Ft as BentoModalVariant,
222
229
  Lt as BentoModalVariantMapping,
223
230
  Rt as BentoPagination,
224
- zt as BentoPaymentMethod,
231
+ jt as BentoPaymentMethod,
225
232
  Kt as BentoPaymentMethodType,
226
233
  Zt as BentoPopover,
227
234
  Wt as BentoPopoverPositions,
228
235
  Ht as BentoRadioButton,
229
- zr as BentoRadioButtonStateClass,
236
+ Nn as BentoRadioButtonStateClass,
230
237
  _t as BentoRadioGroup,
231
238
  qt as BentoRadioGroupVariant,
232
239
  Qt as BentoSearchBar,
@@ -235,34 +242,34 @@ export {
235
242
  to as BentoSecondaryNav,
236
243
  io as BentoSegmentedControl,
237
244
  mo as BentoSegmentedControlEvent,
238
- ro as BentoSelectionCard,
239
- no as BentoSelectionCardGroup,
245
+ no as BentoSelectionCard,
246
+ ro as BentoSelectionCardGroup,
240
247
  ao as BentoSelectionCardState,
241
- so as BentoSidepanel,
248
+ po as BentoSidepanel,
242
249
  uo as BentoSidepanelEvent,
243
250
  lo as BentoSidepanelPage,
244
251
  co as BentoStatus,
245
252
  xo as BentoStatusVariant,
246
- So as BentoStep,
247
- go as BentoStepper,
248
- To as BentoStepperTypeOption,
249
- Co as BentoStepperVariantOption,
250
- bo as BentoStructuredList,
251
- Do as BentoStructuredListItem,
252
- Io as BentoSummaryGrid,
253
- ho as BentoSummaryGridItemAmount,
253
+ go as BentoStep,
254
+ So as BentoStepper,
255
+ Co as BentoStepperTypeOption,
256
+ To as BentoStepperVariantOption,
257
+ Do as BentoStructuredList,
258
+ bo as BentoStructuredListItem,
259
+ Eo as BentoSummaryGrid,
260
+ Io as BentoSummaryGridItemAmount,
254
261
  Fo as BentoSummaryGridItemCustom,
255
262
  Lo as BentoSummaryGridItemNumeric,
256
263
  Po as BentoSummaryGridItemPercentage,
257
264
  Vo as BentoSummaryGridItemSize,
258
- wo as BentoSummaryGridItemText,
259
- Go as BentoSummaryGridItemTrendDirection,
260
- ko as BentoTab,
265
+ ko as BentoSummaryGridItemText,
266
+ wo as BentoSummaryGridItemTrendDirection,
267
+ Mo as BentoTab,
261
268
  Ao as BentoTabs,
262
269
  Ro as BentoTag,
263
- jo as BentoTagVariant,
270
+ zo as BentoTagVariant,
264
271
  No as BentoTextarea,
265
- g as BentoTheme,
272
+ S as BentoTheme,
266
273
  Uo as BentoTimeline,
267
274
  Zo as BentoTimelineGapUnit,
268
275
  Wo as BentoTimelineItem,
@@ -271,25 +278,26 @@ export {
271
278
  _o as BentoTimelineStatus,
272
279
  Jo as BentoToast,
273
280
  Xo as BentoToggle,
274
- gr as BentoToggleButton,
281
+ Cn as BentoToggleButton,
275
282
  $o as BentoToggleLabelPosition,
276
- er as BentoTogglePropClass,
277
- qr as BentoTooltipDirective,
278
- Jr as BentoTooltipPosition,
279
- Qr as BentoTooltipState,
280
- or as BentoTutorial,
281
- nr as BentoTypography,
282
- ar as BentoTypographyElement,
283
- Br as BentoTypographyModifier,
284
- ir as BentoTypographyVariant,
285
- Kr as DateFormat,
286
- h as default,
287
- E as toTypedSchema,
283
+ en as BentoTogglePropClass,
284
+ Xn as BentoTooltipDirective,
285
+ $n as BentoTooltipPosition,
286
+ er as BentoTooltipState,
287
+ on as BentoTutorial,
288
+ rn as BentoTypography,
289
+ an as BentoTypographyElement,
290
+ Bn as BentoTypographyModifier,
291
+ mn as BentoTypographyVariant,
292
+ Wn as DateFormat,
293
+ I as default,
294
+ h as toTypedSchema,
288
295
  P as useBentoToastController,
289
- he as useCountryCapital,
296
+ Un as useClickOutside,
297
+ Ie as useCountryCapital,
290
298
  Fe as useCountryName,
291
299
  Le as useCountryPhoneCode,
292
- I as useForm,
300
+ E as useForm,
293
301
  ue as useSearchBarFilter
294
302
  };
295
303
  //# sourceMappingURL=index.js.map
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-toast-controller/install.ts","../src/install.ts"],"sourcesContent":["import { Ref, ref, 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 * 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>({ validationSchema }: UseForm<T>) {\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values = ref(getInitialFormValues(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 errorBag.value = (validSchema as z.SafeParseError<T>).error.flatten().fieldErrors;\n errors.value = Object.entries(errorBag.value).reduce((acc, [key, value]) => {\n // eslint-disable-next-line prefer-destructuring\n acc[key] = value[0];\n return acc;\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 { 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 { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n BENTO = '',\n}\n\ninterface BentoVuePlugin {\n theme: BentoTheme;\n withToast: boolean;\n}\n\nconst setTheme = (theme: BentoTheme) => {\n document.body.classList.add(theme);\n};\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n install: async (Vue, options: { theme: BentoTheme; withToast: boolean; withUtilityClasses: boolean }) => {\n if (options?.withToast) {\n installToast(Vue);\n }\n // Make sure to put all awaited CSS imports below this point and not above!\n if (options?.theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (options?.theme === BentoTheme.STYLEGUIDE) {\n setTheme(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 (options?.withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n },\n};\n\nexport default plugin;\n"],"names":["toTypedSchema","formSchema","getInitialFormValues","schema","z","key","value","useForm","validationSchema","errors","shallowRef","errorBag","ref","values","cleanErrors","resetForm","validSchema","submitted","acc","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","setTheme","theme","plugin","options","BentoVue"],"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,aAAc,CAAA,IAGpCF,KAAKE,aAAiBF,EAAE,YACnB,CAACC,GAAKH,EAAqBI,CAAK,CAAC,IAGrC,CAACD,GAAK,MAAS,CACzB;AAAA,IAAA;AAKb;AA2CgB,SAAAE,EAA6B,EAAE,kBAAAC,KAAgC;AACrE,QAAAC,IAASC,EAA6C,CAAA,CAAE,GAExDC,IAA4DC,EAAI,CAAA,CAAE,GAClEC,IAASD,EAAIV,EAAqBM,CAAgB,CAAC,GAEnDM,IAAc,MAAM;AACtB,IAAAL,EAAO,QAAQ,IACfE,EAAS,QAAQ;EAAC,GAGhBI,IAAY,MAAM;AACR,IAAAD,KACLD,EAAA,QAAQX,EAAwBM,CAAgB;AAAA,EAAA;AAsBpD,SAAA;AAAA;AAAA,IAEH,UAAAG;AAAA,IACA,QAAAF;AAAA,IACA,QAAAI;AAAA;AAAA,IAGA,aAAa,MAAME,EAAU;AAAA,IAC7B,YA3Be,OAAa,MAAM;AACtB,MAAAD;AAGZ,YAAME,IAAcR,EAAiB,UAAUK,EAAO,KAAK;AAGvD,MAACG,EAAY,UAQbC,EAAUJ,EAAO,KAAK,KAPtBF,EAAS,QAASK,EAAoC,MAAM,QAAA,EAAU,aACtEP,EAAO,QAAQ,OAAO,QAAQE,EAAS,KAAK,EAAE,OAAO,CAACO,GAAK,CAACb,GAAKC,CAAK,OAE9DY,EAAAb,CAAG,IAAIC,EAAM,CAAC,GACXY,IACR,CAAE,CAAA;AAAA,IAGT;AAAA,EAWA;AAER;AChJA,MAAeC,IAAA,CAAOC,MAAA;AAIb,EAAAA,EAAoB,UAAUC,CAAsB,IAAIC,EAAiB;AAIlF;ACZY,IAAAC,sBAAAA,OACRA,EAAA,SAAS,kBACTA,EAAA,aAAa,sBACbA,EAAA,QAAQ,IAHAA,IAAAA,KAAA,CAAA,CAAA;AAWZ,MAAMC,IAAW,CAACC,MAAsB;AAC3B,WAAA,KAAK,UAAU,IAAIA,CAAK;AACrC,GAEMC,IAAuC;AAAA,EACzC,SAAS,OAAON,GAAKO,MAAoF;AACrG,IAAIA,KAAA,QAAAA,EAAS,aACTR,EAAaC,CAAG,IAGhBO,KAAA,gBAAAA,EAAS,WAAU,oBACnBH;AAAA,MAAS;AAAA;AAAA,IAAiB,GAC1B,MAAM,OAAO,qEAAgE,MACtEG,KAAA,gBAAAA,EAAS,WAAU,wBAC1BH;AAAA,MAAS;AAAA;AAAA,IAAqB,GAC9B,MAAM,OAAO,yEAAoE,KAEjF,MAAM,OAAO,8DAAyD,GAGtEG,KAAA,QAAAA,EAAS,sBACT,MAAM,OAAO,4DAAuD;AAAA,EAE5E;AACJ,GAEAC,IAAeF;"}
1
+ {"version":3,"file":"index.js","sources":["../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-toast-controller/install.ts","../src/install.ts"],"sourcesContent":["import { Ref, ref, 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>({ validationSchema }: UseForm<T>) {\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(getInitialFormValues(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 { 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 { PluginObject } from 'vue';\nimport installToast from './composables/use-bento-toast-controller/install';\n\nexport enum BentoTheme {\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n BENTO = '',\n}\n\ninterface BentoVuePlugin {\n theme: BentoTheme;\n withToast: boolean;\n}\n\nconst setTheme = (theme: BentoTheme) => {\n document.body.classList.add(theme);\n};\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n install: async (Vue, options: { theme: BentoTheme; withToast: boolean; withUtilityClasses: boolean }) => {\n if (options?.withToast) {\n installToast(Vue);\n }\n // Make sure to put all awaited CSS imports below this point and not above!\n if (options?.theme === BentoTheme.LEGACY) {\n setTheme(BentoTheme.LEGACY);\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-legacy.css');\n } else if (options?.theme === BentoTheme.STYLEGUIDE) {\n setTheme(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 (options?.withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n },\n};\n\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","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","setTheme","theme","plugin","options","BentoVue"],"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,aAAc,CAAA,IAGpCF,KAAKE,aAAiBF,EAAE,YACnB,CAACC,GAAKH,EAAqBI,CAAK,CAAC,IAGrC,CAACD,GAAK,MAAS,CACzB;AAAA,IAAA;AAKb;AAOA,SAASE,EAAkBC,GAAmB;AACnC,SAAAA,EAAM,KAAK,KAAK,GAAG;AAC9B;AA2CgB,SAAAC,EAA6B,EAAE,kBAAAC,KAAgC;AAErE,QAAAC,IAASC,EAA6C,CAAA,CAAE,GAExDC,IAA4DC,EAAI,CAAA,CAAE,GAClEC,IAASD,EAAIZ,EAAqBQ,CAAgB,CAAC,GAEnDM,IAAc,MAAM;AACtB,IAAAL,EAAO,QAAQ,IACfE,EAAS,QAAQ;EAAC,GAGhBI,IAAY,MAAM;AACR,IAAAD,KACLD,EAAA,QAAQb,EAAwBQ,CAAgB;AAAA,EAAA;AA+BpD,SAAA;AAAA;AAAA,IAEH,UAAAG;AAAA,IACA,QAAAF;AAAA,IACA,QAAAI;AAAA;AAAA,IAGA,aAAa,MAAME,EAAU;AAAA,IAC7B,YApCe,OAAa,MAAM;AACtB,MAAAD;AAGZ,YAAME,IAAcR,EAAiB,UAAUK,EAAO,KAAK;AAGvD,MAACG,EAAY,UAiBbC,EAAUJ,EAAO,KAAK,IAhBrBG,EAAoC,MAAM,OAAO,QAAQ,CAASE,MAAA;AACzD,cAAAC,IAAOd,EAAkBa,CAAK;AAGpC,QAAKT,EAAO,MAAMU,CAAI,MACXV,EAAA,MAAMU,CAAI,IAAID,EAAM,UAI1BP,EAAS,MAAMQ,CAAI,IAGpBR,EAAS,MAAMQ,CAAI,EAAE,KAAKD,EAAM,OAAO,IAFvCP,EAAS,MAAMQ,CAAI,IAAI,CAACD,EAAM,OAAO;AAAA,MAGzC,CACH;AAAA,IAGL;AAAA,EAWA;AAER;ACnKA,MAAeE,IAAA,CAAOC,MAAA;AAIb,EAAAA,EAAoB,UAAUC,CAAsB,IAAIC,EAAiB;AAIlF;ACZY,IAAAC,sBAAAA,OACRA,EAAA,SAAS,kBACTA,EAAA,aAAa,sBACbA,EAAA,QAAQ,IAHAA,IAAAA,KAAA,CAAA,CAAA;AAWZ,MAAMC,IAAW,CAACC,MAAsB;AAC3B,WAAA,KAAK,UAAU,IAAIA,CAAK;AACrC,GAEMC,IAAuC;AAAA,EACzC,SAAS,OAAON,GAAKO,MAAoF;AACrG,IAAIA,KAAA,QAAAA,EAAS,aACTR,EAAaC,CAAG,IAGhBO,KAAA,gBAAAA,EAAS,WAAU,oBACnBH;AAAA,MAAS;AAAA;AAAA,IAAiB,GAC1B,MAAM,OAAO,qEAAgE,MACtEG,KAAA,gBAAAA,EAAS,WAAU,wBAC1BH;AAAA,MAAS;AAAA;AAAA,IAAqB,GAC9B,MAAM,OAAO,yEAAoE,KAEjF,MAAM,OAAO,8DAAyD,GAGtEG,KAAA,QAAAA,EAAS,sBACT,MAAM,OAAO,4DAAuD;AAAA,EAE5E;AACJ,GAEAC,IAAeF;"}
package/dist/info-icon.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as n } from "vue";
2
- import { c as i } from "./chunks/index.51308a21.js";
2
+ import { c as i } from "./chunks/index.671768a1.js";
3
3
  import { I as r } from "./chunks/info.8b6328aa.js";
4
- import { b as s } from "./chunks/tooltip.8e9d733c.js";
4
+ import { b as s } from "./chunks/tooltip.58ef3f4a.js";
5
5
  import { n as a } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
6
- import "./assets/index9.css";
6
+ import "./assets/index27.css";
7
7
  const p = n({
8
8
  name: "bento-info-icon",
9
9
  components: { InfoIcon: r },