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