@vlrc-fe/components 3.0.3 → 3.0.4
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/CHANGELOG.md +17 -0
- package/README.md +10 -1
- package/bin/registry.mjs +1124 -0
- package/bin/vlrc.mjs +102 -7
- package/dist/ConfirmModal.cjs +276 -1
- package/dist/ConfirmModal.js +119 -103
- package/dist/DataTable/DataTable.cjs +203 -1
- package/dist/DataTable/DataTable.js +161 -120
- package/dist/DataTable/components/DataTableColumnHeader.cjs +214 -1
- package/dist/DataTable/components/DataTableColumnHeader.d.ts +3 -3
- package/dist/DataTable/components/DataTableColumnHeader.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableColumnHeader.js +201 -103
- package/dist/DataTable/components/DataTableFacetedFilter.cjs +332 -1
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts +3 -3
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableFacetedFilter.js +285 -181
- package/dist/DataTable/components/DataTablePagination.cjs +200 -1
- package/dist/DataTable/components/DataTablePagination.js +188 -91
- package/dist/DataTable/components/DataTableRowActions.cjs +172 -1
- package/dist/DataTable/components/DataTableRowActions.js +161 -62
- package/dist/DataTable/components/DataTableTable.cjs +100 -1
- package/dist/DataTable/components/DataTableTable.js +87 -35
- package/dist/DataTable/components/DataTableToolbar.cjs +112 -1
- package/dist/DataTable/components/DataTableToolbar.js +106 -44
- package/dist/DataTable/components/DataTableViewOptions.cjs +113 -1
- package/dist/DataTable/components/DataTableViewOptions.js +105 -44
- package/dist/DataTable/render/createColumns.cjs +84 -1
- package/dist/DataTable/render/createColumns.js +65 -44
- package/dist/DataTable/render/defaults.cjs +38 -1
- package/dist/DataTable/render/defaults.js +18 -13
- package/dist/Dropdown/Dropdown.cjs +255 -1
- package/dist/Dropdown/Dropdown.js +138 -108
- package/dist/Form/Form.cjs +439 -1
- package/dist/Form/Form.js +417 -206
- package/dist/Form/FormDatePicker/FormDatePicker.cjs +84 -1
- package/dist/Form/FormDatePicker/FormDatePicker.js +68 -65
- package/dist/Form/FormDatePicker/MonthPickerPanel.cjs +217 -1
- package/dist/Form/FormDatePicker/MonthPickerPanel.js +194 -101
- package/dist/Form/FormDatePicker/RangeDatePicker.cjs +144 -1
- package/dist/Form/FormDatePicker/RangeDatePicker.js +94 -77
- package/dist/Form/FormDatePicker/SingleDatePicker.cjs +191 -1
- package/dist/Form/FormDatePicker/SingleDatePicker.js +144 -114
- package/dist/Form/FormDatePicker/TimeInput.cjs +172 -1
- package/dist/Form/FormDatePicker/TimeInput.js +162 -79
- package/dist/Form/FormDatePicker/TimePicker.cjs +107 -1
- package/dist/Form/FormDatePicker/TimePicker.js +58 -43
- package/dist/Form/FormDatePicker/YearPickerPanel.cjs +184 -1
- package/dist/Form/FormDatePicker/YearPickerPanel.js +164 -84
- package/dist/Form/FormDatePicker/types.cjs +10 -1
- package/dist/Form/FormDatePicker/types.js +8 -3
- package/dist/Form/FormDatePicker/useFormDatePicker.cjs +70 -1
- package/dist/Form/FormDatePicker/useFormDatePicker.js +58 -31
- package/dist/Form/FormFileUpload/FileUpload.cjs +603 -1
- package/dist/Form/FormFileUpload/FileUpload.js +452 -306
- package/dist/Form/FormFileUpload/index.cjs +175 -1
- package/dist/Form/FormFileUpload/index.js +164 -50
- package/dist/Form/FormMultiSelect/FormMultiSelect.cjs +46 -1
- package/dist/Form/FormMultiSelect/FormMultiSelect.js +42 -22
- package/dist/Form/FormNumberInput/FormNumberInput.cjs +71 -1
- package/dist/Form/FormNumberInput/FormNumberInput.js +60 -58
- package/dist/Form/FormNumberInput/StepperControls.cjs +104 -1
- package/dist/Form/FormNumberInput/StepperControls.js +78 -43
- package/dist/Form/FormNumberInput/useFormNumberInput.cjs +72 -1
- package/dist/Form/FormNumberInput/useFormNumberInput.js +68 -39
- package/dist/Form/FormRadioGroup/FormRadio.cjs +65 -1
- package/dist/Form/FormRadioGroup/FormRadio.js +38 -38
- package/dist/Form/FormRadioGroup/useFormRadio.cjs +38 -1
- package/dist/Form/FormRadioGroup/useFormRadio.js +27 -16
- package/dist/Form/FormSelect/FormSelect.cjs +46 -1
- package/dist/Form/FormSelect/FormSelect.js +40 -26
- package/dist/Form/FormSelect/useFormSelect.cjs +58 -1
- package/dist/Form/FormSelect/useFormSelect.js +52 -43
- package/dist/Icons/Icons.cjs +155 -1
- package/dist/Icons/Icons.js +142 -142
- package/dist/Modal.cjs +135 -1
- package/dist/Modal.js +67 -54
- package/dist/MultiSelect/MultiSelect.cjs +211 -1
- package/dist/MultiSelect/MultiSelect.js +127 -117
- package/dist/MultiSelect/renderers.cjs +571 -1
- package/dist/MultiSelect/renderers.js +508 -309
- package/dist/MultiSelect/useMultiSelect.cjs +243 -1
- package/dist/MultiSelect/useMultiSelect.js +207 -127
- package/dist/MultiSelect/utils.cjs +123 -1
- package/dist/MultiSelect/utils.js +79 -51
- package/dist/Select/BaseSelect.cjs +265 -1
- package/dist/Select/BaseSelect.js +165 -126
- package/dist/Select/MultiSelectTags.cjs +129 -1
- package/dist/Select/MultiSelectTags.js +82 -56
- package/dist/Typography/Blockquote.cjs +79 -1
- package/dist/Typography/Blockquote.js +40 -38
- package/dist/Typography/Code.cjs +131 -1
- package/dist/Typography/Code.js +64 -58
- package/dist/Typography/Link.cjs +141 -1
- package/dist/Typography/Link.d.ts +1 -2
- package/dist/Typography/Link.d.ts.map +1 -1
- package/dist/Typography/Link.js +74 -63
- package/dist/Typography/Paragraph.cjs +226 -1
- package/dist/Typography/Paragraph.d.ts +1 -2
- package/dist/Typography/Paragraph.d.ts.map +1 -1
- package/dist/Typography/Paragraph.js +119 -107
- package/dist/Typography/Text.cjs +224 -1
- package/dist/Typography/Text.d.ts +1 -2
- package/dist/Typography/Text.d.ts.map +1 -1
- package/dist/Typography/Text.js +117 -100
- package/dist/Typography/Title.cjs +220 -1
- package/dist/Typography/Title.d.ts +1 -2
- package/dist/Typography/Title.d.ts.map +1 -1
- package/dist/Typography/Title.js +125 -103
- package/dist/Typography/Typography.cjs +17 -1
- package/dist/Typography/Typography.js +14 -14
- package/dist/Typography/index.d.ts +1 -1
- package/dist/Typography/index.d.ts.map +1 -1
- package/dist/Typography/index.js +13 -13
- package/dist/Typography/tooltip.cjs +42 -1
- package/dist/Typography/tooltip.js +34 -14
- package/dist/Typography/types.cjs +20 -1
- package/dist/Typography/types.js +5 -2
- package/dist/Typography/utils.cjs +52 -1
- package/dist/Typography/utils.js +48 -21
- package/dist/Typography/weightStyles.cjs +58 -1
- package/dist/Typography/weightStyles.js +26 -25
- package/dist/_virtual/_rolldown/runtime.cjs +32 -1
- package/dist/_virtual/_rolldown/runtime.js +9 -7
- package/dist/assets/stylex.css +135 -1
- package/dist/astryx.cjs +18 -1
- package/dist/astryx.d.ts.map +1 -1
- package/dist/astryx.js +2 -1
- package/dist/index.cjs +789 -1
- package/dist/index.js +122 -118
- package/dist/layout/Box.cjs +203 -1
- package/dist/layout/Box.d.ts +8 -8
- package/dist/layout/Box.d.ts.map +1 -1
- package/dist/layout/Box.js +138 -49
- package/dist/layout/Center.cjs +51 -1
- package/dist/layout/Center.d.ts +3 -3
- package/dist/layout/Center.d.ts.map +1 -1
- package/dist/layout/Center.js +49 -20
- package/dist/layout/Container.cjs +81 -1
- package/dist/layout/Container.d.ts +8 -8
- package/dist/layout/Container.d.ts.map +1 -1
- package/dist/layout/Container.js +34 -30
- package/dist/layout/Stack.cjs +237 -1
- package/dist/layout/Stack.d.ts +9 -9
- package/dist/layout/Stack.d.ts.map +1 -1
- package/dist/layout/Stack.js +220 -75
- package/dist/layout/index.js +9 -9
- package/dist/lazyLoad.cjs +13 -1
- package/dist/lazyLoad.js +9 -9
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +551 -1
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +440 -234
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +546 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +452 -236
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +330 -1
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +272 -164
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +150 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +132 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +90 -74
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +92 -67
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.3/node_modules/@radix-ui/number/dist/index.cjs +11 -1
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.3/node_modules/@radix-ui/number/dist/index.js +8 -7
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.cjs +48 -1
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.js +34 -31
- package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_023ac3f94ac95798b92bc4b7f556cbda/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +145 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_023ac3f94ac95798b92bc4b7f556cbda/node_modules/@radix-ui/react-alert-dialog/dist/index.js +111 -73
- package/dist/node_modules/.pnpm/@radix-ui_react-aspect-ratio@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_3fe40fa8e2833eaf8803b46e02e4c30f/node_modules/@radix-ui/react-aspect-ratio/dist/index.cjs +38 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-aspect-ratio@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_3fe40fa8e2833eaf8803b46e02e4c30f/node_modules/@radix-ui/react-aspect-ratio/dist/index.js +19 -16
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.2.6_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_c3568bdf5c60d38014d320037c857c95/node_modules/@radix-ui/react-avatar/dist/index.cjs +126 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.2.6_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_c3568bdf5c60d38014d320037c857c95/node_modules/@radix-ui/react-avatar/dist/index.js +103 -72
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.20_@types_react-dom@19.3.0_@types_react@19.3.0__@types__75f9b408b6aa016f78c6c390e6f84227/node_modules/@radix-ui/react-collapsible/dist/index.cjs +134 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.20_@types_react-dom@19.3.0_@types_react@19.3.0__@types__75f9b408b6aa016f78c6c390e6f84227/node_modules/@radix-ui/react-collapsible/dist/index.js +113 -79
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_5961dc5beb3cb19a205dfdbd3304cbe5/node_modules/@radix-ui/react-collection/dist/index.cjs +541 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_5961dc5beb3cb19a205dfdbd3304cbe5/node_modules/@radix-ui/react-collection/dist/index.js +459 -331
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +39 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.js +26 -22
- package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types__30d9c1a1570dd32a7a328fd93feebae9/node_modules/@radix-ui/react-context-menu/dist/index.cjs +304 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types__30d9c1a1570dd32a7a328fd93feebae9/node_modules/@radix-ui/react-context-menu/dist/index.js +234 -160
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.2.2_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-context/dist/index.cjs +108 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.2.2_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-context/dist/index.js +82 -67
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-direction/dist/index.cjs +19 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-direction/dist/index.js +12 -10
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@_221317ca07dfdaa6590fc49e548d4242/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +275 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@_221317ca07dfdaa6590fc49e548d4242/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +228 -127
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +53 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.js +40 -22
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.16_@types_react-dom@19.3.0_@types_react@19.3.0__@types__3593711fa410ee31279d746c57990974/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +215 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.16_@types_react-dom@19.3.0_@types_react@19.3.0__@types__3593711fa410ee31279d746c57990974/node_modules/@radix-ui/react-focus-scope/dist/index.js +171 -117
- package/dist/node_modules/.pnpm/@radix-ui_react-hover-card@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_a8ac333b78a7741970303e37358b886d/node_modules/@radix-ui/react-hover-card/dist/index.cjs +219 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-hover-card@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_a8ac333b78a7741970303e37358b886d/node_modules/@radix-ui/react-hover-card/dist/index.js +178 -118
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-id/dist/index.cjs +22 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-id/dist/index.js +17 -13
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_bd1746795e703f342b2f4982589d4efb/node_modules/@radix-ui/react-menu/dist/index.cjs +802 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_bd1746795e703f342b2f4982589d4efb/node_modules/@radix-ui/react-menu/dist/index.js +648 -422
- package/dist/node_modules/.pnpm/@radix-ui_react-menubar@1.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_reac_b8d55f7c7c6b477421e3cc1ba6fb334b/node_modules/@radix-ui/react-menubar/dist/index.cjs +410 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-menubar@1.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_reac_b8d55f7c7c6b477421e3cc1ba6fb334b/node_modules/@radix-ui/react-menubar/dist/index.js +313 -212
- package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.22_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_fde94e4aef42debd49119dde2ad3b250/node_modules/@radix-ui/react-navigation-menu/dist/index.cjs +741 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.22_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_fde94e4aef42debd49119dde2ad3b250/node_modules/@radix-ui/react-navigation-menu/dist/index.js +602 -417
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_ca4fb1e7b10e21399fbf7b38c61d930c/node_modules/@radix-ui/react-popper/dist/index.cjs +246 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_ca4fb1e7b10e21399fbf7b38c61d930c/node_modules/@radix-ui/react-popper/dist/index.js +195 -121
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.17_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_dcf9598b366f9d4cb930092169158fb6/node_modules/@radix-ui/react-portal/dist/index.cjs +27 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.17_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_dcf9598b366f9d4cb930092169158fb6/node_modules/@radix-ui/react-portal/dist/index.js +20 -17
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_rea_d7b4951725c0f0b9fd732151cb937913/node_modules/@radix-ui/react-presence/dist/index.cjs +148 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_rea_d7b4951725c0f0b9fd732151cb937913/node_modules/@radix-ui/react-presence/dist/index.js +115 -67
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_re_b879c40dbdb8ea08e1db9842f10f20a8/node_modules/@radix-ui/react-primitive/dist/index.cjs +55 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_re_b879c40dbdb8ea08e1db9842f10f20a8/node_modules/@radix-ui/react-primitive/dist/index.js +27 -21
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_43a41e6ed06e4781ce7b1fb0f0076623/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +223 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_43a41e6ed06e4781ce7b1fb0f0076623/node_modules/@radix-ui/react-roving-focus/dist/index.js +179 -131
- package/dist/node_modules/.pnpm/@radix-ui_react-slider@1.4.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_0a49b18268a9d1d70ad7e785633a1513/node_modules/@radix-ui/react-slider/dist/index.cjs +576 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-slider@1.4.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_0a49b18268a9d1d70ad7e785633a1513/node_modules/@radix-ui/react-slider/dist/index.js +437 -308
- package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.cjs +202 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.js +160 -125
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.21_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_2c04ca1fb5fd914a25ee24a303bd8469/node_modules/@radix-ui/react-tabs/dist/index.cjs +159 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.21_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_2c04ca1fb5fd914a25ee24a303bd8469/node_modules/@radix-ui/react-tabs/dist/index.js +125 -93
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_e645c0ca626436d86b14232bd158d09b/node_modules/@radix-ui/react-toggle-group/dist/index.cjs +158 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_e645c0ca626436d86b14232bd158d09b/node_modules/@radix-ui/react-toggle-group/dist/index.js +128 -98
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.18_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_f121473145ec675e8ab50657e8e97e06/node_modules/@radix-ui/react-toggle/dist/index.cjs +39 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.18_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_f121473145ec675e8ab50657e8e97e06/node_modules/@radix-ui/react-toggle/dist/index.js +29 -24
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +19 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +13 -11
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +109 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +91 -68
- package/dist/node_modules/.pnpm/@radix-ui_react-use-effect-event@0.0.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.cjs +28 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-effect-event@0.0.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.js +22 -17
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.3_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +33 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.3_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +25 -19
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +7 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.4_@types_react@19.3.0_react@19.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.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-previous/dist/index.cjs +25 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-previous/dist/index.js +18 -11
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-size/dist/index.cjs +47 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-size/dist/index.js +38 -28
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.11_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_ef452cff5863a129db7ebc4b37ab07c3/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +38 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.11_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_ef452cff5863a129db7ebc4b37ab07c3/node_modules/@radix-ui/react-visually-hidden/dist/index.js +19 -15
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.cjs +106 -1
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +95 -34
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.cjs +5 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.js +3 -3
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.cjs +6 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.js +4 -4
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.cjs +423 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.js +237 -202
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.js +35 -32
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.cjs +42 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.js +37 -32
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +20 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.cjs +7 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.js +5 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.cjs +27 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.js +15 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js +41 -4
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js +42 -4
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.cjs +49 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.js +46 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.cjs +358 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.js +341 -45
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.cjs +31 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.js +28 -7
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.cjs +35 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.js +32 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.cjs +44 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.js +41 -11
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.cjs +49 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.js +46 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.cjs +61 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.js +58 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.cjs +38 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.js +35 -3
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.cjs +39 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.js +36 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +8 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +5 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +50 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +45 -11
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +27 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +20 -14
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +18 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +13 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +77 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +14 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +31 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +6 -6
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +11 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +4 -3
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.cjs +210 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.js +197 -188
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.cjs +122 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.js +12 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.cjs +28 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js +20 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.cjs +34 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.js +31 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.cjs +37 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.js +32 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.cjs +41 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.js +38 -7
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.js +42 -6
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.cjs +56 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.js +53 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.cjs +35 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.js +32 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js +42 -4
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.3.1/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.cjs +34 -1
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.3.1/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +32 -21
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.cjs +39 -1
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +27 -20
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1391 -1
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1178 -803
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.cjs +7 -1
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +3 -4
- package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/input-otp/dist/index.cjs +369 -2
- package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/input-otp/dist/index.js +282 -238
- package/dist/node_modules/.pnpm/react-hook-form@7.83.0_react@19.3.1/node_modules/react-hook-form/dist/index.esm.cjs +625 -1
- package/dist/node_modules/.pnpm/react-hook-form@7.83.0_react@19.3.1/node_modules/react-hook-form/dist/index.esm.js +545 -276
- package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.cjs +1033 -9
- package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.js +898 -460
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +47 -38
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js +38 -64
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +13 -1
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +9 -2
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/index.cjs +4 -1
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +36 -1
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -16
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +15 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.js +10 -10
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +167 -4
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +144 -93
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/UI.cjs +63 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/UI.js +45 -35
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +14 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +11 -9
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +84 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +75 -43
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/medium.cjs +3 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +6 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
- package/dist/node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.cjs +1617 -1
- package/dist/node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +1332 -874
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/component.cjs +18 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/component.js +15 -7
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/hook.cjs +26 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/hook.js +20 -10
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/index.cjs +4 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/singleton.cjs +40 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/singleton.js +29 -16
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.cjs +36 -1
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +25 -14
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +20 -1
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.js +18 -3
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +46 -1
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +38 -19
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useRef.cjs +39 -1
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useRef.js +29 -11
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/exports.cjs +18 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/exports.js +13 -12
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/medium.cjs +81 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/medium.js +58 -45
- package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.cjs +1252 -3
- package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.js +1003 -648
- package/dist/theme/index.cjs +63 -1
- package/dist/theme/index.js +31 -31
- package/dist/theme/spacing.cjs +93 -1
- package/dist/theme/spacing.js +52 -26
- package/dist/theme/tokens.stylex.cjs +210 -1
- package/dist/theme/tokens.stylex.js +58 -26
- package/dist/theme/types.cjs +13 -1
- package/dist/theme/types.js +4 -3
- package/dist/theme/width.cjs +39 -1
- package/dist/theme/width.js +16 -4
- package/dist/theme/zIndex.cjs +64 -1
- package/dist/theme/zIndex.js +44 -15
- package/dist/theme.css +135 -1
- package/dist/ui/accordion.cjs +431 -1
- package/dist/ui/accordion.d.ts +10 -10
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +276 -136
- package/dist/ui/action-bar.cjs +274 -1
- package/dist/ui/action-bar.d.ts +11 -11
- package/dist/ui/action-bar.d.ts.map +1 -1
- package/dist/ui/action-bar.js +204 -98
- package/dist/ui/alert-dialog.cjs +538 -1
- package/dist/ui/alert-dialog.d.ts +19 -19
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +459 -167
- package/dist/ui/alert.cjs +163 -1
- package/dist/ui/alert.d.ts +7 -7
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +111 -50
- package/dist/ui/aspect-ratio.cjs +25 -1
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/ui/aspect-ratio.js +22 -12
- package/dist/ui/avatar.cjs +341 -1
- package/dist/ui/avatar.d.ts +10 -10
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +226 -114
- package/dist/ui/badge-overflow.cjs +66 -1
- package/dist/ui/badge-overflow.d.ts +5 -5
- package/dist/ui/badge-overflow.d.ts.map +1 -1
- package/dist/ui/badge-overflow.js +34 -27
- package/dist/ui/badge.cjs +167 -1
- package/dist/ui/badge.d.ts +3 -3
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +48 -42
- package/dist/ui/breadcrumb.cjs +508 -1
- package/dist/ui/breadcrumb.d.ts +15 -15
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +386 -159
- package/dist/ui/button.cjs +425 -1
- package/dist/ui/button.d.ts +3 -3
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +137 -117
- package/dist/ui/calendar.cjs +626 -1
- package/dist/ui/calendar.d.ts +5 -5
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/calendar.js +309 -192
- package/dist/ui/card.cjs +401 -1
- package/dist/ui/card.d.ts +15 -15
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +300 -119
- package/dist/ui/carousel.cjs +333 -1
- package/dist/ui/carousel.d.ts +10 -10
- package/dist/ui/carousel.d.ts.map +1 -1
- package/dist/ui/carousel.js +245 -126
- package/dist/ui/checkbox.cjs +167 -1
- package/dist/ui/checkbox.d.ts +4 -4
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +66 -58
- package/dist/ui/circular-progress.cjs +139 -1
- package/dist/ui/circular-progress.d.ts +4 -4
- package/dist/ui/circular-progress.d.ts.map +1 -1
- package/dist/ui/circular-progress.js +65 -52
- package/dist/ui/code-block.cjs +819 -0
- package/dist/ui/code-block.d.ts +81 -0
- package/dist/ui/code-block.d.ts.map +1 -0
- package/dist/ui/code-block.js +809 -0
- package/dist/ui/collapsible.cjs +65 -1
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +58 -28
- package/dist/ui/command.cjs +556 -1
- package/dist/ui/command.d.ts +19 -19
- package/dist/ui/command.d.ts.map +1 -1
- package/dist/ui/command.js +432 -163
- package/dist/ui/compare-slider.cjs +170 -1
- package/dist/ui/compare-slider.d.ts +7 -7
- package/dist/ui/compare-slider.d.ts.map +1 -1
- package/dist/ui/compare-slider.js +106 -72
- package/dist/ui/context-menu.cjs +811 -1
- package/dist/ui/context-menu.d.ts +26 -26
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +693 -228
- package/dist/ui/copy-button.cjs +94 -1
- package/dist/ui/copy-button.d.ts +1 -2
- package/dist/ui/copy-button.d.ts.map +1 -1
- package/dist/ui/copy-button.js +56 -44
- package/dist/ui/dialog.cjs +409 -1
- package/dist/ui/dialog.d.ts +18 -18
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +317 -131
- package/dist/ui/drawer.cjs +476 -1
- package/dist/ui/drawer.d.ts +17 -17
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +394 -151
- package/dist/ui/dropdown-menu.cjs +638 -1
- package/dist/ui/dropdown-menu.d.ts +26 -26
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +511 -208
- package/dist/ui/editable.cjs +608 -1
- package/dist/ui/editable.d.ts +14 -14
- package/dist/ui/editable.d.ts.map +1 -1
- package/dist/ui/editable.js +478 -218
- package/dist/ui/empty.cjs +310 -1
- package/dist/ui/empty.d.ts +15 -15
- package/dist/ui/empty.d.ts.map +1 -1
- package/dist/ui/empty.js +277 -107
- package/dist/ui/field.cjs +621 -1
- package/dist/ui/field.d.ts +21 -21
- package/dist/ui/field.d.ts.map +1 -1
- package/dist/ui/field.js +468 -198
- package/dist/ui/file-upload-adapters.cjs +289 -1
- package/dist/ui/file-upload-adapters.d.ts +1 -2
- package/dist/ui/file-upload-adapters.d.ts.map +1 -1
- package/dist/ui/file-upload-adapters.js +244 -170
- package/dist/ui/file-upload.cjs +1481 -1
- package/dist/ui/file-upload.d.ts +22 -22
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +1064 -598
- package/dist/ui/flex.cjs +203 -1
- package/dist/ui/flex.d.ts +6 -6
- package/dist/ui/flex.d.ts.map +1 -1
- package/dist/ui/flex.js +111 -92
- package/dist/ui/form.cjs +454 -1
- package/dist/ui/form.d.ts +11 -11
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +421 -135
- package/dist/ui/gauge.cjs +127 -1
- package/dist/ui/gauge.d.ts +6 -6
- package/dist/ui/gauge.d.ts.map +1 -1
- package/dist/ui/gauge.js +61 -52
- package/dist/ui/grid.cjs +224 -1
- package/dist/ui/grid.d.ts +7 -7
- package/dist/ui/grid.d.ts.map +1 -1
- package/dist/ui/grid.js +125 -94
- package/dist/ui/hover-card.cjs +86 -1
- package/dist/ui/hover-card.d.ts +6 -6
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +57 -36
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-group.cjs +328 -1
- package/dist/ui/input-group.d.ts +12 -12
- package/dist/ui/input-group.d.ts.map +1 -1
- package/dist/ui/input-group.js +207 -105
- package/dist/ui/input-otp.cjs +312 -1
- package/dist/ui/input-otp.d.ts +10 -10
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +217 -94
- package/dist/ui/input.cjs +388 -1
- package/dist/ui/input.d.ts +3 -3
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +137 -119
- package/dist/ui/item.cjs +585 -1
- package/dist/ui/item.d.ts +20 -20
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/item.js +460 -162
- package/dist/ui/kbd.cjs +115 -1
- package/dist/ui/kbd.d.ts +5 -5
- package/dist/ui/kbd.d.ts.map +1 -1
- package/dist/ui/kbd.js +42 -37
- package/dist/ui/label.cjs +67 -1
- package/dist/ui/label.d.ts +4 -4
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +51 -21
- package/dist/ui/marker.cjs +294 -0
- package/dist/ui/marker.d.ts +22 -0
- package/dist/ui/marker.d.ts.map +1 -0
- package/dist/ui/marker.js +290 -0
- package/dist/ui/masonry.cjs +58 -1
- package/dist/ui/masonry.d.ts +4 -4
- package/dist/ui/masonry.d.ts.map +1 -1
- package/dist/ui/masonry.js +41 -36
- package/dist/ui/menubar.cjs +908 -1
- package/dist/ui/menubar.d.ts +29 -29
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +737 -251
- package/dist/ui/navigation-menu.cjs +560 -1
- package/dist/ui/navigation-menu.d.ts +18 -18
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +442 -148
- package/dist/ui/pagination.cjs +575 -1
- package/dist/ui/pagination.d.ts +13 -13
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +422 -172
- package/dist/ui/popover.cjs +93 -1
- package/dist/ui/popover.d.ts +7 -7
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +61 -42
- package/dist/ui/progress.cjs +33 -1
- package/dist/ui/progress.d.ts +3 -3
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +19 -17
- package/dist/ui/questionnaire.cjs +679 -0
- package/dist/ui/questionnaire.d.ts +101 -0
- package/dist/ui/questionnaire.d.ts.map +1 -0
- package/dist/ui/questionnaire.js +667 -0
- package/dist/ui/radio-group.cjs +221 -1
- package/dist/ui/radio-group.d.ts +6 -6
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +125 -74
- package/dist/ui/rating.cjs +191 -1
- package/dist/ui/rating.d.ts +3 -3
- package/dist/ui/rating.d.ts.map +1 -1
- package/dist/ui/rating.js +96 -78
- package/dist/ui/resizable.cjs +175 -1
- package/dist/ui/resizable.d.ts +7 -7
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/resizable.js +150 -54
- package/dist/ui/responsive-dialog.cjs +400 -1
- package/dist/ui/responsive-dialog.d.ts +17 -17
- package/dist/ui/responsive-dialog.d.ts.map +1 -1
- package/dist/ui/responsive-dialog.js +372 -155
- package/dist/ui/row-col.cjs +510 -1
- package/dist/ui/row-col.d.ts +11 -11
- package/dist/ui/row-col.d.ts.map +1 -1
- package/dist/ui/row-col.js +238 -205
- package/dist/ui/scroll-area.cjs +142 -1
- package/dist/ui/scroll-area.d.ts +6 -6
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js +103 -47
- package/dist/ui/segmented.cjs +170 -1
- package/dist/ui/segmented.d.ts +5 -5
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +75 -62
- package/dist/ui/select.cjs +484 -1
- package/dist/ui/select.d.ts +17 -17
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +353 -160
- package/dist/ui/separator.cjs +44 -1
- package/dist/ui/separator.d.ts +4 -4
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +17 -17
- package/dist/ui/sheet.cjs +460 -1
- package/dist/ui/sheet.d.ts +16 -16
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +329 -141
- package/dist/ui/sidebar.cjs +1453 -1
- package/dist/ui/sidebar.d.ts +48 -48
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +1057 -438
- package/dist/ui/signature-pad.cjs +740 -0
- package/dist/ui/signature-pad.d.ts +107 -0
- package/dist/ui/signature-pad.d.ts.map +1 -0
- package/dist/ui/signature-pad.js +730 -0
- package/dist/ui/skeleton.cjs +62 -1
- package/dist/ui/skeleton.d.ts +3 -3
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.js +50 -20
- package/dist/ui/slider.cjs +47 -1
- package/dist/ui/slider.d.ts +4 -4
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +27 -26
- package/dist/ui/sonner.cjs +28 -1
- package/dist/ui/sonner.js +24 -22
- package/dist/ui/spinner.cjs +73 -1
- package/dist/ui/spinner.d.ts +3 -3
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +29 -28
- package/dist/ui/stat.cjs +334 -1
- package/dist/ui/stat.d.ts +15 -15
- package/dist/ui/stat.d.ts.map +1 -1
- package/dist/ui/stat.js +271 -130
- package/dist/ui/stepper.cjs +785 -1
- package/dist/ui/stepper.d.ts +24 -24
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +594 -281
- package/dist/ui/switch.cjs +203 -1
- package/dist/ui/switch.d.ts +4 -4
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +83 -72
- package/dist/ui/table.cjs +435 -1
- package/dist/ui/table.d.ts +17 -17
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +369 -129
- package/dist/ui/tabs.cjs +340 -1
- package/dist/ui/tabs.d.ts +10 -10
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +204 -95
- package/dist/ui/tags-input.cjs +585 -1
- package/dist/ui/tags-input.d.ts +13 -13
- package/dist/ui/tags-input.d.ts.map +1 -1
- package/dist/ui/tags-input.js +446 -221
- package/dist/ui/textarea.cjs +119 -1
- package/dist/ui/textarea.d.ts +3 -3
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +37 -33
- package/dist/ui/timeline.cjs +583 -1
- package/dist/ui/timeline.d.ts +22 -22
- package/dist/ui/timeline.d.ts.map +1 -1
- package/dist/ui/timeline.js +409 -198
- package/dist/ui/toggle-group.cjs +128 -1
- package/dist/ui/toggle-group.d.ts +7 -7
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +92 -41
- package/dist/ui/toggle.cjs +145 -1
- package/dist/ui/toggle.d.ts +4 -4
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +38 -34
- package/dist/ui/tooltip.cjs +81 -1
- package/dist/ui/tooltip.d.ts +7 -7
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +50 -37
- package/dist/ui/useBreakpoint.cjs +91 -1
- package/dist/ui/useBreakpoint.js +66 -43
- package/dist/utils.cjs +9 -1
- package/dist/utils.js +4 -4
- package/package.json +10 -2
|
@@ -1,3 +1,1252 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
){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)}}`);function s(){let e=navigator.userAgent;return typeof window<`u`&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function c(){return p(/^Mac/)}function l(){return p(/^iPhone/)}function u(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function d(){return p(/^iPad/)||c()&&navigator.maxTouchPoints>1}function f(){return l()||d()}function p(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var m=24,h=typeof window<`u`?n.useLayoutEffect:n.useEffect;function g(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var _=typeof document<`u`&&window.visualViewport;function v(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function y(e){for(v(e)&&(e=e.parentElement);e&&!v(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var b=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),x=0,S;function ee(e={}){let{isDisabled:t}=e;h(()=>{if(!t)return x++,x===1&&f()&&(S=C()),()=>{x--,x===0&&S?.()}},[t])}function C(){let e,t=0,n=n=>{e=y(n.target),(e!==document.documentElement||e!==document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;D(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;D(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,_&&(_.height<window.innerHeight?requestAnimationFrame(()=>{E(t)}):_.addEventListener(`resize`,()=>E(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=g(w(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=g(T(document,`touchstart`,n,{passive:!1,capture:!0}),T(document,`touchmove`,r,{passive:!1,capture:!0}),T(document,`touchend`,i,{passive:!1,capture:!0}),T(document,`focus`,a,!0),T(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function w(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function T(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function E(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=y(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+m&&(t.scrollTop+=r-n)}e=t.parentElement}}function D(e){return e instanceof HTMLInputElement&&!b.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function te(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function ne(...e){return t=>e.forEach(e=>te(e,t))}function re(...e){return n.useCallback(ne(...e),e)}var O=new WeakMap;function k(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith(`--`)?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),!n&&O.set(e,r)}function ie(e,t){if(!e||!(e instanceof HTMLElement))return;let n=O.get(e);n&&(e.style[t]=n[t])}var A=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function j(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[A(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[A(t)?5:4]):null)}function ae(e){return 8*(Math.log(e+1)-2)}function M(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var N={DURATION:.5,EASE:[.32,.72,0,1]},oe=.4,se=.25,ce=100,le=8,P=16,ue=26,de=`vaul-dragging`;function F(e){let t=n.default.useRef(e);return n.default.useEffect(()=>{t.current=e}),n.default.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function fe({defaultProp:e,onChange:t}){let r=n.default.useState(e),[i]=r,a=n.default.useRef(i),o=F(t);return n.default.useEffect(()=>{a.current!==i&&(o(i),a.current=i)},[i,a,o]),r}function pe({prop:e,defaultProp:t,onChange:r=()=>{}}){let[i,a]=fe({defaultProp:t,onChange:r}),o=e!==void 0,s=o?e:i,c=F(r);return[s,n.default.useCallback(t=>{if(o){let n=typeof t==`function`?t(e):t;n!==e&&c(n)}else a(t)},[o,e,a,c])]}function me({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:i,overlayRef:a,fadeFromIndex:o,onSnapPointChange:s,direction:c=`bottom`,container:l,snapToSequentialPoint:u}){let[d,f]=pe({prop:e,defaultProp:r?.[0],onChange:t}),[p,m]=n.default.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);n.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let h=n.default.useMemo(()=>d===r?.[r.length-1]||null,[r,d]),g=n.default.useMemo(()=>r?.findIndex(e=>e===d)??null,[r,d]),_=r&&r.length>0&&(o||o===0)&&!Number.isNaN(o)&&r[o]===d||!r,v=n.default.useMemo(()=>{let e=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return r?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),A(c)){let i=n?r:p?t*e.height:0;return p?c===`bottom`?e.height-i:-e.height+i:i}let i=n?r:p?t*e.width:0;return p?c===`right`?e.width-i:-e.width+i:i})??[]},[r,p,l]),y=n.default.useMemo(()=>g===null?null:v?.[g],[v,g]),b=n.default.useCallback(e=>{let t=v?.findIndex(t=>t===e)??null;s(t),k(i.current,{transition:`transform ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`,transform:A(c)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&t!==v.length-1&&o!==void 0&&t!==o&&t<o?k(a.current,{transition:`opacity ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`,opacity:`0`}):k(a.current,{transition:`opacity ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`,opacity:`1`}),f(r?.[Math.max(t,0)])},[i.current,r,v,o,a,f]);n.default.useEffect(()=>{if(d||e){let t=r?.findIndex(t=>t===e||t===d)??-1;v&&t!==-1&&typeof v[t]==`number`&&b(v[t])}},[d,e,r,v,b]);function x({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:i}){if(o===void 0)return;let s=c===`bottom`||c===`right`?(y??0)-e:(y??0)+e,l=g===o-1,d=g===0,f=e>0;if(l&&k(a.current,{transition:`opacity ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`}),!u&&n>2&&!f){i?t():b(v[0]);return}if(!u&&n>2&&f&&v&&r){b(v[r.length-1]);return}let p=v?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-s)<Math.abs(e-s)?t:e),m=A(c)?window.innerHeight:window.innerWidth;if(n>oe&&Math.abs(e)<m*.4){let e=f?1:-1;if(e>0&&h&&r){b(v[r.length-1]);return}if(d&&e<0&&i&&t(),g===null)return;b(v[g+e])}else b(p)}function S({draggedDistance:e}){if(y===null)return;let t=c===`bottom`||c===`right`?y-e:y+e;(c===`bottom`||c===`right`)&&t<v[v.length-1]||(c===`top`||c===`left`)&&t>v[v.length-1]||k(i.current,{transform:A(c)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function ee(e,t){if(!r||typeof g!=`number`||!v||o===void 0)return null;let n=g===o-1;if(g>=o&&t)return 0;if(n&&!t)return 1;if(!_&&!n)return null;let i=n?g+1:g-1,a=n?v[i]-v[i-1]:v[i+1]-v[i],s=e/Math.abs(a);return n?1-s:s}return{isLastSnapPoint:h,activeSnapPoint:d,shouldFade:_,getPercentageDragged:ee,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:x,onDrag:S,snapPointsOffset:v}}function I(){let{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:i,noBodyStyles:a}=o(),s=n.default.useRef(null),c=(0,n.useMemo)(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-ue)/window.innerWidth}n.default.useEffect(()=>{if(t&&r){s.current&&clearTimeout(s.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;i&&!a&&M(document.body,{background:`black`}),M(t,{transformOrigin:A(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${N.DURATION}s`,transitionTimingFunction:`cubic-bezier(${N.EASE.join(`,`)})`});let n=M(t,{borderRadius:`${le}px`,overflow:`hidden`,...A(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),s.current=window.setTimeout(()=>{c?document.body.style.background=c:document.body.style.removeProperty(`background`)},N.DURATION*1e3)}}},[t,r,c])}var L=null;function he({isOpen:e,modal:t,nested:r,hasBeenOpened:i,preventScrollRestoration:a,noBodyStyles:o}){let[s,c]=n.default.useState(()=>typeof window<`u`?window.location.href:``),l=n.default.useRef(0),d=n.default.useCallback(()=>{if(u()&&L===null&&e&&!o){L={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&l.current>=t&&(document.body.style.top=`${-(l.current+e)}px`)}),300)}},[e]),f=n.default.useCallback(()=>{if(u()&&L!==null&&!o){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,L),window.requestAnimationFrame(()=>{a&&s!==window.location.href?c(window.location.href):window.scrollTo(t,e)}),L=null}},[s]);return n.default.useEffect(()=>{function e(){l.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),n.default.useEffect(()=>{if(t)return()=>{typeof document<`u`&&(document.querySelector(`[data-vaul-drawer]`)||f())}},[t,f]),n.default.useEffect(()=>{!r&&i&&(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&d(),t||window.setTimeout(()=>{f()},500)):f())},[e,i,s,t,r,d,f]),{restorePositionSetting:f}}function R({open:e,onOpenChange:t,children:i,onDrag:o,onRelease:c,snapPoints:l,shouldScaleBackground:u=!1,setBackgroundColorOnScale:d=!0,closeThreshold:p=se,scrollLockTimeout:m=ce,dismissible:h=!0,handleOnly:g=!1,fadeFromIndex:_=l&&l.length-1,activeSnapPoint:v,setActiveSnapPoint:y,fixed:b,modal:x=!0,onClose:S,nested:C,noBodyStyles:w=!1,direction:T=`bottom`,defaultOpen:E=!1,disablePreventScroll:te=!0,snapToSequentialPoint:ne=!1,preventScrollRestoration:re=!1,repositionInputs:O=!0,onAnimationEnd:M,container:F,autoFocus:fe=!1}){let[I=!1,L]=pe({defaultProp:E,prop:e,onChange:e=>{t?.(e),!e&&!C&&je(),setTimeout(()=>{M?.(e)},N.DURATION*1e3),e&&!x&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[R,z]=n.default.useState(!1),[B,V]=n.default.useState(!1),[ge,H]=n.default.useState(!1),U=n.default.useRef(null),W=n.default.useRef(null),G=n.default.useRef(null),_e=n.default.useRef(null),K=n.default.useRef(null),q=n.default.useRef(!1),ve=n.default.useRef(null),ye=n.default.useRef(0),J=n.default.useRef(!1),be=n.default.useRef(!E),xe=n.default.useRef(0),Y=n.default.useRef(null),Se=n.default.useRef(Y.current?.getBoundingClientRect().height||0),Ce=n.default.useRef(Y.current?.getBoundingClientRect().width||0),we=n.default.useRef(0),{activeSnapPoint:Te,activeSnapPointIndex:X,setActiveSnapPoint:Ee,onRelease:De,snapPointsOffset:Z,onDrag:Oe,shouldFade:ke,getPercentageDragged:Ae}=me({snapPoints:l,activeSnapPointProp:v,setActiveSnapPointProp:y,drawerRef:Y,fadeFromIndex:_,overlayRef:U,onSnapPointChange:n.default.useCallback(e=>{l&&e===Z.length-1&&(W.current=new Date)},[]),direction:T,container:F,snapToSequentialPoint:ne});ee({isDisabled:!I||B||!x||ge||!R||!O||!te});let{restorePositionSetting:je}=he({isOpen:I,modal:x,nested:C??!1,hasBeenOpened:R,preventScrollRestoration:re,noBodyStyles:w});function Q(){return(window.innerWidth-ue)/window.innerWidth}function Me(e){(h||l)&&(!Y.current||Y.current.contains(e.target))&&(Se.current=Y.current?.getBoundingClientRect().height||0,Ce.current=Y.current?.getBoundingClientRect().width||0,V(!0),G.current=new Date,f()&&window.addEventListener(`touchend`,()=>q.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),ye.current=A(T)?e.pageY:e.pageX)}function Ne(e,t){let n=e,r=window.getSelection()?.toString(),i=Y.current?j(Y.current,T):null,a=new Date;if(n.tagName===`SELECT`||n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(T===`right`||T===`left`)return!0;if(W.current&&a.getTime()-W.current.getTime()<500)return!1;if(i!==null&&(T===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(K.current&&a.getTime()-K.current.getTime()<m&&i===0||t)return K.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return K.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function Pe(e){if(Y.current&&B){let t=T===`bottom`||T===`right`?1:-1,n=(ye.current-(A(T)?e.pageY:e.pageX))*t,r=n>0,i=l&&!h&&!r;if(i&&X===0)return;let a=Math.abs(n),s=document.querySelector(`[data-vaul-drawer-wrapper]`),c=a/(T===`bottom`||T===`top`?Se.current:Ce.current),d=Ae(a,r);if(d!==null&&(c=d),i&&c>=1||!q.current&&!Ne(e.target,r))return;if(Y.current.classList.add(de),q.current=!0,k(Y.current,{transition:`none`}),k(U.current,{transition:`none`}),l&&Oe({draggedDistance:n}),r&&!l){let e=ae(n),r=Math.min(e*-1,0)*t;k(Y.current,{transform:A(T)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let f=1-c;if((ke||_&&X===_-1)&&(o?.(e,c),k(U.current,{opacity:`${f}`,transition:`none`},!0)),s&&U.current&&u){let e=Math.min(Q()+c*(1-Q()),1),t=8-c*8,n=Math.max(0,14-c*14);k(s,{borderRadius:`${t}px`,transform:A(T)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!l){let e=a*t;k(Y.current,{transform:A(T)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}n.default.useEffect(()=>{window.requestAnimationFrame(()=>{be.current=!0})},[]),n.default.useEffect(()=>{var e;function t(){if(!Y.current||!O)return;let e=document.activeElement;if(D(e)||J.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=Y.current.getBoundingClientRect().height||0,i=r>t*.8;we.current||=r;let a=Y.current.getBoundingClientRect().top;if(Math.abs(xe.current-n)>60&&(J.current=!J.current),l&&l.length>0&&Z&&X){let e=Z[X]||0;n+=e}if(xe.current=n,r>e||J.current){let t=Y.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?a:ue)),b?Y.current.style.height=`${t-Math.max(n,0)}px`:Y.current.style.height=`${Math.max(r,e-a)}px`}else s()||(Y.current.style.height=`${we.current}px`);l&&l.length>0&&!J.current?Y.current.style.bottom=`0px`:Y.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[X,l,Z]);function $(e){Ie(),S?.(),e||L(!1),setTimeout(()=>{l&&Ee(l[0])},N.DURATION*1e3)}function Fe(){if(!Y.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=j(Y.current,T);k(Y.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`}),k(U.current,{transition:`opacity ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`,opacity:`1`}),u&&t&&t>0&&I&&k(e,{borderRadius:`${le}px`,overflow:`hidden`,...A(T)?{transform:`scale(${Q()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${Q()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${N.DURATION}s`,transitionTimingFunction:`cubic-bezier(${N.EASE.join(`,`)})`},!0)}function Ie(){B&&Y.current&&(Y.current.classList.remove(de),q.current=!1,V(!1),_e.current=new Date)}function Le(e){if(!B||!Y.current)return;Y.current.classList.remove(de),q.current=!1,V(!1),_e.current=new Date;let t=j(Y.current,T);if(!e||!Ne(e.target,!1)||!t||Number.isNaN(t)||G.current===null)return;let n=_e.current.getTime()-G.current.getTime(),r=ye.current-(A(T)?e.pageY:e.pageX),i=Math.abs(r)/n;if(i>.05&&(H(!0),setTimeout(()=>{H(!1)},200)),l){De({draggedDistance:r*(T===`bottom`||T===`right`?1:-1),closeDrawer:$,velocity:i,dismissible:h}),c?.(e,!0);return}if(T===`bottom`||T===`right`?r>0:r<0){Fe(),c?.(e,!0);return}if(i>oe){$(),c?.(e,!1);return}let a=Math.min(Y.current.getBoundingClientRect().height??0,window.innerHeight),o=Math.min(Y.current.getBoundingClientRect().width??0,window.innerWidth);Math.abs(t)>=(T===`left`||T===`right`?o:a)*p?($(),c?.(e,!1)):(c?.(e,!0),Fe())}n.default.useEffect(()=>(I&&(k(document.documentElement,{scrollBehavior:`auto`}),W.current=new Date),()=>{ie(document.documentElement,`scrollBehavior`)}),[I]);function Re(e){let t=e?(window.innerWidth-P)/window.innerWidth:1,n=e?-16:0;ve.current&&window.clearTimeout(ve.current),k(Y.current,{transition:`transform ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`,transform:A(T)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&Y.current&&(ve.current=setTimeout(()=>{let e=j(Y.current,T);k(Y.current,{transition:`none`,transform:A(T)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function ze(e,t){if(t<0)return;let n=(window.innerWidth-P)/window.innerWidth,r=n+t*(1-n),i=-16+t*P;k(Y.current,{transform:A(T)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function Be(e,t){let n=A(T)?window.innerHeight:window.innerWidth,r=t?(n-P)/n:1,i=t?-16:0;t&&k(Y.current,{transition:`transform ${N.DURATION}s cubic-bezier(${N.EASE.join(`,`)})`,transform:A(T)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return n.default.useEffect(()=>{x||window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`})},[x]),n.default.createElement(r.Root,{defaultOpen:E,onOpenChange:e=>{(h||e)&&(e?z(!0):$(!0),L(e))},open:I},n.default.createElement(a.Provider,{value:{activeSnapPoint:Te,snapPoints:l,setActiveSnapPoint:Ee,drawerRef:Y,overlayRef:U,onOpenChange:t,onPress:Me,onRelease:Le,onDrag:Pe,dismissible:h,shouldAnimate:be,handleOnly:g,isOpen:I,isDragging:B,shouldFade:ke,closeDrawer:$,onNestedDrag:ze,onNestedOpenChange:Re,onNestedRelease:Be,keyboardIsOpen:J,modal:x,snapPointsOffset:Z,activeSnapPointIndex:X,direction:T,shouldScaleBackground:u,setBackgroundColorOnScale:d,noBodyStyles:w,container:F,autoFocus:fe}},i))}var z=n.default.forwardRef(function({...e},t){let{overlayRef:i,snapPoints:a,onRelease:s,shouldFade:c,isOpen:l,modal:u,shouldAnimate:d}=o(),f=re(t,i),p=a&&a.length>0;if(!u)return null;let m=n.default.useCallback(e=>s(e),[s]);return n.default.createElement(r.Overlay,{onMouseUp:m,ref:f,"data-vaul-overlay":``,"data-vaul-snap-points":l&&p?`true`:`false`,"data-vaul-snap-points-overlay":l&&c?`true`:`false`,"data-vaul-animate":d?.current?`true`:`false`,...e})});z.displayName=`Drawer.Overlay`;var B=n.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:i,...a},s){let{drawerRef:c,onPress:l,onRelease:u,onDrag:d,keyboardIsOpen:f,snapPointsOffset:p,activeSnapPointIndex:m,modal:h,isOpen:g,direction:_,snapPoints:v,container:y,handleOnly:b,shouldAnimate:x,autoFocus:S}=o(),[ee,C]=n.default.useState(!1),w=re(s,c),T=n.default.useRef(null),E=n.default.useRef(null),D=n.default.useRef(!1),te=v&&v.length>0;I();let ne=(e,t,n=0)=>{if(D.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return D.current=!0,!0};n.default.useEffect(()=>{te&&window.requestAnimationFrame(()=>{C(!0)})},[]);function O(e){T.current=null,D.current=!1,u(e)}return n.default.createElement(r.Content,{"data-vaul-drawer-direction":_,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":ee?`true`:`false`,"data-vaul-snap-points":g&&te?`true`:`false`,"data-vaul-custom-container":y?`true`:`false`,"data-vaul-animate":x?.current?`true`:`false`,...a,ref:w,style:p&&p.length>0?{"--snap-point-height":`${p[m??0]}px`,...t}:t,onPointerDown:e=>{b||(a.onPointerDown==null||a.onPointerDown.call(a,e),T.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{i?.(e),S||e.preventDefault()},onPointerDownOutside:t=>{e?.(t),!h||t.defaultPrevented?t.preventDefault():f.current&&=!1},onFocusOutside:e=>{h||e.preventDefault()},onPointerMove:e=>{if(E.current=e,b||(a.onPointerMove==null||a.onPointerMove.call(a,e),!T.current))return;let t=e.pageY-T.current.y,n=e.pageX-T.current.x,r=e.pointerType===`touch`?10:2;ne({x:n,y:t},_,r)?d(e):(Math.abs(n)>r||Math.abs(t)>r)&&(T.current=null)},onPointerUp:e=>{a.onPointerUp==null||a.onPointerUp.call(a,e),T.current=null,D.current=!1,u(e)},onPointerOut:e=>{a.onPointerOut==null||a.onPointerOut.call(a,e),O(E.current)},onContextMenu:e=>{a.onContextMenu==null||a.onContextMenu.call(a,e),E.current&&O(E.current)}})});B.displayName=`Drawer.Content`;var V=250,ge=120,H=n.default.forwardRef(function({preventCycle:e=!1,children:t,...r},i){let{closeDrawer:a,isDragging:s,snapPoints:c,activeSnapPoint:l,setActiveSnapPoint:u,dismissible:d,handleOnly:f,isOpen:p,onPress:m,onDrag:h}=o(),g=n.default.useRef(null),_=n.default.useRef(!1);function v(){_.current?x():window.setTimeout(()=>{y()},ge)}function y(){if(s||e||_.current){x();return}if(x(),!c||c.length===0){d||a();return}if(l===c[c.length-1]&&d){a();return}let t=c.findIndex(e=>e===l);if(t===-1)return;let n=c[t+1];u(n)}function b(){g.current=window.setTimeout(()=>{_.current=!0},V)}function x(){g.current&&window.clearTimeout(g.current),_.current=!1}return n.default.createElement(`div`,{onClick:v,onPointerCancel:x,onPointerDown:e=>{f&&m(e),b()},onPointerMove:e=>{f&&h(e)},ref:i,"data-vaul-drawer-visible":p?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...r},n.default.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});H.displayName=`Drawer.Handle`;function U({onDrag:e,onOpenChange:t,open:r,...i}){let{onNestedDrag:a,onNestedOpenChange:s,onNestedRelease:c}=o();if(!a)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return n.default.createElement(R,{nested:!0,open:r,onClose:()=>{s(!1)},onDrag:(t,n)=>{a(t,n),e?.(t,n)},onOpenChange:e=>{e&&s(e),t?.(e)},onRelease:c,...i})}function W(e){let t=o(),{container:i=t.container,...a}=e;return n.default.createElement(r.Portal,{container:i,...a})}var G={Root:R,NestedRoot:U,Content:B,Overlay:z,Trigger:r.Trigger,Portal:W,Handle:H,Close:r.Close,Title:r.Title,Description:r.Description};exports.Content=B,exports.Drawer=G,exports.Handle=H,exports.NestedRoot=U,exports.Overlay=z,exports.Portal=W,exports.Root=R;
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react$1 = require_runtime.__toESM(react, 1);
|
|
5
|
+
react = require_runtime.__toESM(react);
|
|
6
|
+
let _radix_ui_react_dialog = require("@radix-ui/react-dialog");
|
|
7
|
+
_radix_ui_react_dialog = require_runtime.__toESM(_radix_ui_react_dialog, 1);
|
|
8
|
+
// ../../node_modules/.pnpm/vaul@1.1.2_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.mjs
|
|
9
|
+
function __insertCSS(code) {
|
|
10
|
+
if (!code || typeof document == "undefined") return;
|
|
11
|
+
let head = document.head || document.getElementsByTagName("head")[0];
|
|
12
|
+
let style = document.createElement("style");
|
|
13
|
+
style.type = "text/css";
|
|
14
|
+
head.appendChild(style);
|
|
15
|
+
style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
|
|
16
|
+
}
|
|
17
|
+
var DrawerContext = react$1.default.createContext({
|
|
18
|
+
drawerRef: { current: null },
|
|
19
|
+
overlayRef: { current: null },
|
|
20
|
+
onPress: () => {},
|
|
21
|
+
onRelease: () => {},
|
|
22
|
+
onDrag: () => {},
|
|
23
|
+
onNestedDrag: () => {},
|
|
24
|
+
onNestedOpenChange: () => {},
|
|
25
|
+
onNestedRelease: () => {},
|
|
26
|
+
openProp: void 0,
|
|
27
|
+
dismissible: false,
|
|
28
|
+
isOpen: false,
|
|
29
|
+
isDragging: false,
|
|
30
|
+
keyboardIsOpen: { current: false },
|
|
31
|
+
snapPointsOffset: null,
|
|
32
|
+
snapPoints: null,
|
|
33
|
+
handleOnly: false,
|
|
34
|
+
modal: false,
|
|
35
|
+
shouldFade: false,
|
|
36
|
+
activeSnapPoint: null,
|
|
37
|
+
onOpenChange: () => {},
|
|
38
|
+
setActiveSnapPoint: () => {},
|
|
39
|
+
closeDrawer: () => {},
|
|
40
|
+
direction: "bottom",
|
|
41
|
+
shouldAnimate: { current: true },
|
|
42
|
+
shouldScaleBackground: false,
|
|
43
|
+
setBackgroundColorOnScale: true,
|
|
44
|
+
noBodyStyles: false,
|
|
45
|
+
container: null,
|
|
46
|
+
autoFocus: false
|
|
47
|
+
});
|
|
48
|
+
var useDrawerContext = () => {
|
|
49
|
+
const context = react$1.default.useContext(DrawerContext);
|
|
50
|
+
if (!context) throw new Error("useDrawerContext must be used within a Drawer.Root");
|
|
51
|
+
return context;
|
|
52
|
+
};
|
|
53
|
+
__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)}}");
|
|
54
|
+
function isMobileFirefox() {
|
|
55
|
+
const userAgent = navigator.userAgent;
|
|
56
|
+
return typeof window !== "undefined" && (/Firefox/.test(userAgent) && /Mobile/.test(userAgent) || /FxiOS/.test(userAgent));
|
|
57
|
+
}
|
|
58
|
+
function isMac() {
|
|
59
|
+
return testPlatform(/^Mac/);
|
|
60
|
+
}
|
|
61
|
+
function isIPhone() {
|
|
62
|
+
return testPlatform(/^iPhone/);
|
|
63
|
+
}
|
|
64
|
+
function isSafari() {
|
|
65
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
66
|
+
}
|
|
67
|
+
function isIPad() {
|
|
68
|
+
return testPlatform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
|
|
69
|
+
}
|
|
70
|
+
function isIOS() {
|
|
71
|
+
return isIPhone() || isIPad();
|
|
72
|
+
}
|
|
73
|
+
function testPlatform(re) {
|
|
74
|
+
return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.platform) : void 0;
|
|
75
|
+
}
|
|
76
|
+
var KEYBOARD_BUFFER = 24;
|
|
77
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? react$1.useLayoutEffect : react$1.useEffect;
|
|
78
|
+
function chain$1(...callbacks) {
|
|
79
|
+
return (...args) => {
|
|
80
|
+
for (let callback of callbacks) if (typeof callback === "function") callback(...args);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
var visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
84
|
+
function isScrollable(node) {
|
|
85
|
+
let style = window.getComputedStyle(node);
|
|
86
|
+
return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
87
|
+
}
|
|
88
|
+
function getScrollParent(node) {
|
|
89
|
+
if (isScrollable(node)) node = node.parentElement;
|
|
90
|
+
while (node && !isScrollable(node)) node = node.parentElement;
|
|
91
|
+
return node || document.scrollingElement || document.documentElement;
|
|
92
|
+
}
|
|
93
|
+
var nonTextInputTypes = /* @__PURE__ */ new Set([
|
|
94
|
+
"checkbox",
|
|
95
|
+
"radio",
|
|
96
|
+
"range",
|
|
97
|
+
"color",
|
|
98
|
+
"file",
|
|
99
|
+
"image",
|
|
100
|
+
"button",
|
|
101
|
+
"submit",
|
|
102
|
+
"reset"
|
|
103
|
+
]);
|
|
104
|
+
var preventScrollCount = 0;
|
|
105
|
+
var restore;
|
|
106
|
+
/**
|
|
107
|
+
* Prevents scrolling on the document body on mount, and
|
|
108
|
+
* restores it on unmount. Also ensures that content does not
|
|
109
|
+
* shift due to the scrollbars disappearing.
|
|
110
|
+
*/ function usePreventScroll(options = {}) {
|
|
111
|
+
let { isDisabled } = options;
|
|
112
|
+
useIsomorphicLayoutEffect(() => {
|
|
113
|
+
if (isDisabled) return;
|
|
114
|
+
preventScrollCount++;
|
|
115
|
+
if (preventScrollCount === 1) {
|
|
116
|
+
if (isIOS()) restore = preventScrollMobileSafari();
|
|
117
|
+
}
|
|
118
|
+
return () => {
|
|
119
|
+
preventScrollCount--;
|
|
120
|
+
if (preventScrollCount === 0) restore?.();
|
|
121
|
+
};
|
|
122
|
+
}, [isDisabled]);
|
|
123
|
+
}
|
|
124
|
+
function preventScrollMobileSafari() {
|
|
125
|
+
let scrollable;
|
|
126
|
+
let lastY = 0;
|
|
127
|
+
let onTouchStart = (e) => {
|
|
128
|
+
scrollable = getScrollParent(e.target);
|
|
129
|
+
if (scrollable === document.documentElement && scrollable === document.body) return;
|
|
130
|
+
lastY = e.changedTouches[0].pageY;
|
|
131
|
+
};
|
|
132
|
+
let onTouchMove = (e) => {
|
|
133
|
+
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
let y = e.changedTouches[0].pageY;
|
|
138
|
+
let scrollTop = scrollable.scrollTop;
|
|
139
|
+
let bottom = scrollable.scrollHeight - scrollable.clientHeight;
|
|
140
|
+
if (bottom === 0) return;
|
|
141
|
+
if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) e.preventDefault();
|
|
142
|
+
lastY = y;
|
|
143
|
+
};
|
|
144
|
+
let onTouchEnd = (e) => {
|
|
145
|
+
let target = e.target;
|
|
146
|
+
if (isInput(target) && target !== document.activeElement) {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
target.style.transform = "translateY(-2000px)";
|
|
149
|
+
target.focus();
|
|
150
|
+
requestAnimationFrame(() => {
|
|
151
|
+
target.style.transform = "";
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
let onFocus = (e) => {
|
|
156
|
+
let target = e.target;
|
|
157
|
+
if (isInput(target)) {
|
|
158
|
+
target.style.transform = "translateY(-2000px)";
|
|
159
|
+
requestAnimationFrame(() => {
|
|
160
|
+
target.style.transform = "";
|
|
161
|
+
if (visualViewport) {
|
|
162
|
+
if (visualViewport.height < window.innerHeight) requestAnimationFrame(() => {
|
|
163
|
+
scrollIntoView(target);
|
|
164
|
+
});
|
|
165
|
+
else visualViewport.addEventListener("resize", () => scrollIntoView(target), { once: true });
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
let onWindowScroll = () => {
|
|
171
|
+
window.scrollTo(0, 0);
|
|
172
|
+
};
|
|
173
|
+
let scrollX = window.pageXOffset;
|
|
174
|
+
let scrollY = window.pageYOffset;
|
|
175
|
+
let restoreStyles = chain$1(setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
176
|
+
window.scrollTo(0, 0);
|
|
177
|
+
let removeEvents = chain$1(addEvent(document, "touchstart", onTouchStart, {
|
|
178
|
+
passive: false,
|
|
179
|
+
capture: true
|
|
180
|
+
}), addEvent(document, "touchmove", onTouchMove, {
|
|
181
|
+
passive: false,
|
|
182
|
+
capture: true
|
|
183
|
+
}), addEvent(document, "touchend", onTouchEnd, {
|
|
184
|
+
passive: false,
|
|
185
|
+
capture: true
|
|
186
|
+
}), addEvent(document, "focus", onFocus, true), addEvent(window, "scroll", onWindowScroll));
|
|
187
|
+
return () => {
|
|
188
|
+
restoreStyles();
|
|
189
|
+
removeEvents();
|
|
190
|
+
window.scrollTo(scrollX, scrollY);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function setStyle(element, style, value) {
|
|
194
|
+
let cur = element.style[style];
|
|
195
|
+
element.style[style] = value;
|
|
196
|
+
return () => {
|
|
197
|
+
element.style[style] = cur;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function addEvent(target, event, handler, options) {
|
|
201
|
+
target.addEventListener(event, handler, options);
|
|
202
|
+
return () => {
|
|
203
|
+
target.removeEventListener(event, handler, options);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function scrollIntoView(target) {
|
|
207
|
+
let root = document.scrollingElement || document.documentElement;
|
|
208
|
+
while (target && target !== root) {
|
|
209
|
+
let scrollable = getScrollParent(target);
|
|
210
|
+
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
|
|
211
|
+
let scrollableTop = scrollable.getBoundingClientRect().top;
|
|
212
|
+
let targetTop = target.getBoundingClientRect().top;
|
|
213
|
+
if (target.getBoundingClientRect().bottom > scrollable.getBoundingClientRect().bottom + KEYBOARD_BUFFER) scrollable.scrollTop += targetTop - scrollableTop;
|
|
214
|
+
}
|
|
215
|
+
target = scrollable.parentElement;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function isInput(target) {
|
|
219
|
+
return target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Set a given ref to a given value
|
|
223
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
224
|
+
*/ function setRef(ref, value) {
|
|
225
|
+
if (typeof ref === "function") ref(value);
|
|
226
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* A utility to compose multiple refs together
|
|
230
|
+
* Accepts callback refs and RefObject(s)
|
|
231
|
+
*/ function composeRefs(...refs) {
|
|
232
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* A custom hook that composes multiple refs
|
|
236
|
+
* Accepts callback refs and RefObject(s)
|
|
237
|
+
*/ function useComposedRefs(...refs) {
|
|
238
|
+
return react$1.useCallback(composeRefs(...refs), refs);
|
|
239
|
+
}
|
|
240
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
241
|
+
function set(el, styles, ignoreCache = false) {
|
|
242
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
|
243
|
+
let originalStyles = {};
|
|
244
|
+
Object.entries(styles).forEach(([key, value]) => {
|
|
245
|
+
if (key.startsWith("--")) {
|
|
246
|
+
el.style.setProperty(key, value);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
originalStyles[key] = el.style[key];
|
|
250
|
+
el.style[key] = value;
|
|
251
|
+
});
|
|
252
|
+
if (ignoreCache) return;
|
|
253
|
+
cache.set(el, originalStyles);
|
|
254
|
+
}
|
|
255
|
+
function reset(el, prop) {
|
|
256
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
|
257
|
+
let originalStyles = cache.get(el);
|
|
258
|
+
if (!originalStyles) return;
|
|
259
|
+
el.style[prop] = originalStyles[prop];
|
|
260
|
+
}
|
|
261
|
+
var isVertical = (direction) => {
|
|
262
|
+
switch (direction) {
|
|
263
|
+
case "top":
|
|
264
|
+
case "bottom": return true;
|
|
265
|
+
case "left":
|
|
266
|
+
case "right": return false;
|
|
267
|
+
default: return direction;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
function getTranslate(element, direction) {
|
|
271
|
+
if (!element) return null;
|
|
272
|
+
const style = window.getComputedStyle(element);
|
|
273
|
+
const transform = style.transform || style.webkitTransform || style.mozTransform;
|
|
274
|
+
let mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
275
|
+
if (mat) return parseFloat(mat[1].split(", ")[isVertical(direction) ? 13 : 12]);
|
|
276
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
|
277
|
+
return mat ? parseFloat(mat[1].split(", ")[isVertical(direction) ? 5 : 4]) : null;
|
|
278
|
+
}
|
|
279
|
+
function dampenValue(v) {
|
|
280
|
+
return 8 * (Math.log(v + 1) - 2);
|
|
281
|
+
}
|
|
282
|
+
function assignStyle(element, style) {
|
|
283
|
+
if (!element) return () => {};
|
|
284
|
+
const prevStyle = element.style.cssText;
|
|
285
|
+
Object.assign(element.style, style);
|
|
286
|
+
return () => {
|
|
287
|
+
element.style.cssText = prevStyle;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
var TRANSITIONS = {
|
|
291
|
+
DURATION: .5,
|
|
292
|
+
EASE: [
|
|
293
|
+
.32,
|
|
294
|
+
.72,
|
|
295
|
+
0,
|
|
296
|
+
1
|
|
297
|
+
]
|
|
298
|
+
};
|
|
299
|
+
var VELOCITY_THRESHOLD = .4;
|
|
300
|
+
var CLOSE_THRESHOLD = .25;
|
|
301
|
+
var SCROLL_LOCK_TIMEOUT = 100;
|
|
302
|
+
var BORDER_RADIUS = 8;
|
|
303
|
+
var NESTED_DISPLACEMENT = 16;
|
|
304
|
+
var WINDOW_TOP_OFFSET = 26;
|
|
305
|
+
var DRAG_CLASS = "vaul-dragging";
|
|
306
|
+
function useCallbackRef(callback) {
|
|
307
|
+
const callbackRef = react$1.default.useRef(callback);
|
|
308
|
+
react$1.default.useEffect(() => {
|
|
309
|
+
callbackRef.current = callback;
|
|
310
|
+
});
|
|
311
|
+
return react$1.default.useMemo(() => (...args) => callbackRef.current == null ? void 0 : callbackRef.current.call(callbackRef, ...args), []);
|
|
312
|
+
}
|
|
313
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
314
|
+
const uncontrolledState = react$1.default.useState(defaultProp);
|
|
315
|
+
const [value] = uncontrolledState;
|
|
316
|
+
const prevValueRef = react$1.default.useRef(value);
|
|
317
|
+
const handleChange = useCallbackRef(onChange);
|
|
318
|
+
react$1.default.useEffect(() => {
|
|
319
|
+
if (prevValueRef.current !== value) {
|
|
320
|
+
handleChange(value);
|
|
321
|
+
prevValueRef.current = value;
|
|
322
|
+
}
|
|
323
|
+
}, [
|
|
324
|
+
value,
|
|
325
|
+
prevValueRef,
|
|
326
|
+
handleChange
|
|
327
|
+
]);
|
|
328
|
+
return uncontrolledState;
|
|
329
|
+
}
|
|
330
|
+
function useControllableState({ prop, defaultProp, onChange = () => {} }) {
|
|
331
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
332
|
+
defaultProp,
|
|
333
|
+
onChange
|
|
334
|
+
});
|
|
335
|
+
const isControlled = prop !== void 0;
|
|
336
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
337
|
+
const handleChange = useCallbackRef(onChange);
|
|
338
|
+
return [value, react$1.default.useCallback((nextValue) => {
|
|
339
|
+
if (isControlled) {
|
|
340
|
+
const value = typeof nextValue === "function" ? nextValue(prop) : nextValue;
|
|
341
|
+
if (value !== prop) handleChange(value);
|
|
342
|
+
} else setUncontrolledProp(nextValue);
|
|
343
|
+
}, [
|
|
344
|
+
isControlled,
|
|
345
|
+
prop,
|
|
346
|
+
setUncontrolledProp,
|
|
347
|
+
handleChange
|
|
348
|
+
])];
|
|
349
|
+
}
|
|
350
|
+
function useSnapPoints({ activeSnapPointProp, setActiveSnapPointProp, snapPoints, drawerRef, overlayRef, fadeFromIndex, onSnapPointChange, direction = "bottom", container, snapToSequentialPoint }) {
|
|
351
|
+
const [activeSnapPoint, setActiveSnapPoint] = useControllableState({
|
|
352
|
+
prop: activeSnapPointProp,
|
|
353
|
+
defaultProp: snapPoints == null ? void 0 : snapPoints[0],
|
|
354
|
+
onChange: setActiveSnapPointProp
|
|
355
|
+
});
|
|
356
|
+
const [windowDimensions, setWindowDimensions] = react$1.default.useState(typeof window !== "undefined" ? {
|
|
357
|
+
innerWidth: window.innerWidth,
|
|
358
|
+
innerHeight: window.innerHeight
|
|
359
|
+
} : void 0);
|
|
360
|
+
react$1.default.useEffect(() => {
|
|
361
|
+
function onResize() {
|
|
362
|
+
setWindowDimensions({
|
|
363
|
+
innerWidth: window.innerWidth,
|
|
364
|
+
innerHeight: window.innerHeight
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
window.addEventListener("resize", onResize);
|
|
368
|
+
return () => window.removeEventListener("resize", onResize);
|
|
369
|
+
}, []);
|
|
370
|
+
const isLastSnapPoint = react$1.default.useMemo(() => activeSnapPoint === (snapPoints == null ? void 0 : snapPoints[snapPoints.length - 1]) || null, [snapPoints, activeSnapPoint]);
|
|
371
|
+
const activeSnapPointIndex = react$1.default.useMemo(() => {
|
|
372
|
+
var _snapPoints_findIndex;
|
|
373
|
+
return (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint) => snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : null;
|
|
374
|
+
}, [snapPoints, activeSnapPoint]);
|
|
375
|
+
const shouldFade = snapPoints && snapPoints.length > 0 && (fadeFromIndex || fadeFromIndex === 0) && !Number.isNaN(fadeFromIndex) && snapPoints[fadeFromIndex] === activeSnapPoint || !snapPoints;
|
|
376
|
+
const snapPointsOffset = react$1.default.useMemo(() => {
|
|
377
|
+
const containerSize = container ? {
|
|
378
|
+
width: container.getBoundingClientRect().width,
|
|
379
|
+
height: container.getBoundingClientRect().height
|
|
380
|
+
} : typeof window !== "undefined" ? {
|
|
381
|
+
width: window.innerWidth,
|
|
382
|
+
height: window.innerHeight
|
|
383
|
+
} : {
|
|
384
|
+
width: 0,
|
|
385
|
+
height: 0
|
|
386
|
+
};
|
|
387
|
+
var _snapPoints_map;
|
|
388
|
+
return (_snapPoints_map = snapPoints == null ? void 0 : snapPoints.map((snapPoint) => {
|
|
389
|
+
const isPx = typeof snapPoint === "string";
|
|
390
|
+
let snapPointAsNumber = 0;
|
|
391
|
+
if (isPx) snapPointAsNumber = parseInt(snapPoint, 10);
|
|
392
|
+
if (isVertical(direction)) {
|
|
393
|
+
const height = isPx ? snapPointAsNumber : windowDimensions ? snapPoint * containerSize.height : 0;
|
|
394
|
+
if (windowDimensions) return direction === "bottom" ? containerSize.height - height : -containerSize.height + height;
|
|
395
|
+
return height;
|
|
396
|
+
}
|
|
397
|
+
const width = isPx ? snapPointAsNumber : windowDimensions ? snapPoint * containerSize.width : 0;
|
|
398
|
+
if (windowDimensions) return direction === "right" ? containerSize.width - width : -containerSize.width + width;
|
|
399
|
+
return width;
|
|
400
|
+
})) != null ? _snapPoints_map : [];
|
|
401
|
+
}, [
|
|
402
|
+
snapPoints,
|
|
403
|
+
windowDimensions,
|
|
404
|
+
container
|
|
405
|
+
]);
|
|
406
|
+
const activeSnapPointOffset = react$1.default.useMemo(() => activeSnapPointIndex !== null ? snapPointsOffset == null ? void 0 : snapPointsOffset[activeSnapPointIndex] : null, [snapPointsOffset, activeSnapPointIndex]);
|
|
407
|
+
const snapToPoint = react$1.default.useCallback((dimension) => {
|
|
408
|
+
var _snapPointsOffset_findIndex;
|
|
409
|
+
const newSnapPointIndex = (_snapPointsOffset_findIndex = snapPointsOffset == null ? void 0 : snapPointsOffset.findIndex((snapPointDim) => snapPointDim === dimension)) != null ? _snapPointsOffset_findIndex : null;
|
|
410
|
+
onSnapPointChange(newSnapPointIndex);
|
|
411
|
+
set(drawerRef.current, {
|
|
412
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
|
413
|
+
transform: isVertical(direction) ? `translate3d(0, ${dimension}px, 0)` : `translate3d(${dimension}px, 0, 0)`
|
|
414
|
+
});
|
|
415
|
+
if (snapPointsOffset && newSnapPointIndex !== snapPointsOffset.length - 1 && fadeFromIndex !== void 0 && newSnapPointIndex !== fadeFromIndex && newSnapPointIndex < fadeFromIndex) set(overlayRef.current, {
|
|
416
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
|
417
|
+
opacity: "0"
|
|
418
|
+
});
|
|
419
|
+
else set(overlayRef.current, {
|
|
420
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
|
421
|
+
opacity: "1"
|
|
422
|
+
});
|
|
423
|
+
setActiveSnapPoint(snapPoints == null ? void 0 : snapPoints[Math.max(newSnapPointIndex, 0)]);
|
|
424
|
+
}, [
|
|
425
|
+
drawerRef.current,
|
|
426
|
+
snapPoints,
|
|
427
|
+
snapPointsOffset,
|
|
428
|
+
fadeFromIndex,
|
|
429
|
+
overlayRef,
|
|
430
|
+
setActiveSnapPoint
|
|
431
|
+
]);
|
|
432
|
+
react$1.default.useEffect(() => {
|
|
433
|
+
if (activeSnapPoint || activeSnapPointProp) {
|
|
434
|
+
var _snapPoints_findIndex;
|
|
435
|
+
const newIndex = (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint) => snapPoint === activeSnapPointProp || snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : -1;
|
|
436
|
+
if (snapPointsOffset && newIndex !== -1 && typeof snapPointsOffset[newIndex] === "number") snapToPoint(snapPointsOffset[newIndex]);
|
|
437
|
+
}
|
|
438
|
+
}, [
|
|
439
|
+
activeSnapPoint,
|
|
440
|
+
activeSnapPointProp,
|
|
441
|
+
snapPoints,
|
|
442
|
+
snapPointsOffset,
|
|
443
|
+
snapToPoint
|
|
444
|
+
]);
|
|
445
|
+
function onRelease({ draggedDistance, closeDrawer, velocity, dismissible }) {
|
|
446
|
+
if (fadeFromIndex === void 0) return;
|
|
447
|
+
const currentPosition = direction === "bottom" || direction === "right" ? (activeSnapPointOffset != null ? activeSnapPointOffset : 0) - draggedDistance : (activeSnapPointOffset != null ? activeSnapPointOffset : 0) + draggedDistance;
|
|
448
|
+
const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
|
|
449
|
+
const isFirst = activeSnapPointIndex === 0;
|
|
450
|
+
const hasDraggedUp = draggedDistance > 0;
|
|
451
|
+
if (isOverlaySnapPoint) set(overlayRef.current, { transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})` });
|
|
452
|
+
if (!snapToSequentialPoint && velocity > 2 && !hasDraggedUp) {
|
|
453
|
+
if (dismissible) closeDrawer();
|
|
454
|
+
else snapToPoint(snapPointsOffset[0]);
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
if (!snapToSequentialPoint && velocity > 2 && hasDraggedUp && snapPointsOffset && snapPoints) {
|
|
458
|
+
snapToPoint(snapPointsOffset[snapPoints.length - 1]);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
const closestSnapPoint = snapPointsOffset == null ? void 0 : snapPointsOffset.reduce((prev, curr) => {
|
|
462
|
+
if (typeof prev !== "number" || typeof curr !== "number") return prev;
|
|
463
|
+
return Math.abs(curr - currentPosition) < Math.abs(prev - currentPosition) ? curr : prev;
|
|
464
|
+
});
|
|
465
|
+
const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;
|
|
466
|
+
if (velocity > VELOCITY_THRESHOLD && Math.abs(draggedDistance) < dim * .4) {
|
|
467
|
+
const dragDirection = hasDraggedUp ? 1 : -1;
|
|
468
|
+
if (dragDirection > 0 && isLastSnapPoint && snapPoints) {
|
|
469
|
+
snapToPoint(snapPointsOffset[snapPoints.length - 1]);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (isFirst && dragDirection < 0 && dismissible) closeDrawer();
|
|
473
|
+
if (activeSnapPointIndex === null) return;
|
|
474
|
+
snapToPoint(snapPointsOffset[activeSnapPointIndex + dragDirection]);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
snapToPoint(closestSnapPoint);
|
|
478
|
+
}
|
|
479
|
+
function onDrag({ draggedDistance }) {
|
|
480
|
+
if (activeSnapPointOffset === null) return;
|
|
481
|
+
const newValue = direction === "bottom" || direction === "right" ? activeSnapPointOffset - draggedDistance : activeSnapPointOffset + draggedDistance;
|
|
482
|
+
if ((direction === "bottom" || direction === "right") && newValue < snapPointsOffset[snapPointsOffset.length - 1]) return;
|
|
483
|
+
if ((direction === "top" || direction === "left") && newValue > snapPointsOffset[snapPointsOffset.length - 1]) return;
|
|
484
|
+
set(drawerRef.current, { transform: isVertical(direction) ? `translate3d(0, ${newValue}px, 0)` : `translate3d(${newValue}px, 0, 0)` });
|
|
485
|
+
}
|
|
486
|
+
function getPercentageDragged(absDraggedDistance, isDraggingDown) {
|
|
487
|
+
if (!snapPoints || typeof activeSnapPointIndex !== "number" || !snapPointsOffset || fadeFromIndex === void 0) return null;
|
|
488
|
+
const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
|
|
489
|
+
if (activeSnapPointIndex >= fadeFromIndex && isDraggingDown) return 0;
|
|
490
|
+
if (isOverlaySnapPoint && !isDraggingDown) return 1;
|
|
491
|
+
if (!shouldFade && !isOverlaySnapPoint) return null;
|
|
492
|
+
const targetSnapPointIndex = isOverlaySnapPoint ? activeSnapPointIndex + 1 : activeSnapPointIndex - 1;
|
|
493
|
+
const snapPointDistance = isOverlaySnapPoint ? snapPointsOffset[targetSnapPointIndex] - snapPointsOffset[targetSnapPointIndex - 1] : snapPointsOffset[targetSnapPointIndex + 1] - snapPointsOffset[targetSnapPointIndex];
|
|
494
|
+
const percentageDragged = absDraggedDistance / Math.abs(snapPointDistance);
|
|
495
|
+
if (isOverlaySnapPoint) return 1 - percentageDragged;
|
|
496
|
+
else return percentageDragged;
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
isLastSnapPoint,
|
|
500
|
+
activeSnapPoint,
|
|
501
|
+
shouldFade,
|
|
502
|
+
getPercentageDragged,
|
|
503
|
+
setActiveSnapPoint,
|
|
504
|
+
activeSnapPointIndex,
|
|
505
|
+
onRelease,
|
|
506
|
+
onDrag,
|
|
507
|
+
snapPointsOffset
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
function useScaleBackground() {
|
|
511
|
+
const { direction, isOpen, shouldScaleBackground, setBackgroundColorOnScale, noBodyStyles } = useDrawerContext();
|
|
512
|
+
const timeoutIdRef = react$1.default.useRef(null);
|
|
513
|
+
const initialBackgroundColor = (0, react$1.useMemo)(() => document.body.style.backgroundColor, []);
|
|
514
|
+
function getScale() {
|
|
515
|
+
return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
|
|
516
|
+
}
|
|
517
|
+
react$1.default.useEffect(() => {
|
|
518
|
+
if (isOpen && shouldScaleBackground) {
|
|
519
|
+
if (timeoutIdRef.current) clearTimeout(timeoutIdRef.current);
|
|
520
|
+
const wrapper = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
521
|
+
if (!wrapper) return;
|
|
522
|
+
setBackgroundColorOnScale && !noBodyStyles && assignStyle(document.body, { background: "black" }), assignStyle(wrapper, {
|
|
523
|
+
transformOrigin: isVertical(direction) ? "top" : "left",
|
|
524
|
+
transitionProperty: "transform, border-radius",
|
|
525
|
+
transitionDuration: `${TRANSITIONS.DURATION}s`,
|
|
526
|
+
transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
|
527
|
+
});
|
|
528
|
+
const wrapperStylesCleanup = assignStyle(wrapper, {
|
|
529
|
+
borderRadius: `${BORDER_RADIUS}px`,
|
|
530
|
+
overflow: "hidden",
|
|
531
|
+
...isVertical(direction) ? { transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)` } : { transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)` }
|
|
532
|
+
});
|
|
533
|
+
return () => {
|
|
534
|
+
wrapperStylesCleanup();
|
|
535
|
+
timeoutIdRef.current = window.setTimeout(() => {
|
|
536
|
+
if (initialBackgroundColor) document.body.style.background = initialBackgroundColor;
|
|
537
|
+
else document.body.style.removeProperty("background");
|
|
538
|
+
}, TRANSITIONS.DURATION * 1e3);
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
}, [
|
|
542
|
+
isOpen,
|
|
543
|
+
shouldScaleBackground,
|
|
544
|
+
initialBackgroundColor
|
|
545
|
+
]);
|
|
546
|
+
}
|
|
547
|
+
var previousBodyPosition = null;
|
|
548
|
+
/**
|
|
549
|
+
* This hook is necessary to prevent buggy behavior on iOS devices (need to test on Android).
|
|
550
|
+
* I won't get into too much detail about what bugs it solves, but so far I've found that setting the body to `position: fixed` is the most reliable way to prevent those bugs.
|
|
551
|
+
* Issues that this hook solves:
|
|
552
|
+
* https://github.com/emilkowalski/vaul/issues/435
|
|
553
|
+
* https://github.com/emilkowalski/vaul/issues/433
|
|
554
|
+
* And more that I discovered, but were just not reported.
|
|
555
|
+
*/ function usePositionFixed({ isOpen, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles }) {
|
|
556
|
+
const [activeUrl, setActiveUrl] = react$1.default.useState(() => typeof window !== "undefined" ? window.location.href : "");
|
|
557
|
+
const scrollPos = react$1.default.useRef(0);
|
|
558
|
+
const setPositionFixed = react$1.default.useCallback(() => {
|
|
559
|
+
if (!isSafari()) return;
|
|
560
|
+
if (previousBodyPosition === null && isOpen && !noBodyStyles) {
|
|
561
|
+
previousBodyPosition = {
|
|
562
|
+
position: document.body.style.position,
|
|
563
|
+
top: document.body.style.top,
|
|
564
|
+
left: document.body.style.left,
|
|
565
|
+
height: document.body.style.height,
|
|
566
|
+
right: "unset"
|
|
567
|
+
};
|
|
568
|
+
const { scrollX, innerHeight } = window;
|
|
569
|
+
document.body.style.setProperty("position", "fixed", "important");
|
|
570
|
+
Object.assign(document.body.style, {
|
|
571
|
+
top: `${-scrollPos.current}px`,
|
|
572
|
+
left: `${-scrollX}px`,
|
|
573
|
+
right: "0px",
|
|
574
|
+
height: "auto"
|
|
575
|
+
});
|
|
576
|
+
window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
577
|
+
const bottomBarHeight = innerHeight - window.innerHeight;
|
|
578
|
+
if (bottomBarHeight && scrollPos.current >= innerHeight) document.body.style.top = `${-(scrollPos.current + bottomBarHeight)}px`;
|
|
579
|
+
}), 300);
|
|
580
|
+
}
|
|
581
|
+
}, [isOpen]);
|
|
582
|
+
const restorePositionSetting = react$1.default.useCallback(() => {
|
|
583
|
+
if (!isSafari()) return;
|
|
584
|
+
if (previousBodyPosition !== null && !noBodyStyles) {
|
|
585
|
+
const y = -parseInt(document.body.style.top, 10);
|
|
586
|
+
const x = -parseInt(document.body.style.left, 10);
|
|
587
|
+
Object.assign(document.body.style, previousBodyPosition);
|
|
588
|
+
window.requestAnimationFrame(() => {
|
|
589
|
+
if (preventScrollRestoration && activeUrl !== window.location.href) {
|
|
590
|
+
setActiveUrl(window.location.href);
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
window.scrollTo(x, y);
|
|
594
|
+
});
|
|
595
|
+
previousBodyPosition = null;
|
|
596
|
+
}
|
|
597
|
+
}, [activeUrl]);
|
|
598
|
+
react$1.default.useEffect(() => {
|
|
599
|
+
function onScroll() {
|
|
600
|
+
scrollPos.current = window.scrollY;
|
|
601
|
+
}
|
|
602
|
+
onScroll();
|
|
603
|
+
window.addEventListener("scroll", onScroll);
|
|
604
|
+
return () => {
|
|
605
|
+
window.removeEventListener("scroll", onScroll);
|
|
606
|
+
};
|
|
607
|
+
}, []);
|
|
608
|
+
react$1.default.useEffect(() => {
|
|
609
|
+
if (!modal) return;
|
|
610
|
+
return () => {
|
|
611
|
+
if (typeof document === "undefined") return;
|
|
612
|
+
if (!!document.querySelector("[data-vaul-drawer]")) return;
|
|
613
|
+
restorePositionSetting();
|
|
614
|
+
};
|
|
615
|
+
}, [modal, restorePositionSetting]);
|
|
616
|
+
react$1.default.useEffect(() => {
|
|
617
|
+
if (nested || !hasBeenOpened) return;
|
|
618
|
+
if (isOpen) {
|
|
619
|
+
!window.matchMedia("(display-mode: standalone)").matches && setPositionFixed();
|
|
620
|
+
if (!modal) window.setTimeout(() => {
|
|
621
|
+
restorePositionSetting();
|
|
622
|
+
}, 500);
|
|
623
|
+
} else restorePositionSetting();
|
|
624
|
+
}, [
|
|
625
|
+
isOpen,
|
|
626
|
+
hasBeenOpened,
|
|
627
|
+
activeUrl,
|
|
628
|
+
modal,
|
|
629
|
+
nested,
|
|
630
|
+
setPositionFixed,
|
|
631
|
+
restorePositionSetting
|
|
632
|
+
]);
|
|
633
|
+
return { restorePositionSetting };
|
|
634
|
+
}
|
|
635
|
+
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 }) {
|
|
636
|
+
var _drawerRef_current, _drawerRef_current1;
|
|
637
|
+
const [isOpen = false, setIsOpen] = useControllableState({
|
|
638
|
+
defaultProp: defaultOpen,
|
|
639
|
+
prop: openProp,
|
|
640
|
+
onChange: (o) => {
|
|
641
|
+
onOpenChange?.(o);
|
|
642
|
+
if (!o && !nested) restorePositionSetting();
|
|
643
|
+
setTimeout(() => {
|
|
644
|
+
onAnimationEnd?.(o);
|
|
645
|
+
}, TRANSITIONS.DURATION * 1e3);
|
|
646
|
+
if (o && !modal) {
|
|
647
|
+
if (typeof window !== "undefined") window.requestAnimationFrame(() => {
|
|
648
|
+
document.body.style.pointerEvents = "auto";
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
if (!o) document.body.style.pointerEvents = "auto";
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
const [hasBeenOpened, setHasBeenOpened] = react$1.default.useState(false);
|
|
655
|
+
const [isDragging, setIsDragging] = react$1.default.useState(false);
|
|
656
|
+
const [justReleased, setJustReleased] = react$1.default.useState(false);
|
|
657
|
+
const overlayRef = react$1.default.useRef(null);
|
|
658
|
+
const openTime = react$1.default.useRef(null);
|
|
659
|
+
const dragStartTime = react$1.default.useRef(null);
|
|
660
|
+
const dragEndTime = react$1.default.useRef(null);
|
|
661
|
+
const lastTimeDragPrevented = react$1.default.useRef(null);
|
|
662
|
+
const isAllowedToDrag = react$1.default.useRef(false);
|
|
663
|
+
const nestedOpenChangeTimer = react$1.default.useRef(null);
|
|
664
|
+
const pointerStart = react$1.default.useRef(0);
|
|
665
|
+
const keyboardIsOpen = react$1.default.useRef(false);
|
|
666
|
+
const shouldAnimate = react$1.default.useRef(!defaultOpen);
|
|
667
|
+
const previousDiffFromInitial = react$1.default.useRef(0);
|
|
668
|
+
const drawerRef = react$1.default.useRef(null);
|
|
669
|
+
const drawerHeightRef = react$1.default.useRef(((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0);
|
|
670
|
+
const drawerWidthRef = react$1.default.useRef(((_drawerRef_current1 = drawerRef.current) == null ? void 0 : _drawerRef_current1.getBoundingClientRect().width) || 0);
|
|
671
|
+
const initialDrawerHeight = react$1.default.useRef(0);
|
|
672
|
+
const { activeSnapPoint, activeSnapPointIndex, setActiveSnapPoint, onRelease: onReleaseSnapPoints, snapPointsOffset, onDrag: onDragSnapPoints, shouldFade, getPercentageDragged: getSnapPointsPercentageDragged } = useSnapPoints({
|
|
673
|
+
snapPoints,
|
|
674
|
+
activeSnapPointProp,
|
|
675
|
+
setActiveSnapPointProp,
|
|
676
|
+
drawerRef,
|
|
677
|
+
fadeFromIndex,
|
|
678
|
+
overlayRef,
|
|
679
|
+
onSnapPointChange: react$1.default.useCallback((activeSnapPointIndex) => {
|
|
680
|
+
if (snapPoints && activeSnapPointIndex === snapPointsOffset.length - 1) openTime.current = /* @__PURE__ */ new Date();
|
|
681
|
+
}, []),
|
|
682
|
+
direction,
|
|
683
|
+
container,
|
|
684
|
+
snapToSequentialPoint
|
|
685
|
+
});
|
|
686
|
+
usePreventScroll({ isDisabled: !isOpen || isDragging || !modal || justReleased || !hasBeenOpened || !repositionInputs || !disablePreventScroll });
|
|
687
|
+
const { restorePositionSetting } = usePositionFixed({
|
|
688
|
+
isOpen,
|
|
689
|
+
modal,
|
|
690
|
+
nested: nested != null ? nested : false,
|
|
691
|
+
hasBeenOpened,
|
|
692
|
+
preventScrollRestoration,
|
|
693
|
+
noBodyStyles
|
|
694
|
+
});
|
|
695
|
+
function getScale() {
|
|
696
|
+
return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
|
|
697
|
+
}
|
|
698
|
+
function onPress(event) {
|
|
699
|
+
var _drawerRef_current, _drawerRef_current1;
|
|
700
|
+
if (!dismissible && !snapPoints) return;
|
|
701
|
+
if (drawerRef.current && !drawerRef.current.contains(event.target)) return;
|
|
702
|
+
drawerHeightRef.current = ((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0;
|
|
703
|
+
drawerWidthRef.current = ((_drawerRef_current1 = drawerRef.current) == null ? void 0 : _drawerRef_current1.getBoundingClientRect().width) || 0;
|
|
704
|
+
setIsDragging(true);
|
|
705
|
+
dragStartTime.current = /* @__PURE__ */ new Date();
|
|
706
|
+
if (isIOS()) window.addEventListener("touchend", () => isAllowedToDrag.current = false, { once: true });
|
|
707
|
+
event.target.setPointerCapture(event.pointerId);
|
|
708
|
+
pointerStart.current = isVertical(direction) ? event.pageY : event.pageX;
|
|
709
|
+
}
|
|
710
|
+
function shouldDrag(el, isDraggingInDirection) {
|
|
711
|
+
var _window_getSelection;
|
|
712
|
+
let element = el;
|
|
713
|
+
const highlightedText = (_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString();
|
|
714
|
+
const swipeAmount = drawerRef.current ? getTranslate(drawerRef.current, direction) : null;
|
|
715
|
+
const date = /* @__PURE__ */ new Date();
|
|
716
|
+
if (element.tagName === "SELECT") return false;
|
|
717
|
+
if (element.hasAttribute("data-vaul-no-drag") || element.closest("[data-vaul-no-drag]")) return false;
|
|
718
|
+
if (direction === "right" || direction === "left") return true;
|
|
719
|
+
if (openTime.current && date.getTime() - openTime.current.getTime() < 500) return false;
|
|
720
|
+
if (swipeAmount !== null) {
|
|
721
|
+
if (direction === "bottom" ? swipeAmount > 0 : swipeAmount < 0) return true;
|
|
722
|
+
}
|
|
723
|
+
if (highlightedText && highlightedText.length > 0) return false;
|
|
724
|
+
if (lastTimeDragPrevented.current && date.getTime() - lastTimeDragPrevented.current.getTime() < scrollLockTimeout && swipeAmount === 0) {
|
|
725
|
+
lastTimeDragPrevented.current = date;
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
if (isDraggingInDirection) {
|
|
729
|
+
lastTimeDragPrevented.current = date;
|
|
730
|
+
return false;
|
|
731
|
+
}
|
|
732
|
+
while (element) {
|
|
733
|
+
if (element.scrollHeight > element.clientHeight) {
|
|
734
|
+
if (element.scrollTop !== 0) {
|
|
735
|
+
lastTimeDragPrevented.current = /* @__PURE__ */ new Date();
|
|
736
|
+
return false;
|
|
737
|
+
}
|
|
738
|
+
if (element.getAttribute("role") === "dialog") return true;
|
|
739
|
+
}
|
|
740
|
+
element = element.parentNode;
|
|
741
|
+
}
|
|
742
|
+
return true;
|
|
743
|
+
}
|
|
744
|
+
function onDrag(event) {
|
|
745
|
+
if (!drawerRef.current) return;
|
|
746
|
+
if (isDragging) {
|
|
747
|
+
const directionMultiplier = direction === "bottom" || direction === "right" ? 1 : -1;
|
|
748
|
+
const draggedDistance = (pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX)) * directionMultiplier;
|
|
749
|
+
const isDraggingInDirection = draggedDistance > 0;
|
|
750
|
+
const noCloseSnapPointsPreCondition = snapPoints && !dismissible && !isDraggingInDirection;
|
|
751
|
+
if (noCloseSnapPointsPreCondition && activeSnapPointIndex === 0) return;
|
|
752
|
+
const absDraggedDistance = Math.abs(draggedDistance);
|
|
753
|
+
const wrapper = document.querySelector("[data-vaul-drawer-wrapper]");
|
|
754
|
+
let percentageDragged = absDraggedDistance / (direction === "bottom" || direction === "top" ? drawerHeightRef.current : drawerWidthRef.current);
|
|
755
|
+
const snapPointPercentageDragged = getSnapPointsPercentageDragged(absDraggedDistance, isDraggingInDirection);
|
|
756
|
+
if (snapPointPercentageDragged !== null) percentageDragged = snapPointPercentageDragged;
|
|
757
|
+
if (noCloseSnapPointsPreCondition && percentageDragged >= 1) return;
|
|
758
|
+
if (!isAllowedToDrag.current && !shouldDrag(event.target, isDraggingInDirection)) return;
|
|
759
|
+
drawerRef.current.classList.add(DRAG_CLASS);
|
|
760
|
+
isAllowedToDrag.current = true;
|
|
761
|
+
set(drawerRef.current, { transition: "none" });
|
|
762
|
+
set(overlayRef.current, { transition: "none" });
|
|
763
|
+
if (snapPoints) onDragSnapPoints({ draggedDistance });
|
|
764
|
+
if (isDraggingInDirection && !snapPoints) {
|
|
765
|
+
const dampenedDraggedDistance = dampenValue(draggedDistance);
|
|
766
|
+
const translateValue = Math.min(dampenedDraggedDistance * -1, 0) * directionMultiplier;
|
|
767
|
+
set(drawerRef.current, { transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)` });
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
const opacityValue = 1 - percentageDragged;
|
|
771
|
+
if (shouldFade || fadeFromIndex && activeSnapPointIndex === fadeFromIndex - 1) {
|
|
772
|
+
onDragProp?.(event, percentageDragged);
|
|
773
|
+
set(overlayRef.current, {
|
|
774
|
+
opacity: `${opacityValue}`,
|
|
775
|
+
transition: "none"
|
|
776
|
+
}, true);
|
|
777
|
+
}
|
|
778
|
+
if (wrapper && overlayRef.current && shouldScaleBackground) {
|
|
779
|
+
const scaleValue = Math.min(getScale() + percentageDragged * (1 - getScale()), 1);
|
|
780
|
+
const borderRadiusValue = 8 - percentageDragged * 8;
|
|
781
|
+
const translateValue = Math.max(0, 14 - percentageDragged * 14);
|
|
782
|
+
set(wrapper, {
|
|
783
|
+
borderRadius: `${borderRadiusValue}px`,
|
|
784
|
+
transform: isVertical(direction) ? `scale(${scaleValue}) translate3d(0, ${translateValue}px, 0)` : `scale(${scaleValue}) translate3d(${translateValue}px, 0, 0)`,
|
|
785
|
+
transition: "none"
|
|
786
|
+
}, true);
|
|
787
|
+
}
|
|
788
|
+
if (!snapPoints) {
|
|
789
|
+
const translateValue = absDraggedDistance * directionMultiplier;
|
|
790
|
+
set(drawerRef.current, { transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)` });
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
react$1.default.useEffect(() => {
|
|
795
|
+
window.requestAnimationFrame(() => {
|
|
796
|
+
shouldAnimate.current = true;
|
|
797
|
+
});
|
|
798
|
+
}, []);
|
|
799
|
+
react$1.default.useEffect(() => {
|
|
800
|
+
var _window_visualViewport;
|
|
801
|
+
function onVisualViewportChange() {
|
|
802
|
+
if (!drawerRef.current || !repositionInputs) return;
|
|
803
|
+
const focusedElement = document.activeElement;
|
|
804
|
+
if (isInput(focusedElement) || keyboardIsOpen.current) {
|
|
805
|
+
var _window_visualViewport;
|
|
806
|
+
const visualViewportHeight = ((_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.height) || 0;
|
|
807
|
+
const totalHeight = window.innerHeight;
|
|
808
|
+
let diffFromInitial = totalHeight - visualViewportHeight;
|
|
809
|
+
const drawerHeight = drawerRef.current.getBoundingClientRect().height || 0;
|
|
810
|
+
const isTallEnough = drawerHeight > totalHeight * .8;
|
|
811
|
+
if (!initialDrawerHeight.current) initialDrawerHeight.current = drawerHeight;
|
|
812
|
+
const offsetFromTop = drawerRef.current.getBoundingClientRect().top;
|
|
813
|
+
if (Math.abs(previousDiffFromInitial.current - diffFromInitial) > 60) keyboardIsOpen.current = !keyboardIsOpen.current;
|
|
814
|
+
if (snapPoints && snapPoints.length > 0 && snapPointsOffset && activeSnapPointIndex) {
|
|
815
|
+
const activeSnapPointHeight = snapPointsOffset[activeSnapPointIndex] || 0;
|
|
816
|
+
diffFromInitial += activeSnapPointHeight;
|
|
817
|
+
}
|
|
818
|
+
previousDiffFromInitial.current = diffFromInitial;
|
|
819
|
+
if (drawerHeight > visualViewportHeight || keyboardIsOpen.current) {
|
|
820
|
+
const height = drawerRef.current.getBoundingClientRect().height;
|
|
821
|
+
let newDrawerHeight = height;
|
|
822
|
+
if (height > visualViewportHeight) newDrawerHeight = visualViewportHeight - (isTallEnough ? offsetFromTop : WINDOW_TOP_OFFSET);
|
|
823
|
+
if (fixed) drawerRef.current.style.height = `${height - Math.max(diffFromInitial, 0)}px`;
|
|
824
|
+
else drawerRef.current.style.height = `${Math.max(newDrawerHeight, visualViewportHeight - offsetFromTop)}px`;
|
|
825
|
+
} else if (!isMobileFirefox()) drawerRef.current.style.height = `${initialDrawerHeight.current}px`;
|
|
826
|
+
if (snapPoints && snapPoints.length > 0 && !keyboardIsOpen.current) drawerRef.current.style.bottom = `0px`;
|
|
827
|
+
else drawerRef.current.style.bottom = `${Math.max(diffFromInitial, 0)}px`;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
(_window_visualViewport = window.visualViewport) == null || _window_visualViewport.addEventListener("resize", onVisualViewportChange);
|
|
831
|
+
return () => {
|
|
832
|
+
var _window_visualViewport;
|
|
833
|
+
return (_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.removeEventListener("resize", onVisualViewportChange);
|
|
834
|
+
};
|
|
835
|
+
}, [
|
|
836
|
+
activeSnapPointIndex,
|
|
837
|
+
snapPoints,
|
|
838
|
+
snapPointsOffset
|
|
839
|
+
]);
|
|
840
|
+
function closeDrawer(fromWithin) {
|
|
841
|
+
cancelDrag();
|
|
842
|
+
onClose?.();
|
|
843
|
+
if (!fromWithin) setIsOpen(false);
|
|
844
|
+
setTimeout(() => {
|
|
845
|
+
if (snapPoints) setActiveSnapPoint(snapPoints[0]);
|
|
846
|
+
}, TRANSITIONS.DURATION * 1e3);
|
|
847
|
+
}
|
|
848
|
+
function resetDrawer() {
|
|
849
|
+
if (!drawerRef.current) return;
|
|
850
|
+
const wrapper = document.querySelector("[data-vaul-drawer-wrapper]");
|
|
851
|
+
const currentSwipeAmount = getTranslate(drawerRef.current, direction);
|
|
852
|
+
set(drawerRef.current, {
|
|
853
|
+
transform: "translate3d(0, 0, 0)",
|
|
854
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
|
855
|
+
});
|
|
856
|
+
set(overlayRef.current, {
|
|
857
|
+
transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
|
858
|
+
opacity: "1"
|
|
859
|
+
});
|
|
860
|
+
if (shouldScaleBackground && currentSwipeAmount && currentSwipeAmount > 0 && isOpen) set(wrapper, {
|
|
861
|
+
borderRadius: `${BORDER_RADIUS}px`,
|
|
862
|
+
overflow: "hidden",
|
|
863
|
+
...isVertical(direction) ? {
|
|
864
|
+
transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
865
|
+
transformOrigin: "top"
|
|
866
|
+
} : {
|
|
867
|
+
transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
868
|
+
transformOrigin: "left"
|
|
869
|
+
},
|
|
870
|
+
transitionProperty: "transform, border-radius",
|
|
871
|
+
transitionDuration: `${TRANSITIONS.DURATION}s`,
|
|
872
|
+
transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(",")})`
|
|
873
|
+
}, true);
|
|
874
|
+
}
|
|
875
|
+
function cancelDrag() {
|
|
876
|
+
if (!isDragging || !drawerRef.current) return;
|
|
877
|
+
drawerRef.current.classList.remove(DRAG_CLASS);
|
|
878
|
+
isAllowedToDrag.current = false;
|
|
879
|
+
setIsDragging(false);
|
|
880
|
+
dragEndTime.current = /* @__PURE__ */ new Date();
|
|
881
|
+
}
|
|
882
|
+
function onRelease(event) {
|
|
883
|
+
if (!isDragging || !drawerRef.current) return;
|
|
884
|
+
drawerRef.current.classList.remove(DRAG_CLASS);
|
|
885
|
+
isAllowedToDrag.current = false;
|
|
886
|
+
setIsDragging(false);
|
|
887
|
+
dragEndTime.current = /* @__PURE__ */ new Date();
|
|
888
|
+
const swipeAmount = getTranslate(drawerRef.current, direction);
|
|
889
|
+
if (!event || !shouldDrag(event.target, false) || !swipeAmount || Number.isNaN(swipeAmount)) return;
|
|
890
|
+
if (dragStartTime.current === null) return;
|
|
891
|
+
const timeTaken = dragEndTime.current.getTime() - dragStartTime.current.getTime();
|
|
892
|
+
const distMoved = pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX);
|
|
893
|
+
const velocity = Math.abs(distMoved) / timeTaken;
|
|
894
|
+
if (velocity > .05) {
|
|
895
|
+
setJustReleased(true);
|
|
896
|
+
setTimeout(() => {
|
|
897
|
+
setJustReleased(false);
|
|
898
|
+
}, 200);
|
|
899
|
+
}
|
|
900
|
+
if (snapPoints) {
|
|
901
|
+
onReleaseSnapPoints({
|
|
902
|
+
draggedDistance: distMoved * (direction === "bottom" || direction === "right" ? 1 : -1),
|
|
903
|
+
closeDrawer,
|
|
904
|
+
velocity,
|
|
905
|
+
dismissible
|
|
906
|
+
});
|
|
907
|
+
onReleaseProp?.(event, true);
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
if (direction === "bottom" || direction === "right" ? distMoved > 0 : distMoved < 0) {
|
|
911
|
+
resetDrawer();
|
|
912
|
+
onReleaseProp?.(event, true);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
if (velocity > VELOCITY_THRESHOLD) {
|
|
916
|
+
closeDrawer();
|
|
917
|
+
onReleaseProp?.(event, false);
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
var _drawerRef_current_getBoundingClientRect_height;
|
|
921
|
+
const visibleDrawerHeight = Math.min((_drawerRef_current_getBoundingClientRect_height = drawerRef.current.getBoundingClientRect().height) != null ? _drawerRef_current_getBoundingClientRect_height : 0, window.innerHeight);
|
|
922
|
+
var _drawerRef_current_getBoundingClientRect_width;
|
|
923
|
+
const visibleDrawerWidth = Math.min((_drawerRef_current_getBoundingClientRect_width = drawerRef.current.getBoundingClientRect().width) != null ? _drawerRef_current_getBoundingClientRect_width : 0, window.innerWidth);
|
|
924
|
+
if (Math.abs(swipeAmount) >= (direction === "left" || direction === "right" ? visibleDrawerWidth : visibleDrawerHeight) * closeThreshold) {
|
|
925
|
+
closeDrawer();
|
|
926
|
+
onReleaseProp?.(event, false);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
onReleaseProp?.(event, true);
|
|
930
|
+
resetDrawer();
|
|
931
|
+
}
|
|
932
|
+
react$1.default.useEffect(() => {
|
|
933
|
+
if (isOpen) {
|
|
934
|
+
set(document.documentElement, { scrollBehavior: "auto" });
|
|
935
|
+
openTime.current = /* @__PURE__ */ new Date();
|
|
936
|
+
}
|
|
937
|
+
return () => {
|
|
938
|
+
reset(document.documentElement, "scrollBehavior");
|
|
939
|
+
};
|
|
940
|
+
}, [isOpen]);
|
|
941
|
+
function onNestedOpenChange(o) {
|
|
942
|
+
const scale = o ? (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth : 1;
|
|
943
|
+
const initialTranslate = o ? -16 : 0;
|
|
944
|
+
if (nestedOpenChangeTimer.current) window.clearTimeout(nestedOpenChangeTimer.current);
|
|
945
|
+
set(drawerRef.current, {
|
|
946
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
|
947
|
+
transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${initialTranslate}px, 0)` : `scale(${scale}) translate3d(${initialTranslate}px, 0, 0)`
|
|
948
|
+
});
|
|
949
|
+
if (!o && drawerRef.current) nestedOpenChangeTimer.current = setTimeout(() => {
|
|
950
|
+
const translateValue = getTranslate(drawerRef.current, direction);
|
|
951
|
+
set(drawerRef.current, {
|
|
952
|
+
transition: "none",
|
|
953
|
+
transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
|
|
954
|
+
});
|
|
955
|
+
}, 500);
|
|
956
|
+
}
|
|
957
|
+
function onNestedDrag(_event, percentageDragged) {
|
|
958
|
+
if (percentageDragged < 0) return;
|
|
959
|
+
const initialScale = (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth;
|
|
960
|
+
const newScale = initialScale + percentageDragged * (1 - initialScale);
|
|
961
|
+
const newTranslate = -16 + percentageDragged * NESTED_DISPLACEMENT;
|
|
962
|
+
set(drawerRef.current, {
|
|
963
|
+
transform: isVertical(direction) ? `scale(${newScale}) translate3d(0, ${newTranslate}px, 0)` : `scale(${newScale}) translate3d(${newTranslate}px, 0, 0)`,
|
|
964
|
+
transition: "none"
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
function onNestedRelease(_event, o) {
|
|
968
|
+
const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;
|
|
969
|
+
const scale = o ? (dim - NESTED_DISPLACEMENT) / dim : 1;
|
|
970
|
+
const translate = o ? -16 : 0;
|
|
971
|
+
if (o) set(drawerRef.current, {
|
|
972
|
+
transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
|
|
973
|
+
transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${translate}px, 0)` : `scale(${scale}) translate3d(${translate}px, 0, 0)`
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
react$1.default.useEffect(() => {
|
|
977
|
+
if (!modal) window.requestAnimationFrame(() => {
|
|
978
|
+
document.body.style.pointerEvents = "auto";
|
|
979
|
+
});
|
|
980
|
+
}, [modal]);
|
|
981
|
+
return /*#__PURE__*/ react$1.default.createElement(_radix_ui_react_dialog.Root, {
|
|
982
|
+
defaultOpen,
|
|
983
|
+
onOpenChange: (open) => {
|
|
984
|
+
if (!dismissible && !open) return;
|
|
985
|
+
if (open) setHasBeenOpened(true);
|
|
986
|
+
else closeDrawer(true);
|
|
987
|
+
setIsOpen(open);
|
|
988
|
+
},
|
|
989
|
+
open: isOpen
|
|
990
|
+
}, /*#__PURE__*/ react$1.default.createElement(DrawerContext.Provider, { value: {
|
|
991
|
+
activeSnapPoint,
|
|
992
|
+
snapPoints,
|
|
993
|
+
setActiveSnapPoint,
|
|
994
|
+
drawerRef,
|
|
995
|
+
overlayRef,
|
|
996
|
+
onOpenChange,
|
|
997
|
+
onPress,
|
|
998
|
+
onRelease,
|
|
999
|
+
onDrag,
|
|
1000
|
+
dismissible,
|
|
1001
|
+
shouldAnimate,
|
|
1002
|
+
handleOnly,
|
|
1003
|
+
isOpen,
|
|
1004
|
+
isDragging,
|
|
1005
|
+
shouldFade,
|
|
1006
|
+
closeDrawer,
|
|
1007
|
+
onNestedDrag,
|
|
1008
|
+
onNestedOpenChange,
|
|
1009
|
+
onNestedRelease,
|
|
1010
|
+
keyboardIsOpen,
|
|
1011
|
+
modal,
|
|
1012
|
+
snapPointsOffset,
|
|
1013
|
+
activeSnapPointIndex,
|
|
1014
|
+
direction,
|
|
1015
|
+
shouldScaleBackground,
|
|
1016
|
+
setBackgroundColorOnScale,
|
|
1017
|
+
noBodyStyles,
|
|
1018
|
+
container,
|
|
1019
|
+
autoFocus
|
|
1020
|
+
} }, children));
|
|
1021
|
+
}
|
|
1022
|
+
var Overlay = /*#__PURE__*/ react$1.default.forwardRef(function({ ...rest }, ref) {
|
|
1023
|
+
const { overlayRef, snapPoints, onRelease, shouldFade, isOpen, modal, shouldAnimate } = useDrawerContext();
|
|
1024
|
+
const composedRef = useComposedRefs(ref, overlayRef);
|
|
1025
|
+
const hasSnapPoints = snapPoints && snapPoints.length > 0;
|
|
1026
|
+
if (!modal) return null;
|
|
1027
|
+
const onMouseUp = react$1.default.useCallback((event) => onRelease(event), [onRelease]);
|
|
1028
|
+
return /*#__PURE__*/ react$1.default.createElement(_radix_ui_react_dialog.Overlay, {
|
|
1029
|
+
onMouseUp,
|
|
1030
|
+
ref: composedRef,
|
|
1031
|
+
"data-vaul-overlay": "",
|
|
1032
|
+
"data-vaul-snap-points": isOpen && hasSnapPoints ? "true" : "false",
|
|
1033
|
+
"data-vaul-snap-points-overlay": isOpen && shouldFade ? "true" : "false",
|
|
1034
|
+
"data-vaul-animate": (shouldAnimate == null ? void 0 : shouldAnimate.current) ? "true" : "false",
|
|
1035
|
+
...rest
|
|
1036
|
+
});
|
|
1037
|
+
});
|
|
1038
|
+
Overlay.displayName = "Drawer.Overlay";
|
|
1039
|
+
var Content = /*#__PURE__*/ react$1.default.forwardRef(function({ onPointerDownOutside, style, onOpenAutoFocus, ...rest }, ref) {
|
|
1040
|
+
const { drawerRef, onPress, onRelease, onDrag, keyboardIsOpen, snapPointsOffset, activeSnapPointIndex, modal, isOpen, direction, snapPoints, container, handleOnly, shouldAnimate, autoFocus } = useDrawerContext();
|
|
1041
|
+
const [delayedSnapPoints, setDelayedSnapPoints] = react$1.default.useState(false);
|
|
1042
|
+
const composedRef = useComposedRefs(ref, drawerRef);
|
|
1043
|
+
const pointerStartRef = react$1.default.useRef(null);
|
|
1044
|
+
const lastKnownPointerEventRef = react$1.default.useRef(null);
|
|
1045
|
+
const wasBeyondThePointRef = react$1.default.useRef(false);
|
|
1046
|
+
const hasSnapPoints = snapPoints && snapPoints.length > 0;
|
|
1047
|
+
useScaleBackground();
|
|
1048
|
+
const isDeltaInDirection = (delta, direction, threshold = 0) => {
|
|
1049
|
+
if (wasBeyondThePointRef.current) return true;
|
|
1050
|
+
const deltaY = Math.abs(delta.y);
|
|
1051
|
+
const deltaX = Math.abs(delta.x);
|
|
1052
|
+
const isDeltaX = deltaX > deltaY;
|
|
1053
|
+
const dFactor = ["bottom", "right"].includes(direction) ? 1 : -1;
|
|
1054
|
+
if (direction === "left" || direction === "right") {
|
|
1055
|
+
if (!(delta.x * dFactor < 0) && deltaX >= 0 && deltaX <= threshold) return isDeltaX;
|
|
1056
|
+
} else if (!(delta.y * dFactor < 0) && deltaY >= 0 && deltaY <= threshold) return !isDeltaX;
|
|
1057
|
+
wasBeyondThePointRef.current = true;
|
|
1058
|
+
return true;
|
|
1059
|
+
};
|
|
1060
|
+
react$1.default.useEffect(() => {
|
|
1061
|
+
if (hasSnapPoints) window.requestAnimationFrame(() => {
|
|
1062
|
+
setDelayedSnapPoints(true);
|
|
1063
|
+
});
|
|
1064
|
+
}, []);
|
|
1065
|
+
function handleOnPointerUp(event) {
|
|
1066
|
+
pointerStartRef.current = null;
|
|
1067
|
+
wasBeyondThePointRef.current = false;
|
|
1068
|
+
onRelease(event);
|
|
1069
|
+
}
|
|
1070
|
+
return /*#__PURE__*/ react$1.default.createElement(_radix_ui_react_dialog.Content, {
|
|
1071
|
+
"data-vaul-drawer-direction": direction,
|
|
1072
|
+
"data-vaul-drawer": "",
|
|
1073
|
+
"data-vaul-delayed-snap-points": delayedSnapPoints ? "true" : "false",
|
|
1074
|
+
"data-vaul-snap-points": isOpen && hasSnapPoints ? "true" : "false",
|
|
1075
|
+
"data-vaul-custom-container": container ? "true" : "false",
|
|
1076
|
+
"data-vaul-animate": (shouldAnimate == null ? void 0 : shouldAnimate.current) ? "true" : "false",
|
|
1077
|
+
...rest,
|
|
1078
|
+
ref: composedRef,
|
|
1079
|
+
style: snapPointsOffset && snapPointsOffset.length > 0 ? {
|
|
1080
|
+
"--snap-point-height": `${snapPointsOffset[activeSnapPointIndex != null ? activeSnapPointIndex : 0]}px`,
|
|
1081
|
+
...style
|
|
1082
|
+
} : style,
|
|
1083
|
+
onPointerDown: (event) => {
|
|
1084
|
+
if (handleOnly) return;
|
|
1085
|
+
rest.onPointerDown == null || rest.onPointerDown.call(rest, event);
|
|
1086
|
+
pointerStartRef.current = {
|
|
1087
|
+
x: event.pageX,
|
|
1088
|
+
y: event.pageY
|
|
1089
|
+
};
|
|
1090
|
+
onPress(event);
|
|
1091
|
+
},
|
|
1092
|
+
onOpenAutoFocus: (e) => {
|
|
1093
|
+
onOpenAutoFocus?.(e);
|
|
1094
|
+
if (!autoFocus) e.preventDefault();
|
|
1095
|
+
},
|
|
1096
|
+
onPointerDownOutside: (e) => {
|
|
1097
|
+
onPointerDownOutside?.(e);
|
|
1098
|
+
if (!modal || e.defaultPrevented) {
|
|
1099
|
+
e.preventDefault();
|
|
1100
|
+
return;
|
|
1101
|
+
}
|
|
1102
|
+
if (keyboardIsOpen.current) keyboardIsOpen.current = false;
|
|
1103
|
+
},
|
|
1104
|
+
onFocusOutside: (e) => {
|
|
1105
|
+
if (!modal) {
|
|
1106
|
+
e.preventDefault();
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
onPointerMove: (event) => {
|
|
1111
|
+
lastKnownPointerEventRef.current = event;
|
|
1112
|
+
if (handleOnly) return;
|
|
1113
|
+
rest.onPointerMove == null || rest.onPointerMove.call(rest, event);
|
|
1114
|
+
if (!pointerStartRef.current) return;
|
|
1115
|
+
const yPosition = event.pageY - pointerStartRef.current.y;
|
|
1116
|
+
const xPosition = event.pageX - pointerStartRef.current.x;
|
|
1117
|
+
const swipeStartThreshold = event.pointerType === "touch" ? 10 : 2;
|
|
1118
|
+
if (isDeltaInDirection({
|
|
1119
|
+
x: xPosition,
|
|
1120
|
+
y: yPosition
|
|
1121
|
+
}, direction, swipeStartThreshold)) onDrag(event);
|
|
1122
|
+
else if (Math.abs(xPosition) > swipeStartThreshold || Math.abs(yPosition) > swipeStartThreshold) pointerStartRef.current = null;
|
|
1123
|
+
},
|
|
1124
|
+
onPointerUp: (event) => {
|
|
1125
|
+
rest.onPointerUp == null || rest.onPointerUp.call(rest, event);
|
|
1126
|
+
pointerStartRef.current = null;
|
|
1127
|
+
wasBeyondThePointRef.current = false;
|
|
1128
|
+
onRelease(event);
|
|
1129
|
+
},
|
|
1130
|
+
onPointerOut: (event) => {
|
|
1131
|
+
rest.onPointerOut == null || rest.onPointerOut.call(rest, event);
|
|
1132
|
+
handleOnPointerUp(lastKnownPointerEventRef.current);
|
|
1133
|
+
},
|
|
1134
|
+
onContextMenu: (event) => {
|
|
1135
|
+
rest.onContextMenu == null || rest.onContextMenu.call(rest, event);
|
|
1136
|
+
if (lastKnownPointerEventRef.current) handleOnPointerUp(lastKnownPointerEventRef.current);
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
});
|
|
1140
|
+
Content.displayName = "Drawer.Content";
|
|
1141
|
+
var LONG_HANDLE_PRESS_TIMEOUT = 250;
|
|
1142
|
+
var DOUBLE_TAP_TIMEOUT = 120;
|
|
1143
|
+
var Handle = /*#__PURE__*/ react$1.default.forwardRef(function({ preventCycle = false, children, ...rest }, ref) {
|
|
1144
|
+
const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag } = useDrawerContext();
|
|
1145
|
+
const closeTimeoutIdRef = react$1.default.useRef(null);
|
|
1146
|
+
const shouldCancelInteractionRef = react$1.default.useRef(false);
|
|
1147
|
+
function handleStartCycle() {
|
|
1148
|
+
if (shouldCancelInteractionRef.current) {
|
|
1149
|
+
handleCancelInteraction();
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
window.setTimeout(() => {
|
|
1153
|
+
handleCycleSnapPoints();
|
|
1154
|
+
}, DOUBLE_TAP_TIMEOUT);
|
|
1155
|
+
}
|
|
1156
|
+
function handleCycleSnapPoints() {
|
|
1157
|
+
if (isDragging || preventCycle || shouldCancelInteractionRef.current) {
|
|
1158
|
+
handleCancelInteraction();
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
handleCancelInteraction();
|
|
1162
|
+
if (!snapPoints || snapPoints.length === 0) {
|
|
1163
|
+
if (!dismissible) closeDrawer();
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
if (activeSnapPoint === snapPoints[snapPoints.length - 1] && dismissible) {
|
|
1167
|
+
closeDrawer();
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
const currentSnapIndex = snapPoints.findIndex((point) => point === activeSnapPoint);
|
|
1171
|
+
if (currentSnapIndex === -1) return;
|
|
1172
|
+
const nextSnapPoint = snapPoints[currentSnapIndex + 1];
|
|
1173
|
+
setActiveSnapPoint(nextSnapPoint);
|
|
1174
|
+
}
|
|
1175
|
+
function handleStartInteraction() {
|
|
1176
|
+
closeTimeoutIdRef.current = window.setTimeout(() => {
|
|
1177
|
+
shouldCancelInteractionRef.current = true;
|
|
1178
|
+
}, LONG_HANDLE_PRESS_TIMEOUT);
|
|
1179
|
+
}
|
|
1180
|
+
function handleCancelInteraction() {
|
|
1181
|
+
if (closeTimeoutIdRef.current) window.clearTimeout(closeTimeoutIdRef.current);
|
|
1182
|
+
shouldCancelInteractionRef.current = false;
|
|
1183
|
+
}
|
|
1184
|
+
return /*#__PURE__*/ react$1.default.createElement("div", {
|
|
1185
|
+
onClick: handleStartCycle,
|
|
1186
|
+
onPointerCancel: handleCancelInteraction,
|
|
1187
|
+
onPointerDown: (e) => {
|
|
1188
|
+
if (handleOnly) onPress(e);
|
|
1189
|
+
handleStartInteraction();
|
|
1190
|
+
},
|
|
1191
|
+
onPointerMove: (e) => {
|
|
1192
|
+
if (handleOnly) onDrag(e);
|
|
1193
|
+
},
|
|
1194
|
+
ref,
|
|
1195
|
+
"data-vaul-drawer-visible": isOpen ? "true" : "false",
|
|
1196
|
+
"data-vaul-handle": "",
|
|
1197
|
+
"aria-hidden": "true",
|
|
1198
|
+
...rest
|
|
1199
|
+
}, /*#__PURE__*/ react$1.default.createElement("span", {
|
|
1200
|
+
"data-vaul-handle-hitarea": "",
|
|
1201
|
+
"aria-hidden": "true"
|
|
1202
|
+
}, children));
|
|
1203
|
+
});
|
|
1204
|
+
Handle.displayName = "Drawer.Handle";
|
|
1205
|
+
function NestedRoot({ onDrag, onOpenChange, open: nestedIsOpen, ...rest }) {
|
|
1206
|
+
const { onNestedDrag, onNestedOpenChange, onNestedRelease } = useDrawerContext();
|
|
1207
|
+
if (!onNestedDrag) throw new Error("Drawer.NestedRoot must be placed in another drawer");
|
|
1208
|
+
return /*#__PURE__*/ react$1.default.createElement(Root, {
|
|
1209
|
+
nested: true,
|
|
1210
|
+
open: nestedIsOpen,
|
|
1211
|
+
onClose: () => {
|
|
1212
|
+
onNestedOpenChange(false);
|
|
1213
|
+
},
|
|
1214
|
+
onDrag: (e, p) => {
|
|
1215
|
+
onNestedDrag(e, p);
|
|
1216
|
+
onDrag?.(e, p);
|
|
1217
|
+
},
|
|
1218
|
+
onOpenChange: (o) => {
|
|
1219
|
+
if (o) onNestedOpenChange(o);
|
|
1220
|
+
onOpenChange?.(o);
|
|
1221
|
+
},
|
|
1222
|
+
onRelease: onNestedRelease,
|
|
1223
|
+
...rest
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
function Portal(props) {
|
|
1227
|
+
const context = useDrawerContext();
|
|
1228
|
+
const { container = context.container, ...portalProps } = props;
|
|
1229
|
+
return /*#__PURE__*/ react$1.default.createElement(_radix_ui_react_dialog.Portal, {
|
|
1230
|
+
container,
|
|
1231
|
+
...portalProps
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
var Drawer = {
|
|
1235
|
+
Root,
|
|
1236
|
+
NestedRoot,
|
|
1237
|
+
Content,
|
|
1238
|
+
Overlay,
|
|
1239
|
+
Trigger: _radix_ui_react_dialog.Trigger,
|
|
1240
|
+
Portal,
|
|
1241
|
+
Handle,
|
|
1242
|
+
Close: _radix_ui_react_dialog.Close,
|
|
1243
|
+
Title: _radix_ui_react_dialog.Title,
|
|
1244
|
+
Description: _radix_ui_react_dialog.Description
|
|
1245
|
+
};
|
|
1246
|
+
exports.Content = Content;
|
|
1247
|
+
exports.Drawer = Drawer;
|
|
1248
|
+
exports.Handle = Handle;
|
|
1249
|
+
exports.NestedRoot = NestedRoot;
|
|
1250
|
+
exports.Overlay = Overlay;
|
|
1251
|
+
exports.Portal = Portal;
|
|
1252
|
+
exports.Root = Root;
|