@v-miniapp/ui-react 1.0.41 → 1.0.45

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 (137) hide show
  1. package/README.md +1 -1
  2. package/dist/external/index.js +1993 -2004
  3. package/dist/index.js +1011 -1022
  4. package/dist-storybook/assets/ANIMATION-CUdn1GTK.js +99 -0
  5. package/dist-storybook/assets/APP_FRAMEWORK-ljbIOHYd.js +197 -0
  6. package/dist-storybook/assets/BOTTOM_TAB_BAR-DxCwCfBK.js +175 -0
  7. package/dist-storybook/assets/CUSTOM_ERROR_BOUNDARY-B4wTQNZc.js +250 -0
  8. package/dist-storybook/assets/Color-AVL7NMMY-1_8XTICv.js +1 -0
  9. package/dist-storybook/assets/DARK_MODE-CoHseCDO.js +57 -0
  10. package/dist-storybook/assets/DocsRenderer-PQXLIZUC-BO86igwd.js +2 -0
  11. package/dist-storybook/assets/GETTING_STARTED-H_vVi5cv.js +77 -0
  12. package/dist-storybook/assets/INFINITE_SCROLL-BtM3uoX0.js +111 -0
  13. package/dist-storybook/assets/KEEP_ALIVE-CL2au0al.js +126 -0
  14. package/dist-storybook/assets/LOCALE-XTCey55y.js +465 -0
  15. package/dist-storybook/assets/MIGRATION_GUIDE-2LONslE4.js +449 -0
  16. package/dist-storybook/assets/MOBILE_BEHAVIOURS-DZ6alKTX.js +177 -0
  17. package/dist-storybook/assets/PAGE_LAYOUT-BuOpN-1Y.js +192 -0
  18. package/dist-storybook/assets/ROUTING_NAVIGATION-BCPHXNto.js +335 -0
  19. package/dist-storybook/assets/TAILWIND_INTEGRATION-_T-VfvkM.js +87 -0
  20. package/dist-storybook/assets/_setToString-CbM921C9.js +1 -0
  21. package/dist-storybook/assets/alert-DLW8CoyB.js +1 -0
  22. package/dist-storybook/assets/alert.stories-B-vuojPh.js +110 -0
  23. package/dist-storybook/assets/avatar-GxcYPA1p.js +1 -0
  24. package/dist-storybook/assets/avatar.stories-KYFztAc8.js +136 -0
  25. package/dist-storybook/assets/axe-CmvD4WV5.js +20 -0
  26. package/dist-storybook/assets/badge-D_LzMVtw.js +1 -0
  27. package/dist-storybook/assets/badge.stories-Be2ItCmQ.js +262 -0
  28. package/dist-storybook/assets/blocks-BuaOUtiH.js +1243 -0
  29. package/dist-storybook/assets/bottom-tab-bar-CtcTAxuI.js +115 -0
  30. package/dist-storybook/assets/bottom-tab-bar.stories-CDmEve6z.js +186 -0
  31. package/dist-storybook/assets/button-CL7GeC23.js +1 -0
  32. package/dist-storybook/assets/button.stories-CaqLWQiY.js +287 -0
  33. package/dist-storybook/assets/calendar-dOCsjhVU.js +1 -0
  34. package/dist-storybook/assets/calendar.stories-DLWZldet.js +189 -0
  35. package/dist-storybook/assets/carousel-1Kww3hIz.js +37 -0
  36. package/dist-storybook/assets/carousel.stories-B8YbGOOr.js +217 -0
  37. package/dist-storybook/assets/checkbox-MGytNNRt.js +1 -0
  38. package/dist-storybook/assets/checkbox.stories-CLvfZPiw.js +201 -0
  39. package/dist-storybook/assets/chip-kG4p82WT.js +247 -0
  40. package/dist-storybook/assets/chip.stories-BbwJb5eD.js +442 -0
  41. package/dist-storybook/assets/classname-CUR_zgkh.js +1 -0
  42. package/dist-storybook/assets/colors-_6nFGM3e.js +1 -0
  43. package/dist-storybook/assets/date-Cg-Uk_pp.js +1 -0
  44. package/dist-storybook/assets/date-field.stories-Diptwqfv.js +129 -0
  45. package/dist-storybook/assets/date-picker-Dnq_-0Md.js +1 -0
  46. package/dist-storybook/assets/date-picker.stories-BuGWvzFL.js +123 -0
  47. package/dist-storybook/assets/default-error-BcnD8fFO.png +0 -0
  48. package/dist-storybook/assets/dialog.stories-DJ0WsSkA.js +212 -0
  49. package/dist-storybook/assets/dropdown.stories-D6JUYP73.js +200 -0
  50. package/dist-storybook/assets/embla-carousel-react.esm-BYjpaHZ9.js +1 -0
  51. package/dist-storybook/assets/en-Cs9O0XWn.js +15 -0
  52. package/dist-storybook/assets/icon-DdQsMyRa.js +1 -0
  53. package/dist-storybook/assets/icon.stories-B-ZvRzFf.js +365 -0
  54. package/dist-storybook/assets/iframe-CQAwSt4E.js +1071 -0
  55. package/dist-storybook/assets/iframe-yMKl6hJA.css +1 -0
  56. package/dist-storybook/assets/image-C3EsNRhz.js +9 -0
  57. package/dist-storybook/assets/image.stories-C4l8D3ju.js +255 -0
  58. package/dist-storybook/assets/index-B-Ksafg0.js +1 -0
  59. package/dist-storybook/assets/index-BV0AJWP6.js +1 -0
  60. package/dist-storybook/assets/index-CgMRTj-o.js +1 -0
  61. package/dist-storybook/assets/index-DHiZ-gXR.js +1 -0
  62. package/dist-storybook/assets/input-wrapper-BKHgnPy6.js +1 -0
  63. package/dist-storybook/assets/label-DV2iCDmN.js +27 -0
  64. package/dist-storybook/assets/label.stories-BwTIPFXX.js +138 -0
  65. package/dist-storybook/assets/matchers-7Z3WT2CE-Dw4MQV_s.js +14 -0
  66. package/dist-storybook/assets/navigation-bar-vI-FPasP.js +79 -0
  67. package/dist-storybook/assets/navigation-bar.stories-DYuFaJFD.js +73 -0
  68. package/dist-storybook/assets/number-field-CXKmnfKe.js +1 -0
  69. package/dist-storybook/assets/number-field.stories--fn26TJu.js +167 -0
  70. package/dist-storybook/assets/omit-Bsx5nTI0.js +1 -0
  71. package/dist-storybook/assets/option-item-LRh_OyV4.js +1 -0
  72. package/dist-storybook/assets/option-item.stories-snjAvgay.js +66 -0
  73. package/dist-storybook/assets/pagination-DZHoBs_4.js +1 -0
  74. package/dist-storybook/assets/pagination.stories-BoEs0jzS.js +91 -0
  75. package/dist-storybook/assets/pick-BhmhLmLe.js +1 -0
  76. package/dist-storybook/assets/preload-helper-PPVm8Dsz.js +1 -0
  77. package/dist-storybook/assets/radio-B5NJxG_l.js +1 -0
  78. package/dist-storybook/assets/radio.stories-DuN-Awi_.js +183 -0
  79. package/dist-storybook/assets/rating-BdXViYBv.js +1 -0
  80. package/dist-storybook/assets/rating.stories-BCcQjMEx.js +117 -0
  81. package/dist-storybook/assets/react-18-CNyWQ7je.js +9 -0
  82. package/dist-storybook/assets/react-hufnxGVs.js +1 -0
  83. package/dist-storybook/assets/search-field-CQqgFbfg.js +1 -0
  84. package/dist-storybook/assets/search-field.stories-DiCZbhng.js +79 -0
  85. package/dist-storybook/assets/section-content-DGNB4eLN.js +1 -0
  86. package/dist-storybook/assets/section.stories-C2I_kKhu.js +69 -0
  87. package/dist-storybook/assets/sheet.stories-wk1JaKU5.js +152 -0
  88. package/dist-storybook/assets/skeleton-C91JgehG.js +1 -0
  89. package/dist-storybook/assets/skeleton.stories-BCmX-VNr.js +139 -0
  90. package/dist-storybook/assets/store-CPumdfcU.js +1 -0
  91. package/dist-storybook/assets/store-D2RudmNr.js +18 -0
  92. package/dist-storybook/assets/switch-p-aXI-ev.js +1 -0
  93. package/dist-storybook/assets/switch.stories-BqPLNKB9.js +250 -0
  94. package/dist-storybook/assets/tab-bar-CSeCmtIZ.js +31 -0
  95. package/dist-storybook/assets/tab-bar.stories-Cb6v8H2w.js +136 -0
  96. package/dist-storybook/assets/text-area-DwSXyqOe.js +1 -0
  97. package/dist-storybook/assets/text-area.stories-By8bCfgc.js +87 -0
  98. package/dist-storybook/assets/text-field-jK6rpOo2.js +1 -0
  99. package/dist-storybook/assets/text-field.stories-CrWBAhvI.js +92 -0
  100. package/dist-storybook/assets/toast-provider-DurnMJhd.js +9 -0
  101. package/dist-storybook/assets/toast.stories-iWAToAZA.js +201 -0
  102. package/dist-storybook/assets/tooltip-QDdel5My.js +1 -0
  103. package/dist-storybook/assets/tooltip.stories-RC6SuPPD.js +153 -0
  104. package/dist-storybook/assets/typography-DEpAJl_i.js +1 -0
  105. package/dist-storybook/assets/typography.stories-Bu8qFugR.js +202 -0
  106. package/dist-storybook/assets/uploader.stories-B2wW9qVy.js +65 -0
  107. package/dist-storybook/assets/use-app-pause-B_tWHKJK.js +29 -0
  108. package/dist-storybook/assets/use-app-resume--900G-dV.js +29 -0
  109. package/dist-storybook/assets/use-custom-icon-event-3VExRzvC.js +29 -0
  110. package/dist-storybook/assets/use-did-hide-BUsL73ab.js +48 -0
  111. package/dist-storybook/assets/use-did-show-C1-VLDxi.js +49 -0
  112. package/dist-storybook/assets/use-histories-E4E2jJEY.js +50 -0
  113. package/dist-storybook/assets/use-history-o1im8IDj.js +67 -0
  114. package/dist-storybook/assets/use-location-CUEaBO4P.js +56 -0
  115. package/dist-storybook/assets/use-navigate-C4CTuFSZ.js +84 -0
  116. package/dist-storybook/assets/use-navigation-type-Dcz4hgKo.js +44 -0
  117. package/dist-storybook/assets/use-page-config-DSJBVQbq.js +48 -0
  118. package/dist-storybook/assets/use-page-scroll-dY-U1Vv4.js +69 -0
  119. package/dist-storybook/assets/use-page-state-CtNpwGPN.js +79 -0
  120. package/dist-storybook/assets/use-settings-changed-BBJwIHTE.js +29 -0
  121. package/dist-storybook/assets/v-mini-icon-Dn1BmJzb.woff2 +0 -0
  122. package/dist-storybook/assets/visibility-sensor-CwrzJO06.js +1 -0
  123. package/dist-storybook/iframe.html +670 -0
  124. package/dist-storybook/index.html +132 -0
  125. package/dist-storybook/index.json +1 -0
  126. package/dist-storybook/project.json +1 -0
  127. package/dist-storybook/sb-addons/a11y-2/manager-bundle.js +5 -0
  128. package/dist-storybook/sb-addons/docs-1/manager-bundle.js +151 -0
  129. package/dist-storybook/sb-addons/storybook-build-3/manager-bundle.js +3 -0
  130. package/dist-storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
  131. package/dist-storybook/sb-manager/globals-module-info.js +799 -0
  132. package/dist-storybook/sb-manager/globals-runtime.js +69791 -0
  133. package/dist-storybook/sb-manager/globals.js +34 -0
  134. package/dist-storybook/sb-manager/runtime.js +13198 -0
  135. package/dist-storybook/stories-data.json +374 -0
  136. package/dist-storybook/vite-inject-mocker-entry.js +2 -0
  137. package/package.json +1 -1
