@vlrc-fe/components 3.0.3 → 3.0.5
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 +29 -0
- package/README.md +10 -1
- package/bin/registry.mjs +1124 -0
- package/bin/vlrc.mjs +102 -7
- package/dist/ConfirmModal.cjs +268 -1
- package/dist/ConfirmModal.d.ts +5 -21
- package/dist/ConfirmModal.d.ts.map +1 -1
- package/dist/ConfirmModal.js +120 -111
- package/dist/DataTable/DataTable.cjs +203 -1
- package/dist/DataTable/DataTable.js +161 -120
- package/dist/DataTable/components/DataTableColumnHeader.cjs +214 -1
- package/dist/DataTable/components/DataTableColumnHeader.d.ts +3 -3
- package/dist/DataTable/components/DataTableColumnHeader.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableColumnHeader.js +201 -103
- package/dist/DataTable/components/DataTableFacetedFilter.cjs +332 -1
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts +3 -3
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableFacetedFilter.js +285 -181
- package/dist/DataTable/components/DataTablePagination.cjs +200 -1
- package/dist/DataTable/components/DataTablePagination.js +188 -91
- package/dist/DataTable/components/DataTableRowActions.cjs +172 -1
- package/dist/DataTable/components/DataTableRowActions.js +161 -62
- package/dist/DataTable/components/DataTableTable.cjs +100 -1
- package/dist/DataTable/components/DataTableTable.js +87 -35
- package/dist/DataTable/components/DataTableToolbar.cjs +112 -1
- package/dist/DataTable/components/DataTableToolbar.js +106 -44
- package/dist/DataTable/components/DataTableViewOptions.cjs +113 -1
- package/dist/DataTable/components/DataTableViewOptions.js +105 -44
- package/dist/DataTable/render/createColumns.cjs +84 -1
- package/dist/DataTable/render/createColumns.js +65 -44
- package/dist/DataTable/render/defaults.cjs +38 -1
- package/dist/DataTable/render/defaults.js +18 -13
- package/dist/Dropdown/Dropdown.cjs +255 -1
- package/dist/Dropdown/Dropdown.js +138 -108
- package/dist/Form/Form.cjs +439 -1
- package/dist/Form/Form.js +417 -206
- package/dist/Form/FormDatePicker/FormDatePicker.cjs +84 -1
- package/dist/Form/FormDatePicker/FormDatePicker.js +68 -65
- package/dist/Form/FormDatePicker/MonthPickerPanel.cjs +217 -1
- package/dist/Form/FormDatePicker/MonthPickerPanel.js +194 -101
- package/dist/Form/FormDatePicker/RangeDatePicker.cjs +144 -1
- package/dist/Form/FormDatePicker/RangeDatePicker.js +94 -77
- package/dist/Form/FormDatePicker/SingleDatePicker.cjs +191 -1
- package/dist/Form/FormDatePicker/SingleDatePicker.js +144 -114
- package/dist/Form/FormDatePicker/TimeInput.cjs +172 -1
- package/dist/Form/FormDatePicker/TimeInput.js +162 -79
- package/dist/Form/FormDatePicker/TimePicker.cjs +107 -1
- package/dist/Form/FormDatePicker/TimePicker.js +58 -43
- package/dist/Form/FormDatePicker/YearPickerPanel.cjs +184 -1
- package/dist/Form/FormDatePicker/YearPickerPanel.js +164 -84
- package/dist/Form/FormDatePicker/types.cjs +10 -1
- package/dist/Form/FormDatePicker/types.js +8 -3
- package/dist/Form/FormDatePicker/useFormDatePicker.cjs +70 -1
- package/dist/Form/FormDatePicker/useFormDatePicker.js +58 -31
- package/dist/Form/FormFileUpload/FileUpload.cjs +603 -1
- package/dist/Form/FormFileUpload/FileUpload.js +452 -306
- package/dist/Form/FormFileUpload/index.cjs +175 -1
- package/dist/Form/FormFileUpload/index.js +164 -50
- package/dist/Form/FormMultiSelect/FormMultiSelect.cjs +46 -1
- package/dist/Form/FormMultiSelect/FormMultiSelect.js +42 -22
- package/dist/Form/FormNumberInput/FormNumberInput.cjs +71 -1
- package/dist/Form/FormNumberInput/FormNumberInput.js +60 -58
- package/dist/Form/FormNumberInput/StepperControls.cjs +104 -1
- package/dist/Form/FormNumberInput/StepperControls.js +78 -43
- package/dist/Form/FormNumberInput/useFormNumberInput.cjs +72 -1
- package/dist/Form/FormNumberInput/useFormNumberInput.js +68 -39
- package/dist/Form/FormRadioGroup/FormRadio.cjs +65 -1
- package/dist/Form/FormRadioGroup/FormRadio.js +38 -38
- package/dist/Form/FormRadioGroup/useFormRadio.cjs +38 -1
- package/dist/Form/FormRadioGroup/useFormRadio.js +27 -16
- package/dist/Form/FormSelect/FormSelect.cjs +46 -1
- package/dist/Form/FormSelect/FormSelect.js +40 -26
- package/dist/Form/FormSelect/useFormSelect.cjs +58 -1
- package/dist/Form/FormSelect/useFormSelect.js +52 -43
- package/dist/Icons/Icons.cjs +155 -1
- package/dist/Icons/Icons.js +142 -142
- package/dist/Modal.cjs +131 -1
- package/dist/Modal.d.ts +2 -14
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +63 -54
- package/dist/MultiSelect/MultiSelect.cjs +210 -1
- package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/MultiSelect/MultiSelect.js +126 -117
- package/dist/MultiSelect/renderers.cjs +571 -1
- package/dist/MultiSelect/renderers.js +508 -309
- package/dist/MultiSelect/useMultiSelect.cjs +244 -1
- package/dist/MultiSelect/useMultiSelect.d.ts.map +1 -1
- package/dist/MultiSelect/useMultiSelect.js +208 -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 +139 -1
- package/dist/Typography/Link.d.ts +1 -2
- package/dist/Typography/Link.d.ts.map +1 -1
- package/dist/Typography/Link.js +73 -64
- package/dist/Typography/Paragraph.cjs +224 -1
- package/dist/Typography/Paragraph.d.ts +1 -2
- package/dist/Typography/Paragraph.d.ts.map +1 -1
- package/dist/Typography/Paragraph.js +118 -108
- package/dist/Typography/Text.cjs +223 -1
- package/dist/Typography/Text.d.ts +1 -2
- package/dist/Typography/Text.d.ts.map +1 -1
- package/dist/Typography/Text.js +117 -101
- 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 +126 -104
- package/dist/Typography/Typography.cjs +17 -1
- package/dist/Typography/Typography.d.ts +8 -4
- package/dist/Typography/Typography.d.ts.map +1 -1
- package/dist/Typography/Typography.js +14 -14
- package/dist/Typography/index.d.ts +1 -4
- package/dist/Typography/index.d.ts.map +1 -1
- package/dist/Typography/index.js +10 -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.d.ts +4 -0
- package/dist/Typography/types.d.ts.map +1 -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 +167 -9
- package/dist/astryx.cjs +9 -1
- package/dist/astryx.d.ts +0 -1
- package/dist/astryx.d.ts.map +1 -1
- package/dist/astryx.js +0 -1
- package/dist/index.cjs +779 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -118
- package/dist/layout/Box.cjs +180 -1
- package/dist/layout/Box.d.ts +6 -8
- package/dist/layout/Box.d.ts.map +1 -1
- package/dist/layout/Box.js +116 -50
- package/dist/layout/Center.cjs +40 -1
- package/dist/layout/Center.d.ts +3 -3
- package/dist/layout/Center.d.ts.map +1 -1
- package/dist/layout/Center.js +39 -21
- package/dist/layout/Container.cjs +92 -1
- package/dist/layout/Container.d.ts +6 -8
- package/dist/layout/Container.d.ts.map +1 -1
- package/dist/layout/Container.js +46 -31
- package/dist/layout/Stack.cjs +199 -1
- package/dist/layout/Stack.d.ts +9 -9
- package/dist/layout/Stack.d.ts.map +1 -1
- package/dist/layout/Stack.js +186 -79
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +9 -9
- package/dist/lazyLoad.cjs +13 -1
- package/dist/lazyLoad.d.ts.map +1 -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 +62 -1
- package/dist/theme/zIndex.d.ts +4 -4
- package/dist/theme/zIndex.d.ts.map +1 -1
- package/dist/theme/zIndex.js +44 -15
- package/dist/theme.css +167 -9
- 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 +24 -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 -13
- package/dist/ui/avatar.cjs +340 -1
- package/dist/ui/avatar.d.ts +10 -10
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +226 -115
- 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 +625 -1
- package/dist/ui/calendar.d.ts +5 -5
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/calendar.js +309 -193
- 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 +332 -1
- package/dist/ui/carousel.d.ts +10 -10
- package/dist/ui/carousel.d.ts.map +1 -1
- package/dist/ui/carousel.js +245 -127
- package/dist/ui/checkbox.cjs +163 -1
- package/dist/ui/checkbox.d.ts +4 -4
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +62 -58
- package/dist/ui/circular-progress.cjs +144 -1
- package/dist/ui/circular-progress.d.ts +5 -5
- package/dist/ui/circular-progress.d.ts.map +1 -1
- package/dist/ui/circular-progress.js +85 -67
- package/dist/ui/code-block.cjs +823 -0
- package/dist/ui/code-block.d.ts +89 -0
- package/dist/ui/code-block.d.ts.map +1 -0
- package/dist/ui/code-block.js +813 -0
- package/dist/ui/collapsible.cjs +64 -1
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +58 -29
- 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 +169 -1
- package/dist/ui/compare-slider.d.ts +8 -7
- package/dist/ui/compare-slider.d.ts.map +1 -1
- package/dist/ui/compare-slider.js +106 -73
- package/dist/ui/context-menu.cjs +810 -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 -229
- package/dist/ui/copy-button.cjs +93 -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 -45
- package/dist/ui/dialog.cjs +411 -1
- package/dist/ui/dialog.d.ts +18 -18
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +319 -131
- package/dist/ui/drawer.cjs +478 -1
- package/dist/ui/drawer.d.ts +17 -17
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +396 -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 +609 -1
- package/dist/ui/editable.d.ts +14 -14
- package/dist/ui/editable.d.ts.map +1 -1
- package/dist/ui/editable.js +479 -218
- package/dist/ui/empty.cjs +295 -1
- package/dist/ui/empty.d.ts +15 -15
- package/dist/ui/empty.d.ts.map +1 -1
- package/dist/ui/empty.js +267 -112
- 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 +1480 -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 -599
- package/dist/ui/flex.cjs +202 -1
- package/dist/ui/flex.d.ts +7 -6
- package/dist/ui/flex.d.ts.map +1 -1
- package/dist/ui/flex.js +111 -93
- package/dist/ui/form.cjs +453 -1
- package/dist/ui/form.d.ts +11 -11
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +421 -136
- package/dist/ui/gauge.cjs +125 -1
- package/dist/ui/gauge.d.ts +7 -6
- package/dist/ui/gauge.d.ts.map +1 -1
- package/dist/ui/gauge.js +60 -53
- package/dist/ui/grid.cjs +224 -1
- package/dist/ui/grid.d.ts +11 -7
- package/dist/ui/grid.d.ts.map +1 -1
- package/dist/ui/grid.js +126 -96
- package/dist/ui/hover-card.cjs +85 -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 -37
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-group.cjs +322 -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 +203 -107
- 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 +297 -0
- package/dist/ui/marker.d.ts +25 -0
- package/dist/ui/marker.d.ts.map +1 -0
- package/dist/ui/marker.js +293 -0
- package/dist/ui/masonry.cjs +56 -1
- package/dist/ui/masonry.d.ts +4 -4
- package/dist/ui/masonry.d.ts.map +1 -1
- package/dist/ui/masonry.js +40 -37
- package/dist/ui/menubar.cjs +907 -1
- package/dist/ui/menubar.d.ts +29 -29
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +737 -252
- 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 +34 -1
- package/dist/ui/progress.d.ts +3 -3
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +21 -18
- package/dist/ui/questionnaire.cjs +682 -0
- package/dist/ui/questionnaire.d.ts +111 -0
- package/dist/ui/questionnaire.d.ts.map +1 -0
- package/dist/ui/questionnaire.js +670 -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 +190 -1
- package/dist/ui/rating.d.ts +4 -3
- package/dist/ui/rating.d.ts.map +1 -1
- package/dist/ui/rating.js +96 -79
- package/dist/ui/resizable.cjs +174 -1
- package/dist/ui/resizable.d.ts +7 -7
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/resizable.js +150 -55
- 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 +508 -1
- package/dist/ui/row-col.d.ts +13 -11
- package/dist/ui/row-col.d.ts.map +1 -1
- package/dist/ui/row-col.js +238 -207
- package/dist/ui/scroll-area.cjs +129 -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 +92 -49
- package/dist/ui/segmented.cjs +169 -1
- package/dist/ui/segmented.d.ts +6 -5
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +75 -63
- 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 +462 -1
- package/dist/ui/sheet.d.ts +16 -16
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +331 -141
- package/dist/ui/sidebar.cjs +1452 -1
- package/dist/ui/sidebar.d.ts +48 -48
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +1057 -439
- package/dist/ui/signature-pad.cjs +741 -0
- package/dist/ui/signature-pad.d.ts +115 -0
- package/dist/ui/signature-pad.d.ts.map +1 -0
- package/dist/ui/signature-pad.js +731 -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 +320 -1
- package/dist/ui/stat.d.ts +15 -15
- package/dist/ui/stat.d.ts.map +1 -1
- package/dist/ui/stat.js +275 -148
- 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 +199 -1
- package/dist/ui/switch.d.ts +4 -4
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +79 -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 +4 -1
- package/dist/utils.d.ts +2 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -6
- package/package.json +10 -2
package/dist/ui/file-upload.cjs
CHANGED
|
@@ -1 +1,1480 @@
|
|
|
1
|
-
"use client";const e=require("../_virtual/_rolldown/runtime.cjs"),t=require("../Icons/Icons.cjs"),n=require("../Typography/Text.cjs"),r=require("./file-upload-adapters.cjs");let i=require("@stylexjs/stylex");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("react"),s=e.__toESM(o,1);o=e.__toESM(o);let c=require("react/compiler-runtime"),l=require("@radix-ui/react-slot");var u=`FileUpload`,d=`FileUploadDropzone`,f=`FileUploadTrigger`,p=`FileUploadList`,m=`FileUploadItem`,h=`FileUploadItemPreview`,g=`FileUploadItemMetadata`,_=`FileUploadItemProgress`,v=`FileUploadItemDelete`,y={root:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x8233eu`,kzqmXN:`xh8yej3`,$$css:!0},dropzone:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kOIVth:`x13z6uf9`,kaIpWk:`x1ez7q3a`,kMzoRj:`xdh2fpr`,ksu8eU:`xbsl7fq`,kVAM5u:`xb30jbz`,kWkggS:`x1mlyrtw`,kmVPX3:`xis3749`,kkrTdU:`x1ypdohk`,kfSwDN:`x87ps6o`,k1ekBW:`x11vqxbs`,kIyJzY:`x13dflua`,kI3sdo:`x1a2a7pz`,kGzVvX:`x9p52ec`,kaVNsj:`x14aqmuz`,kOJeXU:`x156qtes`,kEtg5x:`xik21o4`,$$css:!0},dropzoneDragging:{kWkggS:`x1jgryid`,kVAM5u:`x1khvrlk`,kGVxlE:`xf0oo4t`,$$css:!0},dropzoneInvalid:{kVAM5u:`x1uwefn5`,kWkggS:`x6lw6w7`,kGVxlE:`x1r3qo2b`,$$css:!0},dropzoneDisabled:{kfzvcC:`x47corl`,kSiTet:`xbyyjgo`,kkrTdU:`x1h6gzvc`,$$css:!0},avatarDropzone:{kVAEAm:`x1n2onr6`,kzqmXN:`x1eyvef`,kZKoxP:`xw76nk8`,kaIpWk:`x9psvww`,kMzoRj:`xdh2fpr`,ksu8eU:`xbsl7fq`,kVAM5u:`xb30jbz`,kWkggS:`x1mlyrtw`,kVQacm:`xb3r6kr`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kkrTdU:`x1ypdohk`,k1ekBW:`xq90yva`,kIyJzY:`x13dflua`,kmVPX3:`x1717udv`,kaVNsj:`x14aqmuz`,$$css:!0},avatarItem:{kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,$$css:!0},avatarPreview:{kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kaIpWk:`x9psvww`,$$css:!0},list:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x13z6uf9`,kzqmXN:`xh8yej3`,$$css:!0},listHorizontal:{kXwgrk:`x1q0g3np`,kwnvtZ:`x1a02dak`,$$css:!0},item:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x8233eu`,kaIpWk:`xrijj7p`,kMzoRj:`xmkeg23`,ksu8eU:`x1y0btm7`,kVAM5u:`xb30jbz`,kWkggS:`x1rexohn`,kMwMTN:`xk0jn7w`,kmVPX3:`x2nx7ib`,kVQacm:`xb3r6kr`,k1ekBW:`xq90yva`,kIyJzY:`xx6bhzk`,$$css:!0},itemPreview:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kzqmXN:`xvm51jw`,kZKoxP:`xwaiz5r`,k7Eaqz:`xj9j1fp`,kaIpWk:`xqfady0`,kWkggS:`x1qry0bl`,kMwMTN:`xw3nh4a`,kVQacm:`xb3r6kr`,$$css:!0},itemMetadata:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kUk6DE:`x98rzlu`,k7Eaqz:`xeuugli`,kOIVth:`x1enigpx`,$$css:!0},itemName:{kGuDYH:`xkpwil5`,k63SB2:`xk50ysn`,kMwMTN:`x84br7x`,kVQacm:`xb3r6kr`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,$$css:!0},itemSize:{kGuDYH:`xboafo0`,kMwMTN:`xw3nh4a`,$$css:!0},itemError:{kGuDYH:`xboafo0`,kMwMTN:`xuuroe4`,$$css:!0},itemDeleteBtn:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kzqmXN:`xh29eag`,kZKoxP:`xb8l8e1`,kaIpWk:`xqfady0`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,kMwMTN:`xw3nh4a`,kkrTdU:`x1ypdohk`,kmVPX3:`x1717udv`,k1ekBW:`xs2xxs2`,kIyJzY:`xx6bhzk`,kGzVvX:`x9p52ec`,kDPRdz:`x1mqvv6a`,$$css:!0},progressRoot:{kVAEAm:`x1n2onr6`,kzqmXN:`xh8yej3`,kZKoxP:`xqu0tyb`,kaIpWk:`x9psvww`,kWkggS:`x1qry0bl`,kVQacm:`xb3r6kr`,$$css:!0},progressBottom:{kVAEAm:`x10l6tqk`,krVfgx:`x1ey2m1c`,kbCHJM:`xu96u03`,kCIrl2:`x3m8u43`,kaIpWk:`x2u8bby`,kZKoxP:`xuoj239`,$$css:!0},progressFill:{kVAEAm:`x10l6tqk`,kpwlN0:`x10a8y8t`,kZKoxP:`x5yr21d`,kaIpWk:`x2u8bby`,kWkggS:`xa0uij2`,kfzvcC:`x47corl`,$$css:!0},dropzoneTitle:{kGuDYH:`xkpwil5`,k63SB2:`xk50ysn`,kMwMTN:`x84br7x`,kogj98:`x1ghz6dp`,$$css:!0},dropzoneSubtitle:{kGuDYH:`xboafo0`,kMwMTN:`xw3nh4a`,kogj98:`x1ghz6dp`,k9WMMc:`x2b8uid`,$$css:!0},whiteText:{kMwMTN:`xstwp1q`,$$css:!0},compactDropzone:{kmVPX3:`x19btat0`,kXwgrk:`x1q0g3np`,kOIVth:`x8233eu`,$$css:!0}};function b(e,t,n,r,i){let a={files:t,dragOver:!1,invalid:r};function o(e,r){switch(r.type){case`ADD_FILES`:for(let e of r.files)t.set(e,{file:e,progress:0,status:`idle`});return i&&i(Array.from(t.values()).map(e=>e.file)),{...e,files:t};case`SET_FILES`:{let n=new Set(r.files);for(let e of t.keys())n.has(e)||t.delete(e);for(let e of r.files)t.get(e)||t.set(e,{file:e,progress:0,status:`idle`});return{...e,files:t}}case`SET_PROGRESS`:{let n=t.get(r.file);return n&&t.set(r.file,{...n,progress:r.progress,status:`uploading`}),{...e,files:t}}case`SET_SUCCESS`:{let n=t.get(r.file);return n&&t.set(r.file,{...n,progress:100,status:`success`}),{...e,files:t}}case`SET_ERROR`:{let n=t.get(r.file);return n&&t.set(r.file,{...n,error:r.error,status:`error`}),{...e,files:t}}case`REMOVE_FILE`:if(n){let e=n.get(r.file);e&&(URL.revokeObjectURL(e),n.delete(r.file))}return t.delete(r.file),i&&i(Array.from(t.values()).map(e=>e.file)),{...e,files:t};case`SET_DRAG_OVER`:return{...e,dragOver:r.dragOver};case`SET_INVALID`:return{...e,invalid:r.invalid};case`CLEAR`:for(let e of t.keys())if(n){let t=n.get(e);t&&(URL.revokeObjectURL(t),n.delete(e))}return t.clear(),i&&i([]),{...e,files:t};default:return e}}function s(){e.forEach(e=>e())}return{getState:()=>a,dispatch:e=>{a=o(a,e),s()},subscribe:t=>(e.add(t),()=>{e.delete(t)})}}var x=s.createContext(null);function S(e){let t=(0,c.c)(3),n=s.useContext(x);if(!n)throw Error(`useStore must be used within FileUploadRoot`);let r=s.useRef(null),i=s.useRef(void 0),a;t[0]!==e||t[1]!==n?(a=()=>{let t=n.getState();if(t===r.current&&i.current!==void 0)return i.current;let a=e(t);return r.current=t,i.current=a,a},t[0]=e,t[1]=n,t[2]=a):a=t[2];let o=a;return s.useSyncExternalStore(n.subscribe,o,o)}function C(e){return S(e)}var w=s.createContext(null);function T(e){let t=s.useContext(w);if(!t)throw Error(`${e} must be within ${u}`);return t}function E(e){let{asChild:t,value:n,defaultValue:o,onValueChange:c,onAccept:u,onFileReject:d,onUpload:f,accept:p,maxFiles:m=0,maxSize:h=1/0,minSize:g=0,multiple:_=!1,disabled:v=!1,name:S,required:C,invalid:T=!1,label:E,dir:D=`ltr`,className:O,sx:k,children:A,...j}=e,M=s.useId(),N=s.useId(),P=s.useId(),F=s.useId(),I=s.useRef(null),L=s.useRef(new Set).current,R=s.useRef(new WeakMap).current,z=s.useMemo(()=>{let e=new Map,t=n??o??[];for(let n of t)e.set(n,{file:n,progress:0,status:`idle`});return e},[]),B=s.useMemo(()=>b(L,z,R,T,c),[]);s.useEffect(()=>{n!==void 0&&B.dispatch({type:`SET_FILES`,files:n})},[n,B]),s.useEffect(()=>{B.dispatch({type:`SET_INVALID`,invalid:T})},[T,B]);let V=s.useCallback(e=>{if(p){let t=p.split(`,`).map(e=>e.trim().toLowerCase()),n=e.type.toLowerCase(),r=e.name.toLowerCase();if(!t.some(e=>{if(e.startsWith(`.`))return r.endsWith(e);if(e.endsWith(`/*`)){let t=e.slice(0,-2);return n.startsWith(t)}return n===e}))return`File "${e.name}" is not an accepted format (${p})`}return e.size>h?`File "${e.name}" exceeds maximum allowed size of ${r.formatFileSize(h)}`:e.size<g?`File "${e.name}" is smaller than minimum required size of ${r.formatFileSize(g)}`:null},[p,h,g]),H=s.useCallback(async e=>{if(v)return;let t=Array.from(B.getState().files.keys()),n=_?m>0?m:1/0:1,r=n-t.length;if(r<=0&&n===1)B.dispatch({type:`CLEAR`});else if(r<=0){d?.(e[0],`Maximum file limit (${m}) reached`);return}let i=_?e.slice(0,r<=0?1:r):[e[0]],a=[];for(let e of i){let t=V(e);t?d?.(e,t):a.push(e)}if(a.length>0&&(B.dispatch({type:`ADD_FILES`,files:a}),u?.(a),f)){for(let e of a)B.dispatch({type:`SET_PROGRESS`,file:e,progress:0});try{await f(a,{onProgress:(e,t)=>{B.dispatch({type:`SET_PROGRESS`,file:e,progress:t})},onSuccess:e=>{B.dispatch({type:`SET_SUCCESS`,file:e})},onError:(e,t)=>{B.dispatch({type:`SET_ERROR`,file:e,error:t.message})}})}catch{}}},[v,m,_,u,d,f,B,V]),U=s.useCallback(e=>{let t=e.target.files?Array.from(e.target.files):[];t.length>0&&H(t),e.target.value=``},[H]),W=s.useMemo(()=>({dropzoneId:M,inputId:N,listId:P,labelId:F,dir:D,disabled:v,inputRef:I,urlCache:R,processFiles:H}),[M,N,P,F,D,v,R,H]),G=t?l.Slot:`div`,K=i.props(y.root,k);return(0,a.jsx)(x.Provider,{value:B,children:(0,a.jsx)(w.Provider,{value:W,children:(0,a.jsxs)(G,{"data-disabled":v?``:void 0,"data-slot":`file-upload`,dir:D,...j,...K,className:O?`${K.className||``} ${O}`.trim():K.className,children:[A,(0,a.jsx)(`input`,{type:`file`,id:N,"aria-labelledby":F,"aria-describedby":M,ref:I,tabIndex:-1,accept:p,name:S,className:`x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km`,disabled:v,multiple:_,required:C,onChange:U}),(0,a.jsx)(`span`,{id:F,className:`x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km`,children:E??`File upload`})]})})})}function D(e){let{asChild:t,className:n,sx:r,onClick:o,onDragOver:c,onDragEnter:u,onDragLeave:f,onDrop:p,onKeyDown:m,children:h,...g}=e,_=T(d),v=s.useContext(x),b=S(e=>e.dragOver),C=S(e=>e.invalid),w=s.useCallback(e=>{if(o?.(e),e.defaultPrevented)return;let t=e.target;t instanceof HTMLElement&&t.closest(`[data-slot="file-upload-trigger"]`)||_.inputRef.current?.click()},[_.inputRef,o]),E=s.useCallback(e=>{c?.(e),!e.defaultPrevented&&(e.preventDefault(),v?.dispatch({type:`SET_DRAG_OVER`,dragOver:!0}))},[v,c]),D=s.useCallback(e=>{u?.(e),!e.defaultPrevented&&(e.preventDefault(),v?.dispatch({type:`SET_DRAG_OVER`,dragOver:!0}))},[v,u]),O=s.useCallback(e=>{if(f?.(e),e.defaultPrevented)return;let t=e.relatedTarget;t&&t instanceof Node&&e.currentTarget.contains(t)||(e.preventDefault(),v?.dispatch({type:`SET_DRAG_OVER`,dragOver:!1}))},[v,f]),k=s.useCallback(e=>{if(p?.(e),e.defaultPrevented)return;e.preventDefault(),v?.dispatch({type:`SET_DRAG_OVER`,dragOver:!1});let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];t.length!==0&&_.processFiles(t)},[v,_.processFiles,p]),A=s.useCallback(e=>{m?.(e),e.defaultPrevented||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),_.inputRef.current?.click())},[_.inputRef,m]),j=t?l.Slot:`div`,M=i.props(y.dropzone,b&&y.dropzoneDragging,C&&y.dropzoneInvalid,_.disabled&&y.dropzoneDisabled,r);return(0,a.jsx)(j,{role:`region`,id:_.dropzoneId,"aria-controls":`${_.inputId} ${_.listId}`,"aria-disabled":_.disabled,"aria-invalid":C,"data-disabled":_.disabled?``:void 0,"data-dragging":b?``:void 0,"data-invalid":C?``:void 0,"data-slot":`file-upload-dropzone`,tabIndex:_.disabled?void 0:0,...g,...M,className:n?`${M.className||``} ${n}`.trim():M.className,onClick:w,onDragEnter:D,onDragLeave:O,onDragOver:E,onDrop:k,onKeyDown:A,children:h})}function O(e){let t=(0,c.c)(23),n,r,o,s,u;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],u=t[5]):({asChild:n,onClick:o,className:r,sx:s,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=u);let d=T(f),p;t[6]!==d.inputRef||t[7]!==o?(p=e=>{o?.(e),!e.defaultPrevented&&d.inputRef.current?.click()},t[6]=d.inputRef,t[7]=o,t[8]=p):p=t[8];let m=p,h=n?l.Slot:`button`,g;t[9]===s?g=t[10]:(g=i.props(s),t[9]=s,t[10]=g);let _=g,v=d.disabled?``:void 0,y;t[11]!==r||t[12]!==_.className?(y=r?`${_.className||``} ${r}`.trim():_.className,t[11]=r,t[12]=_.className,t[13]=y):y=t[13];let b;return t[14]!==h||t[15]!==d.disabled||t[16]!==d.inputId||t[17]!==m||t[18]!==_||t[19]!==v||t[20]!==y||t[21]!==u?(b=(0,a.jsx)(h,{type:`button`,"aria-controls":d.inputId,"data-disabled":v,"data-slot":`file-upload-trigger`,disabled:d.disabled,...u,..._,className:y,onClick:m}),t[14]=h,t[15]=d.disabled,t[16]=d.inputId,t[17]=m,t[18]=_,t[19]=v,t[20]=y,t[21]=u,t[22]=b):b=t[22],b}function k(e){let{asChild:t,orientation:n=`vertical`,className:r,sx:o,children:s,...c}=e,u=T(p),d=t?l.Slot:`div`,f=i.props(y.list,n===`horizontal`&&y.listHorizontal,o);return(0,a.jsx)(d,{id:u.listId,role:`list`,"data-slot":`file-upload-list`,...c,...f,className:r?`${f.className||``} ${r}`.trim():f.className,children:s})}var A=s.createContext(null);function j(e){let t=s.useContext(A);if(!t)throw Error(`${e} must be within ${m}`);return t}function M(e){let t=(0,c.c)(31),n,r,o,u,d,f;t[0]===e?(n=t[1],r=t[2],o=t[3],u=t[4],d=t[5],f=t[6]):({asChild:n,value:f,className:o,sx:d,children:r,...u}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=u,t[5]=d,t[6]=f),T(m);let p=S(N),h;t[7]!==p||t[8]!==f?(h=p.get(f),t[7]=p,t[8]=f,t[9]=h):h=t[9];let g=h,_=s.useId(),v=s.useId(),b=s.useId(),x;t[10]!==g||t[11]!==v||t[12]!==b||t[13]!==_||t[14]!==f?(x={file:f,fileState:g,statusId:_,nameId:v,sizeId:b},t[10]=g,t[11]=v,t[12]=b,t[13]=_,t[14]=f,t[15]=x):x=t[15];let C=x,w=n?l.Slot:`div`,E;t[16]===d?E=t[17]:(E=i.props(y.item,d),t[16]=d,t[17]=E);let D=E,O=g?.status||`idle`,k;t[18]!==o||t[19]!==D.className?(k=o?`${D.className||``} ${o}`.trim():D.className,t[18]=o,t[19]=D.className,t[20]=k):k=t[20];let j;t[21]!==w||t[22]!==r||t[23]!==u||t[24]!==D||t[25]!==O||t[26]!==k?(j=(0,a.jsx)(w,{role:`listitem`,"data-slot":`file-upload-item`,"data-status":O,...u,...D,className:k,children:r}),t[21]=w,t[22]=r,t[23]=u,t[24]=D,t[25]=O,t[26]=k,t[27]=j):j=t[27];let M;return t[28]!==C||t[29]!==j?(M=(0,a.jsx)(A.Provider,{value:C,children:j}),t[28]=C,t[29]=j,t[30]=M):M=t[30],M}function N(e){return e.files}function P(e){let n=(0,c.c)(31),r,o,u,d,f,p;n[0]===e?(r=n[1],o=n[2],u=n[3],d=n[4],f=n[5],p=n[6]):({asChild:r,render:f,className:u,sx:p,children:o,...d}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=u,n[4]=d,n[5]=f,n[6]=p);let m=T(h),g=j(h).file,[_,v]=s.useState(null),b,x;n[7]!==m.urlCache||n[8]!==g?(b=()=>{let e=g;if(e.uploadedUrl&&g.type.startsWith(`image/`))v(e.uploadedUrl);else if(g.type.startsWith(`image/`)&&typeof URL<`u`&&URL.createObjectURL){let e=m.urlCache.get(g);e||(e=URL.createObjectURL(g),m.urlCache.set(g,e)),v(e)}},x=[g,m.urlCache],n[7]=m.urlCache,n[8]=g,n[9]=b,n[10]=x):(b=n[9],x=n[10]),s.useEffect(b,x);let S;n[11]!==g.name||n[12]!==g.type?(S=()=>{let e=g.type,n=g.name.toLowerCase();return e.startsWith(`video/`)?(0,a.jsx)(t.Icons.FileVideoIcon,{size:20}):e.startsWith(`audio/`)?(0,a.jsx)(t.Icons.FileAudioIcon,{size:20}):n.endsWith(`.zip`)||n.endsWith(`.tar`)||n.endsWith(`.gz`)||n.endsWith(`.rar`)?(0,a.jsx)(t.Icons.FileArchiveIcon,{size:20}):n.endsWith(`.js`)||n.endsWith(`.ts`)||n.endsWith(`.tsx`)||n.endsWith(`.html`)||n.endsWith(`.css`)||n.endsWith(`.json`)?(0,a.jsx)(t.Icons.FileCodeIcon,{size:20}):e.startsWith(`text/`)||n.endsWith(`.pdf`)||n.endsWith(`.doc`)||n.endsWith(`.docx`)?(0,a.jsx)(t.Icons.FileTextIcon,{size:20}):(0,a.jsx)(t.Icons.FileIcon,{size:20})},n[11]=g.name,n[12]=g.type,n[13]=S):S=n[13];let C=S,w=r?l.Slot:`div`,E;n[14]===p?E=n[15]:(E=i.props(y.itemPreview,p),n[14]=p,n[15]=E);let D=E,O;n[16]!==u||n[17]!==D.className?(O=u?`${D.className||``} ${u}`.trim():D.className,n[16]=u,n[17]=D.className,n[18]=O):O=n[18];let k;n[19]!==o||n[20]!==C||n[21]!==g||n[22]!==_||n[23]!==f?(k=f?f(g,C):_?(0,a.jsx)(`img`,{src:_,alt:g.name,className:`xh8yej3 x5yr21d xl1xv1r`}):o||C(),n[19]=o,n[20]=C,n[21]=g,n[22]=_,n[23]=f,n[24]=k):k=n[24];let A;return n[25]!==w||n[26]!==d||n[27]!==D||n[28]!==O||n[29]!==k?(A=(0,a.jsx)(w,{"data-slot":`file-upload-item-preview`,...d,...D,className:O,children:k}),n[25]=w,n[26]=d,n[27]=D,n[28]=O,n[29]=k,n[30]=A):A=n[30],A}function F(e){let t=(0,c.c)(23),o,s,u,d,f;t[0]===e?(o=t[1],s=t[2],u=t[3],d=t[4],f=t[5]):({asChild:o,className:u,sx:f,children:s,...d}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=u,t[4]=d,t[5]=f);let p=j(g),m=p.file,h=p.fileState,_=o?l.Slot:`div`,v;t[6]===f?v=t[7]:(v=i.props(y.itemMetadata,f),t[6]=f,t[7]=v);let b=v,x;t[8]!==u||t[9]!==b.className?(x=u?`${b.className||``} ${u}`.trim():b.className,t[8]=u,t[9]=b.className,t[10]=x):x=t[10];let S;t[11]!==s||t[12]!==m||t[13]!==h||t[14]!==p.nameId||t[15]!==p.sizeId?(S=s||(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Text,{id:p.nameId,size:`sm`,weight:`medium`,ellipsis:!0,title:m.name,sx:y.itemName,children:m.name}),h?.error?(0,a.jsx)(n.Text,{size:`xs`,type:`danger`,sx:y.itemError,children:h.error}):(0,a.jsx)(n.Text,{id:p.sizeId,size:`xs`,type:`muted`,sx:y.itemSize,children:r.formatFileSize(m.size)})]}),t[11]=s,t[12]=m,t[13]=h,t[14]=p.nameId,t[15]=p.sizeId,t[16]=S):S=t[16];let C;return t[17]!==_||t[18]!==d||t[19]!==b||t[20]!==x||t[21]!==S?(C=(0,a.jsx)(_,{"data-slot":`file-upload-item-metadata`,...d,...b,className:x,children:S}),t[17]=_,t[18]=d,t[19]=b,t[20]=x,t[21]=S,t[22]=C):C=t[22],C}function I(e){let{asChild:t,variant:n=`linear`,className:r,sx:o,...s}=e,c=j(_),u=c.fileState?.progress??0;if(c.fileState?.status!==`uploading`&&n===`fill`)return null;let d=t?l.Slot:`div`,f=i.props(n===`fill`?y.progressFill:n===`bottom`?[y.progressRoot,y.progressBottom]:y.progressRoot,o);return(0,a.jsx)(d,{role:`progressbar`,"aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,"data-slot":`file-upload-item-progress`,...s,...f,className:r?`${f.className||``} ${r}`.trim():f.className,children:n!==`fill`&&(0,a.jsx)(`div`,{className:`x5yr21d x1j7ufkg x9psvww xxrbq2n x1d8287x xz4gly6`,style:{width:`${Math.min(Math.max(u,0),100)}%`}})})}function L(e){let n=(0,c.c)(26),r,o,u,d,f,p;n[0]===e?(r=n[1],o=n[2],u=n[3],d=n[4],f=n[5],p=n[6]):({asChild:r,onClick:f,className:u,sx:p,children:o,...d}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=u,n[4]=d,n[5]=f,n[6]=p);let m=s.useContext(x),h=j(v),g;n[7]!==h.file||n[8]!==f||n[9]!==m?(g=e=>{f?.(e),!e.defaultPrevented&&m?.dispatch({type:`REMOVE_FILE`,file:h.file})},n[7]=h.file,n[8]=f,n[9]=m,n[10]=g):g=n[10];let _=g,b=r?l.Slot:`button`,S;n[11]===p?S=n[12]:(S=i.props(y.itemDeleteBtn,p),n[11]=p,n[12]=S);let C=S,w=`Remove ${h.file.name}`,T;n[13]!==u||n[14]!==C.className?(T=u?`${C.className||``} ${u}`.trim():C.className,n[13]=u,n[14]=C.className,n[15]=T):T=n[15];let E;n[16]===o?E=n[17]:(E=o||(0,a.jsx)(t.Icons.X,{size:15}),n[16]=o,n[17]=E);let D;return n[18]!==b||n[19]!==d||n[20]!==_||n[21]!==C||n[22]!==w||n[23]!==T||n[24]!==E?(D=(0,a.jsx)(b,{type:`button`,"data-slot":`file-upload-item-delete`,"aria-label":w,...d,...C,className:T,onClick:_,children:E}),n[18]=b,n[19]=d,n[20]=_,n[21]=C,n[22]=w,n[23]=T,n[24]=E,n[25]=D):D=n[25],D}function R(e){let t=(0,c.c)(20),n,r,o,u,d;t[0]===e?(n=t[1],r=t[2],o=t[3],u=t[4],d=t[5]):({asChild:n,onClick:u,className:r,sx:d,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=u,t[5]=d);let f=s.useContext(x),p;t[6]!==u||t[7]!==f?(p=e=>{u?.(e),!e.defaultPrevented&&f?.dispatch({type:`CLEAR`})},t[6]=u,t[7]=f,t[8]=p):p=t[8];let m=p,h=n?l.Slot:`button`,g;t[9]===d?g=t[10]:(g=i.props(d),t[9]=d,t[10]=g);let _=g,v;t[11]!==r||t[12]!==_.className?(v=r?`${_.className||``} ${r}`.trim():_.className,t[11]=r,t[12]=_.className,t[13]=v):v=t[13];let y;return t[14]!==h||t[15]!==o||t[16]!==m||t[17]!==_||t[18]!==v?(y=(0,a.jsx)(h,{type:`button`,"data-slot":`file-upload-clear`,...o,..._,className:v,onClick:m}),t[14]=h,t[15]=o,t[16]=m,t[17]=_,t[18]=v,t[19]=y):y=t[19],y}function z({variant:e=`default`,dropzoneTitle:i,dropzoneSubtitle:o,icon:c,uploadHandler:l,showFileList:u=!0,showProgress:d=!0,showPreview:f=!0,showClear:p=!1,onUpload:m,maxFiles:h=1,maxSize:g=10485760,accept:_=`image/*`,value:v,onValueChange:b,sx:x,className:S,...C}){let[w,T]=s.useState(v||[]),A=v===void 0?w:v,j=e=>{T(e),b?.(e)},N=s.useCallback(async(e,t)=>{if(m)return m(e,t);l&&await l(e,{onProgress:t.onProgress,onSuccess:e=>t.onSuccess(e),onError:(e,n)=>t.onError(e,n)})},[m,l]);if(e===`avatar`){let e=A[0];return(0,a.jsx)(E,{value:A,onValueChange:j,maxFiles:1,maxSize:g,accept:_,onUpload:N,sx:x,className:S,...C,children:(0,a.jsx)(D,{sx:y.avatarDropzone,children:e?(0,a.jsxs)(M,{value:e,sx:y.avatarItem,children:[(0,a.jsx)(P,{sx:y.avatarPreview,render:e=>{let t=URL.createObjectURL(e);return(0,a.jsx)(`img`,{src:t,alt:e.name,className:`xh8yej3 x5yr21d xl1xv1r`})}}),(0,a.jsxs)(`div`,{className:`x10l6tqk x10a8y8t x78zum5 xdt5ytf x6s0dn4 xl56j7k xvh977a xa44r0r xstwp1q xg01cxk x19991ni x13dflua x1o7uuvo`,children:[(0,a.jsx)(t.Icons.Camera,{size:22}),(0,a.jsx)(n.Text,{size:`xs`,weight:`semibold`,sx:y.whiteText,children:`Change`})]}),d&&(0,a.jsx)(I,{variant:`fill`})]}):(0,a.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:`0.25rem`},children:[(0,a.jsx)(t.Icons.Camera,{size:28}),(0,a.jsx)(n.Text,{size:`xs`,type:`muted`,weight:`medium`,children:`Upload photo`})]})})})}if(e===`compact`)return(0,a.jsxs)(E,{value:A,onValueChange:j,maxFiles:h,maxSize:g,accept:_,multiple:h>1,onUpload:N,sx:x,className:S,...C,children:[(0,a.jsxs)(D,{sx:y.compactDropzone,children:[(0,a.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x9psvww xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a`,children:c||(0,a.jsx)(t.Icons.CloudUpload,{size:18})}),(0,a.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,flex:1,minWidth:0},children:[(0,a.jsx)(n.Text,{size:`sm`,weight:`medium`,children:i||`Choose or drop files to upload`}),(0,a.jsx)(n.Text,{size:`xs`,type:`muted`,children:o||`${h>1?`Up to ${h} files`:`1 file max`} ${g?`(Max ${r.formatFileSize(g)})`:``}`})]}),(0,a.jsx)(O,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,style:{fontSize:`0.75rem`,padding:`0.375rem 0.75rem`,borderRadius:`0.375rem`,border:`1px solid var(--border)`,backgroundColor:`var(--background)`,color:`var(--foreground)`,cursor:`pointer`,fontWeight:500},children:`Browse`})})]}),u&&A.length>0&&(0,a.jsx)(k,{orientation:`horizontal`,children:A.map((e,t)=>(0,a.jsxs)(M,{value:e,children:[f&&(0,a.jsx)(P,{}),(0,a.jsx)(F,{}),d&&(0,a.jsx)(I,{variant:`bottom`}),(0,a.jsx)(L,{})]},`${e.name}-${t}`))})]});let z=`${h>1?`Up to ${h} files`:`1 file max`} ${g?`(Max ${r.formatFileSize(g)})`:``}`;return(0,a.jsxs)(E,{value:A,onValueChange:j,maxFiles:h,maxSize:g,accept:_,multiple:h>1,onUpload:N,sx:x,className:S,...C,children:[(0,a.jsxs)(D,{children:[(0,a.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x9psvww xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a`,children:c||(0,a.jsx)(t.Icons.CloudUpload,{size:20})}),(0,a.jsx)(n.Text,{size:`md`,weight:`medium`,sx:y.dropzoneTitle,children:i||`Drag & drop files here, or click to browse`}),(0,a.jsx)(n.Text,{size:`xs`,type:`muted`,sx:y.dropzoneSubtitle,children:o||z})]}),p&&A.length>0&&(0,a.jsx)(`div`,{className:`x78zum5 x13a6bvl xh8yej3`,children:(0,a.jsx)(R,{asChild:!0,children:(0,a.jsxs)(`button`,{type:`button`,className:`x3nfvp2 x6s0dn4 xvh977a xboafo0 xw3nh4a xjbqb8w xc342km x1ypdohk x48ff29 xqfady0 x9p52ec x1mqvv6a`,children:[(0,a.jsx)(t.Icons.Trash2,{size:13}),`Clear all`]})})}),u&&A.length>0&&(0,a.jsx)(k,{children:A.map((e,t)=>(0,a.jsxs)(M,{value:e,children:[f&&(0,a.jsx)(P,{render:(e,t)=>{if(e.type.startsWith(`image/`)){let t=URL.createObjectURL(e);return(0,a.jsx)(`img`,{src:t,alt:e.name,className:`xh8yej3 x5yr21d xl1xv1r`})}return t()}}),(0,a.jsx)(F,{}),d&&(0,a.jsx)(I,{variant:`bottom`}),(0,a.jsx)(L,{})]},`${e.name}-${t}`))})]})}exports.FileUpload=E,exports.FileUploadClear=R,exports.FileUploadDropzone=D,exports.FileUploadItem=M,exports.FileUploadItemDelete=L,exports.FileUploadItemMetadata=F,exports.FileUploadItemPreview=P,exports.FileUploadItemProgress=I,exports.FileUploadList=k,exports.FileUploadTrigger=O,exports.FileUploader=z,exports.createApiUploadHandler=r.createApiUploadHandler,exports.createS3PresignedUploadHandler=r.createS3PresignedUploadHandler,exports.createUploadThingUploadHandler=r.createUploadThingUploadHandler,exports.formatFileSize=r.formatFileSize,exports.useFileUpload=C,exports.useUploadFile=r.useUploadFile;
|
|
1
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_Icons = require("../Icons/Icons.cjs");
|
|
3
|
+
const require_Text = require("../Typography/Text.cjs");
|
|
4
|
+
const require_file_upload_adapters = require("./file-upload-adapters.cjs");
|
|
5
|
+
let _stylexjs_stylex = require("@stylexjs/stylex");
|
|
6
|
+
_stylexjs_stylex = require_runtime.__toESM(_stylexjs_stylex, 1);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
10
|
+
let _radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
11
|
+
// src/ui/file-upload.tsx
|
|
12
|
+
var ROOT_NAME = "FileUpload";
|
|
13
|
+
var DROPZONE_NAME = "FileUploadDropzone";
|
|
14
|
+
var TRIGGER_NAME = "FileUploadTrigger";
|
|
15
|
+
var LIST_NAME = "FileUploadList";
|
|
16
|
+
var ITEM_NAME = "FileUploadItem";
|
|
17
|
+
var ITEM_PREVIEW_NAME = "FileUploadItemPreview";
|
|
18
|
+
var ITEM_METADATA_NAME = "FileUploadItemMetadata";
|
|
19
|
+
var ITEM_PROGRESS_NAME = "FileUploadItemProgress";
|
|
20
|
+
var ITEM_DELETE_NAME = "FileUploadItemDelete";
|
|
21
|
+
var styles = {
|
|
22
|
+
root: {
|
|
23
|
+
kVAEAm: "x1n2onr6",
|
|
24
|
+
k1xSpc: "x78zum5",
|
|
25
|
+
kXwgrk: "xdt5ytf",
|
|
26
|
+
kOIVth: "x8233eu",
|
|
27
|
+
kzqmXN: "xh8yej3",
|
|
28
|
+
$$css: true
|
|
29
|
+
},
|
|
30
|
+
dropzone: {
|
|
31
|
+
kVAEAm: "x1n2onr6",
|
|
32
|
+
k1xSpc: "x78zum5",
|
|
33
|
+
kXwgrk: "xdt5ytf",
|
|
34
|
+
kGNEyG: "x6s0dn4",
|
|
35
|
+
kjj79g: "xl56j7k",
|
|
36
|
+
kOIVth: "x13z6uf9",
|
|
37
|
+
kaIpWk: "x1ez7q3a",
|
|
38
|
+
kMzoRj: "xdh2fpr",
|
|
39
|
+
ksu8eU: "xbsl7fq",
|
|
40
|
+
kVAM5u: "xb30jbz",
|
|
41
|
+
kWkggS: "x1mlyrtw",
|
|
42
|
+
kmVPX3: "xis3749",
|
|
43
|
+
kkrTdU: "x1ypdohk",
|
|
44
|
+
kfSwDN: "x87ps6o",
|
|
45
|
+
k1ekBW: "x11vqxbs",
|
|
46
|
+
kIyJzY: "x13dflua",
|
|
47
|
+
kI3sdo: "x1a2a7pz",
|
|
48
|
+
kGzVvX: "x9p52ec",
|
|
49
|
+
kaVNsj: "x14aqmuz",
|
|
50
|
+
kOJeXU: "x156qtes",
|
|
51
|
+
kEtg5x: "xik21o4",
|
|
52
|
+
$$css: true
|
|
53
|
+
},
|
|
54
|
+
dropzoneDragging: {
|
|
55
|
+
kWkggS: "x1jgryid",
|
|
56
|
+
kVAM5u: "x1khvrlk",
|
|
57
|
+
kGVxlE: "xf0oo4t",
|
|
58
|
+
$$css: true
|
|
59
|
+
},
|
|
60
|
+
dropzoneInvalid: {
|
|
61
|
+
kVAM5u: "x1uwefn5",
|
|
62
|
+
kWkggS: "x6lw6w7",
|
|
63
|
+
kGVxlE: "x1r3qo2b",
|
|
64
|
+
$$css: true
|
|
65
|
+
},
|
|
66
|
+
dropzoneDisabled: {
|
|
67
|
+
kfzvcC: "x47corl",
|
|
68
|
+
kSiTet: "xbyyjgo",
|
|
69
|
+
kkrTdU: "x1h6gzvc",
|
|
70
|
+
$$css: true
|
|
71
|
+
},
|
|
72
|
+
avatarDropzone: {
|
|
73
|
+
kVAEAm: "x1n2onr6",
|
|
74
|
+
kzqmXN: "x1eyvef",
|
|
75
|
+
kZKoxP: "xw76nk8",
|
|
76
|
+
kaIpWk: "x9psvww",
|
|
77
|
+
kMzoRj: "xdh2fpr",
|
|
78
|
+
ksu8eU: "xbsl7fq",
|
|
79
|
+
kVAM5u: "xb30jbz",
|
|
80
|
+
kWkggS: "x1mlyrtw",
|
|
81
|
+
kVQacm: "xb3r6kr",
|
|
82
|
+
k1xSpc: "x78zum5",
|
|
83
|
+
kXwgrk: "xdt5ytf",
|
|
84
|
+
kGNEyG: "x6s0dn4",
|
|
85
|
+
kjj79g: "xl56j7k",
|
|
86
|
+
kkrTdU: "x1ypdohk",
|
|
87
|
+
k1ekBW: "xq90yva",
|
|
88
|
+
kIyJzY: "x13dflua",
|
|
89
|
+
kmVPX3: "x1717udv",
|
|
90
|
+
kaVNsj: "x14aqmuz",
|
|
91
|
+
$$css: true
|
|
92
|
+
},
|
|
93
|
+
avatarItem: {
|
|
94
|
+
kzqmXN: "xh8yej3",
|
|
95
|
+
kZKoxP: "x5yr21d",
|
|
96
|
+
kmVPX3: "x1717udv",
|
|
97
|
+
kMzoRj: "xc342km",
|
|
98
|
+
$$css: true
|
|
99
|
+
},
|
|
100
|
+
avatarPreview: {
|
|
101
|
+
kzqmXN: "xh8yej3",
|
|
102
|
+
kZKoxP: "x5yr21d",
|
|
103
|
+
kaIpWk: "x9psvww",
|
|
104
|
+
$$css: true
|
|
105
|
+
},
|
|
106
|
+
list: {
|
|
107
|
+
k1xSpc: "x78zum5",
|
|
108
|
+
kXwgrk: "xdt5ytf",
|
|
109
|
+
kOIVth: "x13z6uf9",
|
|
110
|
+
kzqmXN: "xh8yej3",
|
|
111
|
+
$$css: true
|
|
112
|
+
},
|
|
113
|
+
listHorizontal: {
|
|
114
|
+
kXwgrk: "x1q0g3np",
|
|
115
|
+
kwnvtZ: "x1a02dak",
|
|
116
|
+
$$css: true
|
|
117
|
+
},
|
|
118
|
+
item: {
|
|
119
|
+
kVAEAm: "x1n2onr6",
|
|
120
|
+
k1xSpc: "x78zum5",
|
|
121
|
+
kGNEyG: "x6s0dn4",
|
|
122
|
+
kOIVth: "x8233eu",
|
|
123
|
+
kaIpWk: "xrijj7p",
|
|
124
|
+
kMzoRj: "xmkeg23",
|
|
125
|
+
ksu8eU: "x1y0btm7",
|
|
126
|
+
kVAM5u: "xb30jbz",
|
|
127
|
+
kWkggS: "x1rexohn",
|
|
128
|
+
kMwMTN: "xk0jn7w",
|
|
129
|
+
kmVPX3: "x2nx7ib",
|
|
130
|
+
kVQacm: "xb3r6kr",
|
|
131
|
+
k1ekBW: "xq90yva",
|
|
132
|
+
kIyJzY: "xx6bhzk",
|
|
133
|
+
$$css: true
|
|
134
|
+
},
|
|
135
|
+
itemPreview: {
|
|
136
|
+
kVAEAm: "x1n2onr6",
|
|
137
|
+
k1xSpc: "x78zum5",
|
|
138
|
+
kGNEyG: "x6s0dn4",
|
|
139
|
+
kjj79g: "xl56j7k",
|
|
140
|
+
kzqmXN: "xvm51jw",
|
|
141
|
+
kZKoxP: "xwaiz5r",
|
|
142
|
+
k7Eaqz: "xj9j1fp",
|
|
143
|
+
kaIpWk: "xqfady0",
|
|
144
|
+
kWkggS: "x1qry0bl",
|
|
145
|
+
kMwMTN: "xw3nh4a",
|
|
146
|
+
kVQacm: "xb3r6kr",
|
|
147
|
+
$$css: true
|
|
148
|
+
},
|
|
149
|
+
itemMetadata: {
|
|
150
|
+
k1xSpc: "x78zum5",
|
|
151
|
+
kXwgrk: "xdt5ytf",
|
|
152
|
+
kUk6DE: "x98rzlu",
|
|
153
|
+
k7Eaqz: "xeuugli",
|
|
154
|
+
kOIVth: "x1enigpx",
|
|
155
|
+
$$css: true
|
|
156
|
+
},
|
|
157
|
+
itemName: {
|
|
158
|
+
kGuDYH: "xkpwil5",
|
|
159
|
+
k63SB2: "xk50ysn",
|
|
160
|
+
kMwMTN: "x84br7x",
|
|
161
|
+
kVQacm: "xb3r6kr",
|
|
162
|
+
kg5iWk: "xlyipyv",
|
|
163
|
+
khDVqt: "xuxw1ft",
|
|
164
|
+
$$css: true
|
|
165
|
+
},
|
|
166
|
+
itemSize: {
|
|
167
|
+
kGuDYH: "xboafo0",
|
|
168
|
+
kMwMTN: "xw3nh4a",
|
|
169
|
+
$$css: true
|
|
170
|
+
},
|
|
171
|
+
itemError: {
|
|
172
|
+
kGuDYH: "xboafo0",
|
|
173
|
+
kMwMTN: "xuuroe4",
|
|
174
|
+
$$css: true
|
|
175
|
+
},
|
|
176
|
+
itemDeleteBtn: {
|
|
177
|
+
k1xSpc: "x3nfvp2",
|
|
178
|
+
kGNEyG: "x6s0dn4",
|
|
179
|
+
kjj79g: "xl56j7k",
|
|
180
|
+
kzqmXN: "xh29eag",
|
|
181
|
+
kZKoxP: "xb8l8e1",
|
|
182
|
+
kaIpWk: "xqfady0",
|
|
183
|
+
kMzoRj: "xc342km",
|
|
184
|
+
kWkggS: "xjbqb8w",
|
|
185
|
+
kMwMTN: "xw3nh4a",
|
|
186
|
+
kkrTdU: "x1ypdohk",
|
|
187
|
+
kmVPX3: "x1717udv",
|
|
188
|
+
k1ekBW: "xs2xxs2",
|
|
189
|
+
kIyJzY: "xx6bhzk",
|
|
190
|
+
kGzVvX: "x9p52ec",
|
|
191
|
+
kDPRdz: "x1mqvv6a",
|
|
192
|
+
$$css: true
|
|
193
|
+
},
|
|
194
|
+
progressRoot: {
|
|
195
|
+
kVAEAm: "x1n2onr6",
|
|
196
|
+
kzqmXN: "xh8yej3",
|
|
197
|
+
kZKoxP: "xqu0tyb",
|
|
198
|
+
kaIpWk: "x9psvww",
|
|
199
|
+
kWkggS: "x1qry0bl",
|
|
200
|
+
kVQacm: "xb3r6kr",
|
|
201
|
+
$$css: true
|
|
202
|
+
},
|
|
203
|
+
progressBottom: {
|
|
204
|
+
kVAEAm: "x10l6tqk",
|
|
205
|
+
krVfgx: "x1ey2m1c",
|
|
206
|
+
kbCHJM: "xu96u03",
|
|
207
|
+
kCIrl2: "x3m8u43",
|
|
208
|
+
kaIpWk: "x2u8bby",
|
|
209
|
+
kZKoxP: "xuoj239",
|
|
210
|
+
$$css: true
|
|
211
|
+
},
|
|
212
|
+
progressFill: {
|
|
213
|
+
kVAEAm: "x10l6tqk",
|
|
214
|
+
kpwlN0: "x10a8y8t",
|
|
215
|
+
kZKoxP: "x5yr21d",
|
|
216
|
+
kaIpWk: "x2u8bby",
|
|
217
|
+
kWkggS: "xa0uij2",
|
|
218
|
+
kfzvcC: "x47corl",
|
|
219
|
+
$$css: true
|
|
220
|
+
},
|
|
221
|
+
dropzoneTitle: {
|
|
222
|
+
kGuDYH: "xkpwil5",
|
|
223
|
+
k63SB2: "xk50ysn",
|
|
224
|
+
kMwMTN: "x84br7x",
|
|
225
|
+
kogj98: "x1ghz6dp",
|
|
226
|
+
$$css: true
|
|
227
|
+
},
|
|
228
|
+
dropzoneSubtitle: {
|
|
229
|
+
kGuDYH: "xboafo0",
|
|
230
|
+
kMwMTN: "xw3nh4a",
|
|
231
|
+
kogj98: "x1ghz6dp",
|
|
232
|
+
k9WMMc: "x2b8uid",
|
|
233
|
+
$$css: true
|
|
234
|
+
},
|
|
235
|
+
whiteText: {
|
|
236
|
+
kMwMTN: "xstwp1q",
|
|
237
|
+
$$css: true
|
|
238
|
+
},
|
|
239
|
+
compactDropzone: {
|
|
240
|
+
kmVPX3: "x19btat0",
|
|
241
|
+
kXwgrk: "x1q0g3np",
|
|
242
|
+
kOIVth: "x8233eu",
|
|
243
|
+
$$css: true
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
function createStore(listeners, files, urlCache, invalid, onValueChange) {
|
|
247
|
+
let state = {
|
|
248
|
+
files,
|
|
249
|
+
dragOver: false,
|
|
250
|
+
invalid
|
|
251
|
+
};
|
|
252
|
+
function reducer(state, action) {
|
|
253
|
+
switch (action.type) {
|
|
254
|
+
case "ADD_FILES":
|
|
255
|
+
for (const file of action.files) files.set(file, {
|
|
256
|
+
file,
|
|
257
|
+
progress: 0,
|
|
258
|
+
status: "idle"
|
|
259
|
+
});
|
|
260
|
+
if (onValueChange) onValueChange(Array.from(files.values()).map((fileState) => fileState.file));
|
|
261
|
+
return {
|
|
262
|
+
...state,
|
|
263
|
+
files
|
|
264
|
+
};
|
|
265
|
+
case "SET_FILES": {
|
|
266
|
+
const newFileSet = new Set(action.files);
|
|
267
|
+
for (const existingFile of files.keys()) if (!newFileSet.has(existingFile)) files.delete(existingFile);
|
|
268
|
+
for (const file of action.files) if (!files.get(file)) files.set(file, {
|
|
269
|
+
file,
|
|
270
|
+
progress: 0,
|
|
271
|
+
status: "idle"
|
|
272
|
+
});
|
|
273
|
+
return {
|
|
274
|
+
...state,
|
|
275
|
+
files
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
case "SET_PROGRESS": {
|
|
279
|
+
const fileState = files.get(action.file);
|
|
280
|
+
if (fileState) files.set(action.file, {
|
|
281
|
+
...fileState,
|
|
282
|
+
progress: action.progress,
|
|
283
|
+
status: "uploading"
|
|
284
|
+
});
|
|
285
|
+
return {
|
|
286
|
+
...state,
|
|
287
|
+
files
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
case "SET_SUCCESS": {
|
|
291
|
+
const fileState = files.get(action.file);
|
|
292
|
+
if (fileState) files.set(action.file, {
|
|
293
|
+
...fileState,
|
|
294
|
+
progress: 100,
|
|
295
|
+
status: "success"
|
|
296
|
+
});
|
|
297
|
+
return {
|
|
298
|
+
...state,
|
|
299
|
+
files
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
case "SET_ERROR": {
|
|
303
|
+
const fileState = files.get(action.file);
|
|
304
|
+
if (fileState) files.set(action.file, {
|
|
305
|
+
...fileState,
|
|
306
|
+
error: action.error,
|
|
307
|
+
status: "error"
|
|
308
|
+
});
|
|
309
|
+
return {
|
|
310
|
+
...state,
|
|
311
|
+
files
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
case "REMOVE_FILE":
|
|
315
|
+
if (urlCache) {
|
|
316
|
+
const cachedUrl = urlCache.get(action.file);
|
|
317
|
+
if (cachedUrl) {
|
|
318
|
+
URL.revokeObjectURL(cachedUrl);
|
|
319
|
+
urlCache.delete(action.file);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
files.delete(action.file);
|
|
323
|
+
if (onValueChange) onValueChange(Array.from(files.values()).map((fileState) => fileState.file));
|
|
324
|
+
return {
|
|
325
|
+
...state,
|
|
326
|
+
files
|
|
327
|
+
};
|
|
328
|
+
case "SET_DRAG_OVER": return {
|
|
329
|
+
...state,
|
|
330
|
+
dragOver: action.dragOver
|
|
331
|
+
};
|
|
332
|
+
case "SET_INVALID": return {
|
|
333
|
+
...state,
|
|
334
|
+
invalid: action.invalid
|
|
335
|
+
};
|
|
336
|
+
case "CLEAR":
|
|
337
|
+
for (const file of files.keys()) if (urlCache) {
|
|
338
|
+
const cachedUrl = urlCache.get(file);
|
|
339
|
+
if (cachedUrl) {
|
|
340
|
+
URL.revokeObjectURL(cachedUrl);
|
|
341
|
+
urlCache.delete(file);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
files.clear();
|
|
345
|
+
if (onValueChange) onValueChange([]);
|
|
346
|
+
return {
|
|
347
|
+
...state,
|
|
348
|
+
files
|
|
349
|
+
};
|
|
350
|
+
default: return state;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function notify() {
|
|
354
|
+
listeners.forEach((listener) => listener());
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
getState: () => state,
|
|
358
|
+
dispatch: (action) => {
|
|
359
|
+
state = reducer(state, action);
|
|
360
|
+
notify();
|
|
361
|
+
},
|
|
362
|
+
subscribe: (listener) => {
|
|
363
|
+
listeners.add(listener);
|
|
364
|
+
return () => {
|
|
365
|
+
listeners.delete(listener);
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
var StoreContext = (0, react.createContext)(null);
|
|
371
|
+
function useStore(selector) {
|
|
372
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
373
|
+
const store = (0, react.useContext)(StoreContext);
|
|
374
|
+
if (!store) throw new Error("useStore must be used within FileUploadRoot");
|
|
375
|
+
const lastStateRef = (0, react.useRef)(null);
|
|
376
|
+
const lastSelectedRef = (0, react.useRef)(void 0);
|
|
377
|
+
let t0;
|
|
378
|
+
if ($[0] !== selector || $[1] !== store) {
|
|
379
|
+
t0 = () => {
|
|
380
|
+
const currentState = store.getState();
|
|
381
|
+
if (currentState === lastStateRef.current && lastSelectedRef.current !== void 0) return lastSelectedRef.current;
|
|
382
|
+
const nextSelected = selector(currentState);
|
|
383
|
+
lastStateRef.current = currentState;
|
|
384
|
+
lastSelectedRef.current = nextSelected;
|
|
385
|
+
return nextSelected;
|
|
386
|
+
};
|
|
387
|
+
$[0] = selector;
|
|
388
|
+
$[1] = store;
|
|
389
|
+
$[2] = t0;
|
|
390
|
+
} else t0 = $[2];
|
|
391
|
+
const getSnapshot = t0;
|
|
392
|
+
return (0, react.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
|
|
393
|
+
}
|
|
394
|
+
function useFileUpload(selector) {
|
|
395
|
+
return useStore(selector);
|
|
396
|
+
}
|
|
397
|
+
var FileUploadContext = (0, react.createContext)(null);
|
|
398
|
+
function useFileUploadContext(name) {
|
|
399
|
+
const context = (0, react.useContext)(FileUploadContext);
|
|
400
|
+
if (!context) throw new Error(`${name} must be within ${ROOT_NAME}`);
|
|
401
|
+
return context;
|
|
402
|
+
}
|
|
403
|
+
function FileUploadRoot(props) {
|
|
404
|
+
const { asChild, value, defaultValue, onValueChange, onAccept, onFileReject, onUpload, accept, maxFiles = 0, maxSize = Infinity, minSize = 0, multiple = false, disabled = false, name, required, invalid = false, label, dir = "ltr", className, sx, children, ...rootProps } = props;
|
|
405
|
+
const dropzoneId = (0, react.useId)();
|
|
406
|
+
const inputId = (0, react.useId)();
|
|
407
|
+
const listId = (0, react.useId)();
|
|
408
|
+
const labelId = (0, react.useId)();
|
|
409
|
+
const inputRef = (0, react.useRef)(null);
|
|
410
|
+
const listeners = (0, react.useRef)(/* @__PURE__ */ new Set()).current;
|
|
411
|
+
const urlCache = (0, react.useRef)(/* @__PURE__ */ new WeakMap()).current;
|
|
412
|
+
const initialFilesMap = (0, react.useMemo)(() => {
|
|
413
|
+
const map = /* @__PURE__ */ new Map();
|
|
414
|
+
const initialFiles = value ?? defaultValue ?? [];
|
|
415
|
+
for (const file of initialFiles) map.set(file, {
|
|
416
|
+
file,
|
|
417
|
+
progress: 0,
|
|
418
|
+
status: "idle"
|
|
419
|
+
});
|
|
420
|
+
return map;
|
|
421
|
+
}, []);
|
|
422
|
+
const store = (0, react.useMemo)(() => createStore(listeners, initialFilesMap, urlCache, invalid, onValueChange), []);
|
|
423
|
+
(0, react.useEffect)(() => {
|
|
424
|
+
if (value !== void 0) store.dispatch({
|
|
425
|
+
type: "SET_FILES",
|
|
426
|
+
files: value
|
|
427
|
+
});
|
|
428
|
+
}, [value, store]);
|
|
429
|
+
(0, react.useEffect)(() => {
|
|
430
|
+
store.dispatch({
|
|
431
|
+
type: "SET_INVALID",
|
|
432
|
+
invalid
|
|
433
|
+
});
|
|
434
|
+
}, [invalid, store]);
|
|
435
|
+
const validateFile = (0, react.useCallback)((file_0) => {
|
|
436
|
+
if (accept) {
|
|
437
|
+
const acceptedTypes = accept.split(",").map((t) => t.trim().toLowerCase());
|
|
438
|
+
const fileType = file_0.type.toLowerCase();
|
|
439
|
+
const fileName = file_0.name.toLowerCase();
|
|
440
|
+
if (!acceptedTypes.some((type) => {
|
|
441
|
+
if (type.startsWith(".")) return fileName.endsWith(type);
|
|
442
|
+
if (type.endsWith("/*")) {
|
|
443
|
+
const baseType = type.slice(0, -2);
|
|
444
|
+
return fileType.startsWith(baseType);
|
|
445
|
+
}
|
|
446
|
+
return fileType === type;
|
|
447
|
+
})) return `File "${file_0.name}" is not an accepted format (${accept})`;
|
|
448
|
+
}
|
|
449
|
+
if (file_0.size > maxSize) return `File "${file_0.name}" exceeds maximum allowed size of ${require_file_upload_adapters.formatFileSize(maxSize)}`;
|
|
450
|
+
if (file_0.size < minSize) return `File "${file_0.name}" is smaller than minimum required size of ${require_file_upload_adapters.formatFileSize(minSize)}`;
|
|
451
|
+
return null;
|
|
452
|
+
}, [
|
|
453
|
+
accept,
|
|
454
|
+
maxSize,
|
|
455
|
+
minSize
|
|
456
|
+
]);
|
|
457
|
+
const processFiles = (0, react.useCallback)(async (rawFiles) => {
|
|
458
|
+
if (disabled) return;
|
|
459
|
+
const currentFiles = Array.from(store.getState().files.keys());
|
|
460
|
+
const maxAllowed = multiple ? maxFiles > 0 ? maxFiles : Infinity : 1;
|
|
461
|
+
const availableSlots = maxAllowed - currentFiles.length;
|
|
462
|
+
if (availableSlots <= 0 && maxAllowed === 1) store.dispatch({ type: "CLEAR" });
|
|
463
|
+
else if (availableSlots <= 0) {
|
|
464
|
+
onFileReject?.(rawFiles[0], `Maximum file limit (${maxFiles}) reached`);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const filesToConsider = multiple ? rawFiles.slice(0, availableSlots <= 0 ? 1 : availableSlots) : [rawFiles[0]];
|
|
468
|
+
const validFiles = [];
|
|
469
|
+
for (const file_1 of filesToConsider) {
|
|
470
|
+
const error = validateFile(file_1);
|
|
471
|
+
if (error) onFileReject?.(file_1, error);
|
|
472
|
+
else validFiles.push(file_1);
|
|
473
|
+
}
|
|
474
|
+
if (validFiles.length > 0) {
|
|
475
|
+
store.dispatch({
|
|
476
|
+
type: "ADD_FILES",
|
|
477
|
+
files: validFiles
|
|
478
|
+
});
|
|
479
|
+
onAccept?.(validFiles);
|
|
480
|
+
if (onUpload) {
|
|
481
|
+
for (const file_2 of validFiles) store.dispatch({
|
|
482
|
+
type: "SET_PROGRESS",
|
|
483
|
+
file: file_2,
|
|
484
|
+
progress: 0
|
|
485
|
+
});
|
|
486
|
+
try {
|
|
487
|
+
await onUpload(validFiles, {
|
|
488
|
+
onProgress: (file_3, progress) => {
|
|
489
|
+
store.dispatch({
|
|
490
|
+
type: "SET_PROGRESS",
|
|
491
|
+
file: file_3,
|
|
492
|
+
progress
|
|
493
|
+
});
|
|
494
|
+
},
|
|
495
|
+
onSuccess: (file_4) => {
|
|
496
|
+
store.dispatch({
|
|
497
|
+
type: "SET_SUCCESS",
|
|
498
|
+
file: file_4
|
|
499
|
+
});
|
|
500
|
+
},
|
|
501
|
+
onError: (file_5, error_0) => {
|
|
502
|
+
store.dispatch({
|
|
503
|
+
type: "SET_ERROR",
|
|
504
|
+
file: file_5,
|
|
505
|
+
error: error_0.message
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
} catch {}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}, [
|
|
513
|
+
disabled,
|
|
514
|
+
maxFiles,
|
|
515
|
+
multiple,
|
|
516
|
+
onAccept,
|
|
517
|
+
onFileReject,
|
|
518
|
+
onUpload,
|
|
519
|
+
store,
|
|
520
|
+
validateFile
|
|
521
|
+
]);
|
|
522
|
+
const onInputChange = (0, react.useCallback)((event) => {
|
|
523
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
524
|
+
if (files.length > 0) processFiles(files);
|
|
525
|
+
event.target.value = "";
|
|
526
|
+
}, [processFiles]);
|
|
527
|
+
const contextValue = (0, react.useMemo)(() => ({
|
|
528
|
+
dropzoneId,
|
|
529
|
+
inputId,
|
|
530
|
+
listId,
|
|
531
|
+
labelId,
|
|
532
|
+
dir,
|
|
533
|
+
disabled,
|
|
534
|
+
inputRef,
|
|
535
|
+
urlCache,
|
|
536
|
+
processFiles
|
|
537
|
+
}), [
|
|
538
|
+
dropzoneId,
|
|
539
|
+
inputId,
|
|
540
|
+
listId,
|
|
541
|
+
labelId,
|
|
542
|
+
dir,
|
|
543
|
+
disabled,
|
|
544
|
+
urlCache,
|
|
545
|
+
processFiles
|
|
546
|
+
]);
|
|
547
|
+
const RootPrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
548
|
+
const sxProps = _stylexjs_stylex.props(styles.root, sx);
|
|
549
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StoreContext.Provider, {
|
|
550
|
+
value: store,
|
|
551
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadContext.Provider, {
|
|
552
|
+
value: contextValue,
|
|
553
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RootPrimitive, {
|
|
554
|
+
"data-disabled": disabled ? "" : void 0,
|
|
555
|
+
"data-slot": "file-upload",
|
|
556
|
+
dir,
|
|
557
|
+
...rootProps,
|
|
558
|
+
...sxProps,
|
|
559
|
+
className: className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className,
|
|
560
|
+
children: [
|
|
561
|
+
children,
|
|
562
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
563
|
+
type: "file",
|
|
564
|
+
id: inputId,
|
|
565
|
+
"aria-labelledby": labelId,
|
|
566
|
+
"aria-describedby": dropzoneId,
|
|
567
|
+
ref: inputRef,
|
|
568
|
+
tabIndex: -1,
|
|
569
|
+
accept,
|
|
570
|
+
name,
|
|
571
|
+
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",
|
|
572
|
+
disabled,
|
|
573
|
+
multiple,
|
|
574
|
+
required,
|
|
575
|
+
onChange: onInputChange
|
|
576
|
+
}),
|
|
577
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
578
|
+
id: labelId,
|
|
579
|
+
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",
|
|
580
|
+
children: label ?? "File upload"
|
|
581
|
+
})
|
|
582
|
+
]
|
|
583
|
+
})
|
|
584
|
+
})
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
function FileUploadDropzone(props) {
|
|
588
|
+
const { asChild, className, sx, onClick: onClickProp, onDragOver: onDragOverProp, onDragEnter: onDragEnterProp, onDragLeave: onDragLeaveProp, onDrop: onDropProp, onKeyDown: onKeyDownProp, children, ...dropzoneProps } = props;
|
|
589
|
+
const context = useFileUploadContext(DROPZONE_NAME);
|
|
590
|
+
const store = (0, react.useContext)(StoreContext);
|
|
591
|
+
const dragOver = useStore((state) => state.dragOver);
|
|
592
|
+
const invalid = useStore((state_0) => state_0.invalid);
|
|
593
|
+
const onClick = (0, react.useCallback)((event) => {
|
|
594
|
+
onClickProp?.(event);
|
|
595
|
+
if (event.defaultPrevented) return;
|
|
596
|
+
const target = event.target;
|
|
597
|
+
if (!(target instanceof HTMLElement && target.closest("[data-slot=\"file-upload-trigger\"]"))) context.inputRef.current?.click();
|
|
598
|
+
}, [context.inputRef, onClickProp]);
|
|
599
|
+
const onDragOver = (0, react.useCallback)((event_0) => {
|
|
600
|
+
onDragOverProp?.(event_0);
|
|
601
|
+
if (event_0.defaultPrevented) return;
|
|
602
|
+
event_0.preventDefault();
|
|
603
|
+
store?.dispatch({
|
|
604
|
+
type: "SET_DRAG_OVER",
|
|
605
|
+
dragOver: true
|
|
606
|
+
});
|
|
607
|
+
}, [store, onDragOverProp]);
|
|
608
|
+
const onDragEnter = (0, react.useCallback)((event_1) => {
|
|
609
|
+
onDragEnterProp?.(event_1);
|
|
610
|
+
if (event_1.defaultPrevented) return;
|
|
611
|
+
event_1.preventDefault();
|
|
612
|
+
store?.dispatch({
|
|
613
|
+
type: "SET_DRAG_OVER",
|
|
614
|
+
dragOver: true
|
|
615
|
+
});
|
|
616
|
+
}, [store, onDragEnterProp]);
|
|
617
|
+
const onDragLeave = (0, react.useCallback)((event_2) => {
|
|
618
|
+
onDragLeaveProp?.(event_2);
|
|
619
|
+
if (event_2.defaultPrevented) return;
|
|
620
|
+
const relatedTarget = event_2.relatedTarget;
|
|
621
|
+
if (relatedTarget && relatedTarget instanceof Node && event_2.currentTarget.contains(relatedTarget)) return;
|
|
622
|
+
event_2.preventDefault();
|
|
623
|
+
store?.dispatch({
|
|
624
|
+
type: "SET_DRAG_OVER",
|
|
625
|
+
dragOver: false
|
|
626
|
+
});
|
|
627
|
+
}, [store, onDragLeaveProp]);
|
|
628
|
+
const onDrop = (0, react.useCallback)((event_3) => {
|
|
629
|
+
onDropProp?.(event_3);
|
|
630
|
+
if (event_3.defaultPrevented) return;
|
|
631
|
+
event_3.preventDefault();
|
|
632
|
+
store?.dispatch({
|
|
633
|
+
type: "SET_DRAG_OVER",
|
|
634
|
+
dragOver: false
|
|
635
|
+
});
|
|
636
|
+
const files = event_3.dataTransfer?.files ? Array.from(event_3.dataTransfer.files) : [];
|
|
637
|
+
if (files.length === 0) return;
|
|
638
|
+
context.processFiles(files);
|
|
639
|
+
}, [
|
|
640
|
+
store,
|
|
641
|
+
context.processFiles,
|
|
642
|
+
onDropProp
|
|
643
|
+
]);
|
|
644
|
+
const onKeyDown = (0, react.useCallback)((event_4) => {
|
|
645
|
+
onKeyDownProp?.(event_4);
|
|
646
|
+
if (!event_4.defaultPrevented && (event_4.key === "Enter" || event_4.key === " ")) {
|
|
647
|
+
event_4.preventDefault();
|
|
648
|
+
context.inputRef.current?.click();
|
|
649
|
+
}
|
|
650
|
+
}, [context.inputRef, onKeyDownProp]);
|
|
651
|
+
const DropzonePrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
652
|
+
const sxProps = _stylexjs_stylex.props(styles.dropzone, dragOver && styles.dropzoneDragging, invalid && styles.dropzoneInvalid, context.disabled && styles.dropzoneDisabled, sx);
|
|
653
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropzonePrimitive, {
|
|
654
|
+
role: "region",
|
|
655
|
+
id: context.dropzoneId,
|
|
656
|
+
"aria-controls": `${context.inputId} ${context.listId}`,
|
|
657
|
+
"aria-disabled": context.disabled,
|
|
658
|
+
"aria-invalid": invalid,
|
|
659
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
660
|
+
"data-dragging": dragOver ? "" : void 0,
|
|
661
|
+
"data-invalid": invalid ? "" : void 0,
|
|
662
|
+
"data-slot": "file-upload-dropzone",
|
|
663
|
+
tabIndex: context.disabled ? void 0 : 0,
|
|
664
|
+
...dropzoneProps,
|
|
665
|
+
...sxProps,
|
|
666
|
+
className: className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className,
|
|
667
|
+
onClick,
|
|
668
|
+
onDragEnter,
|
|
669
|
+
onDragLeave,
|
|
670
|
+
onDragOver,
|
|
671
|
+
onDrop,
|
|
672
|
+
onKeyDown,
|
|
673
|
+
children
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
function FileUploadTrigger(props) {
|
|
677
|
+
const $ = (0, react_compiler_runtime.c)(23);
|
|
678
|
+
let asChild;
|
|
679
|
+
let className;
|
|
680
|
+
let onClickProp;
|
|
681
|
+
let sx;
|
|
682
|
+
let triggerProps;
|
|
683
|
+
if ($[0] !== props) {
|
|
684
|
+
({asChild, onClick: onClickProp, className, sx, ...triggerProps} = props);
|
|
685
|
+
$[0] = props;
|
|
686
|
+
$[1] = asChild;
|
|
687
|
+
$[2] = className;
|
|
688
|
+
$[3] = onClickProp;
|
|
689
|
+
$[4] = sx;
|
|
690
|
+
$[5] = triggerProps;
|
|
691
|
+
} else {
|
|
692
|
+
asChild = $[1];
|
|
693
|
+
className = $[2];
|
|
694
|
+
onClickProp = $[3];
|
|
695
|
+
sx = $[4];
|
|
696
|
+
triggerProps = $[5];
|
|
697
|
+
}
|
|
698
|
+
const context = useFileUploadContext(TRIGGER_NAME);
|
|
699
|
+
let t0;
|
|
700
|
+
if ($[6] !== context.inputRef || $[7] !== onClickProp) {
|
|
701
|
+
t0 = (event) => {
|
|
702
|
+
onClickProp?.(event);
|
|
703
|
+
if (event.defaultPrevented) return;
|
|
704
|
+
context.inputRef.current?.click();
|
|
705
|
+
};
|
|
706
|
+
$[6] = context.inputRef;
|
|
707
|
+
$[7] = onClickProp;
|
|
708
|
+
$[8] = t0;
|
|
709
|
+
} else t0 = $[8];
|
|
710
|
+
const onClick = t0;
|
|
711
|
+
const TriggerPrimitive = asChild ? _radix_ui_react_slot.Slot : "button";
|
|
712
|
+
let t1;
|
|
713
|
+
if ($[9] !== sx) {
|
|
714
|
+
t1 = _stylexjs_stylex.props(sx);
|
|
715
|
+
$[9] = sx;
|
|
716
|
+
$[10] = t1;
|
|
717
|
+
} else t1 = $[10];
|
|
718
|
+
const sxProps = t1;
|
|
719
|
+
const t2 = context.disabled ? "" : void 0;
|
|
720
|
+
let t3;
|
|
721
|
+
if ($[11] !== className || $[12] !== sxProps.className) {
|
|
722
|
+
t3 = className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className;
|
|
723
|
+
$[11] = className;
|
|
724
|
+
$[12] = sxProps.className;
|
|
725
|
+
$[13] = t3;
|
|
726
|
+
} else t3 = $[13];
|
|
727
|
+
let t4;
|
|
728
|
+
if ($[14] !== TriggerPrimitive || $[15] !== context.disabled || $[16] !== context.inputId || $[17] !== onClick || $[18] !== sxProps || $[19] !== t2 || $[20] !== t3 || $[21] !== triggerProps) {
|
|
729
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerPrimitive, {
|
|
730
|
+
type: "button",
|
|
731
|
+
"aria-controls": context.inputId,
|
|
732
|
+
"data-disabled": t2,
|
|
733
|
+
"data-slot": "file-upload-trigger",
|
|
734
|
+
disabled: context.disabled,
|
|
735
|
+
...triggerProps,
|
|
736
|
+
...sxProps,
|
|
737
|
+
className: t3,
|
|
738
|
+
onClick
|
|
739
|
+
});
|
|
740
|
+
$[14] = TriggerPrimitive;
|
|
741
|
+
$[15] = context.disabled;
|
|
742
|
+
$[16] = context.inputId;
|
|
743
|
+
$[17] = onClick;
|
|
744
|
+
$[18] = sxProps;
|
|
745
|
+
$[19] = t2;
|
|
746
|
+
$[20] = t3;
|
|
747
|
+
$[21] = triggerProps;
|
|
748
|
+
$[22] = t4;
|
|
749
|
+
} else t4 = $[22];
|
|
750
|
+
return t4;
|
|
751
|
+
}
|
|
752
|
+
function FileUploadList(props) {
|
|
753
|
+
const { asChild, orientation = "vertical", className, sx, children, ...listProps } = props;
|
|
754
|
+
const context = useFileUploadContext(LIST_NAME);
|
|
755
|
+
const ListPrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
756
|
+
const sxProps = _stylexjs_stylex.props(styles.list, orientation === "horizontal" && styles.listHorizontal, sx);
|
|
757
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListPrimitive, {
|
|
758
|
+
id: context.listId,
|
|
759
|
+
role: "list",
|
|
760
|
+
"data-slot": "file-upload-list",
|
|
761
|
+
...listProps,
|
|
762
|
+
...sxProps,
|
|
763
|
+
className: className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className,
|
|
764
|
+
children
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
var FileUploadItemContext = (0, react.createContext)(null);
|
|
768
|
+
function useFileUploadItemContext(name) {
|
|
769
|
+
const context = (0, react.useContext)(FileUploadItemContext);
|
|
770
|
+
if (!context) throw new Error(`${name} must be within ${ITEM_NAME}`);
|
|
771
|
+
return context;
|
|
772
|
+
}
|
|
773
|
+
function FileUploadItem(props) {
|
|
774
|
+
const $ = (0, react_compiler_runtime.c)(31);
|
|
775
|
+
let asChild;
|
|
776
|
+
let children;
|
|
777
|
+
let className;
|
|
778
|
+
let itemProps;
|
|
779
|
+
let sx;
|
|
780
|
+
let value;
|
|
781
|
+
if ($[0] !== props) {
|
|
782
|
+
({asChild, value, className, sx, children, ...itemProps} = props);
|
|
783
|
+
$[0] = props;
|
|
784
|
+
$[1] = asChild;
|
|
785
|
+
$[2] = children;
|
|
786
|
+
$[3] = className;
|
|
787
|
+
$[4] = itemProps;
|
|
788
|
+
$[5] = sx;
|
|
789
|
+
$[6] = value;
|
|
790
|
+
} else {
|
|
791
|
+
asChild = $[1];
|
|
792
|
+
children = $[2];
|
|
793
|
+
className = $[3];
|
|
794
|
+
itemProps = $[4];
|
|
795
|
+
sx = $[5];
|
|
796
|
+
value = $[6];
|
|
797
|
+
}
|
|
798
|
+
useFileUploadContext(ITEM_NAME);
|
|
799
|
+
const files = useStore(_temp3);
|
|
800
|
+
let t0;
|
|
801
|
+
if ($[7] !== files || $[8] !== value) {
|
|
802
|
+
t0 = files.get(value);
|
|
803
|
+
$[7] = files;
|
|
804
|
+
$[8] = value;
|
|
805
|
+
$[9] = t0;
|
|
806
|
+
} else t0 = $[9];
|
|
807
|
+
const fileState = t0;
|
|
808
|
+
const statusId = (0, react.useId)();
|
|
809
|
+
const nameId = (0, react.useId)();
|
|
810
|
+
const sizeId = (0, react.useId)();
|
|
811
|
+
let t1;
|
|
812
|
+
if ($[10] !== fileState || $[11] !== nameId || $[12] !== sizeId || $[13] !== statusId || $[14] !== value) {
|
|
813
|
+
t1 = {
|
|
814
|
+
file: value,
|
|
815
|
+
fileState,
|
|
816
|
+
statusId,
|
|
817
|
+
nameId,
|
|
818
|
+
sizeId
|
|
819
|
+
};
|
|
820
|
+
$[10] = fileState;
|
|
821
|
+
$[11] = nameId;
|
|
822
|
+
$[12] = sizeId;
|
|
823
|
+
$[13] = statusId;
|
|
824
|
+
$[14] = value;
|
|
825
|
+
$[15] = t1;
|
|
826
|
+
} else t1 = $[15];
|
|
827
|
+
const contextValue = t1;
|
|
828
|
+
const ItemPrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
829
|
+
let t2;
|
|
830
|
+
if ($[16] !== sx) {
|
|
831
|
+
t2 = _stylexjs_stylex.props(styles.item, sx);
|
|
832
|
+
$[16] = sx;
|
|
833
|
+
$[17] = t2;
|
|
834
|
+
} else t2 = $[17];
|
|
835
|
+
const sxProps = t2;
|
|
836
|
+
const t3 = fileState?.status || "idle";
|
|
837
|
+
let t4;
|
|
838
|
+
if ($[18] !== className || $[19] !== sxProps.className) {
|
|
839
|
+
t4 = className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className;
|
|
840
|
+
$[18] = className;
|
|
841
|
+
$[19] = sxProps.className;
|
|
842
|
+
$[20] = t4;
|
|
843
|
+
} else t4 = $[20];
|
|
844
|
+
let t5;
|
|
845
|
+
if ($[21] !== ItemPrimitive || $[22] !== children || $[23] !== itemProps || $[24] !== sxProps || $[25] !== t3 || $[26] !== t4) {
|
|
846
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemPrimitive, {
|
|
847
|
+
role: "listitem",
|
|
848
|
+
"data-slot": "file-upload-item",
|
|
849
|
+
"data-status": t3,
|
|
850
|
+
...itemProps,
|
|
851
|
+
...sxProps,
|
|
852
|
+
className: t4,
|
|
853
|
+
children
|
|
854
|
+
});
|
|
855
|
+
$[21] = ItemPrimitive;
|
|
856
|
+
$[22] = children;
|
|
857
|
+
$[23] = itemProps;
|
|
858
|
+
$[24] = sxProps;
|
|
859
|
+
$[25] = t3;
|
|
860
|
+
$[26] = t4;
|
|
861
|
+
$[27] = t5;
|
|
862
|
+
} else t5 = $[27];
|
|
863
|
+
let t6;
|
|
864
|
+
if ($[28] !== contextValue || $[29] !== t5) {
|
|
865
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemContext.Provider, {
|
|
866
|
+
value: contextValue,
|
|
867
|
+
children: t5
|
|
868
|
+
});
|
|
869
|
+
$[28] = contextValue;
|
|
870
|
+
$[29] = t5;
|
|
871
|
+
$[30] = t6;
|
|
872
|
+
} else t6 = $[30];
|
|
873
|
+
return t6;
|
|
874
|
+
}
|
|
875
|
+
function _temp3(state) {
|
|
876
|
+
return state.files;
|
|
877
|
+
}
|
|
878
|
+
function FileUploadItemPreview(props) {
|
|
879
|
+
const $ = (0, react_compiler_runtime.c)(31);
|
|
880
|
+
let asChild;
|
|
881
|
+
let children;
|
|
882
|
+
let className;
|
|
883
|
+
let previewProps;
|
|
884
|
+
let render;
|
|
885
|
+
let sx;
|
|
886
|
+
if ($[0] !== props) {
|
|
887
|
+
({asChild, render, className, sx, children, ...previewProps} = props);
|
|
888
|
+
$[0] = props;
|
|
889
|
+
$[1] = asChild;
|
|
890
|
+
$[2] = children;
|
|
891
|
+
$[3] = className;
|
|
892
|
+
$[4] = previewProps;
|
|
893
|
+
$[5] = render;
|
|
894
|
+
$[6] = sx;
|
|
895
|
+
} else {
|
|
896
|
+
asChild = $[1];
|
|
897
|
+
children = $[2];
|
|
898
|
+
className = $[3];
|
|
899
|
+
previewProps = $[4];
|
|
900
|
+
render = $[5];
|
|
901
|
+
sx = $[6];
|
|
902
|
+
}
|
|
903
|
+
const context = useFileUploadContext(ITEM_PREVIEW_NAME);
|
|
904
|
+
const file = useFileUploadItemContext(ITEM_PREVIEW_NAME).file;
|
|
905
|
+
const [objectUrl, setObjectUrl] = (0, react.useState)(null);
|
|
906
|
+
let t0;
|
|
907
|
+
let t1;
|
|
908
|
+
if ($[7] !== context.urlCache || $[8] !== file) {
|
|
909
|
+
t0 = () => {
|
|
910
|
+
const extended = file;
|
|
911
|
+
if (extended.uploadedUrl && file.type.startsWith("image/")) setObjectUrl(extended.uploadedUrl);
|
|
912
|
+
else if (file.type.startsWith("image/") && typeof URL !== "undefined" && URL.createObjectURL) {
|
|
913
|
+
let url = context.urlCache.get(file);
|
|
914
|
+
if (!url) {
|
|
915
|
+
url = URL.createObjectURL(file);
|
|
916
|
+
context.urlCache.set(file, url);
|
|
917
|
+
}
|
|
918
|
+
setObjectUrl(url);
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
t1 = [file, context.urlCache];
|
|
922
|
+
$[7] = context.urlCache;
|
|
923
|
+
$[8] = file;
|
|
924
|
+
$[9] = t0;
|
|
925
|
+
$[10] = t1;
|
|
926
|
+
} else {
|
|
927
|
+
t0 = $[9];
|
|
928
|
+
t1 = $[10];
|
|
929
|
+
}
|
|
930
|
+
(0, react.useEffect)(t0, t1);
|
|
931
|
+
let t2;
|
|
932
|
+
if ($[11] !== file.name || $[12] !== file.type) {
|
|
933
|
+
t2 = () => {
|
|
934
|
+
const type = file.type;
|
|
935
|
+
const name = file.name.toLowerCase();
|
|
936
|
+
if (type.startsWith("video/")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.FileVideoIcon, { size: 20 });
|
|
937
|
+
if (type.startsWith("audio/")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.FileAudioIcon, { size: 20 });
|
|
938
|
+
if (name.endsWith(".zip") || name.endsWith(".tar") || name.endsWith(".gz") || name.endsWith(".rar")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.FileArchiveIcon, { size: 20 });
|
|
939
|
+
if (name.endsWith(".js") || name.endsWith(".ts") || name.endsWith(".tsx") || name.endsWith(".html") || name.endsWith(".css") || name.endsWith(".json")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.FileCodeIcon, { size: 20 });
|
|
940
|
+
if (type.startsWith("text/") || name.endsWith(".pdf") || name.endsWith(".doc") || name.endsWith(".docx")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.FileTextIcon, { size: 20 });
|
|
941
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.FileIcon, { size: 20 });
|
|
942
|
+
};
|
|
943
|
+
$[11] = file.name;
|
|
944
|
+
$[12] = file.type;
|
|
945
|
+
$[13] = t2;
|
|
946
|
+
} else t2 = $[13];
|
|
947
|
+
const defaultFallback = t2;
|
|
948
|
+
const PreviewPrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
949
|
+
let t3;
|
|
950
|
+
if ($[14] !== sx) {
|
|
951
|
+
t3 = _stylexjs_stylex.props(styles.itemPreview, sx);
|
|
952
|
+
$[14] = sx;
|
|
953
|
+
$[15] = t3;
|
|
954
|
+
} else t3 = $[15];
|
|
955
|
+
const sxProps = t3;
|
|
956
|
+
let t4;
|
|
957
|
+
if ($[16] !== className || $[17] !== sxProps.className) {
|
|
958
|
+
t4 = className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className;
|
|
959
|
+
$[16] = className;
|
|
960
|
+
$[17] = sxProps.className;
|
|
961
|
+
$[18] = t4;
|
|
962
|
+
} else t4 = $[18];
|
|
963
|
+
let t5;
|
|
964
|
+
if ($[19] !== children || $[20] !== defaultFallback || $[21] !== file || $[22] !== objectUrl || $[23] !== render) {
|
|
965
|
+
t5 = render ? render(file, defaultFallback) : objectUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
966
|
+
src: objectUrl,
|
|
967
|
+
alt: file.name,
|
|
968
|
+
className: "xh8yej3 x5yr21d xl1xv1r"
|
|
969
|
+
}) : children || defaultFallback();
|
|
970
|
+
$[19] = children;
|
|
971
|
+
$[20] = defaultFallback;
|
|
972
|
+
$[21] = file;
|
|
973
|
+
$[22] = objectUrl;
|
|
974
|
+
$[23] = render;
|
|
975
|
+
$[24] = t5;
|
|
976
|
+
} else t5 = $[24];
|
|
977
|
+
let t6;
|
|
978
|
+
if ($[25] !== PreviewPrimitive || $[26] !== previewProps || $[27] !== sxProps || $[28] !== t4 || $[29] !== t5) {
|
|
979
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PreviewPrimitive, {
|
|
980
|
+
"data-slot": "file-upload-item-preview",
|
|
981
|
+
...previewProps,
|
|
982
|
+
...sxProps,
|
|
983
|
+
className: t4,
|
|
984
|
+
children: t5
|
|
985
|
+
});
|
|
986
|
+
$[25] = PreviewPrimitive;
|
|
987
|
+
$[26] = previewProps;
|
|
988
|
+
$[27] = sxProps;
|
|
989
|
+
$[28] = t4;
|
|
990
|
+
$[29] = t5;
|
|
991
|
+
$[30] = t6;
|
|
992
|
+
} else t6 = $[30];
|
|
993
|
+
return t6;
|
|
994
|
+
}
|
|
995
|
+
function FileUploadItemMetadata(props) {
|
|
996
|
+
const $ = (0, react_compiler_runtime.c)(23);
|
|
997
|
+
let asChild;
|
|
998
|
+
let children;
|
|
999
|
+
let className;
|
|
1000
|
+
let metadataProps;
|
|
1001
|
+
let sx;
|
|
1002
|
+
if ($[0] !== props) {
|
|
1003
|
+
({asChild, className, sx, children, ...metadataProps} = props);
|
|
1004
|
+
$[0] = props;
|
|
1005
|
+
$[1] = asChild;
|
|
1006
|
+
$[2] = children;
|
|
1007
|
+
$[3] = className;
|
|
1008
|
+
$[4] = metadataProps;
|
|
1009
|
+
$[5] = sx;
|
|
1010
|
+
} else {
|
|
1011
|
+
asChild = $[1];
|
|
1012
|
+
children = $[2];
|
|
1013
|
+
className = $[3];
|
|
1014
|
+
metadataProps = $[4];
|
|
1015
|
+
sx = $[5];
|
|
1016
|
+
}
|
|
1017
|
+
const itemContext = useFileUploadItemContext(ITEM_METADATA_NAME);
|
|
1018
|
+
const file = itemContext.file;
|
|
1019
|
+
const fileState = itemContext.fileState;
|
|
1020
|
+
const MetadataPrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
1021
|
+
let t0;
|
|
1022
|
+
if ($[6] !== sx) {
|
|
1023
|
+
t0 = _stylexjs_stylex.props(styles.itemMetadata, sx);
|
|
1024
|
+
$[6] = sx;
|
|
1025
|
+
$[7] = t0;
|
|
1026
|
+
} else t0 = $[7];
|
|
1027
|
+
const sxProps = t0;
|
|
1028
|
+
let t1;
|
|
1029
|
+
if ($[8] !== className || $[9] !== sxProps.className) {
|
|
1030
|
+
t1 = className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className;
|
|
1031
|
+
$[8] = className;
|
|
1032
|
+
$[9] = sxProps.className;
|
|
1033
|
+
$[10] = t1;
|
|
1034
|
+
} else t1 = $[10];
|
|
1035
|
+
let t2;
|
|
1036
|
+
if ($[11] !== children || $[12] !== file || $[13] !== fileState || $[14] !== itemContext.nameId || $[15] !== itemContext.sizeId) {
|
|
1037
|
+
t2 = children ? children : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1038
|
+
id: itemContext.nameId,
|
|
1039
|
+
size: "sm",
|
|
1040
|
+
weight: "medium",
|
|
1041
|
+
ellipsis: true,
|
|
1042
|
+
title: file.name,
|
|
1043
|
+
sx: styles.itemName,
|
|
1044
|
+
children: file.name
|
|
1045
|
+
}), fileState?.error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1046
|
+
size: "xs",
|
|
1047
|
+
type: "danger",
|
|
1048
|
+
sx: styles.itemError,
|
|
1049
|
+
children: fileState.error
|
|
1050
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1051
|
+
id: itemContext.sizeId,
|
|
1052
|
+
size: "xs",
|
|
1053
|
+
type: "muted",
|
|
1054
|
+
sx: styles.itemSize,
|
|
1055
|
+
children: require_file_upload_adapters.formatFileSize(file.size)
|
|
1056
|
+
})] });
|
|
1057
|
+
$[11] = children;
|
|
1058
|
+
$[12] = file;
|
|
1059
|
+
$[13] = fileState;
|
|
1060
|
+
$[14] = itemContext.nameId;
|
|
1061
|
+
$[15] = itemContext.sizeId;
|
|
1062
|
+
$[16] = t2;
|
|
1063
|
+
} else t2 = $[16];
|
|
1064
|
+
let t3;
|
|
1065
|
+
if ($[17] !== MetadataPrimitive || $[18] !== metadataProps || $[19] !== sxProps || $[20] !== t1 || $[21] !== t2) {
|
|
1066
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MetadataPrimitive, {
|
|
1067
|
+
"data-slot": "file-upload-item-metadata",
|
|
1068
|
+
...metadataProps,
|
|
1069
|
+
...sxProps,
|
|
1070
|
+
className: t1,
|
|
1071
|
+
children: t2
|
|
1072
|
+
});
|
|
1073
|
+
$[17] = MetadataPrimitive;
|
|
1074
|
+
$[18] = metadataProps;
|
|
1075
|
+
$[19] = sxProps;
|
|
1076
|
+
$[20] = t1;
|
|
1077
|
+
$[21] = t2;
|
|
1078
|
+
$[22] = t3;
|
|
1079
|
+
} else t3 = $[22];
|
|
1080
|
+
return t3;
|
|
1081
|
+
}
|
|
1082
|
+
function FileUploadItemProgress(props) {
|
|
1083
|
+
const { asChild, variant = "linear", className, sx, ...progressProps } = props;
|
|
1084
|
+
const itemContext = useFileUploadItemContext(ITEM_PROGRESS_NAME);
|
|
1085
|
+
const progress = itemContext.fileState?.progress ?? 0;
|
|
1086
|
+
if (itemContext.fileState?.status !== "uploading" && variant === "fill") return null;
|
|
1087
|
+
const ProgressPrimitive = asChild ? _radix_ui_react_slot.Slot : "div";
|
|
1088
|
+
const sxProps = _stylexjs_stylex.props(variant === "fill" ? styles.progressFill : variant === "bottom" ? [styles.progressRoot, styles.progressBottom] : styles.progressRoot, sx);
|
|
1089
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProgressPrimitive, {
|
|
1090
|
+
role: "progressbar",
|
|
1091
|
+
"aria-valuenow": progress,
|
|
1092
|
+
"aria-valuemin": 0,
|
|
1093
|
+
"aria-valuemax": 100,
|
|
1094
|
+
"data-slot": "file-upload-item-progress",
|
|
1095
|
+
...progressProps,
|
|
1096
|
+
...sxProps,
|
|
1097
|
+
className: className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className,
|
|
1098
|
+
children: variant !== "fill" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1099
|
+
className: "x5yr21d x1j7ufkg x9psvww xxrbq2n x1d8287x xz4gly6",
|
|
1100
|
+
style: { width: `${Math.min(Math.max(progress, 0), 100)}%` }
|
|
1101
|
+
})
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
function FileUploadItemDelete(props) {
|
|
1105
|
+
const $ = (0, react_compiler_runtime.c)(26);
|
|
1106
|
+
let asChild;
|
|
1107
|
+
let children;
|
|
1108
|
+
let className;
|
|
1109
|
+
let deleteProps;
|
|
1110
|
+
let onClickProp;
|
|
1111
|
+
let sx;
|
|
1112
|
+
if ($[0] !== props) {
|
|
1113
|
+
({asChild, onClick: onClickProp, className, sx, children, ...deleteProps} = props);
|
|
1114
|
+
$[0] = props;
|
|
1115
|
+
$[1] = asChild;
|
|
1116
|
+
$[2] = children;
|
|
1117
|
+
$[3] = className;
|
|
1118
|
+
$[4] = deleteProps;
|
|
1119
|
+
$[5] = onClickProp;
|
|
1120
|
+
$[6] = sx;
|
|
1121
|
+
} else {
|
|
1122
|
+
asChild = $[1];
|
|
1123
|
+
children = $[2];
|
|
1124
|
+
className = $[3];
|
|
1125
|
+
deleteProps = $[4];
|
|
1126
|
+
onClickProp = $[5];
|
|
1127
|
+
sx = $[6];
|
|
1128
|
+
}
|
|
1129
|
+
const store = (0, react.useContext)(StoreContext);
|
|
1130
|
+
const itemContext = useFileUploadItemContext(ITEM_DELETE_NAME);
|
|
1131
|
+
let t0;
|
|
1132
|
+
if ($[7] !== itemContext.file || $[8] !== onClickProp || $[9] !== store) {
|
|
1133
|
+
t0 = (event) => {
|
|
1134
|
+
onClickProp?.(event);
|
|
1135
|
+
if (event.defaultPrevented) return;
|
|
1136
|
+
store?.dispatch({
|
|
1137
|
+
type: "REMOVE_FILE",
|
|
1138
|
+
file: itemContext.file
|
|
1139
|
+
});
|
|
1140
|
+
};
|
|
1141
|
+
$[7] = itemContext.file;
|
|
1142
|
+
$[8] = onClickProp;
|
|
1143
|
+
$[9] = store;
|
|
1144
|
+
$[10] = t0;
|
|
1145
|
+
} else t0 = $[10];
|
|
1146
|
+
const onClick = t0;
|
|
1147
|
+
const DeletePrimitive = asChild ? _radix_ui_react_slot.Slot : "button";
|
|
1148
|
+
let t1;
|
|
1149
|
+
if ($[11] !== sx) {
|
|
1150
|
+
t1 = _stylexjs_stylex.props(styles.itemDeleteBtn, sx);
|
|
1151
|
+
$[11] = sx;
|
|
1152
|
+
$[12] = t1;
|
|
1153
|
+
} else t1 = $[12];
|
|
1154
|
+
const sxProps = t1;
|
|
1155
|
+
const t2 = `Remove ${itemContext.file.name}`;
|
|
1156
|
+
let t3;
|
|
1157
|
+
if ($[13] !== className || $[14] !== sxProps.className) {
|
|
1158
|
+
t3 = className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className;
|
|
1159
|
+
$[13] = className;
|
|
1160
|
+
$[14] = sxProps.className;
|
|
1161
|
+
$[15] = t3;
|
|
1162
|
+
} else t3 = $[15];
|
|
1163
|
+
let t4;
|
|
1164
|
+
if ($[16] !== children) {
|
|
1165
|
+
t4 = children || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.X, { size: 15 });
|
|
1166
|
+
$[16] = children;
|
|
1167
|
+
$[17] = t4;
|
|
1168
|
+
} else t4 = $[17];
|
|
1169
|
+
let t5;
|
|
1170
|
+
if ($[18] !== DeletePrimitive || $[19] !== deleteProps || $[20] !== onClick || $[21] !== sxProps || $[22] !== t2 || $[23] !== t3 || $[24] !== t4) {
|
|
1171
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeletePrimitive, {
|
|
1172
|
+
type: "button",
|
|
1173
|
+
"data-slot": "file-upload-item-delete",
|
|
1174
|
+
"aria-label": t2,
|
|
1175
|
+
...deleteProps,
|
|
1176
|
+
...sxProps,
|
|
1177
|
+
className: t3,
|
|
1178
|
+
onClick,
|
|
1179
|
+
children: t4
|
|
1180
|
+
});
|
|
1181
|
+
$[18] = DeletePrimitive;
|
|
1182
|
+
$[19] = deleteProps;
|
|
1183
|
+
$[20] = onClick;
|
|
1184
|
+
$[21] = sxProps;
|
|
1185
|
+
$[22] = t2;
|
|
1186
|
+
$[23] = t3;
|
|
1187
|
+
$[24] = t4;
|
|
1188
|
+
$[25] = t5;
|
|
1189
|
+
} else t5 = $[25];
|
|
1190
|
+
return t5;
|
|
1191
|
+
}
|
|
1192
|
+
function FileUploadClear(props) {
|
|
1193
|
+
const $ = (0, react_compiler_runtime.c)(20);
|
|
1194
|
+
let asChild;
|
|
1195
|
+
let className;
|
|
1196
|
+
let clearProps;
|
|
1197
|
+
let onClickProp;
|
|
1198
|
+
let sx;
|
|
1199
|
+
if ($[0] !== props) {
|
|
1200
|
+
({asChild, onClick: onClickProp, className, sx, ...clearProps} = props);
|
|
1201
|
+
$[0] = props;
|
|
1202
|
+
$[1] = asChild;
|
|
1203
|
+
$[2] = className;
|
|
1204
|
+
$[3] = clearProps;
|
|
1205
|
+
$[4] = onClickProp;
|
|
1206
|
+
$[5] = sx;
|
|
1207
|
+
} else {
|
|
1208
|
+
asChild = $[1];
|
|
1209
|
+
className = $[2];
|
|
1210
|
+
clearProps = $[3];
|
|
1211
|
+
onClickProp = $[4];
|
|
1212
|
+
sx = $[5];
|
|
1213
|
+
}
|
|
1214
|
+
const store = (0, react.useContext)(StoreContext);
|
|
1215
|
+
let t0;
|
|
1216
|
+
if ($[6] !== onClickProp || $[7] !== store) {
|
|
1217
|
+
t0 = (event) => {
|
|
1218
|
+
onClickProp?.(event);
|
|
1219
|
+
if (event.defaultPrevented) return;
|
|
1220
|
+
store?.dispatch({ type: "CLEAR" });
|
|
1221
|
+
};
|
|
1222
|
+
$[6] = onClickProp;
|
|
1223
|
+
$[7] = store;
|
|
1224
|
+
$[8] = t0;
|
|
1225
|
+
} else t0 = $[8];
|
|
1226
|
+
const onClick = t0;
|
|
1227
|
+
const ClearPrimitive = asChild ? _radix_ui_react_slot.Slot : "button";
|
|
1228
|
+
let t1;
|
|
1229
|
+
if ($[9] !== sx) {
|
|
1230
|
+
t1 = _stylexjs_stylex.props(sx);
|
|
1231
|
+
$[9] = sx;
|
|
1232
|
+
$[10] = t1;
|
|
1233
|
+
} else t1 = $[10];
|
|
1234
|
+
const sxProps = t1;
|
|
1235
|
+
let t2;
|
|
1236
|
+
if ($[11] !== className || $[12] !== sxProps.className) {
|
|
1237
|
+
t2 = className ? `${sxProps.className || ""} ${className}`.trim() : sxProps.className;
|
|
1238
|
+
$[11] = className;
|
|
1239
|
+
$[12] = sxProps.className;
|
|
1240
|
+
$[13] = t2;
|
|
1241
|
+
} else t2 = $[13];
|
|
1242
|
+
let t3;
|
|
1243
|
+
if ($[14] !== ClearPrimitive || $[15] !== clearProps || $[16] !== onClick || $[17] !== sxProps || $[18] !== t2) {
|
|
1244
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClearPrimitive, {
|
|
1245
|
+
type: "button",
|
|
1246
|
+
"data-slot": "file-upload-clear",
|
|
1247
|
+
...clearProps,
|
|
1248
|
+
...sxProps,
|
|
1249
|
+
className: t2,
|
|
1250
|
+
onClick
|
|
1251
|
+
});
|
|
1252
|
+
$[14] = ClearPrimitive;
|
|
1253
|
+
$[15] = clearProps;
|
|
1254
|
+
$[16] = onClick;
|
|
1255
|
+
$[17] = sxProps;
|
|
1256
|
+
$[18] = t2;
|
|
1257
|
+
$[19] = t3;
|
|
1258
|
+
} else t3 = $[19];
|
|
1259
|
+
return t3;
|
|
1260
|
+
}
|
|
1261
|
+
function FileUploader({ variant = "default", dropzoneTitle, dropzoneSubtitle, icon, uploadHandler, showFileList = true, showProgress = true, showPreview = true, showClear = false, onUpload: onUploadProp, maxFiles = 1, maxSize = 10485760, accept = "image/*", value, onValueChange, sx, className, ...props }) {
|
|
1262
|
+
const [internalFiles, setInternalFiles] = (0, react.useState)(value || []);
|
|
1263
|
+
const activeFiles = value !== void 0 ? value : internalFiles;
|
|
1264
|
+
const handleValueChange = (newFiles) => {
|
|
1265
|
+
setInternalFiles(newFiles);
|
|
1266
|
+
onValueChange?.(newFiles);
|
|
1267
|
+
};
|
|
1268
|
+
const handleUpload = (0, react.useCallback)(async (files, options) => {
|
|
1269
|
+
if (onUploadProp) return onUploadProp(files, options);
|
|
1270
|
+
if (uploadHandler) await uploadHandler(files, {
|
|
1271
|
+
onProgress: options.onProgress,
|
|
1272
|
+
onSuccess: (f) => options.onSuccess(f),
|
|
1273
|
+
onError: (f_0, err) => options.onError(f_0, err)
|
|
1274
|
+
});
|
|
1275
|
+
}, [onUploadProp, uploadHandler]);
|
|
1276
|
+
if (variant === "avatar") {
|
|
1277
|
+
const singleFile = activeFiles[0];
|
|
1278
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadRoot, {
|
|
1279
|
+
value: activeFiles,
|
|
1280
|
+
onValueChange: handleValueChange,
|
|
1281
|
+
maxFiles: 1,
|
|
1282
|
+
maxSize,
|
|
1283
|
+
accept,
|
|
1284
|
+
onUpload: handleUpload,
|
|
1285
|
+
sx,
|
|
1286
|
+
className,
|
|
1287
|
+
...props,
|
|
1288
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadDropzone, {
|
|
1289
|
+
sx: styles.avatarDropzone,
|
|
1290
|
+
children: singleFile ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadItem, {
|
|
1291
|
+
value: singleFile,
|
|
1292
|
+
sx: styles.avatarItem,
|
|
1293
|
+
children: [
|
|
1294
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemPreview, {
|
|
1295
|
+
sx: styles.avatarPreview,
|
|
1296
|
+
render: (file) => {
|
|
1297
|
+
const url = URL.createObjectURL(file);
|
|
1298
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
1299
|
+
src: url,
|
|
1300
|
+
alt: file.name,
|
|
1301
|
+
className: "xh8yej3 x5yr21d xl1xv1r"
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
}),
|
|
1305
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1306
|
+
className: "x10l6tqk x10a8y8t x78zum5 xdt5ytf x6s0dn4 xl56j7k xvh977a xa44r0r xstwp1q xg01cxk x19991ni x13dflua x1o7uuvo",
|
|
1307
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.Camera, { size: 22 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1308
|
+
size: "xs",
|
|
1309
|
+
weight: "semibold",
|
|
1310
|
+
sx: styles.whiteText,
|
|
1311
|
+
children: "Change"
|
|
1312
|
+
})]
|
|
1313
|
+
}),
|
|
1314
|
+
showProgress && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemProgress, { variant: "fill" })
|
|
1315
|
+
]
|
|
1316
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1317
|
+
style: {
|
|
1318
|
+
display: "flex",
|
|
1319
|
+
flexDirection: "column",
|
|
1320
|
+
alignItems: "center",
|
|
1321
|
+
gap: "0.25rem"
|
|
1322
|
+
},
|
|
1323
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.Camera, { size: 28 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1324
|
+
size: "xs",
|
|
1325
|
+
type: "muted",
|
|
1326
|
+
weight: "medium",
|
|
1327
|
+
children: "Upload photo"
|
|
1328
|
+
})]
|
|
1329
|
+
})
|
|
1330
|
+
})
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
if (variant === "compact") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadRoot, {
|
|
1334
|
+
value: activeFiles,
|
|
1335
|
+
onValueChange: handleValueChange,
|
|
1336
|
+
maxFiles,
|
|
1337
|
+
maxSize,
|
|
1338
|
+
accept,
|
|
1339
|
+
multiple: maxFiles > 1,
|
|
1340
|
+
onUpload: handleUpload,
|
|
1341
|
+
sx,
|
|
1342
|
+
className,
|
|
1343
|
+
...props,
|
|
1344
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadDropzone, {
|
|
1345
|
+
sx: styles.compactDropzone,
|
|
1346
|
+
children: [
|
|
1347
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1348
|
+
className: "x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x9psvww xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a",
|
|
1349
|
+
children: icon || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.CloudUpload, { size: 18 })
|
|
1350
|
+
}),
|
|
1351
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1352
|
+
style: {
|
|
1353
|
+
display: "flex",
|
|
1354
|
+
flexDirection: "column",
|
|
1355
|
+
flex: 1,
|
|
1356
|
+
minWidth: 0
|
|
1357
|
+
},
|
|
1358
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1359
|
+
size: "sm",
|
|
1360
|
+
weight: "medium",
|
|
1361
|
+
children: dropzoneTitle || "Choose or drop files to upload"
|
|
1362
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1363
|
+
size: "xs",
|
|
1364
|
+
type: "muted",
|
|
1365
|
+
children: dropzoneSubtitle || `${maxFiles > 1 ? `Up to ${maxFiles} files` : "1 file max"} ${maxSize ? `(Max ${require_file_upload_adapters.formatFileSize(maxSize)})` : ""}`
|
|
1366
|
+
})]
|
|
1367
|
+
}),
|
|
1368
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadTrigger, {
|
|
1369
|
+
asChild: true,
|
|
1370
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1371
|
+
type: "button",
|
|
1372
|
+
style: {
|
|
1373
|
+
fontSize: "0.75rem",
|
|
1374
|
+
padding: "0.375rem 0.75rem",
|
|
1375
|
+
borderRadius: "0.375rem",
|
|
1376
|
+
border: "1px solid var(--border)",
|
|
1377
|
+
backgroundColor: "var(--background)",
|
|
1378
|
+
color: "var(--foreground)",
|
|
1379
|
+
cursor: "pointer",
|
|
1380
|
+
fontWeight: 500
|
|
1381
|
+
},
|
|
1382
|
+
children: "Browse"
|
|
1383
|
+
})
|
|
1384
|
+
})
|
|
1385
|
+
]
|
|
1386
|
+
}), showFileList && activeFiles.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadList, {
|
|
1387
|
+
orientation: "horizontal",
|
|
1388
|
+
children: activeFiles.map((file_0, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadItem, {
|
|
1389
|
+
value: file_0,
|
|
1390
|
+
children: [
|
|
1391
|
+
showPreview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemPreview, {}),
|
|
1392
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemMetadata, {}),
|
|
1393
|
+
showProgress && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemProgress, { variant: "bottom" }),
|
|
1394
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemDelete, {})
|
|
1395
|
+
]
|
|
1396
|
+
}, `${file_0.name}-${index}`))
|
|
1397
|
+
})]
|
|
1398
|
+
});
|
|
1399
|
+
const defaultTitle = "Drag & drop files here, or click to browse";
|
|
1400
|
+
const defaultSubtitle = `${maxFiles > 1 ? `Up to ${maxFiles} files` : "1 file max"} ${maxSize ? `(Max ${require_file_upload_adapters.formatFileSize(maxSize)})` : ""}`;
|
|
1401
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadRoot, {
|
|
1402
|
+
value: activeFiles,
|
|
1403
|
+
onValueChange: handleValueChange,
|
|
1404
|
+
maxFiles,
|
|
1405
|
+
maxSize,
|
|
1406
|
+
accept,
|
|
1407
|
+
multiple: maxFiles > 1,
|
|
1408
|
+
onUpload: handleUpload,
|
|
1409
|
+
sx,
|
|
1410
|
+
className,
|
|
1411
|
+
...props,
|
|
1412
|
+
children: [
|
|
1413
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadDropzone, { children: [
|
|
1414
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1415
|
+
className: "x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x9psvww xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a",
|
|
1416
|
+
children: icon || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.CloudUpload, { size: 20 })
|
|
1417
|
+
}),
|
|
1418
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1419
|
+
size: "md",
|
|
1420
|
+
weight: "medium",
|
|
1421
|
+
sx: styles.dropzoneTitle,
|
|
1422
|
+
children: dropzoneTitle || defaultTitle
|
|
1423
|
+
}),
|
|
1424
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
1425
|
+
size: "xs",
|
|
1426
|
+
type: "muted",
|
|
1427
|
+
sx: styles.dropzoneSubtitle,
|
|
1428
|
+
children: dropzoneSubtitle || defaultSubtitle
|
|
1429
|
+
})
|
|
1430
|
+
] }),
|
|
1431
|
+
showClear && activeFiles.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1432
|
+
className: "x78zum5 x13a6bvl xh8yej3",
|
|
1433
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadClear, {
|
|
1434
|
+
asChild: true,
|
|
1435
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1436
|
+
type: "button",
|
|
1437
|
+
className: "x3nfvp2 x6s0dn4 xvh977a xboafo0 xw3nh4a xjbqb8w xc342km x1ypdohk x48ff29 xqfady0 x9p52ec x1mqvv6a",
|
|
1438
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.Icons.Trash2, { size: 13 }), "Clear all"]
|
|
1439
|
+
})
|
|
1440
|
+
})
|
|
1441
|
+
}),
|
|
1442
|
+
showFileList && activeFiles.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadList, { children: activeFiles.map((file_1, index_0) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FileUploadItem, {
|
|
1443
|
+
value: file_1,
|
|
1444
|
+
children: [
|
|
1445
|
+
showPreview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemPreview, { render: (previewFile, fallback) => {
|
|
1446
|
+
if (previewFile.type.startsWith("image/")) {
|
|
1447
|
+
const url_0 = URL.createObjectURL(previewFile);
|
|
1448
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
1449
|
+
src: url_0,
|
|
1450
|
+
alt: previewFile.name,
|
|
1451
|
+
className: "xh8yej3 x5yr21d xl1xv1r"
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
return fallback();
|
|
1455
|
+
} }),
|
|
1456
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemMetadata, {}),
|
|
1457
|
+
showProgress && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemProgress, { variant: "bottom" }),
|
|
1458
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FileUploadItemDelete, {})
|
|
1459
|
+
]
|
|
1460
|
+
}, `${file_1.name}-${index_0}`)) })
|
|
1461
|
+
]
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
exports.FileUpload = FileUploadRoot;
|
|
1465
|
+
exports.FileUploadClear = FileUploadClear;
|
|
1466
|
+
exports.FileUploadDropzone = FileUploadDropzone;
|
|
1467
|
+
exports.FileUploadItem = FileUploadItem;
|
|
1468
|
+
exports.FileUploadItemDelete = FileUploadItemDelete;
|
|
1469
|
+
exports.FileUploadItemMetadata = FileUploadItemMetadata;
|
|
1470
|
+
exports.FileUploadItemPreview = FileUploadItemPreview;
|
|
1471
|
+
exports.FileUploadItemProgress = FileUploadItemProgress;
|
|
1472
|
+
exports.FileUploadList = FileUploadList;
|
|
1473
|
+
exports.FileUploadTrigger = FileUploadTrigger;
|
|
1474
|
+
exports.FileUploader = FileUploader;
|
|
1475
|
+
exports.createApiUploadHandler = require_file_upload_adapters.createApiUploadHandler;
|
|
1476
|
+
exports.createS3PresignedUploadHandler = require_file_upload_adapters.createS3PresignedUploadHandler;
|
|
1477
|
+
exports.createUploadThingUploadHandler = require_file_upload_adapters.createUploadThingUploadHandler;
|
|
1478
|
+
exports.formatFileSize = require_file_upload_adapters.formatFileSize;
|
|
1479
|
+
exports.useFileUpload = useFileUpload;
|
|
1480
|
+
exports.useUploadFile = require_file_upload_adapters.useUploadFile;
|