@worldcoin/mini-apps-ui-kit-react 1.0.0-canary.2 → 1.0.0-canary.21
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.
- package/README.md +15 -17
- package/dist/_virtual/_commonjsHelpers.js +3 -3
- package/dist/_virtual/create-plugin.js +2 -2
- package/dist/_virtual/createPlugin.js +2 -2
- package/dist/_virtual/plugin.js +5 -5
- package/dist/components/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +79 -74
- package/dist/components/AlertDialog/index.d.ts +2 -1
- package/dist/components/AlertDialog/use-alert-dialog.js +9 -7
- package/dist/components/BottomBar/BottomBar.d.ts +4 -3
- package/dist/components/BottomBar/BottomBar.js +11 -8
- package/dist/components/BottomBar/index.d.ts +1 -1
- package/dist/components/BulletList/BulletList.d.ts +10 -5
- package/dist/components/BulletList/BulletList.js +28 -8
- package/dist/components/BulletList/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +4 -9
- package/dist/components/Button/Button.js +38 -48
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +4 -3
- package/dist/components/Checkbox/Checkbox.js +21 -20
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Chip/Chip.d.ts +6 -5
- package/dist/components/Chip/Chip.js +25 -15
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/CircularIcon/CircularIcon.d.ts +10 -0
- package/dist/components/CircularIcon/CircularIcon.js +34 -0
- package/dist/components/CircularIcon/index.d.ts +1 -0
- package/dist/components/ClearButton/Clear.d.ts +3 -2
- package/dist/components/ClearButton/Clear.js +7 -7
- package/dist/components/ClearButton/ClearButton.d.ts +2 -2
- package/dist/components/ClearButton/ClearButton.js +21 -17
- package/dist/components/ClearButton/index.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +4 -3
- package/dist/components/ColorPicker/ColorPicker.js +36 -38
- package/dist/components/ColorPicker/index.d.ts +2 -1
- package/dist/components/CountryDrawer/CountryDrawer.d.ts +14 -2
- package/dist/components/CountryDrawer/CountryDrawer.js +58 -47
- package/dist/components/CountryDrawer/index.d.ts +1 -1
- package/dist/components/CountryDrawer/useCountryFiltering.js +7 -6
- package/dist/components/CountryDrawer/useCountryGrouping.js +18 -12
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +58 -55
- package/dist/components/Drawer/index.d.ts +2 -1
- package/dist/components/Drawer/use-drawer.js +9 -7
- package/dist/components/Flag/Flag.d.ts +4 -4
- package/dist/components/Flag/Flag.js +24 -10
- package/dist/components/Flag/constants.d.ts +1 -2
- package/dist/components/Flag/constants.js +2 -5
- package/dist/components/Flag/index.d.ts +1 -2
- package/dist/components/Flag/types.d.ts +2 -0
- package/dist/components/Flag/utils.d.ts +1 -1
- package/dist/components/Flag/utils.js +5 -3
- package/dist/components/Form/Form.d.ts +8 -7
- package/dist/components/Form/Form.js +29 -24
- package/dist/components/Icons/ArrowDown.js +6 -6
- package/dist/components/Icons/Clear.d.ts +8 -0
- package/dist/components/Icons/Delete.d.ts +1 -0
- package/dist/components/Icons/Fail.js +77 -75
- package/dist/components/Icons/MagicWand.js +11 -11
- package/dist/components/Icons/Magnifier.js +8 -8
- package/dist/components/Icons/Success.js +77 -75
- package/dist/components/Icons/Tick.js +7 -7
- package/dist/components/Icons/XMark.js +7 -7
- package/dist/components/Input/Input.d.ts +14 -43
- package/dist/components/Input/Input.js +182 -130
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/ListItem/ListItem.d.ts +3 -2
- package/dist/components/ListItem/ListItem.js +30 -28
- package/dist/components/ListItem/index.d.ts +1 -1
- package/dist/components/LiveFeedback/LiveFeedback.d.ts +21 -0
- package/dist/components/LiveFeedback/LiveFeedback.js +48 -0
- package/dist/components/LiveFeedback/index.d.ts +1 -0
- package/dist/components/Marble/Marble.d.ts +2 -2
- package/dist/components/Marble/Marble.js +12 -13
- package/dist/components/Marble/index.d.ts +1 -1
- package/dist/components/NumberPad/Delete.js +6 -6
- package/dist/components/NumberPad/NumberPad.d.ts +3 -2
- package/dist/components/NumberPad/NumberPad.js +39 -36
- package/dist/components/NumberPad/index.d.ts +1 -1
- package/dist/components/OTPField/OTPField.d.ts +53 -2
- package/dist/components/OTPField/OTPField.js +63 -40
- package/dist/components/OTPField/index.d.ts +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +4 -3
- package/dist/components/PasswordField/index.d.ts +1 -1
- package/dist/components/PasteButton/PasteButton.d.ts +2 -2
- package/dist/components/PasteButton/PasteButton.js +25 -25
- package/dist/components/PasteButton/index.d.ts +1 -1
- package/dist/components/PhoneField/CountryListItem.js +34 -33
- package/dist/components/PhoneField/CountrySelectorButton.js +29 -27
- package/dist/components/PhoneField/GroupedCountryList.js +27 -24
- package/dist/components/PhoneField/PhoneField.d.ts +5 -9
- package/dist/components/PhoneField/PhoneField.js +79 -76
- package/dist/components/PhoneField/constants.d.ts +0 -1
- package/dist/components/PhoneField/constants.js +26 -24
- package/dist/components/PhoneField/index.d.ts +1 -1
- package/dist/components/PhoneField/utils.js +31 -20
- package/dist/components/Pill/Pill.d.ts +4 -3
- package/dist/components/Pill/Pill.js +27 -24
- package/dist/components/Pill/index.d.ts +1 -1
- package/dist/components/Progress/Progress.d.ts +6 -2
- package/dist/components/Progress/Progress.js +32 -29
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +4 -3
- package/dist/components/RadioGroup/RadioGroup.js +30 -28
- package/dist/components/RadioGroup/RadioGroupItem.d.ts +4 -3
- package/dist/components/RadioGroup/RadioGroupItem.js +20 -19
- package/dist/components/RadioGroup/index.d.ts +2 -2
- package/dist/components/SearchField/SearchField.d.ts +4 -3
- package/dist/components/SearchField/SearchField.js +73 -67
- package/dist/components/SearchField/index.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +5 -4
- package/dist/components/Select/Select.js +103 -63
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.d.ts +6 -2
- package/dist/components/Spinner/Spinner.js +37 -34
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -3
- package/dist/components/Switch/Switch.js +20 -19
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +40 -40
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tabs/types.d.ts +2 -2
- package/dist/components/TextArea/TextArea.d.ts +9 -4
- package/dist/components/TextArea/TextArea.js +70 -49
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/Toast/Toast.js +47 -44
- package/dist/components/Toast/Toaster.d.ts +5 -1
- package/dist/components/Toast/Toaster.js +10 -9
- package/dist/components/Toast/index.d.ts +3 -3
- package/dist/components/Toast/use-toast.js +92 -67
- package/dist/components/ToggleGroup/ToggleGroup.js +18 -18
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/Token/Token.d.ts +3 -2
- package/dist/components/Token/Token.js +11 -11
- package/dist/components/Token/icons/btc.js +8 -8
- package/dist/components/Token/icons/dai.js +8 -8
- package/dist/components/Token/icons/eth.js +8 -8
- package/dist/components/Token/icons/index.js +12 -12
- package/dist/components/Token/icons/usdc.js +10 -10
- package/dist/components/Token/icons/usdt.js +8 -8
- package/dist/components/Token/icons/utils.js +10 -9
- package/dist/components/Token/icons/wld.js +8 -8
- package/dist/components/Token/index.d.ts +1 -1
- package/dist/components/TopBar/TopBar.d.ts +9 -3
- package/dist/components/TopBar/TopBar.js +34 -20
- package/dist/components/TopBar/index.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +4 -3
- package/dist/components/Typography/Typography.js +27 -25
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/components/WalletAddressField/WalletAddressField.d.ts +4 -3
- package/dist/components/WalletAddressField/WalletAddressField.js +75 -65
- package/dist/components/WalletAddressField/index.d.ts +1 -1
- package/dist/index.d.ts +35 -34
- package/dist/index.js +93 -100
- package/dist/lib/constants/dropdownStyles.js +2 -2
- package/dist/lib/utils.js +11 -9
- package/dist/node_modules/.pnpm/@floating-ui_core@1.6.8/node_modules/@floating-ui/core/dist/floating-ui.core.js +558 -368
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.6.12/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +515 -304
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +258 -171
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.8/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +137 -102
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.8/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +110 -86
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.0/node_modules/@radix-ui/number/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.js +7 -5
- package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.1_wfj52omijboqejc6zhpwkjvyjq/node_modules/@radix-ui/react-arrow/dist/index.js +17 -16
- package/dist/node_modules/.pnpm/@radix-ui_react-checkbox@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18._5vtvszwgvdmnkk62ia2dob365m/node_modules/@radix-ui/react-checkbox/dist/index.js +122 -96
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@1_du3umibpgknzrmwryvhzp3lgou/node_modules/@radix-ui/react-collection/dist/index.js +55 -35
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@1_tagbd57u5fsqga6qdjecsll7fm/node_modules/@radix-ui/react-collection/dist/index.js +55 -35
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -19
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.js +64 -53
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._vurlugjqrhlu53o6edaj3yx2bq/node_modules/@radix-ui/react-dialog/dist/index.js +274 -195
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-direction/dist/index.js +6 -6
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types__ejthwt4vwbnzwtfufv7q3bddiy/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +182 -97
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.5_@types_react-dom@18.3.5_@types_react@18.3.18__@types__nitdfoqpcbroetgllwgz3is5ai/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +186 -100
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.js +23 -11
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@_4owg5o3kd7femmpae5yic5inii/node_modules/@radix-ui/react-focus-scope/dist/index.js +170 -99
- package/dist/node_modules/.pnpm/@radix-ui_react-form@0.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.18_z32yjmfa36dn2egycaeb5u52lm/node_modules/@radix-ui/react-form/dist/index.js +365 -234
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.js +11 -10
- package/dist/node_modules/.pnpm/@radix-ui_react-label@2.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.1_qr7n7ocfbwauilv6obluyms2qy/node_modules/@radix-ui/react-label/dist/index.js +21 -15
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.2.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._z2gu7tymhfvx6ebd6lqqykecmq/node_modules/@radix-ui/react-popper/dist/index.js +206 -138
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.3_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._jmui37rk6fvzofztyauznikgpi/node_modules/@radix-ui/react-portal/dist/index.js +15 -13
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._ulc3jfxcmrz2rfz7bui53djdtu/node_modules/@radix-ui/react-portal/dist/index.js +15 -13
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18._pqwkltkxenlrsgmgun6icjiigu/node_modules/@radix-ui/react-presence/dist/index.js +104 -46
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18_sspjpiczol7qxzbuuyfihuep4u/node_modules/@radix-ui/react-primitive/dist/index.js +20 -14
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18_sejcxqoscaweil2bvgwwavaoha/node_modules/@radix-ui/react-primitive/dist/index.js +20 -14
- package/dist/node_modules/.pnpm/@radix-ui_react-progress@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18._wpsg2ubedou6txnsnvgmus4txq/node_modules/@radix-ui/react-progress/dist/index.js +71 -59
- package/dist/node_modules/.pnpm/@radix-ui_react-radio-group@1.2.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@_2u6lfd2xt65wmbxn7lgvaxqbmy/node_modules/@radix-ui/react-radio-group/dist/index.js +211 -161
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_bkbd3syfptkiebtjifbhjosaba/node_modules/@radix-ui/react-roving-focus/dist/index.js +176 -132
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_ki7uy4u3diz5446cqygvbjwuge/node_modules/@radix-ui/react-roving-focus/dist/index.js +176 -132
- package/dist/node_modules/.pnpm/@radix-ui_react-select@2.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._atdh45n5c7sked5b6tbwgdz7re/node_modules/@radix-ui/react-select/dist/index.js +938 -607
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js +70 -36
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.2_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.js +72 -34
- package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._udl6ccyllphugejc6sszfrese4/node_modules/@radix-ui/react-switch/dist/index.js +104 -81
- package/dist/node_modules/.pnpm/@radix-ui_react-toast@1.2.6_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.1_mux33mveszkw5z6iia6acnivvy/node_modules/@radix-ui/react-toast/dist/index.js +517 -323
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react_3smwloudr6a3igss4kifyxcwju/node_modules/@radix-ui/react-toggle-group/dist/index.js +139 -105
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._yiv2ptaqcv244n5f7zfldmgupm/node_modules/@radix-ui/react-toggle/dist/index.js +25 -21
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -9
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +36 -23
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +13 -10
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-previous/dist/index.js +11 -5
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.0_@types_react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-size/dist/index.js +34 -22
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.1_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_m7thze522i3jfpb2tnge6dybgi/node_modules/@radix-ui/react-visually-hidden/dist/index.js +29 -26
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_re_omyrydx3gc2oidaiqb4gsovieq/node_modules/@radix-ui/react-visually-hidden/dist/index.js +29 -26
- package/dist/node_modules/.pnpm/@uidotdev_usehooks@2.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@uidotdev/usehooks/index.js +53 -26
- package/dist/node_modules/.pnpm/aria-hidden@1.2.4/node_modules/aria-hidden/dist/es2015/index.js +111 -41
- package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js +40 -30
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +13 -13
- package/dist/node_modules/.pnpm/countries-list@3.1.1/node_modules/countries-list/mjs/index.js +6 -4
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +5 -3
- package/dist/node_modules/.pnpm/input-otp@1.4.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-otp/dist/index.js +152 -145
- package/dist/node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js +291 -271
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js +41 -65
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -5
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +28 -16
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.js +8 -8
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +157 -95
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -24
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +12 -9
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +86 -48
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
- package/dist/node_modules/.pnpm/react-remove-scroll@2.6.2_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.18_react@18.3.1/node_modules/react-style-singleton/dist/es2015/component.js +9 -7
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.18_react@18.3.1/node_modules/react-style-singleton/dist/es2015/hook.js +11 -10
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.18_react@18.3.1/node_modules/react-style-singleton/dist/es2015/singleton.js +35 -17
- package/dist/node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.js +625 -424
- package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/lib/public/create-plugin.js +21 -17
- package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/lib/util/createPlugin.js +28 -21
- package/dist/node_modules/.pnpm/tailwindcss@3.4.17/node_modules/tailwindcss/plugin.js +10 -8
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +33 -21
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.18_react@18.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.js +8 -3
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.18_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +28 -19
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.18_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useRef.js +15 -11
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@18.3.18_react@18.3.1/node_modules/use-sidecar/dist/es2015/exports.js +15 -12
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@18.3.18_react@18.3.1/node_modules/use-sidecar/dist/es2015/medium.js +64 -43
- package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3.18_react-dom@18.3._7iqkcrcg5qjc3n2ixm6rnrnx3e/node_modules/vaul/dist/index.js +1205 -764
- package/dist/tailwind/index.d.ts +36 -0
- package/dist/{tailwind/index.js → tailwind.js} +119 -20
- package/package.json +86 -79
- package/public/flags/AD.svg +35 -0
- package/public/flags/AE.svg +30 -0
- package/public/flags/AF.svg +34 -0
- package/public/flags/AG.svg +38 -0
- package/public/flags/AI.svg +54 -0
- package/public/flags/AL.svg +22 -0
- package/public/flags/AM.svg +26 -0
- package/public/flags/AO.svg +34 -0
- package/public/flags/AR.svg +30 -0
- package/public/flags/AS.svg +38 -0
- package/public/flags/AT.svg +26 -0
- package/public/flags/AU.svg +59 -0
- package/public/flags/AW.svg +38 -0
- package/public/flags/AX.svg +38 -0
- package/public/flags/AZ.svg +34 -0
- package/public/flags/BA.svg +30 -0
- package/public/flags/BB.svg +30 -0
- package/public/flags/BD.svg +22 -0
- package/public/flags/BE.svg +26 -0
- package/public/flags/BF.svg +31 -0
- package/public/flags/BG.svg +26 -0
- package/public/flags/BH.svg +22 -0
- package/public/flags/BI.svg +50 -0
- package/public/flags/BJ.svg +26 -0
- package/public/flags/BL.svg +44 -0
- package/public/flags/BM.svg +52 -0
- package/public/flags/BN.svg +42 -0
- package/public/flags/BO.svg +26 -0
- package/public/flags/BQ.svg +34 -0
- package/public/flags/BR.svg +34 -0
- package/public/flags/BS.svg +30 -0
- package/public/flags/BT.svg +30 -0
- package/public/flags/BW.svg +30 -0
- package/public/flags/BY.svg +50 -0
- package/public/flags/BZ.svg +43 -0
- package/public/flags/CA.svg +30 -0
- package/public/flags/CC.svg +54 -0
- package/public/flags/CD.svg +34 -0
- package/public/flags/CF.svg +52 -0
- package/public/flags/CG.svg +26 -0
- package/public/flags/CH.svg +22 -0
- package/public/flags/CI.svg +26 -0
- package/public/flags/CK.svg +66 -0
- package/public/flags/CL.svg +30 -0
- package/public/flags/CM.svg +30 -0
- package/public/flags/CN.svg +38 -0
- package/public/flags/CO.svg +26 -0
- package/public/flags/CR.svg +30 -0
- package/public/flags/CU.svg +39 -0
- package/public/flags/CV.svg +70 -0
- package/public/flags/CW.svg +34 -0
- package/public/flags/CY.svg +26 -0
- package/public/flags/CZ.svg +26 -0
- package/public/flags/DE.svg +26 -0
- package/public/flags/DJ.svg +30 -0
- package/public/flags/DK.svg +34 -0
- package/public/flags/DM.svg +114 -0
- package/public/flags/DO.svg +46 -0
- package/public/flags/DZ.svg +30 -0
- package/public/flags/EC.svg +38 -0
- package/public/flags/EE.svg +26 -0
- package/public/flags/EG.svg +30 -0
- package/public/flags/ER.svg +30 -0
- package/public/flags/ES.svg +26 -0
- package/public/flags/ET.svg +38 -0
- package/public/flags/EU.svg +50 -0
- package/public/flags/FI.svg +22 -0
- package/public/flags/FJ.svg +47 -0
- package/public/flags/FK.svg +50 -0
- package/public/flags/FM.svg +34 -0
- package/public/flags/FO.svg +26 -0
- package/public/flags/FR.svg +26 -0
- package/public/flags/GA.svg +26 -0
- package/public/flags/GB.svg +70 -0
- package/public/flags/GD.svg +83 -0
- package/public/flags/GE.svg +38 -0
- package/public/flags/GG.svg +26 -0
- package/public/flags/GH.svg +30 -0
- package/public/flags/GI.svg +30 -0
- package/public/flags/GL.svg +30 -0
- package/public/flags/GM.svg +30 -0
- package/public/flags/GN.svg +26 -0
- package/public/flags/GP.svg +26 -0
- package/public/flags/GQ.svg +39 -0
- package/public/flags/GR.svg +38 -0
- package/public/flags/GT.svg +34 -0
- package/public/flags/GU.svg +44 -0
- package/public/flags/GW.svg +34 -0
- package/public/flags/GY.svg +38 -0
- package/public/flags/HK.svg +38 -0
- package/public/flags/HN.svg +46 -0
- package/public/flags/HR.svg +69 -0
- package/public/flags/HT.svg +40 -0
- package/public/flags/HU.svg +26 -0
- package/public/flags/ID.svg +22 -0
- package/public/flags/IE.svg +26 -0
- package/public/flags/IL.svg +30 -0
- package/public/flags/IM.svg +22 -0
- package/public/flags/IN.svg +38 -0
- package/public/flags/IO.svg +82 -0
- package/public/flags/IQ.svg +38 -0
- package/public/flags/IR.svg +30 -0
- package/public/flags/IS.svg +38 -0
- package/public/flags/IT.svg +26 -0
- package/public/flags/JE.svg +30 -0
- package/public/flags/JM.svg +34 -0
- package/public/flags/JO.svg +34 -0
- package/public/flags/JP.svg +22 -0
- package/public/flags/KE.svg +54 -0
- package/public/flags/KG.svg +42 -0
- package/public/flags/KH.svg +30 -0
- package/public/flags/KI.svg +46 -0
- package/public/flags/KM.svg +54 -0
- package/public/flags/KP.svg +38 -0
- package/public/flags/KR.svg +98 -0
- package/public/flags/KW.svg +30 -0
- package/public/flags/KY.svg +55 -0
- package/public/flags/KZ.svg +30 -0
- package/public/flags/LA.svg +30 -0
- package/public/flags/LB.svg +30 -0
- package/public/flags/LC.svg +21 -0
- package/public/flags/LI.svg +26 -0
- package/public/flags/LK.svg +32 -0
- package/public/flags/LR.svg +70 -0
- package/public/flags/LS.svg +30 -0
- package/public/flags/LT.svg +26 -0
- package/public/flags/LU.svg +26 -0
- package/public/flags/LV.svg +26 -0
- package/public/flags/LY.svg +34 -0
- package/public/flags/MA.svg +22 -0
- package/public/flags/MC.svg +22 -0
- package/public/flags/MD.svg +35 -0
- package/public/flags/ME.svg +35 -0
- package/public/flags/MG.svg +26 -0
- package/public/flags/MH.svg +30 -0
- package/public/flags/MK.svg +58 -0
- package/public/flags/ML.svg +26 -0
- package/public/flags/MM.svg +30 -0
- package/public/flags/MN.svg +42 -0
- package/public/flags/MO.svg +50 -0
- package/public/flags/MP.svg +34 -0
- package/public/flags/MQ.svg +50 -0
- package/public/flags/MR.svg +26 -0
- package/public/flags/MS.svg +46 -0
- package/public/flags/MT.svg +26 -0
- package/public/flags/MU.svg +30 -0
- package/public/flags/MV.svg +23 -0
- package/public/flags/MW.svg +30 -0
- package/public/flags/MX.svg +34 -0
- package/public/flags/MY.svg +46 -0
- package/public/flags/MZ.svg +43 -0
- package/public/flags/NA.svg +34 -0
- package/public/flags/NE.svg +30 -0
- package/public/flags/NF.svg +30 -0
- package/public/flags/NG.svg +26 -0
- package/public/flags/NI.svg +39 -0
- package/public/flags/NL.svg +26 -0
- package/public/flags/NO.svg +38 -0
- package/public/flags/NP.svg +39 -0
- package/public/flags/NR.svg +34 -0
- package/public/flags/NU.svg +55 -0
- package/public/flags/NZ.svg +50 -0
- package/public/flags/OM.svg +38 -0
- package/public/flags/PA.svg +34 -0
- package/public/flags/PE.svg +26 -0
- package/public/flags/PF.svg +37 -0
- package/public/flags/PG.svg +46 -0
- package/public/flags/PH.svg +42 -0
- package/public/flags/PK.svg +34 -0
- package/public/flags/PL.svg +22 -0
- package/public/flags/PN.svg +50 -0
- package/public/flags/PR.svg +38 -0
- package/public/flags/PS.svg +30 -0
- package/public/flags/PT.svg +34 -0
- package/public/flags/PW.svg +22 -0
- package/public/flags/PY.svg +34 -0
- package/public/flags/QA.svg +22 -0
- package/public/flags/RO.svg +26 -0
- package/public/flags/RS.svg +42 -0
- package/public/flags/RU.svg +26 -0
- package/public/flags/RW.svg +30 -0
- package/public/flags/SA.svg +36 -0
- package/public/flags/SB.svg +46 -0
- package/public/flags/SC.svg +34 -0
- package/public/flags/SD.svg +30 -0
- package/public/flags/SE.svg +39 -0
- package/public/flags/SG.svg +46 -0
- package/public/flags/SI.svg +30 -0
- package/public/flags/SK.svg +42 -0
- package/public/flags/SL.svg +26 -0
- package/public/flags/SM.svg +42 -0
- package/public/flags/SN.svg +30 -0
- package/public/flags/SO.svg +22 -0
- package/public/flags/SR.svg +34 -0
- package/public/flags/SS.svg +38 -0
- package/public/flags/ST.svg +38 -0
- package/public/flags/SV.svg +35 -0
- package/public/flags/SX.svg +46 -0
- package/public/flags/SY.svg +34 -0
- package/public/flags/SZ.svg +50 -0
- package/public/flags/TC.svg +54 -0
- package/public/flags/TD.svg +26 -0
- package/public/flags/TG.svg +38 -0
- package/public/flags/TH.svg +30 -0
- package/public/flags/TJ.svg +58 -0
- package/public/flags/TK.svg +38 -0
- package/public/flags/TL.svg +30 -0
- package/public/flags/TM.svg +95 -0
- package/public/flags/TN.svg +30 -0
- package/public/flags/TO.svg +26 -0
- package/public/flags/TR.svg +26 -0
- package/public/flags/TT.svg +30 -0
- package/public/flags/TV.svg +72 -0
- package/public/flags/TW.svg +34 -0
- package/public/flags/TZ.svg +30 -0
- package/public/flags/UA.svg +22 -0
- package/public/flags/UG.svg +42 -0
- package/public/flags/US.svg +38 -0
- package/public/flags/UY.svg +42 -0
- package/public/flags/UZ.svg +86 -0
- package/public/flags/VA.svg +30 -0
- package/public/flags/VC.svg +43 -0
- package/public/flags/VE.svg +58 -0
- package/public/flags/VG.svg +53 -0
- package/public/flags/VN.svg +22 -0
- package/public/flags/VU.svg +111 -0
- package/public/flags/WS.svg +42 -0
- package/public/flags/XK.svg +46 -0
- package/public/flags/YE.svg +26 -0
- package/public/flags/ZA.svg +38 -0
- package/public/flags/ZM.svg +34 -0
- package/public/flags/ZW.svg +58 -0
- package/public/globals.css +3 -1
- package/dist/_virtual/dynamic-import-helper.js +0 -16
- package/dist/components/AlertDialog/index.js +0 -12
- package/dist/components/AlertDialog/types.js +0 -1
- package/dist/components/BottomBar/index.js +0 -4
- package/dist/components/BulletList/index.js +0 -4
- package/dist/components/BulletListItem/BulletListItem.d.ts +0 -7
- package/dist/components/BulletListItem/BulletListItem.js +0 -23
- package/dist/components/BulletListItem/index.d.ts +0 -1
- package/dist/components/BulletListItem/index.js +0 -4
- package/dist/components/BulletPoint/BulletPoint.d.ts +0 -6
- package/dist/components/BulletPoint/BulletPoint.js +0 -22
- package/dist/components/BulletPoint/index.d.ts +0 -1
- package/dist/components/BulletPoint/index.js +0 -1
- package/dist/components/Button/index.js +0 -4
- package/dist/components/Checkbox/index.js +0 -4
- package/dist/components/Chip/index.js +0 -4
- package/dist/components/ClearButton/index.js +0 -4
- package/dist/components/ColorPicker/index.js +0 -5
- package/dist/components/CountryDrawer/index.js +0 -4
- package/dist/components/Drawer/index.js +0 -9
- package/dist/components/Drawer/types.js +0 -1
- package/dist/components/Flag/LazyFlag.d.ts +0 -13
- package/dist/components/Flag/LazyFlag.js +0 -25
- package/dist/components/Flag/flag-components/ad.d.ts +0 -3
- package/dist/components/Flag/flag-components/ad.js +0 -56
- package/dist/components/Flag/flag-components/ae.d.ts +0 -3
- package/dist/components/Flag/flag-components/ae.js +0 -48
- package/dist/components/Flag/flag-components/af.d.ts +0 -3
- package/dist/components/Flag/flag-components/af.js +0 -55
- package/dist/components/Flag/flag-components/ag.d.ts +0 -3
- package/dist/components/Flag/flag-components/ag.js +0 -62
- package/dist/components/Flag/flag-components/ai.d.ts +0 -3
- package/dist/components/Flag/flag-components/ai.js +0 -90
- package/dist/components/Flag/flag-components/al.d.ts +0 -3
- package/dist/components/Flag/flag-components/al.js +0 -34
- package/dist/components/Flag/flag-components/am.d.ts +0 -3
- package/dist/components/Flag/flag-components/am.js +0 -41
- package/dist/components/Flag/flag-components/ao.d.ts +0 -3
- package/dist/components/Flag/flag-components/ao.js +0 -55
- package/dist/components/Flag/flag-components/ar.d.ts +0 -3
- package/dist/components/Flag/flag-components/ar.js +0 -48
- package/dist/components/Flag/flag-components/as.d.ts +0 -3
- package/dist/components/Flag/flag-components/as.js +0 -62
- package/dist/components/Flag/flag-components/at.d.ts +0 -3
- package/dist/components/Flag/flag-components/at.js +0 -41
- package/dist/components/Flag/flag-components/au.d.ts +0 -3
- package/dist/components/Flag/flag-components/au.js +0 -98
- package/dist/components/Flag/flag-components/aw.d.ts +0 -3
- package/dist/components/Flag/flag-components/aw.js +0 -62
- package/dist/components/Flag/flag-components/ax.d.ts +0 -3
- package/dist/components/Flag/flag-components/ax.js +0 -62
- package/dist/components/Flag/flag-components/az.d.ts +0 -3
- package/dist/components/Flag/flag-components/az.js +0 -55
- package/dist/components/Flag/flag-components/ba.d.ts +0 -3
- package/dist/components/Flag/flag-components/ba.js +0 -48
- package/dist/components/Flag/flag-components/bb.d.ts +0 -3
- package/dist/components/Flag/flag-components/bb.js +0 -48
- package/dist/components/Flag/flag-components/bd.d.ts +0 -3
- package/dist/components/Flag/flag-components/bd.js +0 -34
- package/dist/components/Flag/flag-components/be.d.ts +0 -3
- package/dist/components/Flag/flag-components/be.js +0 -41
- package/dist/components/Flag/flag-components/bf.d.ts +0 -3
- package/dist/components/Flag/flag-components/bf.js +0 -49
- package/dist/components/Flag/flag-components/bg.d.ts +0 -3
- package/dist/components/Flag/flag-components/bg.js +0 -41
- package/dist/components/Flag/flag-components/bh.d.ts +0 -3
- package/dist/components/Flag/flag-components/bh.js +0 -34
- package/dist/components/Flag/flag-components/bi.d.ts +0 -3
- package/dist/components/Flag/flag-components/bi.js +0 -83
- package/dist/components/Flag/flag-components/bj.d.ts +0 -3
- package/dist/components/Flag/flag-components/bj.js +0 -41
- package/dist/components/Flag/flag-components/bl.d.ts +0 -3
- package/dist/components/Flag/flag-components/bl.js +0 -71
- package/dist/components/Flag/flag-components/bm.d.ts +0 -3
- package/dist/components/Flag/flag-components/bm.js +0 -85
- package/dist/components/Flag/flag-components/bn.d.ts +0 -3
- package/dist/components/Flag/flag-components/bn.js +0 -66
- package/dist/components/Flag/flag-components/bo.d.ts +0 -3
- package/dist/components/Flag/flag-components/bo.js +0 -41
- package/dist/components/Flag/flag-components/bq.d.ts +0 -3
- package/dist/components/Flag/flag-components/bq.js +0 -55
- package/dist/components/Flag/flag-components/br.d.ts +0 -3
- package/dist/components/Flag/flag-components/br.js +0 -55
- package/dist/components/Flag/flag-components/bs.d.ts +0 -3
- package/dist/components/Flag/flag-components/bs.js +0 -48
- package/dist/components/Flag/flag-components/bt.d.ts +0 -3
- package/dist/components/Flag/flag-components/bt.js +0 -48
- package/dist/components/Flag/flag-components/bw.d.ts +0 -3
- package/dist/components/Flag/flag-components/bw.js +0 -48
- package/dist/components/Flag/flag-components/by.d.ts +0 -3
- package/dist/components/Flag/flag-components/by.js +0 -83
- package/dist/components/Flag/flag-components/bz.d.ts +0 -3
- package/dist/components/Flag/flag-components/bz.js +0 -70
- package/dist/components/Flag/flag-components/ca.d.ts +0 -3
- package/dist/components/Flag/flag-components/ca.js +0 -48
- package/dist/components/Flag/flag-components/cc.d.ts +0 -3
- package/dist/components/Flag/flag-components/cc.js +0 -90
- package/dist/components/Flag/flag-components/cd.d.ts +0 -3
- package/dist/components/Flag/flag-components/cd.js +0 -55
- package/dist/components/Flag/flag-components/cf.d.ts +0 -3
- package/dist/components/Flag/flag-components/cf.js +0 -85
- package/dist/components/Flag/flag-components/cg.d.ts +0 -3
- package/dist/components/Flag/flag-components/cg.js +0 -41
- package/dist/components/Flag/flag-components/ch.d.ts +0 -3
- package/dist/components/Flag/flag-components/ch.js +0 -34
- package/dist/components/Flag/flag-components/ci.d.ts +0 -3
- package/dist/components/Flag/flag-components/ci.js +0 -41
- package/dist/components/Flag/flag-components/ck.d.ts +0 -3
- package/dist/components/Flag/flag-components/ck.js +0 -111
- package/dist/components/Flag/flag-components/cl.d.ts +0 -3
- package/dist/components/Flag/flag-components/cl.js +0 -48
- package/dist/components/Flag/flag-components/cm.d.ts +0 -3
- package/dist/components/Flag/flag-components/cm.js +0 -48
- package/dist/components/Flag/flag-components/cn.d.ts +0 -3
- package/dist/components/Flag/flag-components/cn.js +0 -62
- package/dist/components/Flag/flag-components/co.d.ts +0 -3
- package/dist/components/Flag/flag-components/co.js +0 -41
- package/dist/components/Flag/flag-components/cr.d.ts +0 -3
- package/dist/components/Flag/flag-components/cr.js +0 -48
- package/dist/components/Flag/flag-components/cu.d.ts +0 -3
- package/dist/components/Flag/flag-components/cu.js +0 -63
- package/dist/components/Flag/flag-components/cv.d.ts +0 -3
- package/dist/components/Flag/flag-components/cv.js +0 -118
- package/dist/components/Flag/flag-components/cw.d.ts +0 -3
- package/dist/components/Flag/flag-components/cw.js +0 -55
- package/dist/components/Flag/flag-components/cy.d.ts +0 -3
- package/dist/components/Flag/flag-components/cy.js +0 -41
- package/dist/components/Flag/flag-components/cz.d.ts +0 -3
- package/dist/components/Flag/flag-components/cz.js +0 -41
- package/dist/components/Flag/flag-components/de.d.ts +0 -3
- package/dist/components/Flag/flag-components/de.js +0 -41
- package/dist/components/Flag/flag-components/dj.d.ts +0 -3
- package/dist/components/Flag/flag-components/dj.js +0 -48
- package/dist/components/Flag/flag-components/dk.d.ts +0 -3
- package/dist/components/Flag/flag-components/dk.js +0 -55
- package/dist/components/Flag/flag-components/dm.d.ts +0 -3
- package/dist/components/Flag/flag-components/dm.js +0 -195
- package/dist/components/Flag/flag-components/do.d.ts +0 -3
- package/dist/components/Flag/flag-components/do.js +0 -76
- package/dist/components/Flag/flag-components/dz.d.ts +0 -3
- package/dist/components/Flag/flag-components/dz.js +0 -48
- package/dist/components/Flag/flag-components/ec.d.ts +0 -3
- package/dist/components/Flag/flag-components/ec.js +0 -62
- package/dist/components/Flag/flag-components/ee.d.ts +0 -3
- package/dist/components/Flag/flag-components/ee.js +0 -41
- package/dist/components/Flag/flag-components/eg.d.ts +0 -3
- package/dist/components/Flag/flag-components/eg.js +0 -48
- package/dist/components/Flag/flag-components/er.d.ts +0 -3
- package/dist/components/Flag/flag-components/er.js +0 -48
- package/dist/components/Flag/flag-components/es.d.ts +0 -3
- package/dist/components/Flag/flag-components/es.js +0 -41
- package/dist/components/Flag/flag-components/et.d.ts +0 -3
- package/dist/components/Flag/flag-components/et.js +0 -62
- package/dist/components/Flag/flag-components/eu.d.ts +0 -3
- package/dist/components/Flag/flag-components/eu.js +0 -83
- package/dist/components/Flag/flag-components/fi.d.ts +0 -3
- package/dist/components/Flag/flag-components/fi.js +0 -34
- package/dist/components/Flag/flag-components/fj.d.ts +0 -3
- package/dist/components/Flag/flag-components/fj.js +0 -77
- package/dist/components/Flag/flag-components/fk.d.ts +0 -3
- package/dist/components/Flag/flag-components/fk.js +0 -83
- package/dist/components/Flag/flag-components/fm.d.ts +0 -3
- package/dist/components/Flag/flag-components/fm.js +0 -55
- package/dist/components/Flag/flag-components/fo.d.ts +0 -3
- package/dist/components/Flag/flag-components/fo.js +0 -41
- package/dist/components/Flag/flag-components/fr.d.ts +0 -3
- package/dist/components/Flag/flag-components/fr.js +0 -41
- package/dist/components/Flag/flag-components/ga.d.ts +0 -3
- package/dist/components/Flag/flag-components/ga.js +0 -41
- package/dist/components/Flag/flag-components/gb.d.ts +0 -3
- package/dist/components/Flag/flag-components/gb.js +0 -118
- package/dist/components/Flag/flag-components/gd.d.ts +0 -3
- package/dist/components/Flag/flag-components/gd.js +0 -140
- package/dist/components/Flag/flag-components/ge.d.ts +0 -3
- package/dist/components/Flag/flag-components/ge.js +0 -62
- package/dist/components/Flag/flag-components/gg.d.ts +0 -3
- package/dist/components/Flag/flag-components/gg.js +0 -41
- package/dist/components/Flag/flag-components/gh.d.ts +0 -3
- package/dist/components/Flag/flag-components/gh.js +0 -48
- package/dist/components/Flag/flag-components/gi.d.ts +0 -3
- package/dist/components/Flag/flag-components/gi.js +0 -48
- package/dist/components/Flag/flag-components/gl.d.ts +0 -3
- package/dist/components/Flag/flag-components/gl.js +0 -48
- package/dist/components/Flag/flag-components/gm.d.ts +0 -3
- package/dist/components/Flag/flag-components/gm.js +0 -48
- package/dist/components/Flag/flag-components/gn.d.ts +0 -3
- package/dist/components/Flag/flag-components/gn.js +0 -41
- package/dist/components/Flag/flag-components/gp.d.ts +0 -3
- package/dist/components/Flag/flag-components/gp.js +0 -41
- package/dist/components/Flag/flag-components/gq.d.ts +0 -3
- package/dist/components/Flag/flag-components/gq.js +0 -63
- package/dist/components/Flag/flag-components/gr.d.ts +0 -3
- package/dist/components/Flag/flag-components/gr.js +0 -62
- package/dist/components/Flag/flag-components/gt.d.ts +0 -3
- package/dist/components/Flag/flag-components/gt.js +0 -55
- package/dist/components/Flag/flag-components/gu.d.ts +0 -3
- package/dist/components/Flag/flag-components/gu.js +0 -71
- package/dist/components/Flag/flag-components/gw.d.ts +0 -3
- package/dist/components/Flag/flag-components/gw.js +0 -55
- package/dist/components/Flag/flag-components/gy.d.ts +0 -3
- package/dist/components/Flag/flag-components/gy.js +0 -62
- package/dist/components/Flag/flag-components/hk.d.ts +0 -3
- package/dist/components/Flag/flag-components/hk.js +0 -62
- package/dist/components/Flag/flag-components/hn.d.ts +0 -3
- package/dist/components/Flag/flag-components/hn.js +0 -76
- package/dist/components/Flag/flag-components/hr.d.ts +0 -3
- package/dist/components/Flag/flag-components/hr.js +0 -108
- package/dist/components/Flag/flag-components/ht.d.ts +0 -3
- package/dist/components/Flag/flag-components/ht.js +0 -64
- package/dist/components/Flag/flag-components/hu.d.ts +0 -3
- package/dist/components/Flag/flag-components/hu.js +0 -41
- package/dist/components/Flag/flag-components/id.d.ts +0 -3
- package/dist/components/Flag/flag-components/id.js +0 -34
- package/dist/components/Flag/flag-components/ie.d.ts +0 -3
- package/dist/components/Flag/flag-components/ie.js +0 -41
- package/dist/components/Flag/flag-components/il.d.ts +0 -3
- package/dist/components/Flag/flag-components/il.js +0 -48
- package/dist/components/Flag/flag-components/im.d.ts +0 -3
- package/dist/components/Flag/flag-components/im.js +0 -34
- package/dist/components/Flag/flag-components/in.d.ts +0 -3
- package/dist/components/Flag/flag-components/in.js +0 -62
- package/dist/components/Flag/flag-components/index.d.ts +0 -232
- package/dist/components/Flag/flag-components/index.js +0 -466
- package/dist/components/Flag/flag-components/io.d.ts +0 -3
- package/dist/components/Flag/flag-components/io.js +0 -136
- package/dist/components/Flag/flag-components/iq.d.ts +0 -3
- package/dist/components/Flag/flag-components/iq.js +0 -62
- package/dist/components/Flag/flag-components/ir.d.ts +0 -3
- package/dist/components/Flag/flag-components/ir.js +0 -48
- package/dist/components/Flag/flag-components/is.d.ts +0 -3
- package/dist/components/Flag/flag-components/is.js +0 -62
- package/dist/components/Flag/flag-components/it.d.ts +0 -3
- package/dist/components/Flag/flag-components/it.js +0 -41
- package/dist/components/Flag/flag-components/je.d.ts +0 -3
- package/dist/components/Flag/flag-components/je.js +0 -48
- package/dist/components/Flag/flag-components/jm.d.ts +0 -3
- package/dist/components/Flag/flag-components/jm.js +0 -55
- package/dist/components/Flag/flag-components/jo.d.ts +0 -3
- package/dist/components/Flag/flag-components/jo.js +0 -55
- package/dist/components/Flag/flag-components/jp.d.ts +0 -3
- package/dist/components/Flag/flag-components/jp.js +0 -34
- package/dist/components/Flag/flag-components/ke.d.ts +0 -3
- package/dist/components/Flag/flag-components/ke.js +0 -90
- package/dist/components/Flag/flag-components/kg.d.ts +0 -3
- package/dist/components/Flag/flag-components/kg.js +0 -69
- package/dist/components/Flag/flag-components/kh.d.ts +0 -3
- package/dist/components/Flag/flag-components/kh.js +0 -48
- package/dist/components/Flag/flag-components/ki.d.ts +0 -3
- package/dist/components/Flag/flag-components/ki.js +0 -76
- package/dist/components/Flag/flag-components/km.d.ts +0 -3
- package/dist/components/Flag/flag-components/km.js +0 -90
- package/dist/components/Flag/flag-components/kp.d.ts +0 -3
- package/dist/components/Flag/flag-components/kp.js +0 -62
- package/dist/components/Flag/flag-components/kr.d.ts +0 -3
- package/dist/components/Flag/flag-components/kr.js +0 -167
- package/dist/components/Flag/flag-components/kw.d.ts +0 -3
- package/dist/components/Flag/flag-components/kw.js +0 -48
- package/dist/components/Flag/flag-components/ky.d.ts +0 -3
- package/dist/components/Flag/flag-components/ky.js +0 -91
- package/dist/components/Flag/flag-components/kz.d.ts +0 -3
- package/dist/components/Flag/flag-components/kz.js +0 -48
- package/dist/components/Flag/flag-components/la.d.ts +0 -3
- package/dist/components/Flag/flag-components/la.js +0 -48
- package/dist/components/Flag/flag-components/lb.d.ts +0 -3
- package/dist/components/Flag/flag-components/lb.js +0 -48
- package/dist/components/Flag/flag-components/lc.d.ts +0 -3
- package/dist/components/Flag/flag-components/lc.js +0 -30
- package/dist/components/Flag/flag-components/li.d.ts +0 -3
- package/dist/components/Flag/flag-components/li.js +0 -41
- package/dist/components/Flag/flag-components/lk.d.ts +0 -3
- package/dist/components/Flag/flag-components/lk.js +0 -50
- package/dist/components/Flag/flag-components/lr.d.ts +0 -3
- package/dist/components/Flag/flag-components/lr.js +0 -118
- package/dist/components/Flag/flag-components/ls.d.ts +0 -3
- package/dist/components/Flag/flag-components/ls.js +0 -48
- package/dist/components/Flag/flag-components/lt.d.ts +0 -3
- package/dist/components/Flag/flag-components/lt.js +0 -41
- package/dist/components/Flag/flag-components/lu.d.ts +0 -3
- package/dist/components/Flag/flag-components/lu.js +0 -41
- package/dist/components/Flag/flag-components/lv.d.ts +0 -3
- package/dist/components/Flag/flag-components/lv.js +0 -41
- package/dist/components/Flag/flag-components/ly.d.ts +0 -3
- package/dist/components/Flag/flag-components/ly.js +0 -55
- package/dist/components/Flag/flag-components/ma.d.ts +0 -3
- package/dist/components/Flag/flag-components/ma.js +0 -34
- package/dist/components/Flag/flag-components/mc.d.ts +0 -3
- package/dist/components/Flag/flag-components/mc.js +0 -34
- package/dist/components/Flag/flag-components/md.d.ts +0 -3
- package/dist/components/Flag/flag-components/md.js +0 -56
- package/dist/components/Flag/flag-components/me.d.ts +0 -3
- package/dist/components/Flag/flag-components/me.js +0 -56
- package/dist/components/Flag/flag-components/mg.d.ts +0 -3
- package/dist/components/Flag/flag-components/mg.js +0 -41
- package/dist/components/Flag/flag-components/mh.d.ts +0 -3
- package/dist/components/Flag/flag-components/mh.js +0 -48
- package/dist/components/Flag/flag-components/mk.d.ts +0 -3
- package/dist/components/Flag/flag-components/mk.js +0 -97
- package/dist/components/Flag/flag-components/ml.d.ts +0 -3
- package/dist/components/Flag/flag-components/ml.js +0 -41
- package/dist/components/Flag/flag-components/mm.d.ts +0 -3
- package/dist/components/Flag/flag-components/mm.js +0 -48
- package/dist/components/Flag/flag-components/mn.d.ts +0 -3
- package/dist/components/Flag/flag-components/mn.js +0 -66
- package/dist/components/Flag/flag-components/mo.d.ts +0 -3
- package/dist/components/Flag/flag-components/mo.js +0 -83
- package/dist/components/Flag/flag-components/mp.d.ts +0 -3
- package/dist/components/Flag/flag-components/mp.js +0 -55
- package/dist/components/Flag/flag-components/mq.d.ts +0 -3
- package/dist/components/Flag/flag-components/mq.js +0 -83
- package/dist/components/Flag/flag-components/mr.d.ts +0 -3
- package/dist/components/Flag/flag-components/mr.js +0 -41
- package/dist/components/Flag/flag-components/ms.d.ts +0 -3
- package/dist/components/Flag/flag-components/ms.js +0 -76
- package/dist/components/Flag/flag-components/mt.d.ts +0 -3
- package/dist/components/Flag/flag-components/mt.js +0 -41
- package/dist/components/Flag/flag-components/mu.d.ts +0 -3
- package/dist/components/Flag/flag-components/mu.js +0 -48
- package/dist/components/Flag/flag-components/mv.d.ts +0 -3
- package/dist/components/Flag/flag-components/mv.js +0 -35
- package/dist/components/Flag/flag-components/mw.d.ts +0 -3
- package/dist/components/Flag/flag-components/mw.js +0 -48
- package/dist/components/Flag/flag-components/mx.d.ts +0 -3
- package/dist/components/Flag/flag-components/mx.js +0 -55
- package/dist/components/Flag/flag-components/my.d.ts +0 -3
- package/dist/components/Flag/flag-components/my.js +0 -76
- package/dist/components/Flag/flag-components/mz.d.ts +0 -3
- package/dist/components/Flag/flag-components/mz.js +0 -70
- package/dist/components/Flag/flag-components/na.d.ts +0 -3
- package/dist/components/Flag/flag-components/na.js +0 -55
- package/dist/components/Flag/flag-components/ne.d.ts +0 -3
- package/dist/components/Flag/flag-components/ne.js +0 -48
- package/dist/components/Flag/flag-components/nf.d.ts +0 -3
- package/dist/components/Flag/flag-components/nf.js +0 -48
- package/dist/components/Flag/flag-components/ng.d.ts +0 -3
- package/dist/components/Flag/flag-components/ng.js +0 -41
- package/dist/components/Flag/flag-components/ni.d.ts +0 -3
- package/dist/components/Flag/flag-components/ni.js +0 -63
- package/dist/components/Flag/flag-components/nl.d.ts +0 -3
- package/dist/components/Flag/flag-components/nl.js +0 -41
- package/dist/components/Flag/flag-components/no.d.ts +0 -3
- package/dist/components/Flag/flag-components/no.js +0 -62
- package/dist/components/Flag/flag-components/np.d.ts +0 -3
- package/dist/components/Flag/flag-components/np.js +0 -63
- package/dist/components/Flag/flag-components/nr.d.ts +0 -3
- package/dist/components/Flag/flag-components/nr.js +0 -55
- package/dist/components/Flag/flag-components/nu.d.ts +0 -3
- package/dist/components/Flag/flag-components/nu.js +0 -91
- package/dist/components/Flag/flag-components/nz.d.ts +0 -3
- package/dist/components/Flag/flag-components/nz.js +0 -83
- package/dist/components/Flag/flag-components/om.d.ts +0 -3
- package/dist/components/Flag/flag-components/om.js +0 -62
- package/dist/components/Flag/flag-components/pa.d.ts +0 -3
- package/dist/components/Flag/flag-components/pa.js +0 -55
- package/dist/components/Flag/flag-components/pe.d.ts +0 -3
- package/dist/components/Flag/flag-components/pe.js +0 -41
- package/dist/components/Flag/flag-components/pf.d.ts +0 -3
- package/dist/components/Flag/flag-components/pf.js +0 -58
- package/dist/components/Flag/flag-components/pg.d.ts +0 -3
- package/dist/components/Flag/flag-components/pg.js +0 -76
- package/dist/components/Flag/flag-components/ph.d.ts +0 -3
- package/dist/components/Flag/flag-components/ph.js +0 -69
- package/dist/components/Flag/flag-components/pk.d.ts +0 -3
- package/dist/components/Flag/flag-components/pk.js +0 -55
- package/dist/components/Flag/flag-components/pl.d.ts +0 -3
- package/dist/components/Flag/flag-components/pl.js +0 -34
- package/dist/components/Flag/flag-components/pn.d.ts +0 -3
- package/dist/components/Flag/flag-components/pn.js +0 -83
- package/dist/components/Flag/flag-components/pr.d.ts +0 -3
- package/dist/components/Flag/flag-components/pr.js +0 -62
- package/dist/components/Flag/flag-components/ps.d.ts +0 -3
- package/dist/components/Flag/flag-components/ps.js +0 -48
- package/dist/components/Flag/flag-components/pt.d.ts +0 -3
- package/dist/components/Flag/flag-components/pt.js +0 -55
- package/dist/components/Flag/flag-components/pw.d.ts +0 -3
- package/dist/components/Flag/flag-components/pw.js +0 -34
- package/dist/components/Flag/flag-components/py.d.ts +0 -3
- package/dist/components/Flag/flag-components/py.js +0 -55
- package/dist/components/Flag/flag-components/qa.d.ts +0 -3
- package/dist/components/Flag/flag-components/qa.js +0 -34
- package/dist/components/Flag/flag-components/ro.d.ts +0 -3
- package/dist/components/Flag/flag-components/ro.js +0 -41
- package/dist/components/Flag/flag-components/rs.d.ts +0 -3
- package/dist/components/Flag/flag-components/rs.js +0 -69
- package/dist/components/Flag/flag-components/ru.d.ts +0 -3
- package/dist/components/Flag/flag-components/ru.js +0 -41
- package/dist/components/Flag/flag-components/rw.d.ts +0 -3
- package/dist/components/Flag/flag-components/rw.js +0 -48
- package/dist/components/Flag/flag-components/sa.d.ts +0 -3
- package/dist/components/Flag/flag-components/sa.js +0 -57
- package/dist/components/Flag/flag-components/sb.d.ts +0 -3
- package/dist/components/Flag/flag-components/sb.js +0 -76
- package/dist/components/Flag/flag-components/sc.d.ts +0 -3
- package/dist/components/Flag/flag-components/sc.js +0 -55
- package/dist/components/Flag/flag-components/sd.d.ts +0 -3
- package/dist/components/Flag/flag-components/sd.js +0 -48
- package/dist/components/Flag/flag-components/se.d.ts +0 -3
- package/dist/components/Flag/flag-components/se.js +0 -63
- package/dist/components/Flag/flag-components/sg.d.ts +0 -3
- package/dist/components/Flag/flag-components/sg.js +0 -76
- package/dist/components/Flag/flag-components/si.d.ts +0 -3
- package/dist/components/Flag/flag-components/si.js +0 -48
- package/dist/components/Flag/flag-components/sk.d.ts +0 -3
- package/dist/components/Flag/flag-components/sk.js +0 -69
- package/dist/components/Flag/flag-components/sl.d.ts +0 -3
- package/dist/components/Flag/flag-components/sl.js +0 -41
- package/dist/components/Flag/flag-components/sm.d.ts +0 -3
- package/dist/components/Flag/flag-components/sm.js +0 -69
- package/dist/components/Flag/flag-components/sn.d.ts +0 -3
- package/dist/components/Flag/flag-components/sn.js +0 -48
- package/dist/components/Flag/flag-components/so.d.ts +0 -3
- package/dist/components/Flag/flag-components/so.js +0 -34
- package/dist/components/Flag/flag-components/sr.d.ts +0 -3
- package/dist/components/Flag/flag-components/sr.js +0 -55
- package/dist/components/Flag/flag-components/ss.d.ts +0 -3
- package/dist/components/Flag/flag-components/ss.js +0 -62
- package/dist/components/Flag/flag-components/st.d.ts +0 -3
- package/dist/components/Flag/flag-components/st.js +0 -62
- package/dist/components/Flag/flag-components/sv.d.ts +0 -3
- package/dist/components/Flag/flag-components/sv.js +0 -56
- package/dist/components/Flag/flag-components/sx.d.ts +0 -3
- package/dist/components/Flag/flag-components/sx.js +0 -76
- package/dist/components/Flag/flag-components/sy.d.ts +0 -3
- package/dist/components/Flag/flag-components/sy.js +0 -55
- package/dist/components/Flag/flag-components/sz.d.ts +0 -3
- package/dist/components/Flag/flag-components/sz.js +0 -80
- package/dist/components/Flag/flag-components/tc.d.ts +0 -3
- package/dist/components/Flag/flag-components/tc.js +0 -90
- package/dist/components/Flag/flag-components/td.d.ts +0 -3
- package/dist/components/Flag/flag-components/td.js +0 -41
- package/dist/components/Flag/flag-components/tg.d.ts +0 -3
- package/dist/components/Flag/flag-components/tg.js +0 -62
- package/dist/components/Flag/flag-components/th.d.ts +0 -3
- package/dist/components/Flag/flag-components/th.js +0 -48
- package/dist/components/Flag/flag-components/tj.d.ts +0 -3
- package/dist/components/Flag/flag-components/tj.js +0 -97
- package/dist/components/Flag/flag-components/tk.d.ts +0 -3
- package/dist/components/Flag/flag-components/tk.js +0 -62
- package/dist/components/Flag/flag-components/tl.d.ts +0 -3
- package/dist/components/Flag/flag-components/tl.js +0 -48
- package/dist/components/Flag/flag-components/tm.d.ts +0 -3
- package/dist/components/Flag/flag-components/tm.js +0 -161
- package/dist/components/Flag/flag-components/tn.d.ts +0 -3
- package/dist/components/Flag/flag-components/tn.js +0 -48
- package/dist/components/Flag/flag-components/to.d.ts +0 -3
- package/dist/components/Flag/flag-components/to.js +0 -41
- package/dist/components/Flag/flag-components/tr.d.ts +0 -3
- package/dist/components/Flag/flag-components/tr.js +0 -41
- package/dist/components/Flag/flag-components/tt.d.ts +0 -3
- package/dist/components/Flag/flag-components/tt.js +0 -48
- package/dist/components/Flag/flag-components/tv.d.ts +0 -3
- package/dist/components/Flag/flag-components/tv.js +0 -120
- package/dist/components/Flag/flag-components/tw.d.ts +0 -3
- package/dist/components/Flag/flag-components/tw.js +0 -55
- package/dist/components/Flag/flag-components/tz.d.ts +0 -3
- package/dist/components/Flag/flag-components/tz.js +0 -48
- package/dist/components/Flag/flag-components/ua.d.ts +0 -3
- package/dist/components/Flag/flag-components/ua.js +0 -34
- package/dist/components/Flag/flag-components/ug.d.ts +0 -3
- package/dist/components/Flag/flag-components/ug.js +0 -69
- package/dist/components/Flag/flag-components/us.d.ts +0 -3
- package/dist/components/Flag/flag-components/us.js +0 -62
- package/dist/components/Flag/flag-components/uy.d.ts +0 -3
- package/dist/components/Flag/flag-components/uy.js +0 -69
- package/dist/components/Flag/flag-components/uz.d.ts +0 -3
- package/dist/components/Flag/flag-components/uz.js +0 -146
- package/dist/components/Flag/flag-components/va.d.ts +0 -3
- package/dist/components/Flag/flag-components/va.js +0 -48
- package/dist/components/Flag/flag-components/vc.d.ts +0 -3
- package/dist/components/Flag/flag-components/vc.js +0 -70
- package/dist/components/Flag/flag-components/ve.d.ts +0 -3
- package/dist/components/Flag/flag-components/ve.js +0 -97
- package/dist/components/Flag/flag-components/vg.d.ts +0 -3
- package/dist/components/Flag/flag-components/vg.js +0 -83
- package/dist/components/Flag/flag-components/vn.d.ts +0 -3
- package/dist/components/Flag/flag-components/vn.js +0 -34
- package/dist/components/Flag/flag-components/vu.d.ts +0 -3
- package/dist/components/Flag/flag-components/vu.js +0 -189
- package/dist/components/Flag/flag-components/ws.d.ts +0 -3
- package/dist/components/Flag/flag-components/ws.js +0 -69
- package/dist/components/Flag/flag-components/xk.d.ts +0 -3
- package/dist/components/Flag/flag-components/xk.js +0 -76
- package/dist/components/Flag/flag-components/ye.d.ts +0 -3
- package/dist/components/Flag/flag-components/ye.js +0 -41
- package/dist/components/Flag/flag-components/za.d.ts +0 -3
- package/dist/components/Flag/flag-components/za.js +0 -62
- package/dist/components/Flag/flag-components/zm.d.ts +0 -3
- package/dist/components/Flag/flag-components/zm.js +0 -55
- package/dist/components/Flag/flag-components/zw.d.ts +0 -3
- package/dist/components/Flag/flag-components/zw.js +0 -97
- package/dist/components/Flag/index.js +0 -8
- package/dist/components/Form/index.js +0 -4
- package/dist/components/Icons/Eye.js +0 -40
- package/dist/components/Icons/EyeClosed.js +0 -60
- package/dist/components/Input/index.js +0 -6
- package/dist/components/ListItem/index.js +0 -4
- package/dist/components/Marble/index.js +0 -4
- package/dist/components/NumberPad/index.js +0 -4
- package/dist/components/OTPField/index.js +0 -4
- package/dist/components/PasswordField/PasswordField.js +0 -45
- package/dist/components/PasswordField/index.js +0 -4
- package/dist/components/PasteButton/index.js +0 -4
- package/dist/components/PhoneField/index.js +0 -6
- package/dist/components/Pill/index.js +0 -4
- package/dist/components/Progress/index.js +0 -4
- package/dist/components/RadioGroup/index.js +0 -6
- package/dist/components/SearchField/index.js +0 -4
- package/dist/components/Select/index.js +0 -4
- package/dist/components/Spinner/index.js +0 -4
- package/dist/components/Switch/index.js +0 -4
- package/dist/components/Tabs/index.js +0 -5
- package/dist/components/Tabs/types.js +0 -1
- package/dist/components/TextArea/index.js +0 -4
- package/dist/components/Toast/index.js +0 -12
- package/dist/components/ToggleGroup/index.js +0 -5
- package/dist/components/ToggleGroup/types.js +0 -1
- package/dist/components/Token/icons/types.js +0 -1
- package/dist/components/Token/index.js +0 -4
- package/dist/components/TopBar/index.js +0 -4
- package/dist/components/Typography/index.js +0 -5
- package/dist/components/WalletAddressField/index.js +0 -4
@@ -1,13 +1,16 @@
|
|
1
1
|
"use client";
|
2
|
-
import { Overlay as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
function
|
6
|
-
if (typeof document
|
7
|
-
let
|
8
|
-
|
2
|
+
import { Overlay as Overlay$1, Content as Content$1, Trigger, Close, Title, Description, Root as Root$1, Portal as Portal$1 } from "../../../../@radix-ui_react-dialog@1.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._vurlugjqrhlu53o6edaj3yx2bq/node_modules/@radix-ui/react-dialog/dist/index.js";
|
3
|
+
import * as React from "react";
|
4
|
+
import React__default, { useMemo, useLayoutEffect, useEffect } from "react";
|
5
|
+
function __insertCSS(code) {
|
6
|
+
if (typeof document == "undefined") return;
|
7
|
+
let head = document.head || document.getElementsByTagName("head")[0];
|
8
|
+
let style = document.createElement("style");
|
9
|
+
style.type = "text/css";
|
10
|
+
head.appendChild(style);
|
11
|
+
style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
|
9
12
|
}
|
10
|
-
const
|
13
|
+
const DrawerContext = React__default.createContext({
|
11
14
|
drawerRef: {
|
12
15
|
current: null
|
13
16
|
},
|
@@ -27,17 +30,17 @@ const Wt = r.createContext({
|
|
27
30
|
onNestedRelease: () => {
|
28
31
|
},
|
29
32
|
openProp: void 0,
|
30
|
-
dismissible:
|
31
|
-
isOpen:
|
32
|
-
isDragging:
|
33
|
+
dismissible: false,
|
34
|
+
isOpen: false,
|
35
|
+
isDragging: false,
|
33
36
|
keyboardIsOpen: {
|
34
|
-
current:
|
37
|
+
current: false
|
35
38
|
},
|
36
39
|
snapPointsOffset: null,
|
37
40
|
snapPoints: null,
|
38
|
-
handleOnly:
|
39
|
-
modal:
|
40
|
-
shouldFade:
|
41
|
+
handleOnly: false,
|
42
|
+
modal: false,
|
43
|
+
shouldFade: false,
|
41
44
|
activeSnapPoint: null,
|
42
45
|
onOpenChange: () => {
|
43
46
|
},
|
@@ -47,64 +50,72 @@ const Wt = r.createContext({
|
|
47
50
|
},
|
48
51
|
direction: "bottom",
|
49
52
|
shouldAnimate: {
|
50
|
-
current:
|
53
|
+
current: true
|
51
54
|
},
|
52
|
-
shouldScaleBackground:
|
53
|
-
setBackgroundColorOnScale:
|
54
|
-
noBodyStyles:
|
55
|
+
shouldScaleBackground: false,
|
56
|
+
setBackgroundColorOnScale: true,
|
57
|
+
noBodyStyles: false,
|
55
58
|
container: null,
|
56
|
-
autoFocus:
|
57
|
-
})
|
58
|
-
|
59
|
-
|
59
|
+
autoFocus: false
|
60
|
+
});
|
61
|
+
const useDrawerContext = () => {
|
62
|
+
const context = React__default.useContext(DrawerContext);
|
63
|
+
if (!context) {
|
60
64
|
throw new Error("useDrawerContext must be used within a Drawer.Root");
|
61
|
-
|
65
|
+
}
|
66
|
+
return context;
|
62
67
|
};
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
return typeof window < "u" && (/Firefox/.test(t) && /Mobile/.test(t) || // Android Firefox
|
69
|
-
/FxiOS/.test(t));
|
68
|
+
__insertCSS("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");
|
69
|
+
function isMobileFirefox() {
|
70
|
+
const userAgent = navigator.userAgent;
|
71
|
+
return typeof window !== "undefined" && (/Firefox/.test(userAgent) && /Mobile/.test(userAgent) || // Android Firefox
|
72
|
+
/FxiOS/.test(userAgent));
|
70
73
|
}
|
71
|
-
function
|
72
|
-
return
|
74
|
+
function isMac() {
|
75
|
+
return testPlatform(/^Mac/);
|
73
76
|
}
|
74
|
-
function
|
75
|
-
return
|
77
|
+
function isIPhone() {
|
78
|
+
return testPlatform(/^iPhone/);
|
76
79
|
}
|
77
|
-
function
|
80
|
+
function isSafari() {
|
78
81
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
79
82
|
}
|
80
|
-
function
|
81
|
-
return
|
82
|
-
|
83
|
+
function isIPad() {
|
84
|
+
return testPlatform(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
85
|
+
isMac() && navigator.maxTouchPoints > 1;
|
83
86
|
}
|
84
|
-
function
|
85
|
-
return
|
87
|
+
function isIOS() {
|
88
|
+
return isIPhone() || isIPad();
|
86
89
|
}
|
87
|
-
function
|
88
|
-
return typeof window
|
90
|
+
function testPlatform(re) {
|
91
|
+
return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.platform) : void 0;
|
89
92
|
}
|
90
|
-
const
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
93
|
+
const KEYBOARD_BUFFER = 24;
|
94
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
95
|
+
function chain$1(...callbacks) {
|
96
|
+
return (...args) => {
|
97
|
+
for (let callback of callbacks) {
|
98
|
+
if (typeof callback === "function") {
|
99
|
+
callback(...args);
|
100
|
+
}
|
101
|
+
}
|
95
102
|
};
|
96
103
|
}
|
97
|
-
const
|
98
|
-
function
|
99
|
-
let
|
100
|
-
return /(auto|scroll)/.test(
|
104
|
+
const visualViewport = typeof document !== "undefined" && window.visualViewport;
|
105
|
+
function isScrollable(node) {
|
106
|
+
let style = window.getComputedStyle(node);
|
107
|
+
return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
101
108
|
}
|
102
|
-
function
|
103
|
-
|
104
|
-
|
105
|
-
|
109
|
+
function getScrollParent(node) {
|
110
|
+
if (isScrollable(node)) {
|
111
|
+
node = node.parentElement;
|
112
|
+
}
|
113
|
+
while (node && !isScrollable(node)) {
|
114
|
+
node = node.parentElement;
|
115
|
+
}
|
116
|
+
return node || document.scrollingElement || document.documentElement;
|
106
117
|
}
|
107
|
-
const
|
118
|
+
const nonTextInputTypes = /* @__PURE__ */ new Set([
|
108
119
|
"checkbox",
|
109
120
|
"radio",
|
110
121
|
"range",
|
@@ -115,152 +126,230 @@ const Ne = /* @__PURE__ */ new Set([
|
|
115
126
|
"submit",
|
116
127
|
"reset"
|
117
128
|
]);
|
118
|
-
let
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
129
|
+
let preventScrollCount = 0;
|
130
|
+
let restore;
|
131
|
+
function usePreventScroll(options = {}) {
|
132
|
+
let { isDisabled } = options;
|
133
|
+
useIsomorphicLayoutEffect(() => {
|
134
|
+
if (isDisabled) {
|
135
|
+
return;
|
136
|
+
}
|
137
|
+
preventScrollCount++;
|
138
|
+
if (preventScrollCount === 1) {
|
139
|
+
if (isIOS()) {
|
140
|
+
restore = preventScrollMobileSafari();
|
141
|
+
}
|
142
|
+
}
|
143
|
+
return () => {
|
144
|
+
preventScrollCount--;
|
145
|
+
if (preventScrollCount === 0) {
|
146
|
+
restore == null ? void 0 : restore();
|
147
|
+
}
|
148
|
+
};
|
126
149
|
}, [
|
127
|
-
|
150
|
+
isDisabled
|
128
151
|
]);
|
129
152
|
}
|
130
|
-
function
|
131
|
-
let
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
153
|
+
function preventScrollMobileSafari() {
|
154
|
+
let scrollable;
|
155
|
+
let lastY = 0;
|
156
|
+
let onTouchStart = (e) => {
|
157
|
+
scrollable = getScrollParent(e.target);
|
158
|
+
if (scrollable === document.documentElement && scrollable === document.body) {
|
136
159
|
return;
|
137
160
|
}
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
}
|
145
|
-
|
146
|
-
let
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
}
|
154
|
-
|
161
|
+
lastY = e.changedTouches[0].pageY;
|
162
|
+
};
|
163
|
+
let onTouchMove = (e) => {
|
164
|
+
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
165
|
+
e.preventDefault();
|
166
|
+
return;
|
167
|
+
}
|
168
|
+
let y = e.changedTouches[0].pageY;
|
169
|
+
let scrollTop = scrollable.scrollTop;
|
170
|
+
let bottom = scrollable.scrollHeight - scrollable.clientHeight;
|
171
|
+
if (bottom === 0) {
|
172
|
+
return;
|
173
|
+
}
|
174
|
+
if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) {
|
175
|
+
e.preventDefault();
|
176
|
+
}
|
177
|
+
lastY = y;
|
178
|
+
};
|
179
|
+
let onTouchEnd = (e) => {
|
180
|
+
let target = e.target;
|
181
|
+
if (isInput(target) && target !== document.activeElement) {
|
182
|
+
e.preventDefault();
|
183
|
+
target.style.transform = "translateY(-2000px)";
|
184
|
+
target.focus();
|
185
|
+
requestAnimationFrame(() => {
|
186
|
+
target.style.transform = "";
|
187
|
+
});
|
188
|
+
}
|
189
|
+
};
|
190
|
+
let onFocus = (e) => {
|
191
|
+
let target = e.target;
|
192
|
+
if (isInput(target)) {
|
193
|
+
target.style.transform = "translateY(-2000px)";
|
194
|
+
requestAnimationFrame(() => {
|
195
|
+
target.style.transform = "";
|
196
|
+
if (visualViewport) {
|
197
|
+
if (visualViewport.height < window.innerHeight) {
|
198
|
+
requestAnimationFrame(() => {
|
199
|
+
scrollIntoView(target);
|
200
|
+
});
|
201
|
+
} else {
|
202
|
+
visualViewport.addEventListener("resize", () => scrollIntoView(target), {
|
203
|
+
once: true
|
204
|
+
});
|
205
|
+
}
|
206
|
+
}
|
207
|
+
});
|
208
|
+
}
|
209
|
+
};
|
210
|
+
let onWindowScroll = () => {
|
155
211
|
window.scrollTo(0, 0);
|
156
|
-
}
|
212
|
+
};
|
213
|
+
let scrollX = window.pageXOffset;
|
214
|
+
let scrollY = window.pageYOffset;
|
215
|
+
let restoreStyles = chain$1(setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
157
216
|
window.scrollTo(0, 0);
|
158
|
-
let
|
159
|
-
passive:
|
160
|
-
capture:
|
161
|
-
}),
|
162
|
-
passive:
|
163
|
-
capture:
|
164
|
-
}),
|
165
|
-
passive:
|
166
|
-
capture:
|
167
|
-
}),
|
217
|
+
let removeEvents = chain$1(addEvent(document, "touchstart", onTouchStart, {
|
218
|
+
passive: false,
|
219
|
+
capture: true
|
220
|
+
}), addEvent(document, "touchmove", onTouchMove, {
|
221
|
+
passive: false,
|
222
|
+
capture: true
|
223
|
+
}), addEvent(document, "touchend", onTouchEnd, {
|
224
|
+
passive: false,
|
225
|
+
capture: true
|
226
|
+
}), addEvent(document, "focus", onFocus, true), addEvent(window, "scroll", onWindowScroll));
|
168
227
|
return () => {
|
169
|
-
|
228
|
+
restoreStyles();
|
229
|
+
removeEvents();
|
230
|
+
window.scrollTo(scrollX, scrollY);
|
170
231
|
};
|
171
232
|
}
|
172
|
-
function
|
173
|
-
let
|
174
|
-
|
175
|
-
|
233
|
+
function setStyle(element, style, value) {
|
234
|
+
let cur = element.style[style];
|
235
|
+
element.style[style] = value;
|
236
|
+
return () => {
|
237
|
+
element.style[style] = cur;
|
176
238
|
};
|
177
239
|
}
|
178
|
-
function
|
179
|
-
|
180
|
-
|
240
|
+
function addEvent(target, event, handler, options) {
|
241
|
+
target.addEventListener(event, handler, options);
|
242
|
+
return () => {
|
243
|
+
target.removeEventListener(event, handler, options);
|
181
244
|
};
|
182
245
|
}
|
183
|
-
function
|
184
|
-
let
|
185
|
-
|
186
|
-
let
|
187
|
-
if (
|
188
|
-
let
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
246
|
+
function scrollIntoView(target) {
|
247
|
+
let root = document.scrollingElement || document.documentElement;
|
248
|
+
while (target && target !== root) {
|
249
|
+
let scrollable = getScrollParent(target);
|
250
|
+
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
|
251
|
+
let scrollableTop = scrollable.getBoundingClientRect().top;
|
252
|
+
let targetTop = target.getBoundingClientRect().top;
|
253
|
+
let targetBottom = target.getBoundingClientRect().bottom;
|
254
|
+
const keyboardHeight = scrollable.getBoundingClientRect().bottom + KEYBOARD_BUFFER;
|
255
|
+
if (targetBottom > keyboardHeight) {
|
256
|
+
scrollable.scrollTop += targetTop - scrollableTop;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
target = scrollable.parentElement;
|
193
260
|
}
|
194
261
|
}
|
195
|
-
function
|
196
|
-
return
|
262
|
+
function isInput(target) {
|
263
|
+
return target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
197
264
|
}
|
198
|
-
function
|
199
|
-
typeof
|
265
|
+
function setRef(ref, value) {
|
266
|
+
if (typeof ref === "function") {
|
267
|
+
ref(value);
|
268
|
+
} else if (ref !== null && ref !== void 0) {
|
269
|
+
ref.current = value;
|
270
|
+
}
|
200
271
|
}
|
201
|
-
function
|
202
|
-
return (
|
272
|
+
function composeRefs(...refs) {
|
273
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
203
274
|
}
|
204
|
-
function
|
205
|
-
return
|
275
|
+
function useComposedRefs(...refs) {
|
276
|
+
return React.useCallback(composeRefs(...refs), refs);
|
206
277
|
}
|
207
|
-
const
|
208
|
-
function
|
209
|
-
if (!
|
210
|
-
let
|
211
|
-
Object.entries(
|
212
|
-
if (
|
213
|
-
|
278
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
279
|
+
function set(el, styles, ignoreCache = false) {
|
280
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
281
|
+
let originalStyles = {};
|
282
|
+
Object.entries(styles).forEach(([key, value]) => {
|
283
|
+
if (key.startsWith("--")) {
|
284
|
+
el.style.setProperty(key, value);
|
214
285
|
return;
|
215
286
|
}
|
216
|
-
|
217
|
-
|
287
|
+
originalStyles[key] = el.style[key];
|
288
|
+
el.style[key] = value;
|
289
|
+
});
|
290
|
+
if (ignoreCache) return;
|
291
|
+
cache.set(el, originalStyles);
|
218
292
|
}
|
219
|
-
function
|
220
|
-
if (!
|
221
|
-
let
|
222
|
-
|
293
|
+
function reset(el, prop) {
|
294
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
295
|
+
let originalStyles = cache.get(el);
|
296
|
+
if (!originalStyles) {
|
297
|
+
return;
|
298
|
+
}
|
299
|
+
{
|
300
|
+
el.style[prop] = originalStyles[prop];
|
301
|
+
}
|
223
302
|
}
|
224
|
-
const
|
225
|
-
switch (
|
303
|
+
const isVertical = (direction) => {
|
304
|
+
switch (direction) {
|
226
305
|
case "top":
|
227
306
|
case "bottom":
|
228
|
-
return
|
307
|
+
return true;
|
229
308
|
case "left":
|
230
309
|
case "right":
|
231
|
-
return
|
310
|
+
return false;
|
232
311
|
default:
|
233
|
-
return
|
312
|
+
return direction;
|
234
313
|
}
|
235
314
|
};
|
236
|
-
function
|
237
|
-
if (!
|
315
|
+
function getTranslate(element, direction) {
|
316
|
+
if (!element) {
|
238
317
|
return null;
|
239
|
-
|
318
|
+
}
|
319
|
+
const style = window.getComputedStyle(element);
|
320
|
+
const transform = (
|
240
321
|
// @ts-ignore
|
241
|
-
|
322
|
+
style.transform || style.webkitTransform || style.mozTransform
|
242
323
|
);
|
243
|
-
let
|
244
|
-
|
324
|
+
let mat = transform.match(/^matrix3d\((.+)\)$/);
|
325
|
+
if (mat) {
|
326
|
+
return parseFloat(mat[1].split(", ")[isVertical(direction) ? 13 : 12]);
|
327
|
+
}
|
328
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
329
|
+
return mat ? parseFloat(mat[1].split(", ")[isVertical(direction) ? 5 : 4]) : null;
|
245
330
|
}
|
246
|
-
function
|
247
|
-
return 8 * (Math.log(
|
331
|
+
function dampenValue(v) {
|
332
|
+
return 8 * (Math.log(v + 1) - 2);
|
248
333
|
}
|
249
|
-
function
|
250
|
-
if (!
|
334
|
+
function assignStyle(element, style) {
|
335
|
+
if (!element) return () => {
|
251
336
|
};
|
252
|
-
const
|
253
|
-
|
254
|
-
|
337
|
+
const prevStyle = element.style.cssText;
|
338
|
+
Object.assign(element.style, style);
|
339
|
+
return () => {
|
340
|
+
element.style.cssText = prevStyle;
|
255
341
|
};
|
256
342
|
}
|
257
|
-
function
|
258
|
-
return (...
|
259
|
-
for (const
|
260
|
-
typeof
|
343
|
+
function chain(...fns) {
|
344
|
+
return (...args) => {
|
345
|
+
for (const fn of fns) {
|
346
|
+
if (typeof fn === "function") {
|
347
|
+
fn(...args);
|
348
|
+
}
|
349
|
+
}
|
261
350
|
};
|
262
351
|
}
|
263
|
-
const
|
352
|
+
const TRANSITIONS = {
|
264
353
|
DURATION: 0.5,
|
265
354
|
EASE: [
|
266
355
|
0.32,
|
@@ -268,799 +357,1151 @@ const O = {
|
|
268
357
|
0,
|
269
358
|
1
|
270
359
|
]
|
271
|
-
}
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
360
|
+
};
|
361
|
+
const VELOCITY_THRESHOLD = 0.4;
|
362
|
+
const CLOSE_THRESHOLD = 0.25;
|
363
|
+
const SCROLL_LOCK_TIMEOUT = 100;
|
364
|
+
const BORDER_RADIUS = 8;
|
365
|
+
const NESTED_DISPLACEMENT = 16;
|
366
|
+
const WINDOW_TOP_OFFSET = 26;
|
367
|
+
const DRAG_CLASS = "vaul-dragging";
|
368
|
+
function useCallbackRef(callback) {
|
369
|
+
const callbackRef = React__default.useRef(callback);
|
370
|
+
React__default.useEffect(() => {
|
371
|
+
callbackRef.current = callback;
|
372
|
+
});
|
373
|
+
return React__default.useMemo(() => (...args) => callbackRef.current == null ? void 0 : callbackRef.current.call(callbackRef, ...args), []);
|
277
374
|
}
|
278
|
-
function
|
279
|
-
const
|
280
|
-
|
281
|
-
|
375
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
376
|
+
const uncontrolledState = React__default.useState(defaultProp);
|
377
|
+
const [value] = uncontrolledState;
|
378
|
+
const prevValueRef = React__default.useRef(value);
|
379
|
+
const handleChange = useCallbackRef(onChange);
|
380
|
+
React__default.useEffect(() => {
|
381
|
+
if (prevValueRef.current !== value) {
|
382
|
+
handleChange(value);
|
383
|
+
prevValueRef.current = value;
|
384
|
+
}
|
282
385
|
}, [
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
])
|
386
|
+
value,
|
387
|
+
prevValueRef,
|
388
|
+
handleChange
|
389
|
+
]);
|
390
|
+
return uncontrolledState;
|
287
391
|
}
|
288
|
-
function
|
392
|
+
function useControllableState({ prop, defaultProp, onChange = () => {
|
289
393
|
} }) {
|
290
|
-
const [
|
291
|
-
defaultProp
|
292
|
-
onChange
|
293
|
-
})
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
394
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
395
|
+
defaultProp,
|
396
|
+
onChange
|
397
|
+
});
|
398
|
+
const isControlled = prop !== void 0;
|
399
|
+
const value = isControlled ? prop : uncontrolledProp;
|
400
|
+
const handleChange = useCallbackRef(onChange);
|
401
|
+
const setValue = React__default.useCallback((nextValue) => {
|
402
|
+
if (isControlled) {
|
403
|
+
const setter = nextValue;
|
404
|
+
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
405
|
+
if (value2 !== prop) handleChange(value2);
|
406
|
+
} else {
|
407
|
+
setUncontrolledProp(nextValue);
|
408
|
+
}
|
299
409
|
}, [
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
410
|
+
isControlled,
|
411
|
+
prop,
|
412
|
+
setUncontrolledProp,
|
413
|
+
handleChange
|
304
414
|
]);
|
305
415
|
return [
|
306
|
-
|
307
|
-
|
416
|
+
value,
|
417
|
+
setValue
|
308
418
|
];
|
309
419
|
}
|
310
|
-
function
|
311
|
-
const [
|
312
|
-
prop:
|
313
|
-
defaultProp:
|
314
|
-
onChange:
|
315
|
-
})
|
420
|
+
function useSnapPoints({ activeSnapPointProp, setActiveSnapPointProp, snapPoints, drawerRef, overlayRef, fadeFromIndex, onSnapPointChange, direction = "bottom", container, snapToSequentialPoint }) {
|
421
|
+
const [activeSnapPoint, setActiveSnapPoint] = useControllableState({
|
422
|
+
prop: activeSnapPointProp,
|
423
|
+
defaultProp: snapPoints == null ? void 0 : snapPoints[0],
|
424
|
+
onChange: setActiveSnapPointProp
|
425
|
+
});
|
426
|
+
const [windowDimensions, setWindowDimensions] = React__default.useState(typeof window !== "undefined" ? {
|
316
427
|
innerWidth: window.innerWidth,
|
317
428
|
innerHeight: window.innerHeight
|
318
429
|
} : void 0);
|
319
|
-
|
320
|
-
function
|
321
|
-
|
430
|
+
React__default.useEffect(() => {
|
431
|
+
function onResize() {
|
432
|
+
setWindowDimensions({
|
322
433
|
innerWidth: window.innerWidth,
|
323
434
|
innerHeight: window.innerHeight
|
324
435
|
});
|
325
436
|
}
|
326
|
-
|
437
|
+
window.addEventListener("resize", onResize);
|
438
|
+
return () => window.removeEventListener("resize", onResize);
|
327
439
|
}, []);
|
328
|
-
const
|
329
|
-
|
330
|
-
|
331
|
-
])
|
332
|
-
|
333
|
-
|
440
|
+
const isLastSnapPoint = React__default.useMemo(() => activeSnapPoint === (snapPoints == null ? void 0 : snapPoints[snapPoints.length - 1]) || null, [
|
441
|
+
snapPoints,
|
442
|
+
activeSnapPoint
|
443
|
+
]);
|
444
|
+
const activeSnapPointIndex = React__default.useMemo(() => {
|
445
|
+
var _snapPoints_findIndex;
|
446
|
+
return (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint) => snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : null;
|
334
447
|
}, [
|
335
|
-
|
336
|
-
|
337
|
-
])
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
448
|
+
snapPoints,
|
449
|
+
activeSnapPoint
|
450
|
+
]);
|
451
|
+
const shouldFade = snapPoints && snapPoints.length > 0 && (fadeFromIndex || fadeFromIndex === 0) && !Number.isNaN(fadeFromIndex) && snapPoints[fadeFromIndex] === activeSnapPoint || !snapPoints;
|
452
|
+
const snapPointsOffset = React__default.useMemo(() => {
|
453
|
+
const containerSize = container ? {
|
454
|
+
width: container.getBoundingClientRect().width,
|
455
|
+
height: container.getBoundingClientRect().height
|
456
|
+
} : typeof window !== "undefined" ? {
|
342
457
|
width: window.innerWidth,
|
343
458
|
height: window.innerHeight
|
344
459
|
} : {
|
345
460
|
width: 0,
|
346
461
|
height: 0
|
347
462
|
};
|
348
|
-
var
|
349
|
-
return (
|
350
|
-
const
|
351
|
-
let
|
352
|
-
if (
|
353
|
-
|
354
|
-
|
463
|
+
var _snapPoints_map;
|
464
|
+
return (_snapPoints_map = snapPoints == null ? void 0 : snapPoints.map((snapPoint) => {
|
465
|
+
const isPx = typeof snapPoint === "string";
|
466
|
+
let snapPointAsNumber = 0;
|
467
|
+
if (isPx) {
|
468
|
+
snapPointAsNumber = parseInt(snapPoint, 10);
|
469
|
+
}
|
470
|
+
if (isVertical(direction)) {
|
471
|
+
const height = isPx ? snapPointAsNumber : windowDimensions ? snapPoint * containerSize.height : 0;
|
472
|
+
if (windowDimensions) {
|
473
|
+
return direction === "bottom" ? containerSize.height - height : -containerSize.height + height;
|
474
|
+
}
|
475
|
+
return height;
|
355
476
|
}
|
356
|
-
const
|
357
|
-
|
358
|
-
|
477
|
+
const width = isPx ? snapPointAsNumber : windowDimensions ? snapPoint * containerSize.width : 0;
|
478
|
+
if (windowDimensions) {
|
479
|
+
return direction === "right" ? containerSize.width - width : -containerSize.width + width;
|
480
|
+
}
|
481
|
+
return width;
|
482
|
+
})) != null ? _snapPoints_map : [];
|
359
483
|
}, [
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
])
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
transition: `
|
374
|
-
|
375
|
-
})
|
376
|
-
|
377
|
-
|
378
|
-
|
484
|
+
snapPoints,
|
485
|
+
windowDimensions,
|
486
|
+
container
|
487
|
+
]);
|
488
|
+
const activeSnapPointOffset = React__default.useMemo(() => activeSnapPointIndex !== null ? snapPointsOffset == null ? void 0 : snapPointsOffset[activeSnapPointIndex] : null, [
|
489
|
+
snapPointsOffset,
|
490
|
+
activeSnapPointIndex
|
491
|
+
]);
|
492
|
+
const snapToPoint = React__default.useCallback((dimension) => {
|
493
|
+
var _snapPointsOffset_findIndex;
|
494
|
+
const newSnapPointIndex = (_snapPointsOffset_findIndex = snapPointsOffset == null ? void 0 : snapPointsOffset.findIndex((snapPointDim) => snapPointDim === dimension)) != null ? _snapPointsOffset_findIndex : null;
|
495
|
+
onSnapPointChange(newSnapPointIndex);
|
496
|
+
set(drawerRef.current, {
|
497
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
498
|
+
transform: isVertical(direction) ? `translate3d(0, ${dimension}px, 0)` : `translate3d(${dimension}px, 0, 0)`
|
499
|
+
});
|
500
|
+
if (snapPointsOffset && newSnapPointIndex !== snapPointsOffset.length - 1 && fadeFromIndex !== void 0 && newSnapPointIndex !== fadeFromIndex && newSnapPointIndex < fadeFromIndex) {
|
501
|
+
set(overlayRef.current, {
|
502
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
503
|
+
opacity: "0"
|
504
|
+
});
|
505
|
+
} else {
|
506
|
+
set(overlayRef.current, {
|
507
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
508
|
+
opacity: "1"
|
509
|
+
});
|
510
|
+
}
|
511
|
+
setActiveSnapPoint(snapPoints == null ? void 0 : snapPoints[Math.max(newSnapPointIndex, 0)]);
|
379
512
|
}, [
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
513
|
+
drawerRef.current,
|
514
|
+
snapPoints,
|
515
|
+
snapPointsOffset,
|
516
|
+
fadeFromIndex,
|
517
|
+
overlayRef,
|
518
|
+
setActiveSnapPoint
|
386
519
|
]);
|
387
|
-
|
388
|
-
if (
|
389
|
-
var
|
390
|
-
const
|
391
|
-
|
520
|
+
React__default.useEffect(() => {
|
521
|
+
if (activeSnapPoint || activeSnapPointProp) {
|
522
|
+
var _snapPoints_findIndex;
|
523
|
+
const newIndex = (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint) => snapPoint === activeSnapPointProp || snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : -1;
|
524
|
+
if (snapPointsOffset && newIndex !== -1 && typeof snapPointsOffset[newIndex] === "number") {
|
525
|
+
snapToPoint(snapPointsOffset[newIndex]);
|
526
|
+
}
|
392
527
|
}
|
393
528
|
}, [
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
529
|
+
activeSnapPoint,
|
530
|
+
activeSnapPointProp,
|
531
|
+
snapPoints,
|
532
|
+
snapPointsOffset,
|
533
|
+
snapToPoint
|
399
534
|
]);
|
400
|
-
function
|
401
|
-
if (
|
402
|
-
const
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
535
|
+
function onRelease({ draggedDistance, closeDrawer, velocity, dismissible }) {
|
536
|
+
if (fadeFromIndex === void 0) return;
|
537
|
+
const currentPosition = direction === "bottom" || direction === "right" ? (activeSnapPointOffset != null ? activeSnapPointOffset : 0) - draggedDistance : (activeSnapPointOffset != null ? activeSnapPointOffset : 0) + draggedDistance;
|
538
|
+
const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
|
539
|
+
const isFirst = activeSnapPointIndex === 0;
|
540
|
+
const hasDraggedUp = draggedDistance > 0;
|
541
|
+
if (isOverlaySnapPoint) {
|
542
|
+
set(overlayRef.current, {
|
543
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
544
|
+
});
|
545
|
+
}
|
546
|
+
if (!snapToSequentialPoint && velocity > 2 && !hasDraggedUp) {
|
547
|
+
if (dismissible) closeDrawer();
|
548
|
+
else snapToPoint(snapPointsOffset[0]);
|
407
549
|
return;
|
408
550
|
}
|
409
|
-
if (!
|
410
|
-
|
551
|
+
if (!snapToSequentialPoint && velocity > 2 && hasDraggedUp && snapPointsOffset && snapPoints) {
|
552
|
+
snapToPoint(snapPointsOffset[snapPoints.length - 1]);
|
411
553
|
return;
|
412
554
|
}
|
413
|
-
const
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
555
|
+
const closestSnapPoint = snapPointsOffset == null ? void 0 : snapPointsOffset.reduce((prev, curr) => {
|
556
|
+
if (typeof prev !== "number" || typeof curr !== "number") return prev;
|
557
|
+
return Math.abs(curr - currentPosition) < Math.abs(prev - currentPosition) ? curr : prev;
|
558
|
+
});
|
559
|
+
const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;
|
560
|
+
if (velocity > VELOCITY_THRESHOLD && Math.abs(draggedDistance) < dim * 0.4) {
|
561
|
+
const dragDirection = hasDraggedUp ? 1 : -1;
|
562
|
+
if (dragDirection > 0 && isLastSnapPoint && snapPoints) {
|
563
|
+
snapToPoint(snapPointsOffset[snapPoints.length - 1]);
|
418
564
|
return;
|
419
565
|
}
|
420
|
-
if (
|
421
|
-
|
566
|
+
if (isFirst && dragDirection < 0 && dismissible) {
|
567
|
+
closeDrawer();
|
568
|
+
}
|
569
|
+
if (activeSnapPointIndex === null) return;
|
570
|
+
snapToPoint(snapPointsOffset[activeSnapPointIndex + dragDirection]);
|
422
571
|
return;
|
423
572
|
}
|
424
|
-
|
573
|
+
snapToPoint(closestSnapPoint);
|
425
574
|
}
|
426
|
-
function
|
427
|
-
if (
|
428
|
-
const
|
429
|
-
(
|
430
|
-
|
575
|
+
function onDrag({ draggedDistance }) {
|
576
|
+
if (activeSnapPointOffset === null) return;
|
577
|
+
const newValue = direction === "bottom" || direction === "right" ? activeSnapPointOffset - draggedDistance : activeSnapPointOffset + draggedDistance;
|
578
|
+
if ((direction === "bottom" || direction === "right") && newValue < snapPointsOffset[snapPointsOffset.length - 1]) {
|
579
|
+
return;
|
580
|
+
}
|
581
|
+
if ((direction === "top" || direction === "left") && newValue > snapPointsOffset[snapPointsOffset.length - 1]) {
|
582
|
+
return;
|
583
|
+
}
|
584
|
+
set(drawerRef.current, {
|
585
|
+
transform: isVertical(direction) ? `translate3d(0, ${newValue}px, 0)` : `translate3d(${newValue}px, 0, 0)`
|
431
586
|
});
|
432
587
|
}
|
433
|
-
function
|
434
|
-
if (!
|
435
|
-
const
|
436
|
-
|
588
|
+
function getPercentageDragged(absDraggedDistance, isDraggingDown) {
|
589
|
+
if (!snapPoints || typeof activeSnapPointIndex !== "number" || !snapPointsOffset || fadeFromIndex === void 0) return null;
|
590
|
+
const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
|
591
|
+
const isOverlaySnapPointOrHigher = activeSnapPointIndex >= fadeFromIndex;
|
592
|
+
if (isOverlaySnapPointOrHigher && isDraggingDown) {
|
437
593
|
return 0;
|
438
|
-
|
439
|
-
if (
|
440
|
-
|
441
|
-
|
594
|
+
}
|
595
|
+
if (isOverlaySnapPoint && !isDraggingDown) return 1;
|
596
|
+
if (!shouldFade && !isOverlaySnapPoint) return null;
|
597
|
+
const targetSnapPointIndex = isOverlaySnapPoint ? activeSnapPointIndex + 1 : activeSnapPointIndex - 1;
|
598
|
+
const snapPointDistance = isOverlaySnapPoint ? snapPointsOffset[targetSnapPointIndex] - snapPointsOffset[targetSnapPointIndex - 1] : snapPointsOffset[targetSnapPointIndex + 1] - snapPointsOffset[targetSnapPointIndex];
|
599
|
+
const percentageDragged = absDraggedDistance / Math.abs(snapPointDistance);
|
600
|
+
if (isOverlaySnapPoint) {
|
601
|
+
return 1 - percentageDragged;
|
602
|
+
} else {
|
603
|
+
return percentageDragged;
|
604
|
+
}
|
442
605
|
}
|
443
606
|
return {
|
444
|
-
isLastSnapPoint
|
445
|
-
activeSnapPoint
|
446
|
-
shouldFade
|
447
|
-
getPercentageDragged
|
448
|
-
setActiveSnapPoint
|
449
|
-
activeSnapPointIndex
|
450
|
-
onRelease
|
451
|
-
onDrag
|
452
|
-
snapPointsOffset
|
607
|
+
isLastSnapPoint,
|
608
|
+
activeSnapPoint,
|
609
|
+
shouldFade,
|
610
|
+
getPercentageDragged,
|
611
|
+
setActiveSnapPoint,
|
612
|
+
activeSnapPointIndex,
|
613
|
+
onRelease,
|
614
|
+
onDrag,
|
615
|
+
snapPointsOffset
|
453
616
|
};
|
454
617
|
}
|
455
|
-
const
|
618
|
+
const noop = () => () => {
|
456
619
|
};
|
457
|
-
function
|
458
|
-
const { direction
|
459
|
-
|
460
|
-
|
620
|
+
function useScaleBackground() {
|
621
|
+
const { direction, isOpen, shouldScaleBackground, setBackgroundColorOnScale, noBodyStyles } = useDrawerContext();
|
622
|
+
const timeoutIdRef = React__default.useRef(null);
|
623
|
+
const initialBackgroundColor = useMemo(() => document.body.style.backgroundColor, []);
|
624
|
+
function getScale() {
|
625
|
+
return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
|
461
626
|
}
|
462
|
-
|
463
|
-
if (
|
464
|
-
|
465
|
-
const
|
466
|
-
if (!
|
467
|
-
|
627
|
+
React__default.useEffect(() => {
|
628
|
+
if (isOpen && shouldScaleBackground) {
|
629
|
+
if (timeoutIdRef.current) clearTimeout(timeoutIdRef.current);
|
630
|
+
const wrapper = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
631
|
+
if (!wrapper) return;
|
632
|
+
chain(setBackgroundColorOnScale && !noBodyStyles ? assignStyle(document.body, {
|
468
633
|
background: "black"
|
469
|
-
}) :
|
470
|
-
transformOrigin:
|
634
|
+
}) : noop, assignStyle(wrapper, {
|
635
|
+
transformOrigin: isVertical(direction) ? "top" : "left",
|
471
636
|
transitionProperty: "transform, border-radius",
|
472
|
-
transitionDuration: `${
|
473
|
-
transitionTimingFunction: `cubic-bezier(${
|
637
|
+
transitionDuration: `${TRANSITIONS.DURATION}s`,
|
638
|
+
transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
474
639
|
}));
|
475
|
-
const
|
476
|
-
borderRadius: `${
|
640
|
+
const wrapperStylesCleanup = assignStyle(wrapper, {
|
641
|
+
borderRadius: `${BORDER_RADIUS}px`,
|
477
642
|
overflow: "hidden",
|
478
|
-
...
|
479
|
-
transform: `scale(${
|
643
|
+
...isVertical(direction) ? {
|
644
|
+
transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
|
480
645
|
} : {
|
481
|
-
transform: `scale(${
|
646
|
+
transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
|
482
647
|
}
|
483
648
|
});
|
484
649
|
return () => {
|
485
|
-
|
486
|
-
|
487
|
-
|
650
|
+
wrapperStylesCleanup();
|
651
|
+
timeoutIdRef.current = window.setTimeout(() => {
|
652
|
+
if (initialBackgroundColor) {
|
653
|
+
document.body.style.background = initialBackgroundColor;
|
654
|
+
} else {
|
655
|
+
document.body.style.removeProperty("background");
|
656
|
+
}
|
657
|
+
}, TRANSITIONS.DURATION * 1e3);
|
488
658
|
};
|
489
659
|
}
|
490
660
|
}, [
|
491
|
-
|
492
|
-
|
493
|
-
|
661
|
+
isOpen,
|
662
|
+
shouldScaleBackground,
|
663
|
+
initialBackgroundColor
|
494
664
|
]);
|
495
665
|
}
|
496
|
-
let
|
497
|
-
function
|
498
|
-
const [
|
499
|
-
|
500
|
-
|
666
|
+
let previousBodyPosition = null;
|
667
|
+
function usePositionFixed({ isOpen, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles }) {
|
668
|
+
const [activeUrl, setActiveUrl] = React__default.useState(() => typeof window !== "undefined" ? window.location.href : "");
|
669
|
+
const scrollPos = React__default.useRef(0);
|
670
|
+
const setPositionFixed = React__default.useCallback(() => {
|
671
|
+
if (!isSafari()) return;
|
672
|
+
if (previousBodyPosition === null && isOpen && !noBodyStyles) {
|
673
|
+
previousBodyPosition = {
|
501
674
|
position: document.body.style.position,
|
502
675
|
top: document.body.style.top,
|
503
676
|
left: document.body.style.left,
|
504
677
|
height: document.body.style.height,
|
505
678
|
right: "unset"
|
506
679
|
};
|
507
|
-
const { scrollX
|
508
|
-
document.body.style.setProperty("position", "fixed", "important")
|
509
|
-
|
510
|
-
|
680
|
+
const { scrollX, innerHeight } = window;
|
681
|
+
document.body.style.setProperty("position", "fixed", "important");
|
682
|
+
Object.assign(document.body.style, {
|
683
|
+
top: `${-scrollPos.current}px`,
|
684
|
+
left: `${-scrollX}px`,
|
511
685
|
right: "0px",
|
512
686
|
height: "auto"
|
513
|
-
})
|
514
|
-
|
515
|
-
|
687
|
+
});
|
688
|
+
window.setTimeout(() => window.requestAnimationFrame(() => {
|
689
|
+
const bottomBarHeight = innerHeight - window.innerHeight;
|
690
|
+
if (bottomBarHeight && scrollPos.current >= innerHeight) {
|
691
|
+
document.body.style.top = `${-(scrollPos.current + bottomBarHeight)}px`;
|
692
|
+
}
|
516
693
|
}), 300);
|
517
694
|
}
|
518
695
|
}, [
|
519
|
-
|
520
|
-
])
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
696
|
+
isOpen
|
697
|
+
]);
|
698
|
+
const restorePositionSetting = React__default.useCallback(() => {
|
699
|
+
if (!isSafari()) return;
|
700
|
+
if (previousBodyPosition !== null && !noBodyStyles) {
|
701
|
+
const y = -parseInt(document.body.style.top, 10);
|
702
|
+
const x = -parseInt(document.body.style.left, 10);
|
703
|
+
Object.assign(document.body.style, previousBodyPosition);
|
704
|
+
window.requestAnimationFrame(() => {
|
705
|
+
if (preventScrollRestoration && activeUrl !== window.location.href) {
|
706
|
+
setActiveUrl(window.location.href);
|
526
707
|
return;
|
527
708
|
}
|
528
|
-
window.scrollTo(
|
529
|
-
})
|
709
|
+
window.scrollTo(x, y);
|
710
|
+
});
|
711
|
+
previousBodyPosition = null;
|
530
712
|
}
|
531
713
|
}, [
|
532
|
-
|
714
|
+
activeUrl
|
533
715
|
]);
|
534
|
-
|
535
|
-
function
|
536
|
-
|
716
|
+
React__default.useEffect(() => {
|
717
|
+
function onScroll() {
|
718
|
+
scrollPos.current = window.scrollY;
|
537
719
|
}
|
538
|
-
|
539
|
-
|
720
|
+
onScroll();
|
721
|
+
window.addEventListener("scroll", onScroll);
|
722
|
+
return () => {
|
723
|
+
window.removeEventListener("scroll", onScroll);
|
724
|
+
};
|
725
|
+
}, []);
|
726
|
+
React__default.useEffect(() => {
|
727
|
+
if (!modal) return;
|
728
|
+
return () => {
|
729
|
+
if (typeof document === "undefined") return;
|
730
|
+
const hasDrawerOpened = !!document.querySelector("[data-vaul-drawer]");
|
731
|
+
if (hasDrawerOpened) return;
|
732
|
+
restorePositionSetting();
|
540
733
|
};
|
541
|
-
}, []), r.useEffect(() => {
|
542
|
-
if (n)
|
543
|
-
return () => {
|
544
|
-
typeof document > "u" || document.querySelector("[data-vaul-drawer]") || h();
|
545
|
-
};
|
546
734
|
}, [
|
547
|
-
|
548
|
-
|
549
|
-
])
|
550
|
-
|
551
|
-
|
552
|
-
|
735
|
+
modal,
|
736
|
+
restorePositionSetting
|
737
|
+
]);
|
738
|
+
React__default.useEffect(() => {
|
739
|
+
if (nested || !hasBeenOpened) return;
|
740
|
+
if (isOpen) {
|
741
|
+
const isStandalone = window.matchMedia("(display-mode: standalone)").matches;
|
742
|
+
!isStandalone && setPositionFixed();
|
743
|
+
if (!modal) {
|
744
|
+
window.setTimeout(() => {
|
745
|
+
restorePositionSetting();
|
746
|
+
}, 500);
|
747
|
+
}
|
748
|
+
} else {
|
749
|
+
restorePositionSetting();
|
750
|
+
}
|
553
751
|
}, [
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
])
|
562
|
-
|
752
|
+
isOpen,
|
753
|
+
hasBeenOpened,
|
754
|
+
activeUrl,
|
755
|
+
modal,
|
756
|
+
nested,
|
757
|
+
setPositionFixed,
|
758
|
+
restorePositionSetting
|
759
|
+
]);
|
760
|
+
return {
|
761
|
+
restorePositionSetting
|
563
762
|
};
|
564
763
|
}
|
565
|
-
function
|
566
|
-
var
|
567
|
-
const [
|
568
|
-
defaultProp:
|
569
|
-
prop:
|
570
|
-
onChange: (
|
571
|
-
|
572
|
-
|
573
|
-
|
764
|
+
function Root({ open: openProp, onOpenChange, children, onDrag: onDragProp, onRelease: onReleaseProp, snapPoints, shouldScaleBackground = false, setBackgroundColorOnScale = true, closeThreshold = CLOSE_THRESHOLD, scrollLockTimeout = SCROLL_LOCK_TIMEOUT, dismissible = true, handleOnly = false, fadeFromIndex = snapPoints && snapPoints.length - 1, activeSnapPoint: activeSnapPointProp, setActiveSnapPoint: setActiveSnapPointProp, fixed, modal = true, onClose, nested, noBodyStyles = false, direction = "bottom", defaultOpen = false, disablePreventScroll = true, snapToSequentialPoint = false, preventScrollRestoration = false, repositionInputs = true, onAnimationEnd, container, autoFocus = false }) {
|
765
|
+
var _drawerRef_current, _drawerRef_current1;
|
766
|
+
const [isOpen = false, setIsOpen] = useControllableState({
|
767
|
+
defaultProp: defaultOpen,
|
768
|
+
prop: openProp,
|
769
|
+
onChange: (o) => {
|
770
|
+
onOpenChange == null ? void 0 : onOpenChange(o);
|
771
|
+
if (!o && !nested) {
|
772
|
+
restorePositionSetting();
|
773
|
+
}
|
774
|
+
setTimeout(() => {
|
775
|
+
onAnimationEnd == null ? void 0 : onAnimationEnd(o);
|
776
|
+
}, TRANSITIONS.DURATION * 1e3);
|
777
|
+
if (o && !modal) {
|
778
|
+
if (typeof window !== "undefined") {
|
779
|
+
window.requestAnimationFrame(() => {
|
780
|
+
document.body.style.pointerEvents = "auto";
|
781
|
+
});
|
782
|
+
}
|
783
|
+
}
|
784
|
+
if (!o) {
|
574
785
|
document.body.style.pointerEvents = "auto";
|
575
|
-
}
|
576
|
-
}
|
577
|
-
}), [I, q] = r.useState(!1), [X, at] = r.useState(!1), [ee, Ct] = r.useState(!1), tt = r.useRef(null), dt = r.useRef(null), ht = r.useRef(null), gt = r.useRef(null), ot = r.useRef(null), it = r.useRef(!1), vt = r.useRef(null), yt = r.useRef(0), et = r.useRef(!1), $t = r.useRef(!Y), At = r.useRef(0), f = r.useRef(null), Mt = r.useRef(((s = f.current) == null ? void 0 : s.getBoundingClientRect().height) || 0), Pt = r.useRef(((F = f.current) == null ? void 0 : F.getBoundingClientRect().width) || 0), bt = r.useRef(0), ne = r.useCallback((l) => {
|
578
|
-
a && l === lt.length - 1 && (dt.current = /* @__PURE__ */ new Date());
|
579
|
-
}, []), { activeSnapPoint: re, activeSnapPointIndex: nt, setActiveSnapPoint: It, onRelease: ae, snapPointsOffset: lt, onDrag: oe, shouldFade: Nt, getPercentageDragged: ie } = je({
|
580
|
-
snapPoints: a,
|
581
|
-
activeSnapPointProp: B,
|
582
|
-
setActiveSnapPointProp: L,
|
583
|
-
drawerRef: f,
|
584
|
-
fadeFromIndex: p,
|
585
|
-
overlayRef: tt,
|
586
|
-
onSnapPointChange: ne,
|
587
|
-
direction: d,
|
588
|
-
container: P,
|
589
|
-
snapToSequentialPoint: c
|
786
|
+
}
|
787
|
+
}
|
590
788
|
});
|
591
|
-
|
592
|
-
|
789
|
+
const [hasBeenOpened, setHasBeenOpened] = React__default.useState(false);
|
790
|
+
const [isDragging, setIsDragging] = React__default.useState(false);
|
791
|
+
const [justReleased, setJustReleased] = React__default.useState(false);
|
792
|
+
const overlayRef = React__default.useRef(null);
|
793
|
+
const openTime = React__default.useRef(null);
|
794
|
+
const dragStartTime = React__default.useRef(null);
|
795
|
+
const dragEndTime = React__default.useRef(null);
|
796
|
+
const lastTimeDragPrevented = React__default.useRef(null);
|
797
|
+
const isAllowedToDrag = React__default.useRef(false);
|
798
|
+
const nestedOpenChangeTimer = React__default.useRef(null);
|
799
|
+
const pointerStart = React__default.useRef(0);
|
800
|
+
const keyboardIsOpen = React__default.useRef(false);
|
801
|
+
const shouldAnimate = React__default.useRef(!defaultOpen);
|
802
|
+
const previousDiffFromInitial = React__default.useRef(0);
|
803
|
+
const drawerRef = React__default.useRef(null);
|
804
|
+
const drawerHeightRef = React__default.useRef(((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0);
|
805
|
+
const drawerWidthRef = React__default.useRef(((_drawerRef_current1 = drawerRef.current) == null ? void 0 : _drawerRef_current1.getBoundingClientRect().width) || 0);
|
806
|
+
const initialDrawerHeight = React__default.useRef(0);
|
807
|
+
const onSnapPointChange = React__default.useCallback((activeSnapPointIndex2) => {
|
808
|
+
if (snapPoints && activeSnapPointIndex2 === snapPointsOffset.length - 1) openTime.current = /* @__PURE__ */ new Date();
|
809
|
+
}, []);
|
810
|
+
const { activeSnapPoint, activeSnapPointIndex, setActiveSnapPoint, onRelease: onReleaseSnapPoints, snapPointsOffset, onDrag: onDragSnapPoints, shouldFade, getPercentageDragged: getSnapPointsPercentageDragged } = useSnapPoints({
|
811
|
+
snapPoints,
|
812
|
+
activeSnapPointProp,
|
813
|
+
setActiveSnapPointProp,
|
814
|
+
drawerRef,
|
815
|
+
fadeFromIndex,
|
816
|
+
overlayRef,
|
817
|
+
onSnapPointChange,
|
818
|
+
direction,
|
819
|
+
container,
|
820
|
+
snapToSequentialPoint
|
821
|
+
});
|
822
|
+
usePreventScroll({
|
823
|
+
isDisabled: !isOpen || isDragging || !modal || justReleased || !hasBeenOpened || !repositionInputs || !disablePreventScroll
|
593
824
|
});
|
594
|
-
const { restorePositionSetting
|
595
|
-
isOpen
|
596
|
-
modal
|
597
|
-
nested:
|
598
|
-
hasBeenOpened
|
599
|
-
preventScrollRestoration
|
600
|
-
noBodyStyles
|
825
|
+
const { restorePositionSetting } = usePositionFixed({
|
826
|
+
isOpen,
|
827
|
+
modal,
|
828
|
+
nested: nested != null ? nested : false,
|
829
|
+
hasBeenOpened,
|
830
|
+
preventScrollRestoration,
|
831
|
+
noBodyStyles
|
601
832
|
});
|
602
|
-
function
|
603
|
-
return (window.innerWidth -
|
833
|
+
function getScale() {
|
834
|
+
return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
|
604
835
|
}
|
605
|
-
function
|
606
|
-
var
|
607
|
-
|
608
|
-
|
609
|
-
|
836
|
+
function onPress(event) {
|
837
|
+
var _drawerRef_current2, _drawerRef_current12;
|
838
|
+
if (!dismissible && !snapPoints) return;
|
839
|
+
if (drawerRef.current && !drawerRef.current.contains(event.target)) return;
|
840
|
+
drawerHeightRef.current = ((_drawerRef_current2 = drawerRef.current) == null ? void 0 : _drawerRef_current2.getBoundingClientRect().height) || 0;
|
841
|
+
drawerWidthRef.current = ((_drawerRef_current12 = drawerRef.current) == null ? void 0 : _drawerRef_current12.getBoundingClientRect().width) || 0;
|
842
|
+
setIsDragging(true);
|
843
|
+
dragStartTime.current = /* @__PURE__ */ new Date();
|
844
|
+
if (isIOS()) {
|
845
|
+
window.addEventListener("touchend", () => isAllowedToDrag.current = false, {
|
846
|
+
once: true
|
847
|
+
});
|
848
|
+
}
|
849
|
+
event.target.setPointerCapture(event.pointerId);
|
850
|
+
pointerStart.current = isVertical(direction) ? event.pageY : event.pageX;
|
610
851
|
}
|
611
|
-
function
|
612
|
-
var
|
613
|
-
let
|
614
|
-
const
|
615
|
-
|
616
|
-
|
617
|
-
if (
|
618
|
-
return
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
if (
|
624
|
-
return
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
852
|
+
function shouldDrag(el, isDraggingInDirection) {
|
853
|
+
var _window_getSelection;
|
854
|
+
let element = el;
|
855
|
+
const highlightedText = (_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString();
|
856
|
+
const swipeAmount = drawerRef.current ? getTranslate(drawerRef.current, direction) : null;
|
857
|
+
const date = /* @__PURE__ */ new Date();
|
858
|
+
if (element.tagName === "SELECT") {
|
859
|
+
return false;
|
860
|
+
}
|
861
|
+
if (element.hasAttribute("data-vaul-no-drag") || element.closest("[data-vaul-no-drag]")) {
|
862
|
+
return false;
|
863
|
+
}
|
864
|
+
if (direction === "right" || direction === "left") {
|
865
|
+
return true;
|
866
|
+
}
|
867
|
+
if (openTime.current && date.getTime() - openTime.current.getTime() < 500) {
|
868
|
+
return false;
|
869
|
+
}
|
870
|
+
if (swipeAmount !== null) {
|
871
|
+
if (direction === "bottom" ? swipeAmount > 0 : swipeAmount < 0) {
|
872
|
+
return true;
|
873
|
+
}
|
874
|
+
}
|
875
|
+
if (highlightedText && highlightedText.length > 0) {
|
876
|
+
return false;
|
877
|
+
}
|
878
|
+
if (lastTimeDragPrevented.current && date.getTime() - lastTimeDragPrevented.current.getTime() < scrollLockTimeout && swipeAmount === 0) {
|
879
|
+
lastTimeDragPrevented.current = date;
|
880
|
+
return false;
|
881
|
+
}
|
882
|
+
if (isDraggingInDirection) {
|
883
|
+
lastTimeDragPrevented.current = date;
|
884
|
+
return false;
|
885
|
+
}
|
886
|
+
while (element) {
|
887
|
+
if (element.scrollHeight > element.clientHeight) {
|
888
|
+
if (element.scrollTop !== 0) {
|
889
|
+
lastTimeDragPrevented.current = /* @__PURE__ */ new Date();
|
890
|
+
return false;
|
891
|
+
}
|
892
|
+
if (element.getAttribute("role") === "dialog") {
|
893
|
+
return true;
|
894
|
+
}
|
633
895
|
}
|
634
|
-
|
896
|
+
element = element.parentNode;
|
635
897
|
}
|
636
|
-
return
|
898
|
+
return true;
|
637
899
|
}
|
638
|
-
function
|
639
|
-
if (
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
const
|
645
|
-
|
646
|
-
|
900
|
+
function onDrag(event) {
|
901
|
+
if (!drawerRef.current) {
|
902
|
+
return;
|
903
|
+
}
|
904
|
+
if (isDragging) {
|
905
|
+
const directionMultiplier = direction === "bottom" || direction === "right" ? 1 : -1;
|
906
|
+
const draggedDistance = (pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX)) * directionMultiplier;
|
907
|
+
const isDraggingInDirection = draggedDistance > 0;
|
908
|
+
const noCloseSnapPointsPreCondition = snapPoints && !dismissible && !isDraggingInDirection;
|
909
|
+
if (noCloseSnapPointsPreCondition && activeSnapPointIndex === 0) return;
|
910
|
+
const absDraggedDistance = Math.abs(draggedDistance);
|
911
|
+
const wrapper = document.querySelector("[data-vaul-drawer-wrapper]");
|
912
|
+
const drawerDimension = direction === "bottom" || direction === "top" ? drawerHeightRef.current : drawerWidthRef.current;
|
913
|
+
let percentageDragged = absDraggedDistance / drawerDimension;
|
914
|
+
const snapPointPercentageDragged = getSnapPointsPercentageDragged(absDraggedDistance, isDraggingInDirection);
|
915
|
+
if (snapPointPercentageDragged !== null) {
|
916
|
+
percentageDragged = snapPointPercentageDragged;
|
917
|
+
}
|
918
|
+
if (noCloseSnapPointsPreCondition && percentageDragged >= 1) {
|
919
|
+
return;
|
920
|
+
}
|
921
|
+
if (!isAllowedToDrag.current && !shouldDrag(event.target, isDraggingInDirection)) return;
|
922
|
+
drawerRef.current.classList.add(DRAG_CLASS);
|
923
|
+
isAllowedToDrag.current = true;
|
924
|
+
set(drawerRef.current, {
|
647
925
|
transition: "none"
|
648
|
-
})
|
926
|
+
});
|
927
|
+
set(overlayRef.current, {
|
649
928
|
transition: "none"
|
650
|
-
})
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
929
|
+
});
|
930
|
+
if (snapPoints) {
|
931
|
+
onDragSnapPoints({
|
932
|
+
draggedDistance
|
933
|
+
});
|
934
|
+
}
|
935
|
+
if (isDraggingInDirection && !snapPoints) {
|
936
|
+
const dampenedDraggedDistance = dampenValue(draggedDistance);
|
937
|
+
const translateValue = Math.min(dampenedDraggedDistance * -1, 0) * directionMultiplier;
|
938
|
+
set(drawerRef.current, {
|
939
|
+
transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
|
656
940
|
});
|
657
941
|
return;
|
658
942
|
}
|
659
|
-
const
|
660
|
-
if (
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
const j = Math.min(ft() + V * (1 - ft()), 1), mt = 8 - V * 8, Lt = Math.max(0, 14 - V * 14);
|
665
|
-
$(H, {
|
666
|
-
borderRadius: `${mt}px`,
|
667
|
-
transform: C(d) ? `scale(${j}) translate3d(0, ${Lt}px, 0)` : `scale(${j}) translate3d(${Lt}px, 0, 0)`,
|
943
|
+
const opacityValue = 1 - percentageDragged;
|
944
|
+
if (shouldFade || fadeFromIndex && activeSnapPointIndex === fadeFromIndex - 1) {
|
945
|
+
onDragProp == null ? void 0 : onDragProp(event, percentageDragged);
|
946
|
+
set(overlayRef.current, {
|
947
|
+
opacity: `${opacityValue}`,
|
668
948
|
transition: "none"
|
669
|
-
},
|
949
|
+
}, true);
|
670
950
|
}
|
671
|
-
if (
|
672
|
-
const
|
673
|
-
|
674
|
-
|
951
|
+
if (wrapper && overlayRef.current && shouldScaleBackground) {
|
952
|
+
const scaleValue = Math.min(getScale() + percentageDragged * (1 - getScale()), 1);
|
953
|
+
const borderRadiusValue = 8 - percentageDragged * 8;
|
954
|
+
const translateValue = Math.max(0, 14 - percentageDragged * 14);
|
955
|
+
set(wrapper, {
|
956
|
+
borderRadius: `${borderRadiusValue}px`,
|
957
|
+
transform: isVertical(direction) ? `scale(${scaleValue}) translate3d(0, ${translateValue}px, 0)` : `scale(${scaleValue}) translate3d(${translateValue}px, 0, 0)`,
|
958
|
+
transition: "none"
|
959
|
+
}, true);
|
960
|
+
}
|
961
|
+
if (!snapPoints) {
|
962
|
+
const translateValue = absDraggedDistance * directionMultiplier;
|
963
|
+
set(drawerRef.current, {
|
964
|
+
transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
|
675
965
|
});
|
676
966
|
}
|
677
967
|
}
|
678
968
|
}
|
679
|
-
|
969
|
+
React__default.useEffect(() => {
|
680
970
|
window.requestAnimationFrame(() => {
|
681
|
-
|
971
|
+
shouldAnimate.current = true;
|
682
972
|
});
|
683
|
-
}, [])
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
const
|
693
|
-
|
694
|
-
const
|
695
|
-
|
696
|
-
|
697
|
-
|
973
|
+
}, []);
|
974
|
+
React__default.useEffect(() => {
|
975
|
+
var _window_visualViewport;
|
976
|
+
function onVisualViewportChange() {
|
977
|
+
if (!drawerRef.current || !repositionInputs) return;
|
978
|
+
const focusedElement = document.activeElement;
|
979
|
+
if (isInput(focusedElement) || keyboardIsOpen.current) {
|
980
|
+
var _window_visualViewport2;
|
981
|
+
const visualViewportHeight = ((_window_visualViewport2 = window.visualViewport) == null ? void 0 : _window_visualViewport2.height) || 0;
|
982
|
+
const totalHeight = window.innerHeight;
|
983
|
+
let diffFromInitial = totalHeight - visualViewportHeight;
|
984
|
+
const drawerHeight = drawerRef.current.getBoundingClientRect().height || 0;
|
985
|
+
const isTallEnough = drawerHeight > totalHeight * 0.8;
|
986
|
+
if (!initialDrawerHeight.current) {
|
987
|
+
initialDrawerHeight.current = drawerHeight;
|
988
|
+
}
|
989
|
+
const offsetFromTop = drawerRef.current.getBoundingClientRect().top;
|
990
|
+
if (Math.abs(previousDiffFromInitial.current - diffFromInitial) > 60) {
|
991
|
+
keyboardIsOpen.current = !keyboardIsOpen.current;
|
992
|
+
}
|
993
|
+
if (snapPoints && snapPoints.length > 0 && snapPointsOffset && activeSnapPointIndex) {
|
994
|
+
const activeSnapPointHeight = snapPointsOffset[activeSnapPointIndex] || 0;
|
995
|
+
diffFromInitial += activeSnapPointHeight;
|
996
|
+
}
|
997
|
+
previousDiffFromInitial.current = diffFromInitial;
|
998
|
+
if (drawerHeight > visualViewportHeight || keyboardIsOpen.current) {
|
999
|
+
const height = drawerRef.current.getBoundingClientRect().height;
|
1000
|
+
let newDrawerHeight = height;
|
1001
|
+
if (height > visualViewportHeight) {
|
1002
|
+
newDrawerHeight = visualViewportHeight - (isTallEnough ? offsetFromTop : WINDOW_TOP_OFFSET);
|
1003
|
+
}
|
1004
|
+
if (fixed) {
|
1005
|
+
drawerRef.current.style.height = `${height - Math.max(diffFromInitial, 0)}px`;
|
1006
|
+
} else {
|
1007
|
+
drawerRef.current.style.height = `${Math.max(newDrawerHeight, visualViewportHeight - offsetFromTop)}px`;
|
1008
|
+
}
|
1009
|
+
} else if (!isMobileFirefox()) {
|
1010
|
+
drawerRef.current.style.height = `${initialDrawerHeight.current}px`;
|
1011
|
+
}
|
1012
|
+
if (snapPoints && snapPoints.length > 0 && !keyboardIsOpen.current) {
|
1013
|
+
drawerRef.current.style.bottom = `0px`;
|
1014
|
+
} else {
|
1015
|
+
drawerRef.current.style.bottom = `${Math.max(diffFromInitial, 0)}px`;
|
698
1016
|
}
|
699
|
-
if (At.current = H, K > x || et.current) {
|
700
|
-
const G = f.current.getBoundingClientRect().height;
|
701
|
-
let j = G;
|
702
|
-
G > x && (j = x - (V ? Q : Ot)), D ? f.current.style.height = `${G - Math.max(H, 0)}px` : f.current.style.height = `${Math.max(j, x - Q)}px`;
|
703
|
-
} else Ce() || (f.current.style.height = `${bt.current}px`);
|
704
|
-
a && a.length > 0 && !et.current ? f.current.style.bottom = "0px" : f.current.style.bottom = `${Math.max(H, 0)}px`;
|
705
1017
|
}
|
706
1018
|
}
|
707
|
-
|
708
|
-
|
709
|
-
|
1019
|
+
(_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.addEventListener("resize", onVisualViewportChange);
|
1020
|
+
return () => {
|
1021
|
+
var _window_visualViewport2;
|
1022
|
+
return (_window_visualViewport2 = window.visualViewport) == null ? void 0 : _window_visualViewport2.removeEventListener("resize", onVisualViewportChange);
|
710
1023
|
};
|
711
1024
|
}, [
|
712
|
-
|
713
|
-
|
714
|
-
|
1025
|
+
activeSnapPointIndex,
|
1026
|
+
snapPoints,
|
1027
|
+
snapPointsOffset
|
715
1028
|
]);
|
716
|
-
function
|
717
|
-
|
718
|
-
|
719
|
-
|
1029
|
+
function closeDrawer(fromWithin) {
|
1030
|
+
cancelDrag();
|
1031
|
+
onClose == null ? void 0 : onClose();
|
1032
|
+
if (!fromWithin) {
|
1033
|
+
setIsOpen(false);
|
1034
|
+
}
|
1035
|
+
setTimeout(() => {
|
1036
|
+
if (snapPoints) {
|
1037
|
+
setActiveSnapPoint(snapPoints[0]);
|
1038
|
+
}
|
1039
|
+
}, TRANSITIONS.DURATION * 1e3);
|
720
1040
|
}
|
721
|
-
function
|
722
|
-
if (!
|
723
|
-
const
|
724
|
-
|
1041
|
+
function resetDrawer() {
|
1042
|
+
if (!drawerRef.current) return;
|
1043
|
+
const wrapper = document.querySelector("[data-vaul-drawer-wrapper]");
|
1044
|
+
const currentSwipeAmount = getTranslate(drawerRef.current, direction);
|
1045
|
+
set(drawerRef.current, {
|
725
1046
|
transform: "translate3d(0, 0, 0)",
|
726
|
-
transition: `transform ${
|
727
|
-
})
|
728
|
-
|
1047
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
1048
|
+
});
|
1049
|
+
set(overlayRef.current, {
|
1050
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
729
1051
|
opacity: "1"
|
730
|
-
})
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
1052
|
+
});
|
1053
|
+
if (shouldScaleBackground && currentSwipeAmount && currentSwipeAmount > 0 && isOpen) {
|
1054
|
+
set(wrapper, {
|
1055
|
+
borderRadius: `${BORDER_RADIUS}px`,
|
1056
|
+
overflow: "hidden",
|
1057
|
+
...isVertical(direction) ? {
|
1058
|
+
transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
1059
|
+
transformOrigin: "top"
|
1060
|
+
} : {
|
1061
|
+
transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
1062
|
+
transformOrigin: "left"
|
1063
|
+
},
|
1064
|
+
transitionProperty: "transform, border-radius",
|
1065
|
+
transitionDuration: `${TRANSITIONS.DURATION}s`,
|
1066
|
+
transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
1067
|
+
}, true);
|
1068
|
+
}
|
744
1069
|
}
|
745
|
-
function
|
746
|
-
!
|
1070
|
+
function cancelDrag() {
|
1071
|
+
if (!isDragging || !drawerRef.current) return;
|
1072
|
+
drawerRef.current.classList.remove(DRAG_CLASS);
|
1073
|
+
isAllowedToDrag.current = false;
|
1074
|
+
setIsDragging(false);
|
1075
|
+
dragEndTime.current = /* @__PURE__ */ new Date();
|
747
1076
|
}
|
748
|
-
function
|
749
|
-
if (!
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
1077
|
+
function onRelease(event) {
|
1078
|
+
if (!isDragging || !drawerRef.current) return;
|
1079
|
+
drawerRef.current.classList.remove(DRAG_CLASS);
|
1080
|
+
isAllowedToDrag.current = false;
|
1081
|
+
setIsDragging(false);
|
1082
|
+
dragEndTime.current = /* @__PURE__ */ new Date();
|
1083
|
+
const swipeAmount = getTranslate(drawerRef.current, direction);
|
1084
|
+
if (!event || !shouldDrag(event.target, false) || !swipeAmount || Number.isNaN(swipeAmount)) return;
|
1085
|
+
if (dragStartTime.current === null) return;
|
1086
|
+
const timeTaken = dragEndTime.current.getTime() - dragStartTime.current.getTime();
|
1087
|
+
const distMoved = pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX);
|
1088
|
+
const velocity = Math.abs(distMoved) / timeTaken;
|
1089
|
+
if (velocity > 0.05) {
|
1090
|
+
setJustReleased(true);
|
1091
|
+
setTimeout(() => {
|
1092
|
+
setJustReleased(false);
|
1093
|
+
}, 200);
|
1094
|
+
}
|
1095
|
+
if (snapPoints) {
|
1096
|
+
const directionMultiplier = direction === "bottom" || direction === "right" ? 1 : -1;
|
1097
|
+
onReleaseSnapPoints({
|
1098
|
+
draggedDistance: distMoved * directionMultiplier,
|
1099
|
+
closeDrawer,
|
1100
|
+
velocity,
|
1101
|
+
dismissible
|
1102
|
+
});
|
1103
|
+
onReleaseProp == null ? void 0 : onReleaseProp(event, true);
|
763
1104
|
return;
|
764
1105
|
}
|
765
|
-
if (
|
766
|
-
|
1106
|
+
if (direction === "bottom" || direction === "right" ? distMoved > 0 : distMoved < 0) {
|
1107
|
+
resetDrawer();
|
1108
|
+
onReleaseProp == null ? void 0 : onReleaseProp(event, true);
|
767
1109
|
return;
|
768
1110
|
}
|
769
|
-
if (
|
770
|
-
|
1111
|
+
if (velocity > VELOCITY_THRESHOLD) {
|
1112
|
+
closeDrawer();
|
1113
|
+
onReleaseProp == null ? void 0 : onReleaseProp(event, false);
|
771
1114
|
return;
|
772
1115
|
}
|
773
|
-
var
|
774
|
-
const
|
775
|
-
var
|
776
|
-
const
|
777
|
-
|
778
|
-
|
1116
|
+
var _drawerRef_current_getBoundingClientRect_height;
|
1117
|
+
const visibleDrawerHeight = Math.min((_drawerRef_current_getBoundingClientRect_height = drawerRef.current.getBoundingClientRect().height) != null ? _drawerRef_current_getBoundingClientRect_height : 0, window.innerHeight);
|
1118
|
+
var _drawerRef_current_getBoundingClientRect_width;
|
1119
|
+
const visibleDrawerWidth = Math.min((_drawerRef_current_getBoundingClientRect_width = drawerRef.current.getBoundingClientRect().width) != null ? _drawerRef_current_getBoundingClientRect_width : 0, window.innerWidth);
|
1120
|
+
const isHorizontalSwipe = direction === "left" || direction === "right";
|
1121
|
+
if (Math.abs(swipeAmount) >= (isHorizontalSwipe ? visibleDrawerWidth : visibleDrawerHeight) * closeThreshold) {
|
1122
|
+
closeDrawer();
|
1123
|
+
onReleaseProp == null ? void 0 : onReleaseProp(event, false);
|
779
1124
|
return;
|
780
1125
|
}
|
781
|
-
|
1126
|
+
onReleaseProp == null ? void 0 : onReleaseProp(event, true);
|
1127
|
+
resetDrawer();
|
782
1128
|
}
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
}), [
|
788
|
-
_
|
789
|
-
]);
|
790
|
-
function fe(l) {
|
791
|
-
const R = l ? (window.innerWidth - Z) / window.innerWidth : 1, T = l ? -Z : 0;
|
792
|
-
vt.current && window.clearTimeout(vt.current), $(f.current, {
|
793
|
-
transition: `transform ${O.DURATION}s cubic-bezier(${O.EASE.join(",")})`,
|
794
|
-
transform: C(d) ? `scale(${R}) translate3d(0, ${T}px, 0)` : `scale(${R}) translate3d(${T}px, 0, 0)`
|
795
|
-
}), !l && f.current && (vt.current = setTimeout(() => {
|
796
|
-
const v = wt(f.current, d);
|
797
|
-
$(f.current, {
|
798
|
-
transition: "none",
|
799
|
-
transform: C(d) ? `translate3d(0, ${v}px, 0)` : `translate3d(${v}px, 0, 0)`
|
1129
|
+
React__default.useEffect(() => {
|
1130
|
+
if (isOpen) {
|
1131
|
+
set(document.documentElement, {
|
1132
|
+
scrollBehavior: "auto"
|
800
1133
|
});
|
801
|
-
|
1134
|
+
openTime.current = /* @__PURE__ */ new Date();
|
1135
|
+
}
|
1136
|
+
return () => {
|
1137
|
+
reset(document.documentElement, "scrollBehavior");
|
1138
|
+
};
|
1139
|
+
}, [
|
1140
|
+
isOpen
|
1141
|
+
]);
|
1142
|
+
function onNestedOpenChange(o) {
|
1143
|
+
const scale = o ? (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth : 1;
|
1144
|
+
const initialTranslate = o ? -NESTED_DISPLACEMENT : 0;
|
1145
|
+
if (nestedOpenChangeTimer.current) {
|
1146
|
+
window.clearTimeout(nestedOpenChangeTimer.current);
|
1147
|
+
}
|
1148
|
+
set(drawerRef.current, {
|
1149
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
1150
|
+
transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${initialTranslate}px, 0)` : `scale(${scale}) translate3d(${initialTranslate}px, 0, 0)`
|
1151
|
+
});
|
1152
|
+
if (!o && drawerRef.current) {
|
1153
|
+
nestedOpenChangeTimer.current = setTimeout(() => {
|
1154
|
+
const translateValue = getTranslate(drawerRef.current, direction);
|
1155
|
+
set(drawerRef.current, {
|
1156
|
+
transition: "none",
|
1157
|
+
transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
|
1158
|
+
});
|
1159
|
+
}, 500);
|
1160
|
+
}
|
802
1161
|
}
|
803
|
-
function
|
804
|
-
if (
|
805
|
-
const
|
806
|
-
|
807
|
-
|
1162
|
+
function onNestedDrag(_event, percentageDragged) {
|
1163
|
+
if (percentageDragged < 0) return;
|
1164
|
+
const initialScale = (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth;
|
1165
|
+
const newScale = initialScale + percentageDragged * (1 - initialScale);
|
1166
|
+
const newTranslate = -NESTED_DISPLACEMENT + percentageDragged * NESTED_DISPLACEMENT;
|
1167
|
+
set(drawerRef.current, {
|
1168
|
+
transform: isVertical(direction) ? `scale(${newScale}) translate3d(0, ${newTranslate}px, 0)` : `scale(${newScale}) translate3d(${newTranslate}px, 0, 0)`,
|
808
1169
|
transition: "none"
|
809
1170
|
});
|
810
1171
|
}
|
811
|
-
function
|
812
|
-
const
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
1172
|
+
function onNestedRelease(_event, o) {
|
1173
|
+
const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;
|
1174
|
+
const scale = o ? (dim - NESTED_DISPLACEMENT) / dim : 1;
|
1175
|
+
const translate = o ? -NESTED_DISPLACEMENT : 0;
|
1176
|
+
if (o) {
|
1177
|
+
set(drawerRef.current, {
|
1178
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
1179
|
+
transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${translate}px, 0)` : `scale(${scale}) translate3d(${translate}px, 0, 0)`
|
1180
|
+
});
|
1181
|
+
}
|
817
1182
|
}
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
1183
|
+
React__default.useEffect(() => {
|
1184
|
+
if (!modal) {
|
1185
|
+
window.requestAnimationFrame(() => {
|
1186
|
+
document.body.style.pointerEvents = "auto";
|
1187
|
+
});
|
1188
|
+
}
|
822
1189
|
}, [
|
823
|
-
|
824
|
-
])
|
825
|
-
|
826
|
-
|
827
|
-
|
1190
|
+
modal
|
1191
|
+
]);
|
1192
|
+
return /* @__PURE__ */ React__default.createElement(Root$1, {
|
1193
|
+
defaultOpen,
|
1194
|
+
onOpenChange: (open) => {
|
1195
|
+
if (!dismissible && !open) return;
|
1196
|
+
if (open) {
|
1197
|
+
setHasBeenOpened(true);
|
1198
|
+
} else {
|
1199
|
+
closeDrawer(true);
|
1200
|
+
}
|
1201
|
+
setIsOpen(open);
|
828
1202
|
},
|
829
|
-
open:
|
830
|
-
}, /* @__PURE__ */
|
1203
|
+
open: isOpen
|
1204
|
+
}, /* @__PURE__ */ React__default.createElement(DrawerContext.Provider, {
|
831
1205
|
value: {
|
832
|
-
activeSnapPoint
|
833
|
-
snapPoints
|
834
|
-
setActiveSnapPoint
|
835
|
-
drawerRef
|
836
|
-
overlayRef
|
837
|
-
onOpenChange
|
838
|
-
onPress
|
839
|
-
onRelease
|
840
|
-
onDrag
|
841
|
-
dismissible
|
842
|
-
shouldAnimate
|
843
|
-
handleOnly
|
844
|
-
isOpen
|
845
|
-
isDragging
|
846
|
-
shouldFade
|
847
|
-
closeDrawer
|
848
|
-
onNestedDrag
|
849
|
-
onNestedOpenChange
|
850
|
-
onNestedRelease
|
851
|
-
keyboardIsOpen
|
852
|
-
modal
|
853
|
-
snapPointsOffset
|
854
|
-
activeSnapPointIndex
|
855
|
-
direction
|
856
|
-
shouldScaleBackground
|
857
|
-
setBackgroundColorOnScale
|
858
|
-
noBodyStyles
|
859
|
-
container
|
860
|
-
autoFocus
|
861
|
-
}
|
862
|
-
},
|
1206
|
+
activeSnapPoint,
|
1207
|
+
snapPoints,
|
1208
|
+
setActiveSnapPoint,
|
1209
|
+
drawerRef,
|
1210
|
+
overlayRef,
|
1211
|
+
onOpenChange,
|
1212
|
+
onPress,
|
1213
|
+
onRelease,
|
1214
|
+
onDrag,
|
1215
|
+
dismissible,
|
1216
|
+
shouldAnimate,
|
1217
|
+
handleOnly,
|
1218
|
+
isOpen,
|
1219
|
+
isDragging,
|
1220
|
+
shouldFade,
|
1221
|
+
closeDrawer,
|
1222
|
+
onNestedDrag,
|
1223
|
+
onNestedOpenChange,
|
1224
|
+
onNestedRelease,
|
1225
|
+
keyboardIsOpen,
|
1226
|
+
modal,
|
1227
|
+
snapPointsOffset,
|
1228
|
+
activeSnapPointIndex,
|
1229
|
+
direction,
|
1230
|
+
shouldScaleBackground,
|
1231
|
+
setBackgroundColorOnScale,
|
1232
|
+
noBodyStyles,
|
1233
|
+
container,
|
1234
|
+
autoFocus
|
1235
|
+
}
|
1236
|
+
}, children));
|
863
1237
|
}
|
864
|
-
const
|
865
|
-
const { overlayRef
|
866
|
-
|
1238
|
+
const Overlay = /* @__PURE__ */ React__default.forwardRef(function({ ...rest }, ref) {
|
1239
|
+
const { overlayRef, snapPoints, onRelease, shouldFade, isOpen, modal, shouldAnimate } = useDrawerContext();
|
1240
|
+
const composedRef = useComposedRefs(ref, overlayRef);
|
1241
|
+
const hasSnapPoints = snapPoints && snapPoints.length > 0;
|
1242
|
+
if (!modal) {
|
867
1243
|
return null;
|
868
|
-
|
869
|
-
|
1244
|
+
}
|
1245
|
+
const onMouseUp = React__default.useCallback((event) => onRelease(event), [
|
1246
|
+
onRelease
|
870
1247
|
]);
|
871
|
-
return /* @__PURE__ */
|
872
|
-
onMouseUp
|
873
|
-
ref:
|
1248
|
+
return /* @__PURE__ */ React__default.createElement(Overlay$1, {
|
1249
|
+
onMouseUp,
|
1250
|
+
ref: composedRef,
|
874
1251
|
"data-vaul-overlay": "",
|
875
|
-
"data-vaul-snap-points":
|
876
|
-
"data-vaul-snap-points-overlay":
|
877
|
-
"data-vaul-animate":
|
878
|
-
...
|
1252
|
+
"data-vaul-snap-points": isOpen && hasSnapPoints ? "true" : "false",
|
1253
|
+
"data-vaul-snap-points-overlay": isOpen && shouldFade ? "true" : "false",
|
1254
|
+
"data-vaul-animate": (shouldAnimate == null ? void 0 : shouldAnimate.current) ? "true" : "false",
|
1255
|
+
...rest
|
879
1256
|
});
|
880
1257
|
});
|
881
|
-
|
882
|
-
const
|
883
|
-
const { drawerRef
|
884
|
-
|
885
|
-
const
|
886
|
-
|
887
|
-
|
1258
|
+
Overlay.displayName = "Drawer.Overlay";
|
1259
|
+
const Content = /* @__PURE__ */ React__default.forwardRef(function({ onPointerDownOutside, style, onOpenAutoFocus, ...rest }, ref) {
|
1260
|
+
const { drawerRef, onPress, onRelease, onDrag, keyboardIsOpen, snapPointsOffset, activeSnapPointIndex, modal, isOpen, direction, snapPoints, container, handleOnly, shouldAnimate, autoFocus } = useDrawerContext();
|
1261
|
+
const [delayedSnapPoints, setDelayedSnapPoints] = React__default.useState(false);
|
1262
|
+
const composedRef = useComposedRefs(ref, drawerRef);
|
1263
|
+
const pointerStartRef = React__default.useRef(null);
|
1264
|
+
const lastKnownPointerEventRef = React__default.useRef(null);
|
1265
|
+
const wasBeyondThePointRef = React__default.useRef(false);
|
1266
|
+
const hasSnapPoints = snapPoints && snapPoints.length > 0;
|
1267
|
+
useScaleBackground();
|
1268
|
+
const isDeltaInDirection = (delta, direction2, threshold = 0) => {
|
1269
|
+
if (wasBeyondThePointRef.current) return true;
|
1270
|
+
const deltaY = Math.abs(delta.y);
|
1271
|
+
const deltaX = Math.abs(delta.x);
|
1272
|
+
const isDeltaX = deltaX > deltaY;
|
1273
|
+
const dFactor = [
|
888
1274
|
"bottom",
|
889
1275
|
"right"
|
890
|
-
].includes(
|
891
|
-
if (
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
1276
|
+
].includes(direction2) ? 1 : -1;
|
1277
|
+
if (direction2 === "left" || direction2 === "right") {
|
1278
|
+
const isReverseDirection = delta.x * dFactor < 0;
|
1279
|
+
if (!isReverseDirection && deltaX >= 0 && deltaX <= threshold) {
|
1280
|
+
return isDeltaX;
|
1281
|
+
}
|
1282
|
+
} else {
|
1283
|
+
const isReverseDirection = delta.y * dFactor < 0;
|
1284
|
+
if (!isReverseDirection && deltaY >= 0 && deltaY <= threshold) {
|
1285
|
+
return !isDeltaX;
|
1286
|
+
}
|
1287
|
+
}
|
1288
|
+
wasBeyondThePointRef.current = true;
|
1289
|
+
return true;
|
897
1290
|
};
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
1291
|
+
React__default.useEffect(() => {
|
1292
|
+
if (hasSnapPoints) {
|
1293
|
+
window.requestAnimationFrame(() => {
|
1294
|
+
setDelayedSnapPoints(true);
|
1295
|
+
});
|
1296
|
+
}
|
902
1297
|
}, []);
|
903
|
-
function
|
904
|
-
|
1298
|
+
function handleOnPointerUp(event) {
|
1299
|
+
pointerStartRef.current = null;
|
1300
|
+
wasBeyondThePointRef.current = false;
|
1301
|
+
onRelease(event);
|
905
1302
|
}
|
906
|
-
return /* @__PURE__ */
|
907
|
-
"data-vaul-drawer-direction":
|
1303
|
+
return /* @__PURE__ */ React__default.createElement(Content$1, {
|
1304
|
+
"data-vaul-drawer-direction": direction,
|
908
1305
|
"data-vaul-drawer": "",
|
909
|
-
"data-vaul-delayed-snap-points":
|
910
|
-
"data-vaul-snap-points":
|
911
|
-
"data-vaul-custom-container":
|
912
|
-
"data-vaul-animate":
|
913
|
-
...
|
914
|
-
ref:
|
915
|
-
style:
|
916
|
-
"--snap-point-height": `${
|
917
|
-
...
|
918
|
-
} :
|
919
|
-
onPointerDown: (
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
1306
|
+
"data-vaul-delayed-snap-points": delayedSnapPoints ? "true" : "false",
|
1307
|
+
"data-vaul-snap-points": isOpen && hasSnapPoints ? "true" : "false",
|
1308
|
+
"data-vaul-custom-container": container ? "true" : "false",
|
1309
|
+
"data-vaul-animate": (shouldAnimate == null ? void 0 : shouldAnimate.current) ? "true" : "false",
|
1310
|
+
...rest,
|
1311
|
+
ref: composedRef,
|
1312
|
+
style: snapPointsOffset && snapPointsOffset.length > 0 ? {
|
1313
|
+
"--snap-point-height": `${snapPointsOffset[activeSnapPointIndex != null ? activeSnapPointIndex : 0]}px`,
|
1314
|
+
...style
|
1315
|
+
} : style,
|
1316
|
+
onPointerDown: (event) => {
|
1317
|
+
if (handleOnly) return;
|
1318
|
+
rest.onPointerDown == null ? void 0 : rest.onPointerDown.call(rest, event);
|
1319
|
+
pointerStartRef.current = {
|
1320
|
+
x: event.pageX,
|
1321
|
+
y: event.pageY
|
1322
|
+
};
|
1323
|
+
onPress(event);
|
924
1324
|
},
|
925
|
-
onOpenAutoFocus: (
|
926
|
-
|
1325
|
+
onOpenAutoFocus: (e) => {
|
1326
|
+
onOpenAutoFocus == null ? void 0 : onOpenAutoFocus(e);
|
1327
|
+
if (!autoFocus) {
|
1328
|
+
e.preventDefault();
|
1329
|
+
}
|
927
1330
|
},
|
928
|
-
onPointerDownOutside: (
|
929
|
-
|
930
|
-
|
1331
|
+
onPointerDownOutside: (e) => {
|
1332
|
+
onPointerDownOutside == null ? void 0 : onPointerDownOutside(e);
|
1333
|
+
if (!modal || e.defaultPrevented) {
|
1334
|
+
e.preventDefault();
|
931
1335
|
return;
|
932
1336
|
}
|
933
|
-
|
1337
|
+
if (keyboardIsOpen.current) {
|
1338
|
+
keyboardIsOpen.current = false;
|
1339
|
+
}
|
934
1340
|
},
|
935
|
-
onFocusOutside: (
|
936
|
-
if (!
|
937
|
-
|
1341
|
+
onFocusOutside: (e) => {
|
1342
|
+
if (!modal) {
|
1343
|
+
e.preventDefault();
|
938
1344
|
return;
|
939
1345
|
}
|
940
1346
|
},
|
941
|
-
onPointerMove: (
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
1347
|
+
onPointerMove: (event) => {
|
1348
|
+
lastKnownPointerEventRef.current = event;
|
1349
|
+
if (handleOnly) return;
|
1350
|
+
rest.onPointerMove == null ? void 0 : rest.onPointerMove.call(rest, event);
|
1351
|
+
if (!pointerStartRef.current) return;
|
1352
|
+
const yPosition = event.pageY - pointerStartRef.current.y;
|
1353
|
+
const xPosition = event.pageX - pointerStartRef.current.x;
|
1354
|
+
const swipeStartThreshold = event.pointerType === "touch" ? 10 : 2;
|
1355
|
+
const delta = {
|
1356
|
+
x: xPosition,
|
1357
|
+
y: yPosition
|
1358
|
+
};
|
1359
|
+
const isAllowedToSwipe = isDeltaInDirection(delta, direction, swipeStartThreshold);
|
1360
|
+
if (isAllowedToSwipe) onDrag(event);
|
1361
|
+
else if (Math.abs(xPosition) > swipeStartThreshold || Math.abs(yPosition) > swipeStartThreshold) {
|
1362
|
+
pointerStartRef.current = null;
|
1363
|
+
}
|
948
1364
|
},
|
949
|
-
onPointerUp: (
|
950
|
-
|
1365
|
+
onPointerUp: (event) => {
|
1366
|
+
rest.onPointerUp == null ? void 0 : rest.onPointerUp.call(rest, event);
|
1367
|
+
pointerStartRef.current = null;
|
1368
|
+
wasBeyondThePointRef.current = false;
|
1369
|
+
onRelease(event);
|
951
1370
|
},
|
952
|
-
onPointerOut: (
|
953
|
-
|
1371
|
+
onPointerOut: (event) => {
|
1372
|
+
rest.onPointerOut == null ? void 0 : rest.onPointerOut.call(rest, event);
|
1373
|
+
handleOnPointerUp(lastKnownPointerEventRef.current);
|
954
1374
|
},
|
955
|
-
onContextMenu: (
|
956
|
-
|
1375
|
+
onContextMenu: (event) => {
|
1376
|
+
rest.onContextMenu == null ? void 0 : rest.onContextMenu.call(rest, event);
|
1377
|
+
if (lastKnownPointerEventRef.current) {
|
1378
|
+
handleOnPointerUp(lastKnownPointerEventRef.current);
|
1379
|
+
}
|
957
1380
|
}
|
958
1381
|
});
|
959
1382
|
});
|
960
|
-
|
961
|
-
const
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
1383
|
+
Content.displayName = "Drawer.Content";
|
1384
|
+
const LONG_HANDLE_PRESS_TIMEOUT = 250;
|
1385
|
+
const DOUBLE_TAP_TIMEOUT = 120;
|
1386
|
+
const Handle = /* @__PURE__ */ React__default.forwardRef(function({ preventCycle = false, children, ...rest }, ref) {
|
1387
|
+
const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag } = useDrawerContext();
|
1388
|
+
const closeTimeoutIdRef = React__default.useRef(null);
|
1389
|
+
const shouldCancelInteractionRef = React__default.useRef(false);
|
1390
|
+
function handleStartCycle() {
|
1391
|
+
if (shouldCancelInteractionRef.current) {
|
1392
|
+
handleCancelInteraction();
|
966
1393
|
return;
|
967
1394
|
}
|
968
1395
|
window.setTimeout(() => {
|
969
|
-
|
970
|
-
},
|
1396
|
+
handleCycleSnapPoints();
|
1397
|
+
}, DOUBLE_TAP_TIMEOUT);
|
971
1398
|
}
|
972
|
-
function
|
973
|
-
if (
|
974
|
-
|
1399
|
+
function handleCycleSnapPoints() {
|
1400
|
+
if (isDragging || preventCycle || shouldCancelInteractionRef.current) {
|
1401
|
+
handleCancelInteraction();
|
975
1402
|
return;
|
976
1403
|
}
|
977
|
-
|
978
|
-
|
1404
|
+
handleCancelInteraction();
|
1405
|
+
if (!snapPoints || snapPoints.length === 0) {
|
1406
|
+
if (!dismissible) {
|
1407
|
+
closeDrawer();
|
1408
|
+
}
|
979
1409
|
return;
|
980
1410
|
}
|
981
|
-
|
982
|
-
|
1411
|
+
const isLastSnapPoint = activeSnapPoint === snapPoints[snapPoints.length - 1];
|
1412
|
+
if (isLastSnapPoint && dismissible) {
|
1413
|
+
closeDrawer();
|
983
1414
|
return;
|
984
1415
|
}
|
985
|
-
const
|
986
|
-
if (
|
987
|
-
const
|
988
|
-
|
1416
|
+
const currentSnapIndex = snapPoints.findIndex((point) => point === activeSnapPoint);
|
1417
|
+
if (currentSnapIndex === -1) return;
|
1418
|
+
const nextSnapPoint = snapPoints[currentSnapIndex + 1];
|
1419
|
+
setActiveSnapPoint(nextSnapPoint);
|
989
1420
|
}
|
990
|
-
function
|
991
|
-
|
992
|
-
|
993
|
-
},
|
1421
|
+
function handleStartInteraction() {
|
1422
|
+
closeTimeoutIdRef.current = window.setTimeout(() => {
|
1423
|
+
shouldCancelInteractionRef.current = true;
|
1424
|
+
}, LONG_HANDLE_PRESS_TIMEOUT);
|
994
1425
|
}
|
995
|
-
function
|
996
|
-
|
1426
|
+
function handleCancelInteraction() {
|
1427
|
+
if (closeTimeoutIdRef.current) {
|
1428
|
+
window.clearTimeout(closeTimeoutIdRef.current);
|
1429
|
+
}
|
1430
|
+
shouldCancelInteractionRef.current = false;
|
997
1431
|
}
|
998
|
-
return /* @__PURE__ */
|
999
|
-
onClick:
|
1000
|
-
onPointerCancel:
|
1001
|
-
onPointerDown: (
|
1002
|
-
|
1432
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
1433
|
+
onClick: handleStartCycle,
|
1434
|
+
onPointerCancel: handleCancelInteraction,
|
1435
|
+
onPointerDown: (e) => {
|
1436
|
+
if (handleOnly) onPress(e);
|
1437
|
+
handleStartInteraction();
|
1003
1438
|
},
|
1004
|
-
onPointerMove: (
|
1005
|
-
|
1439
|
+
onPointerMove: (e) => {
|
1440
|
+
if (handleOnly) onDrag(e);
|
1006
1441
|
},
|
1007
1442
|
// onPointerUp is already handled by the content component
|
1008
|
-
ref
|
1009
|
-
"data-vaul-drawer-visible":
|
1443
|
+
ref,
|
1444
|
+
"data-vaul-drawer-visible": isOpen ? "true" : "false",
|
1010
1445
|
"data-vaul-handle": "",
|
1011
1446
|
"aria-hidden": "true",
|
1012
|
-
...
|
1013
|
-
}, /* @__PURE__ */
|
1447
|
+
...rest
|
1448
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
1014
1449
|
"data-vaul-handle-hitarea": "",
|
1015
1450
|
"aria-hidden": "true"
|
1016
|
-
},
|
1451
|
+
}, children));
|
1017
1452
|
});
|
1018
|
-
|
1019
|
-
function
|
1020
|
-
const { onNestedDrag
|
1021
|
-
if (!
|
1453
|
+
Handle.displayName = "Drawer.Handle";
|
1454
|
+
function NestedRoot({ onDrag, onOpenChange, open: nestedIsOpen, ...rest }) {
|
1455
|
+
const { onNestedDrag, onNestedOpenChange, onNestedRelease } = useDrawerContext();
|
1456
|
+
if (!onNestedDrag) {
|
1022
1457
|
throw new Error("Drawer.NestedRoot must be placed in another drawer");
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1458
|
+
}
|
1459
|
+
return /* @__PURE__ */ React__default.createElement(Root, {
|
1460
|
+
nested: true,
|
1461
|
+
open: nestedIsOpen,
|
1026
1462
|
onClose: () => {
|
1027
|
-
|
1463
|
+
onNestedOpenChange(false);
|
1028
1464
|
},
|
1029
|
-
onDrag: (
|
1030
|
-
|
1465
|
+
onDrag: (e, p) => {
|
1466
|
+
onNestedDrag(e, p);
|
1467
|
+
onDrag == null ? void 0 : onDrag(e, p);
|
1031
1468
|
},
|
1032
|
-
onOpenChange: (
|
1033
|
-
|
1469
|
+
onOpenChange: (o) => {
|
1470
|
+
if (o) {
|
1471
|
+
onNestedOpenChange(o);
|
1472
|
+
}
|
1473
|
+
onOpenChange == null ? void 0 : onOpenChange(o);
|
1034
1474
|
},
|
1035
|
-
onRelease:
|
1036
|
-
...
|
1475
|
+
onRelease: onNestedRelease,
|
1476
|
+
...rest
|
1037
1477
|
});
|
1038
1478
|
}
|
1039
|
-
function
|
1040
|
-
const
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1479
|
+
function Portal(props) {
|
1480
|
+
const context = useDrawerContext();
|
1481
|
+
const { container = context.container, ...portalProps } = props;
|
1482
|
+
return /* @__PURE__ */ React__default.createElement(Portal$1, {
|
1483
|
+
container,
|
1484
|
+
...portalProps
|
1044
1485
|
});
|
1045
1486
|
}
|
1046
|
-
const
|
1047
|
-
Root
|
1048
|
-
NestedRoot
|
1049
|
-
Content
|
1050
|
-
Overlay
|
1051
|
-
Trigger
|
1052
|
-
Portal
|
1053
|
-
Handle
|
1054
|
-
Close
|
1055
|
-
Title
|
1056
|
-
Description
|
1487
|
+
const Drawer = {
|
1488
|
+
Root,
|
1489
|
+
NestedRoot,
|
1490
|
+
Content,
|
1491
|
+
Overlay,
|
1492
|
+
Trigger,
|
1493
|
+
Portal,
|
1494
|
+
Handle,
|
1495
|
+
Close,
|
1496
|
+
Title,
|
1497
|
+
Description
|
1057
1498
|
};
|
1058
1499
|
export {
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1500
|
+
Content,
|
1501
|
+
Drawer,
|
1502
|
+
Handle,
|
1503
|
+
NestedRoot,
|
1504
|
+
Overlay,
|
1505
|
+
Portal,
|
1506
|
+
Root
|
1066
1507
|
};
|