@@ -0,0 +1,200 @@
1
+ import{j as n,r as u}from"./iframe-CQAwSt4E.js";import{T as w,S as b,M as c,P as h,a as v}from"./blocks-BuaOUtiH.js";import{c as e}from"./chip-kG4p82WT.js";import{t as o}from"./store-D2RudmNr.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";import"./classname-CUR_zgkh.js";import"./icon-DdQsMyRa.js";import"./colors-_6nFGM3e.js";import"./navigation-bar-vI-FPasP.js";import"./visibility-sensor-CwrzJO06.js";import"./index-B-Ksafg0.js";import"./store-CPumdfcU.js";import"./_setToString-CbM921C9.js";import"./react-hufnxGVs.js";import"./omit-Bsx5nTI0.js";import"./pick-BhmhLmLe.js";import"./button-CL7GeC23.js";import"./typography-DEpAJl_i.js";import"./image-C3EsNRhz.js";import"./bottom-tab-bar-CtcTAxuI.js";import"./toast-provider-DurnMJhd.js";import"./carousel-1Kww3hIz.js";import"./embla-carousel-react.esm-BYjpaHZ9.js";import"./pagination-DZHoBs_4.js";import"./section-content-DGNB4eLN.js";import"./option-item-LRh_OyV4.js";import"./index-BV0AJWP6.js";import"./alert-DLW8CoyB.js";import"./skeleton-C91JgehG.js";import"./label-DV2iCDmN.js";import"./input-wrapper-BKHgnPy6.js";import"./text-field-jK6rpOo2.js";import"./number-field-CXKmnfKe.js";import"./checkbox-MGytNNRt.js";import"./radio-B5NJxG_l.js";import"./date-Cg-Uk_pp.js";import"./date-picker-Dnq_-0Md.js";import"./calendar-dOCsjhVU.js";import"./search-field-CQqgFbfg.js";import"./text-area-DwSXyqOe.js";import"./avatar-GxcYPA1p.js";import"./badge-D_LzMVtw.js";import"./switch-p-aXI-ev.js";import"./tab-bar-CSeCmtIZ.js";import"./rating-BdXViYBv.js";import"./tooltip-QDdel5My.js";const y=()=>{const d=`
2
+ ## ${o("common.table.title")}
3
+
4
+ | ${o("common.table.name")} | ${o("common.table.type")} | ${o("common.table.required")} | ${o("common.table.description")} |
5
+ | :--- | :--- | :--- | :--- |
6
+ | \`options\` | \`IDropdownOption[]\` | ${o("common.table.yes")} | ${o("components.dropdown.optionsDescription")} |
7
+ | \`value\` | \`Value\` | ${o("common.table.no")} | ${o("components.dropdown.valueDescription")} |
8
+ | \`onChange\` | \`(value: Value) => void\` | ${o("common.table.no")} | ${o("components.dropdown.onChangeDescription")} |
9
+ | \`placeholder\` | \`string\` | ${o("common.table.no")} | ${o("components.dropdown.placeholderDescription")} |
10
+ | \`shape\` | \`'rounded' | 'pill'\` | ${o("common.table.no")} | ${o("components.dropdown.shapeDescription")} |
11
+ | \`disabled\` | \`boolean\` | ${o("common.table.no")} | ${o("components.dropdown.disabledDescription")} |
12
+ | \`error\` | \`boolean\` | ${o("common.table.no")} | ${o("components.dropdown.errorDescription")} |
13
+ | \`errorMessage\` | \`ReactNode\` | ${o("common.table.no")} | ${o("components.dropdown.errorMessageDescription")} |
14
+ | \`success\` | \`boolean\` | ${o("common.table.no")} | ${o("components.dropdown.successDescription")} |
15
+ | \`successMessage\` | \`ReactNode\` | ${o("common.table.no")} | ${o("components.dropdown.successMessageDescription")} |
16
+ | \`allowSearch\` | \`boolean\` | ${o("common.table.no")} | ${o("components.dropdown.allowSearchDescription")} |
17
+ | \`loading\` | \`boolean\` | ${o("common.table.no")} | ${o("components.dropdown.loadingDescription")} |
18
+ | \`leadingIcon\` | \`IIconProps | ReactNode\` | ${o("common.table.no")} | ${o("components.dropdown.leadingIconDescription")} |
19
+ | \`onLeadingIconClick\` | \`(event: React.MouseEvent) => void\` | ${o("common.table.no")} | ${o("components.dropdown.onLeadingIconClickDescription")} |
20
+ | \`trailingIcon\` | \`IIconProps | ReactNode\` | ${o("common.table.no")} | ${o("components.dropdown.trailingIconDescription")} |
21
+ | \`onTrailingIconClick\` | \`(event: React.MouseEvent) => void\` | ${o("common.table.no")} | ${o("components.dropdown.onTrailingIconClickDescription")} |
22
+ | \`prefix\` | \`ReactNode\` | ${o("common.table.no")} | ${o("components.dropdown.prefixDescription")} |
23
+ | \`suffix\` | \`ReactNode\` | ${o("common.table.no")} | ${o("components.dropdown.suffixDescription")} |
24
+ | \`className\` | \`string\` | ${o("common.table.no")} | ${o("components.dropdown.classNameDescription")} |
25
+ | \`...props\` | \`ComponentPropsWithRef<'div'>\` | ${o("common.table.no")} | ${o("components.dropdown.propsDescription")} |
26
+ `;return n.jsxs(n.Fragment,{children:[n.jsx(w,{}),n.jsx(b,{}),n.jsx(c,{children:o("components.dropdown.description")}),n.jsx(h,{}),n.jsx(c,{children:d}),n.jsx(v,{})]})},uo={title:"Components/Dropdown",component:e,parameters:{layout:"padded",docs:{page:y}},tags:["autodocs"],argTypes:{options:{control:!1,description:o("components.dropdown.argTypes.optionsDescription"),table:{type:{summary:"IDropdownOption[]"}}},value:{control:"text",description:o("components.dropdown.argTypes.valueDescription"),table:{type:{summary:"Value"}}},onChange:{action:"changed",description:o("components.dropdown.argTypes.onChangeDescription"),table:{type:{summary:"(value: Value) => void"}}},placeholder:{control:"text",description:o("components.dropdown.argTypes.placeholderDescription"),table:{type:{summary:"string"}}},shape:{control:"select",options:["rounded","pill"],description:o("components.dropdown.argTypes.shapeDescription"),table:{type:{summary:'"rounded" | "pill"'},defaultValue:{summary:"rounded"}}},disabled:{control:"boolean",description:o("components.dropdown.argTypes.disabledDescription"),table:{type:{summary:"boolean"}}},allowSearch:{control:"boolean",description:o("components.dropdown.argTypes.allowSearchDescription"),table:{type:{summary:"boolean"}}},loading:{control:"boolean",description:o("components.dropdown.argTypes.loadingDescription"),table:{type:{summary:"boolean"}}},className:{control:"text",description:o("components.dropdown.argTypes.classNameDescription"),table:{type:{summary:"string"}}}}},t={storyName:o("components.dropdown.stories.default.storyName"),args:{options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")},{value:"option3",label:o("components.dropdown.stories.options.option3")},{value:"option4",label:o("components.dropdown.stories.options.option4")},{value:"option5",label:o("components.dropdown.stories.options.option5")}],placeholder:o("components.dropdown.stories.default.placeholder")}},s={storyName:o("components.dropdown.stories.controlled.storyName"),render:()=>{const[d,m]=u.useState(null);return n.jsx(e,{options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")},{value:"option3",label:o("components.dropdown.stories.options.option3")},{value:"option4",label:o("components.dropdown.stories.options.option4")},{value:"option5",label:o("components.dropdown.stories.options.option5")}],value:d,onChange:m,placeholder:o("components.dropdown.stories.default.placeholder")})}},p={storyName:o("components.dropdown.stories.withLabel.storyName"),args:{options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")},{value:"option3",label:o("components.dropdown.stories.options.option3")},{value:"option4",label:o("components.dropdown.stories.options.option4")},{value:"option5",label:o("components.dropdown.stories.options.option5")}],label:{text:o("components.dropdown.stories.withLabel.label")},placeholder:o("components.dropdown.stories.default.placeholder")}},r={storyName:o("components.dropdown.stories.shapes.storyName"),render:()=>n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[n.jsx(e,{shape:"rounded",options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],placeholder:o("components.dropdown.stories.shapes.rounded")}),n.jsx(e,{shape:"pill",options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],placeholder:o("components.dropdown.stories.shapes.pill")})]})},i={storyName:o("components.dropdown.stories.states.storyName"),render:()=>n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[n.jsx(e,{options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],placeholder:o("components.dropdown.stories.default.placeholder")}),n.jsx(e,{options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],value:"option1",placeholder:o("components.dropdown.stories.default.placeholder")}),n.jsx(e,{disabled:!0,options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],placeholder:o("components.dropdown.stories.states.disabled")}),n.jsx(e,{error:!0,errorMessage:o("components.dropdown.stories.states.errorMessage"),options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],placeholder:o("components.dropdown.stories.default.placeholder")}),n.jsx(e,{loading:!0,options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")}],placeholder:o("components.dropdown.stories.states.loading")})]})},a={storyName:o("components.dropdown.stories.withSearch.storyName"),args:{options:[{value:"apple",label:o("components.dropdown.stories.withSearch.apple")},{value:"banana",label:o("components.dropdown.stories.withSearch.banana")},{value:"cherry",label:o("components.dropdown.stories.withSearch.cherry")},{value:"date",label:o("components.dropdown.stories.withSearch.date")},{value:"elderberry",label:o("components.dropdown.stories.withSearch.elderberry")}],allowSearch:!0,placeholder:o("components.dropdown.stories.withSearch.placeholder")}},l={storyName:o("components.dropdown.stories.interactive.storyName"),args:{options:[{value:"option1",label:o("components.dropdown.stories.options.option1")},{value:"option2",label:o("components.dropdown.stories.options.option2")},{value:"option3",label:o("components.dropdown.stories.options.option3")},{value:"option4",label:o("components.dropdown.stories.options.option4")},{value:"option5",label:o("components.dropdown.stories.options.option5")}],placeholder:o("components.dropdown.stories.default.placeholder")}};t.parameters={...t.parameters,docs:{...t.parameters?.docs,source:{originalSource:`{
27
+ storyName: t('components.dropdown.stories.default.storyName'),
28
+ args: {
29
+ options: [{
30
+ value: 'option1',
31
+ label: t('components.dropdown.stories.options.option1')
32
+ }, {
33
+ value: 'option2',
34
+ label: t('components.dropdown.stories.options.option2')
35
+ }, {
36
+ value: 'option3',
37
+ label: t('components.dropdown.stories.options.option3')
38
+ }, {
39
+ value: 'option4',
40
+ label: t('components.dropdown.stories.options.option4')
41
+ }, {
42
+ value: 'option5',
43
+ label: t('components.dropdown.stories.options.option5')
44
+ }],
45
+ placeholder: t('components.dropdown.stories.default.placeholder')
46
+ }
47
+ }`,...t.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
48
+ storyName: t('components.dropdown.stories.controlled.storyName'),
49
+ render: () => {
50
+ const [value, setValue] = useState<string | null>(null);
51
+ return <Dropdown options={[{
52
+ value: 'option1',
53
+ label: t('components.dropdown.stories.options.option1')
54
+ }, {
55
+ value: 'option2',
56
+ label: t('components.dropdown.stories.options.option2')
57
+ }, {
58
+ value: 'option3',
59
+ label: t('components.dropdown.stories.options.option3')
60
+ }, {
61
+ value: 'option4',
62
+ label: t('components.dropdown.stories.options.option4')
63
+ }, {
64
+ value: 'option5',
65
+ label: t('components.dropdown.stories.options.option5')
66
+ }]} value={value} onChange={setValue} placeholder={t('components.dropdown.stories.default.placeholder')} />;
67
+ }
68
+ }`,...s.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
69
+ storyName: t('components.dropdown.stories.withLabel.storyName'),
70
+ args: {
71
+ options: [{
72
+ value: 'option1',
73
+ label: t('components.dropdown.stories.options.option1')
74
+ }, {
75
+ value: 'option2',
76
+ label: t('components.dropdown.stories.options.option2')
77
+ }, {
78
+ value: 'option3',
79
+ label: t('components.dropdown.stories.options.option3')
80
+ }, {
81
+ value: 'option4',
82
+ label: t('components.dropdown.stories.options.option4')
83
+ }, {
84
+ value: 'option5',
85
+ label: t('components.dropdown.stories.options.option5')
86
+ }],
87
+ label: {
88
+ text: t('components.dropdown.stories.withLabel.label')
89
+ },
90
+ placeholder: t('components.dropdown.stories.default.placeholder')
91
+ }
92
+ }`,...p.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
93
+ storyName: t('components.dropdown.stories.shapes.storyName'),
94
+ render: () => <div style={{
95
+ display: 'flex',
96
+ flexDirection: 'column',
97
+ gap: '16px'
98
+ }}>
99
+ <Dropdown shape="rounded" options={[{
100
+ value: 'option1',
101
+ label: t('components.dropdown.stories.options.option1')
102
+ }, {
103
+ value: 'option2',
104
+ label: t('components.dropdown.stories.options.option2')
105
+ }]} placeholder={t('components.dropdown.stories.shapes.rounded')} />
106
+ <Dropdown shape="pill" options={[{
107
+ value: 'option1',
108
+ label: t('components.dropdown.stories.options.option1')
109
+ }, {
110
+ value: 'option2',
111
+ label: t('components.dropdown.stories.options.option2')
112
+ }]} placeholder={t('components.dropdown.stories.shapes.pill')} />
113
+ </div>
114
+ }`,...r.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
115
+ storyName: t('components.dropdown.stories.states.storyName'),
116
+ render: () => <div style={{
117
+ display: 'flex',
118
+ flexDirection: 'column',
119
+ gap: '16px'
120
+ }}>
121
+ <Dropdown options={[{
122
+ value: 'option1',
123
+ label: t('components.dropdown.stories.options.option1')
124
+ }, {
125
+ value: 'option2',
126
+ label: t('components.dropdown.stories.options.option2')
127
+ }]} placeholder={t('components.dropdown.stories.default.placeholder')} />
128
+ <Dropdown options={[{
129
+ value: 'option1',
130
+ label: t('components.dropdown.stories.options.option1')
131
+ }, {
132
+ value: 'option2',
133
+ label: t('components.dropdown.stories.options.option2')
134
+ }]} value="option1" placeholder={t('components.dropdown.stories.default.placeholder')} />
135
+ <Dropdown disabled options={[{
136
+ value: 'option1',
137
+ label: t('components.dropdown.stories.options.option1')
138
+ }, {
139
+ value: 'option2',
140
+ label: t('components.dropdown.stories.options.option2')
141
+ }]} placeholder={t('components.dropdown.stories.states.disabled')} />
142
+ <Dropdown error errorMessage={t('components.dropdown.stories.states.errorMessage')} options={[{
143
+ value: 'option1',
144
+ label: t('components.dropdown.stories.options.option1')
145
+ }, {
146
+ value: 'option2',
147
+ label: t('components.dropdown.stories.options.option2')
148
+ }]} placeholder={t('components.dropdown.stories.default.placeholder')} />
149
+ <Dropdown loading options={[{
150
+ value: 'option1',
151
+ label: t('components.dropdown.stories.options.option1')
152
+ }, {
153
+ value: 'option2',
154
+ label: t('components.dropdown.stories.options.option2')
155
+ }]} placeholder={t('components.dropdown.stories.states.loading')} />
156
+ </div>
157
+ }`,...i.parameters?.docs?.source}}};a.parameters={...a.parameters,docs:{...a.parameters?.docs,source:{originalSource:`{
158
+ storyName: t('components.dropdown.stories.withSearch.storyName'),
159
+ args: {
160
+ options: [{
161
+ value: 'apple',
162
+ label: t('components.dropdown.stories.withSearch.apple')
163
+ }, {
164
+ value: 'banana',
165
+ label: t('components.dropdown.stories.withSearch.banana')
166
+ }, {
167
+ value: 'cherry',
168
+ label: t('components.dropdown.stories.withSearch.cherry')
169
+ }, {
170
+ value: 'date',
171
+ label: t('components.dropdown.stories.withSearch.date')
172
+ }, {
173
+ value: 'elderberry',
174
+ label: t('components.dropdown.stories.withSearch.elderberry')
175
+ }],
176
+ allowSearch: true,
177
+ placeholder: t('components.dropdown.stories.withSearch.placeholder')
178
+ }
179
+ }`,...a.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
180
+ storyName: t('components.dropdown.stories.interactive.storyName'),
181
+ args: {
182
+ options: [{
183
+ value: 'option1',
184
+ label: t('components.dropdown.stories.options.option1')
185
+ }, {
186
+ value: 'option2',
187
+ label: t('components.dropdown.stories.options.option2')
188
+ }, {
189
+ value: 'option3',
190
+ label: t('components.dropdown.stories.options.option3')
191
+ }, {
192
+ value: 'option4',
193
+ label: t('components.dropdown.stories.options.option4')
194
+ }, {
195
+ value: 'option5',
196
+ label: t('components.dropdown.stories.options.option5')
197
+ }],
198
+ placeholder: t('components.dropdown.stories.default.placeholder')
199
+ }
200
+ }`,...l.parameters?.docs?.source}}};const wo=["Default","Controlled","WithLabel","Shapes","States","WithSearch","Interactive"];export{s as Controlled,t as Default,l as Interactive,r as Shapes,i as States,p as WithLabel,a as WithSearch,wo as __namedExportsOrder,uo as default};
@@ -0,0 +1 @@
1
+ import{r as _}from"./iframe-CQAwSt4E.js";function en(t){return Object.prototype.toString.call(t)==="[object Object]"}function zt(t){return en(t)||Array.isArray(t)}function on(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function vt(t,n){const o=Object.keys(t),s=Object.keys(n);if(o.length!==s.length)return!1;const c=JSON.stringify(Object.keys(t.breakpoints||{})),r=JSON.stringify(Object.keys(n.breakpoints||{}));return c!==r?!1:o.every(e=>{const f=t[e],i=n[e];return typeof f=="function"?`${f}`==`${i}`:!zt(f)||!zt(i)?f===i:vt(f,i)})}function jt(t){return t.concat().sort((n,o)=>n.name>o.name?1:-1).map(n=>n.options)}function rn(t,n){if(t.length!==n.length)return!1;const o=jt(t),s=jt(n);return o.every((c,r)=>{const e=s[r];return vt(c,e)})}function At(t){return typeof t=="number"}function It(t){return typeof t=="string"}function St(t){return typeof t=="boolean"}function Gt(t){return Object.prototype.toString.call(t)==="[object Object]"}function w(t){return Math.abs(t)}function Ot(t){return Math.sign(t)}function at(t,n){return w(t-n)}function sn(t,n){if(t===0||n===0||w(t)<=w(n))return 0;const o=at(w(t),w(n));return w(o/t)}function cn(t){return Math.round(t*100)/100}function lt(t){return dt(t).map(Number)}function z(t){return t[mt(t)]}function mt(t){return Math.max(0,t.length-1)}function Dt(t,n){return n===mt(t)}function Ht(t,n=0){return Array.from(Array(t),(o,s)=>n+s)}function dt(t){return Object.keys(t)}function Rt(t,n){return[t,n].reduce((o,s)=>(dt(s).forEach(c=>{const r=o[c],e=s[c],f=Gt(r)&&Gt(e);o[c]=f?Rt(r,e):e}),o),{})}function Tt(t,n){return typeof n.MouseEvent<"u"&&t instanceof n.MouseEvent}function un(t,n){const o={start:s,center:c,end:r};function s(){return 0}function c(i){return r(i)/2}function r(i){return n-i}function e(i,u){return It(t)?o[t](i):t(n,i,u)}return{measure:e}}function pt(){let t=[];function n(c,r,e,f={passive:!0}){let i;if("addEventListener"in c)c.addEventListener(r,e,f),i=()=>c.removeEventListener(r,e,f);else{const u=c;u.addListener(e),i=()=>u.removeListener(e)}return t.push(i),s}function o(){t=t.filter(c=>c())}const s={add:n,clear:o};return s}function fn(t,n,o,s){const c=pt(),r=1e3/60;let e=null,f=0,i=0;function u(){c.add(t,"visibilitychange",()=>{t.hidden&&l()})}function h(){b(),c.clear()}function d(g){if(!i)return;e||(e=g,o(),o());const a=g-e;for(e=g,f+=a;f>=r;)o(),f-=r;const S=f/r;s(S),i&&(i=n.requestAnimationFrame(d))}function p(){i||(i=n.requestAnimationFrame(d))}function b(){n.cancelAnimationFrame(i),e=null,f=0,i=0}function l(){e=null,f=0}return{init:u,destroy:h,start:p,stop:b,update:o,render:s}}function an(t,n){const o=n==="rtl",s=t==="y",c=s?"y":"x",r=s?"x":"y",e=!s&&o?-1:1,f=h(),i=d();function u(l){const{height:m,width:g}=l;return s?m:g}function h(){return s?"top":o?"right":"left"}function d(){return s?"bottom":o?"left":"right"}function p(l){return l*e}return{scroll:c,cross:r,startEdge:f,endEdge:i,measureSize:u,direction:p}}function nt(t=0,n=0){const o=w(t-n);function s(u){return u<t}function c(u){return u>n}function r(u){return s(u)||c(u)}function e(u){return r(u)?s(u)?t:n:u}function f(u){return o?u-o*Math.ceil((u-n)/o):u}return{length:o,max:n,min:t,constrain:e,reachedAny:r,reachedMax:c,reachedMin:s,removeOffset:f}}function qt(t,n,o){const{constrain:s}=nt(0,t),c=t+1;let r=e(n);function e(p){return o?w((c+p)%c):s(p)}function f(){return r}function i(p){return r=e(p),d}function u(p){return h().set(f()+p)}function h(){return qt(t,f(),o)}const d={get:f,set:i,add:u,clone:h};return d}function ln(t,n,o,s,c,r,e,f,i,u,h,d,p,b,l,m,g,a,S){const{cross:x,direction:I}=t,D=["INPUT","SELECT","TEXTAREA"],T={passive:!1},E=pt(),L=pt(),v=nt(50,225).constrain(b.measure(20)),P={mouse:300,touch:400},A={mouse:500,touch:600},N=l?43:25;let j=!1,G=0,H=0,Z=!1,X=!1,$=!1,U=!1;function st(y){if(!S)return;function O(k){(St(S)||S(y,k))&&ct(k)}const F=n;E.add(F,"dragstart",k=>k.preventDefault(),T).add(F,"touchmove",()=>{},T).add(F,"touchend",()=>{}).add(F,"touchstart",O).add(F,"mousedown",O).add(F,"touchcancel",C).add(F,"contextmenu",C).add(F,"click",Q,!0)}function R(){E.clear(),L.clear()}function et(){const y=U?o:n;L.add(y,"touchmove",B,T).add(y,"touchend",C).add(y,"mousemove",B,T).add(y,"mouseup",C)}function ot(y){const O=y.nodeName||"";return D.includes(O)}function K(){return(l?A:P)[U?"mouse":"touch"]}function it(y,O){const F=d.add(Ot(y)*-1),k=h.byDistance(y,!l).distance;return l||w(y)<v?k:g&&O?k*.5:h.byIndex(F.get(),0).distance}function ct(y){const O=Tt(y,s);U=O,$=l&&O&&!y.buttons&&j,j=at(c.get(),e.get())>=2,!(O&&y.button!==0)&&(ot(y.target)||(Z=!0,r.pointerDown(y),u.useFriction(0).useDuration(0),c.set(e),et(),G=r.readPoint(y),H=r.readPoint(y,x),p.emit("pointerDown")))}function B(y){if(!Tt(y,s)&&y.touches.length>=2)return C(y);const F=r.readPoint(y),k=r.readPoint(y,x),q=at(F,G),J=at(k,H);if(!X&&!U&&(!y.cancelable||(X=q>J,!X)))return C(y);const W=r.pointerMove(y);q>m&&($=!0),u.useFriction(.3).useDuration(.75),f.start(),c.add(I(W)),y.preventDefault()}function C(y){const F=h.byDistance(0,!1).index!==d.get(),k=r.pointerUp(y)*K(),q=it(I(k),F),J=sn(k,q),W=N-10*J,Y=a+J/50;X=!1,Z=!1,L.clear(),u.useDuration(W).useFriction(Y),i.distance(q,!l),U=!1,p.emit("pointerUp")}function Q(y){$&&(y.stopPropagation(),y.preventDefault(),$=!1)}function V(){return Z}return{init:st,destroy:R,pointerDown:V}}function dn(t,n){let s,c;function r(d){return d.timeStamp}function e(d,p){const l=`client${(p||t.scroll)==="x"?"X":"Y"}`;return(Tt(d,n)?d:d.touches[0])[l]}function f(d){return s=d,c=d,e(d)}function i(d){const p=e(d)-e(c),b=r(d)-r(s)>170;return c=d,b&&(s=d),p}function u(d){if(!s||!c)return 0;const p=e(c)-e(s),b=r(d)-r(s),l=r(d)-r(c)>170,m=p/b;return b&&!l&&w(m)>.1?m:0}return{pointerDown:f,pointerMove:i,pointerUp:u,readPoint:e}}function pn(){function t(o){const{offsetTop:s,offsetLeft:c,offsetWidth:r,offsetHeight:e}=o;return{top:s,right:c+r,bottom:s+e,left:c,width:r,height:e}}return{measure:t}}function mn(t){function n(s){return t*(s/100)}return{measure:n}}function gn(t,n,o,s,c,r,e){const f=[t].concat(s);let i,u,h=[],d=!1;function p(g){return c.measureSize(e.measure(g))}function b(g){if(!r)return;u=p(t),h=s.map(p);function a(S){for(const x of S){if(d)return;const I=x.target===t,D=s.indexOf(x.target),T=I?u:h[D],E=p(I?t:s[D]);if(w(E-T)>=.5){g.reInit(),n.emit("resize");break}}}i=new ResizeObserver(S=>{(St(r)||r(g,S))&&a(S)}),o.requestAnimationFrame(()=>{f.forEach(S=>i.observe(S))})}function l(){d=!0,i&&i.disconnect()}return{init:b,destroy:l}}function hn(t,n,o,s,c,r){let e=0,f=0,i=c,u=r,h=t.get(),d=0;function p(){const T=s.get()-t.get(),E=!i;let L=0;return E?(e=0,o.set(s),t.set(s),L=T):(o.set(t),e+=T/i,e*=u,h+=e,t.add(e),L=h-d),f=Ot(L),d=h,D}function b(){const T=s.get()-n.get();return w(T)<.001}function l(){return i}function m(){return f}function g(){return e}function a(){return x(c)}function S(){return I(r)}function x(T){return i=T,D}function I(T){return u=T,D}const D={direction:m,duration:l,velocity:g,seek:p,settled:b,useBaseFriction:S,useBaseDuration:a,useFriction:I,useDuration:x};return D}function Sn(t,n,o,s,c){const r=c.measure(10),e=c.measure(50),f=nt(.1,.99);let i=!1;function u(){return!(i||!t.reachedAny(o.get())||!t.reachedAny(n.get()))}function h(b){if(!u())return;const l=t.reachedMin(n.get())?"min":"max",m=w(t[l]-n.get()),g=o.get()-n.get(),a=f.constrain(m/e);o.subtract(g*a),!b&&w(g)<r&&(o.set(t.constrain(o.get())),s.useDuration(25).useBaseFriction())}function d(b){i=!b}return{shouldConstrain:u,constrain:h,toggleActive:d}}function yn(t,n,o,s,c){const r=nt(-n+t,0),e=d(),f=h(),i=p();function u(l,m){return at(l,m)<=1}function h(){const l=e[0],m=z(e),g=e.lastIndexOf(l),a=e.indexOf(m)+1;return nt(g,a)}function d(){return o.map((l,m)=>{const{min:g,max:a}=r,S=r.constrain(l),x=!m,I=Dt(o,m);return x?a:I||u(g,S)?g:u(a,S)?a:S}).map(l=>parseFloat(l.toFixed(3)))}function p(){if(n<=t+c)return[r.max];if(s==="keepSnaps")return e;const{min:l,max:m}=f;return e.slice(l,m)}return{snapsContained:i,scrollContainLimit:f}}function bn(t,n,o){const s=n[0],c=o?s-t:z(n);return{limit:nt(c,s)}}function xn(t,n,o,s){const r=n.min+.1,e=n.max+.1,{reachedMin:f,reachedMax:i}=nt(r,e);function u(p){return p===1?i(o.get()):p===-1?f(o.get()):!1}function h(p){if(!u(p))return;const b=t*(p*-1);s.forEach(l=>l.add(b))}return{loop:h}}function En(t){const{max:n,length:o}=t;function s(r){const e=r-n;return o?e/-o:0}return{get:s}}function Ln(t,n,o,s,c){const{startEdge:r,endEdge:e}=t,{groupSlides:f}=c,i=d().map(n.measure),u=p(),h=b();function d(){return f(s).map(m=>z(m)[e]-m[0][r]).map(w)}function p(){return s.map(m=>o[r]-m[r]).map(m=>-w(m))}function b(){return f(u).map(m=>m[0]).map((m,g)=>m+i[g])}return{snaps:u,snapsAligned:h}}function In(t,n,o,s,c,r){const{groupSlides:e}=c,{min:f,max:i}=s,u=h();function h(){const p=e(r),b=!t||n==="keepSnaps";return o.length===1?[r]:b?p:p.slice(f,i).map((l,m,g)=>{const a=!m,S=Dt(g,m);if(a){const x=z(g[0])+1;return Ht(x)}if(S){const x=mt(r)-z(g)[0]+1;return Ht(x,z(g)[0])}return l})}return{slideRegistry:u}}function Tn(t,n,o,s,c){const{reachedAny:r,removeOffset:e,constrain:f}=s;function i(l){return l.concat().sort((m,g)=>w(m)-w(g))[0]}function u(l){const m=t?e(l):f(l),g=n.map((S,x)=>({diff:h(S-m,0),index:x})).sort((S,x)=>w(S.diff)-w(x.diff)),{index:a}=g[0];return{index:a,distance:m}}function h(l,m){const g=[l,l+o,l-o];if(!t)return l;if(!m)return i(g);const a=g.filter(S=>Ot(S)===m);return a.length?i(a):z(g)-o}function d(l,m){const g=n[l]-c.get(),a=h(g,m);return{index:l,distance:a}}function p(l,m){const g=c.get()+l,{index:a,distance:S}=u(g),x=!t&&r(g);if(!m||x)return{index:a,distance:l};const I=n[a]-S,D=l+h(I,0);return{index:a,distance:D}}return{byDistance:p,byIndex:d,shortcut:h}}function vn(t,n,o,s,c,r,e){function f(d){const p=d.distance,b=d.index!==n.get();r.add(p),p&&(s.duration()?t.start():(t.update(),t.render(1),t.update())),b&&(o.set(n.get()),n.set(d.index),e.emit("select"))}function i(d,p){const b=c.byDistance(d,p);f(b)}function u(d,p){const b=n.clone().set(d),l=c.byIndex(b.get(),p);f(l)}return{distance:i,index:u}}function An(t,n,o,s,c,r,e,f){const i={passive:!0,capture:!0};let u=0;function h(b){if(!f)return;function l(m){if(new Date().getTime()-u>10)return;e.emit("slideFocusStart"),t.scrollLeft=0;const S=o.findIndex(x=>x.includes(m));At(S)&&(c.useDuration(0),s.index(S,0),e.emit("slideFocus"))}r.add(document,"keydown",d,!1),n.forEach((m,g)=>{r.add(m,"focus",a=>{(St(f)||f(b,a))&&l(g)},i)})}function d(b){b.code==="Tab"&&(u=new Date().getTime())}return{init:h}}function ft(t){let n=t;function o(){return n}function s(i){n=e(i)}function c(i){n+=e(i)}function r(i){n-=e(i)}function e(i){return At(i)?i:i.get()}return{get:o,set:s,add:c,subtract:r}}function $t(t,n){const o=t.scroll==="x"?e:f,s=n.style;let c=null,r=!1;function e(p){return`translate3d(${p}px,0px,0px)`}function f(p){return`translate3d(0px,${p}px,0px)`}function i(p){if(r)return;const b=cn(t.direction(p));b!==c&&(s.transform=o(b),c=b)}function u(p){r=!p}function h(){r||(s.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:h,to:i,toggleActive:u}}function On(t,n,o,s,c,r,e,f,i){const h=lt(c),d=lt(c).reverse(),p=a().concat(S());function b(E,L){return E.reduce((v,P)=>v-c[P],L)}function l(E,L){return E.reduce((v,P)=>b(v,L)>0?v.concat([P]):v,[])}function m(E){return r.map((L,v)=>({start:L-s[v]+.5+E,end:L+n-.5+E}))}function g(E,L,v){const P=m(L);return E.map(A=>{const N=v?0:-o,j=v?o:0,G=v?"end":"start",H=P[A][G];return{index:A,loopPoint:H,slideLocation:ft(-1),translate:$t(t,i[A]),target:()=>f.get()>H?N:j}})}function a(){const E=e[0],L=l(d,E);return g(L,o,!1)}function S(){const E=n-e[0]-1,L=l(h,E);return g(L,-o,!0)}function x(){return p.every(({index:E})=>{const L=h.filter(v=>v!==E);return b(L,n)<=.1})}function I(){p.forEach(E=>{const{target:L,translate:v,slideLocation:P}=E,A=L();A!==P.get()&&(v.to(A),P.set(A))})}function D(){p.forEach(E=>E.translate.clear())}return{canLoop:x,clear:D,loop:I,loopPoints:p}}function Dn(t,n,o){let s,c=!1;function r(i){if(!o)return;function u(h){for(const d of h)if(d.type==="childList"){i.reInit(),n.emit("slidesChanged");break}}s=new MutationObserver(h=>{c||(St(o)||o(i,h))&&u(h)}),s.observe(t,{childList:!0})}function e(){s&&s.disconnect(),c=!0}return{init:r,destroy:e}}function Mn(t,n,o,s){const c={};let r=null,e=null,f,i=!1;function u(){f=new IntersectionObserver(l=>{i||(l.forEach(m=>{const g=n.indexOf(m.target);c[g]=m}),r=null,e=null,o.emit("slidesInView"))},{root:t.parentElement,threshold:s}),n.forEach(l=>f.observe(l))}function h(){f&&f.disconnect(),i=!0}function d(l){return dt(c).reduce((m,g)=>{const a=parseInt(g),{isIntersecting:S}=c[a];return(l&&S||!l&&!S)&&m.push(a),m},[])}function p(l=!0){if(l&&r)return r;if(!l&&e)return e;const m=d(l);return l&&(r=m),l||(e=m),m}return{init:u,destroy:h,get:p}}function wn(t,n,o,s,c,r){const{measureSize:e,startEdge:f,endEdge:i}=t,u=o[0]&&c,h=l(),d=m(),p=o.map(e),b=g();function l(){if(!u)return 0;const S=o[0];return w(n[f]-S[f])}function m(){if(!u)return 0;const S=r.getComputedStyle(z(s));return parseFloat(S.getPropertyValue(`margin-${i}`))}function g(){return o.map((S,x,I)=>{const D=!x,T=Dt(I,x);return D?p[x]+h:T?p[x]+d:I[x+1][f]-S[f]}).map(w)}return{slideSizes:p,slideSizesWithGaps:b,startGap:h,endGap:d}}function Pn(t,n,o,s,c,r,e,f,i){const{startEdge:u,endEdge:h,direction:d}=t,p=At(o);function b(a,S){return lt(a).filter(x=>x%S===0).map(x=>a.slice(x,x+S))}function l(a){return a.length?lt(a).reduce((S,x,I)=>{const D=z(S)||0,T=D===0,E=x===mt(a),L=c[u]-r[D][u],v=c[u]-r[x][h],P=!s&&T?d(e):0,A=!s&&E?d(f):0,N=w(v-A-(L+P));return I&&N>n+i&&S.push(x),E&&S.push(a.length),S},[]).map((S,x,I)=>{const D=Math.max(I[x-1]||0);return a.slice(D,S)}):[]}function m(a){return p?b(a,o):l(a)}return{groupSlides:m}}function Fn(t,n,o,s,c,r,e){const{align:f,axis:i,direction:u,startIndex:h,loop:d,duration:p,dragFree:b,dragThreshold:l,inViewThreshold:m,slidesToScroll:g,skipSnaps:a,containScroll:S,watchResize:x,watchSlides:I,watchDrag:D,watchFocus:T}=r,E=2,L=pn(),v=L.measure(n),P=o.map(L.measure),A=an(i,u),N=A.measureSize(v),j=mn(N),G=un(f,N),H=!d&&!!S,Z=d||!!S,{slideSizes:X,slideSizesWithGaps:$,startGap:U,endGap:st}=wn(A,v,P,o,Z,c),R=Pn(A,N,g,d,v,P,U,st,E),{snaps:et,snapsAligned:ot}=Ln(A,G,v,P,R),K=-z(et)+z($),{snapsContained:it,scrollContainLimit:ct}=yn(N,K,ot,S,E),B=H?it:ot,{limit:C}=bn(K,B,d),Q=qt(mt(B),h,d),V=Q.clone(),M=lt(o),y=({dragHandler:rt,scrollBody:Et,scrollBounds:Lt,options:{loop:gt}})=>{gt||Lt.constrain(rt.pointerDown()),Et.seek()},O=({scrollBody:rt,translate:Et,location:Lt,offsetLocation:gt,previousLocation:Jt,scrollLooper:Xt,slideLooper:Yt,dragHandler:_t,animation:Zt,eventHandler:Ft,scrollBounds:Wt,options:{loop:Ct}},kt)=>{const Nt=rt.settled(),tn=!Wt.shouldConstrain(),Bt=Ct?Nt:Nt&&tn,Vt=Bt&&!_t.pointerDown();Vt&&Zt.stop();const nn=Lt.get()*kt+Jt.get()*(1-kt);gt.set(nn),Ct&&(Xt.loop(rt.direction()),Yt.loop()),Et.to(gt.get()),Vt&&Ft.emit("settle"),Bt||Ft.emit("scroll")},F=fn(s,c,()=>y(xt),rt=>O(xt,rt)),k=.68,q=B[Q.get()],J=ft(q),W=ft(q),Y=ft(q),tt=ft(q),ut=hn(J,Y,W,tt,p,k),yt=Tn(d,B,K,C,tt),bt=vn(F,Q,V,ut,yt,tt,e),Mt=En(C),wt=pt(),Kt=Mn(n,o,e,m),{slideRegistry:Pt}=In(H,S,B,ct,R,M),Qt=An(t,o,Pt,bt,ut,wt,e,T),xt={ownerDocument:s,ownerWindow:c,eventHandler:e,containerRect:v,slideRects:P,animation:F,axis:A,dragHandler:ln(A,t,s,c,tt,dn(A,c),J,F,bt,ut,yt,Q,e,j,b,l,a,k,D),eventStore:wt,percentOfView:j,index:Q,indexPrevious:V,limit:C,location:J,offsetLocation:Y,previousLocation:W,options:r,resizeHandler:gn(n,e,c,o,A,x,L),scrollBody:ut,scrollBounds:Sn(C,Y,tt,ut,j),scrollLooper:xn(K,C,Y,[J,Y,W,tt]),scrollProgress:Mt,scrollSnapList:B.map(Mt.get),scrollSnaps:B,scrollTarget:yt,scrollTo:bt,slideLooper:On(A,N,K,X,$,et,B,Y,o),slideFocus:Qt,slidesHandler:Dn(n,e,I),slidesInView:Kt,slideIndexes:M,slideRegistry:Pt,slidesToScroll:R,target:tt,translate:$t(A,n)};return xt}function Cn(){let t={},n;function o(u){n=u}function s(u){return t[u]||[]}function c(u){return s(u).forEach(h=>h(n,u)),i}function r(u,h){return t[u]=s(u).concat([h]),i}function e(u,h){return t[u]=s(u).filter(d=>d!==h),i}function f(){t={}}const i={init:o,emit:c,off:e,on:r,clear:f};return i}const kn={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Nn(t){function n(r,e){return Rt(r,e||{})}function o(r){const e=r.breakpoints||{},f=dt(e).filter(i=>t.matchMedia(i).matches).map(i=>e[i]).reduce((i,u)=>n(i,u),{});return n(r,f)}function s(r){return r.map(e=>dt(e.breakpoints||{})).reduce((e,f)=>e.concat(f),[]).map(t.matchMedia)}return{mergeOptions:n,optionsAtMedia:o,optionsMediaQueries:s}}function Bn(t){let n=[];function o(r,e){return n=e.filter(({options:f})=>t.optionsAtMedia(f).active!==!1),n.forEach(f=>f.init(r,t)),e.reduce((f,i)=>Object.assign(f,{[i.name]:i}),{})}function s(){n=n.filter(r=>r.destroy())}return{init:o,destroy:s}}function ht(t,n,o){const s=t.ownerDocument,c=s.defaultView,r=Nn(c),e=Bn(r),f=pt(),i=Cn(),{mergeOptions:u,optionsAtMedia:h,optionsMediaQueries:d}=r,{on:p,off:b,emit:l}=i,m=A;let g=!1,a,S=u(kn,ht.globalOptions),x=u(S),I=[],D,T,E;function L(){const{container:M,slides:y}=x;T=(It(M)?t.querySelector(M):M)||t.children[0];const F=It(y)?T.querySelectorAll(y):y;E=[].slice.call(F||T.children)}function v(M){const y=Fn(t,T,E,s,c,M,i);if(M.loop&&!y.slideLooper.canLoop()){const O=Object.assign({},M,{loop:!1});return v(O)}return y}function P(M,y){g||(S=u(S,M),x=h(S),I=y||I,L(),a=v(x),d([S,...I.map(({options:O})=>O)]).forEach(O=>f.add(O,"change",A)),x.active&&(a.translate.to(a.location.get()),a.animation.init(),a.slidesInView.init(),a.slideFocus.init(V),a.eventHandler.init(V),a.resizeHandler.init(V),a.slidesHandler.init(V),a.options.loop&&a.slideLooper.loop(),T.offsetParent&&E.length&&a.dragHandler.init(V),D=e.init(V,I)))}function A(M,y){const O=R();N(),P(u({startIndex:O},M),y),i.emit("reInit")}function N(){a.dragHandler.destroy(),a.eventStore.clear(),a.translate.clear(),a.slideLooper.clear(),a.resizeHandler.destroy(),a.slidesHandler.destroy(),a.slidesInView.destroy(),a.animation.destroy(),e.destroy(),f.clear()}function j(){g||(g=!0,f.clear(),N(),i.emit("destroy"),i.clear())}function G(M,y,O){!x.active||g||(a.scrollBody.useBaseFriction().useDuration(y===!0?0:x.duration),a.scrollTo.index(M,O||0))}function H(M){const y=a.index.add(1).get();G(y,M,-1)}function Z(M){const y=a.index.add(-1).get();G(y,M,1)}function X(){return a.index.add(1).get()!==R()}function $(){return a.index.add(-1).get()!==R()}function U(){return a.scrollSnapList}function st(){return a.scrollProgress.get(a.offsetLocation.get())}function R(){return a.index.get()}function et(){return a.indexPrevious.get()}function ot(){return a.slidesInView.get()}function K(){return a.slidesInView.get(!1)}function it(){return D}function ct(){return a}function B(){return t}function C(){return T}function Q(){return E}const V={canScrollNext:X,canScrollPrev:$,containerNode:C,internalEngine:ct,destroy:j,off:b,on:p,emit:l,plugins:it,previousScrollSnap:et,reInit:m,rootNode:B,scrollNext:H,scrollPrev:Z,scrollProgress:st,scrollSnapList:U,scrollTo:G,selectedScrollSnap:R,slideNodes:Q,slidesInView:ot,slidesNotInView:K};return P(n,o),setTimeout(()=>i.emit("init"),0),V}ht.globalOptions=void 0;function Ut(t={},n=[]){const o=_.useRef(t),s=_.useRef(n),[c,r]=_.useState(),[e,f]=_.useState(),i=_.useCallback(()=>{c&&c.reInit(o.current,s.current)},[c]);return _.useEffect(()=>{vt(o.current,t)||(o.current=t,i())},[t,i]),_.useEffect(()=>{rn(s.current,n)||(s.current=n,i())},[n,i]),_.useEffect(()=>{if(on()&&e){ht.globalOptions=Ut.globalOptions;const u=ht(e,o.current,s.current);return r(u),()=>u.destroy()}else r(void 0)},[e,r]),[f,c]}Ut.globalOptions=void 0;export{Ut as u};