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