@vlrc-fe/components 2.7.0 → 2.8.0
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 +25 -0
- package/dist/ConfirmModal.d.ts +2 -3
- package/dist/ConfirmModal.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts.map +1 -1
- package/dist/DataTable/components/DataTablePagination.d.ts.map +1 -1
- package/dist/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/Dropdown/types.d.ts +1 -1
- package/dist/Dropdown/types.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/FormDatePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/MonthPickerPanel.d.ts +2 -1
- package/dist/Form/FormDatePicker/MonthPickerPanel.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/RangeDatePicker.d.ts +7 -1
- package/dist/Form/FormDatePicker/RangeDatePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/SingleDatePicker.d.ts +5 -1
- package/dist/Form/FormDatePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/TimeInput.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/TimePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/types.d.ts +5 -0
- package/dist/Form/FormDatePicker/types.d.ts.map +1 -1
- package/dist/Form/FormFileUpload/index.d.ts.map +1 -1
- package/dist/Form/FormNumberInput/useFormNumberInput.d.ts +2 -2
- package/dist/Form/FormNumberInput/useFormNumberInput.d.ts.map +1 -1
- package/dist/Form/FormSelect/FormSelect.d.ts.map +1 -1
- package/dist/Form/FormSelect/types.d.ts +1 -1
- package/dist/Form/FormSelect/types.d.ts.map +1 -1
- package/dist/Form/FormSelect/useFormSelect.d.ts +1 -1
- package/dist/Form/FormSelect/useFormSelect.d.ts.map +1 -1
- package/dist/MultiSelect/MultiSelect.d.ts +3 -31
- package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/MultiSelect/renderers.d.ts.map +1 -1
- package/dist/MultiSelect/type.d.ts +1 -0
- package/dist/MultiSelect/type.d.ts.map +1 -1
- package/dist/MultiSelect/useMultiSelect.d.ts.map +1 -1
- package/dist/Select/BaseSelect.d.ts.map +1 -1
- package/dist/Select/MultiSelectTags.d.ts.map +1 -1
- package/dist/Select/type.d.ts +1 -1
- package/dist/Select/type.d.ts.map +1 -1
- package/dist/Typography/Code.d.ts.map +1 -1
- package/dist/Typography/Link.d.ts.map +1 -1
- package/dist/Typography/Paragraph.d.ts.map +1 -1
- package/dist/Typography/Text.d.ts.map +1 -1
- package/dist/Typography/Title.d.ts.map +1 -1
- package/dist/Typography/types.d.ts +37 -1
- package/dist/Typography/types.d.ts.map +1 -1
- package/dist/Typography/utils.d.ts +3 -2
- package/dist/Typography/utils.d.ts.map +1 -1
- package/dist/assets/stylex.css +36 -24
- package/dist/index.cjs +1 -1
- package/dist/index.js +108 -108
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +18 -55
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +89 -89
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +29 -29
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +128 -124
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +16 -16
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +2 -2
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +114 -117
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +95 -92
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +41 -41
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +36 -164
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +128 -120
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +151 -151
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +96 -91
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +18 -18
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +2 -2
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +15 -15
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +147 -103
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +10 -10
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +31 -31
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +3 -3
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +2 -2
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +53 -49
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +35 -38
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +114 -107
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +8 -8
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +53 -53
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +130 -102
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +134 -130
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +7 -7
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +95 -95
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +2 -2
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +113 -99
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +8 -8
- package/dist/index137.cjs +1 -1
- package/dist/index137.js +16 -16
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +20 -20
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +154 -80
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +2 -2
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +24 -24
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +2 -2
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +15 -15
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +3 -3
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +2 -2
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +88 -88
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +64 -64
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +116 -63
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +9 -9
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +41 -41
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +73 -73
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +34 -34
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +8 -8
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +30 -30
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +21 -21
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +60 -91
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +59 -59
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +2 -2
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +50 -50
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +11 -11
- package/dist/index164.cjs +1 -1
- package/dist/index164.js +1 -1
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +33 -33
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +11 -11
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +2 -2
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +7 -7
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +74 -65
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +122 -15
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +9 -9
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +7 -7
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +12 -12
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +15 -15
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +13 -13
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +2 -2
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +140 -115
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +4 -4
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +47 -47
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +15 -268
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +36 -25
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +4 -4
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +5 -8
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +5 -15
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +5 -20
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +5 -16
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +8 -5
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +11 -281
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +7 -4
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +12 -6
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +6 -5
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +6 -5
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +6 -7
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +10 -68
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +9 -10
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +5 -201
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +7 -123
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +7 -31
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +26 -11
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +66 -17
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +8 -68
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +13 -13
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +6 -6
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +15 -278
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +171 -126
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +21 -19
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +16 -8
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +123 -13
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +19 -7
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +29 -26
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +8 -6
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +9 -9
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +13 -8
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +9 -4
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +9 -6
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +4 -6
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +42 -9
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +386 -8
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +37 -14
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +22 -10
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +367 -59
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +57 -9
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +39 -4
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +116 -35
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +85 -387
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +87 -35
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +116 -18
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +97 -55
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +154 -37
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +76 -121
- package/dist/index229.cjs +9 -1
- package/dist/index229.js +588 -77
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +212 -29
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +64 -68
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +42 -115
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +65 -98
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +48 -149
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +98 -68
- package/dist/index235.cjs +1 -9
- package/dist/index235.js +214 -580
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +29 -66
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +23 -40
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +55 -59
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +419 -46
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +200 -312
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +30 -97
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +205 -196
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +228 -124
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +161 -86
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +89 -143
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +140 -76
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +92 -84
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +84 -26
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +26 -35
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +39 -86
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +84 -231
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +234 -44
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +39 -26
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +30 -14
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +14 -13
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +13 -3
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +4 -87
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +83 -174
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +66 -142
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +217 -62
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +135 -47
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +47 -260
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +273 -8
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +7 -4
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +4 -503
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +472 -177
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +205 -23
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +21 -1008
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +1014 -21
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +22 -207
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +181 -130
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +132 -99
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +123 -19
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +17 -79
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +75 -90
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +91 -9
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +12 -91
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +62 -5
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +92 -31
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +29 -208
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +123 -99
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +17 -17
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +28 -28
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +30 -30
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +11 -11
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +22 -28
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +20 -20
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +7 -7
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +28 -28
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +28 -61
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +60 -15
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/calendar.d.ts +1 -1
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/command.d.ts +1 -1
- package/dist/ui/command.d.ts.map +1 -1
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/editable.d.ts.map +1 -1
- package/dist/ui/field.d.ts.map +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/input-group.d.ts.map +1 -1
- package/dist/ui/input-otp.d.ts +1 -1
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/pagination.d.ts +3 -1
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/toggle-group.d.ts +1 -1
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/useBreakpoint.d.ts +0 -4
- package/dist/ui/useBreakpoint.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index242.cjs +0 -1
- package/dist/index242.js +0 -25
- package/dist/index243.cjs +0 -1
- package/dist/index243.js +0 -26
- package/dist/index244.cjs +0 -1
- package/dist/index244.js +0 -63
- package/dist/index245.cjs +0 -1
- package/dist/index245.js +0 -422
- package/dist/index246.cjs +0 -1
- package/dist/index246.js +0 -25
- package/dist/index247.cjs +0 -1
- package/dist/index247.js +0 -209
package/dist/index236.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index2.cjs"),t=require("./
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index179.cjs"),n=require("./index233.cjs"),r=require("./index235.cjs");let i=require("react/jsx-runtime"),a=require("react");a=e.__toESM(a,1);let o=require("react/compiler-runtime");function s(e){let a=(0,o.c)(7),{baseSelectProps:s,isMulti:c,createChangeHandlers:l}=n.useFormSelect(e),u;a[0]!==s||a[1]!==l||a[2]!==c?(u=e=>{let{onChangeMulti:t,onChangeSingle:n}=l(e);return c?(0,i.jsx)(r.BaseSelect,{...s,isMulti:!0,value:e.value,onChange:t}):(0,i.jsx)(r.BaseSelect,{...s,isMulti:!1,value:e.value,onChange:n})},a[0]=s,a[1]=l,a[2]=c,a[3]=u):u=a[3];let d;return a[4]!==e||a[5]!==u?(d=(0,i.jsx)(t.FormBase,{...e,children:u}),a[4]=e,a[5]=u,a[6]=d):d=a[6],d}exports.FormSelect=s;
|
package/dist/index236.js
CHANGED
|
@@ -1,67 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as r
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
// src/Form/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
$$css: !0
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
function c(c) {
|
|
33
|
-
let l = a(17), { onIncrement: u, onDecrement: d, disableIncrement: f, disableDecrement: p } = c, { t: m } = o(), h;
|
|
34
|
-
l[0] === m ? h = l[1] : (h = m("form_increase_value"), l[0] = m, l[1] = h);
|
|
35
|
-
let g;
|
|
36
|
-
l[2] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ r(n, { size: 15 }), l[2] = g) : g = l[2];
|
|
37
|
-
let _;
|
|
38
|
-
l[3] !== f || l[4] !== u || l[5] !== h ? (_ = /* @__PURE__ */ r(e, {
|
|
39
|
-
"aria-label": h,
|
|
40
|
-
sx: s.btnUp,
|
|
41
|
-
variant: "outline",
|
|
42
|
-
onClick: u,
|
|
43
|
-
disabled: f,
|
|
44
|
-
type: "button",
|
|
45
|
-
children: g
|
|
46
|
-
}), l[3] = f, l[4] = u, l[5] = h, l[6] = _) : _ = l[6];
|
|
47
|
-
let v;
|
|
48
|
-
l[7] === m ? v = l[8] : (v = m("form_decrease_value"), l[7] = m, l[8] = v);
|
|
49
|
-
let y;
|
|
50
|
-
l[9] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ r(t, { size: 15 }), l[9] = y) : y = l[9];
|
|
51
|
-
let b;
|
|
52
|
-
l[10] !== p || l[11] !== d || l[12] !== v ? (b = /* @__PURE__ */ r(e, {
|
|
53
|
-
"aria-label": v,
|
|
54
|
-
sx: s.btnDown,
|
|
55
|
-
variant: "outline",
|
|
56
|
-
onClick: d,
|
|
57
|
-
disabled: p,
|
|
58
|
-
type: "button",
|
|
59
|
-
children: y
|
|
60
|
-
}), l[10] = p, l[11] = d, l[12] = v, l[13] = b) : b = l[13];
|
|
61
|
-
let x;
|
|
62
|
-
return l[14] !== _ || l[15] !== b ? (x = /* @__PURE__ */ i("div", {
|
|
63
|
-
className: "x78zum5 xdt5ytf x4aigyd",
|
|
64
|
-
children: [_, b]
|
|
65
|
-
}), l[14] = _, l[15] = b, l[16] = x) : x = l[16], x;
|
|
1
|
+
import { FormBase as e } from "./index179.js";
|
|
2
|
+
import { useFormSelect as t } from "./index233.js";
|
|
3
|
+
import { BaseSelect as n } from "./index235.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
|
+
import { c as i } from "react/compiler-runtime";
|
|
7
|
+
// src/Form/FormSelect/FormSelect.tsx
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = i(7), { baseSelectProps: s, isMulti: c, createChangeHandlers: l } = t(a), u;
|
|
10
|
+
o[0] !== s || o[1] !== l || o[2] !== c ? (u = (e) => {
|
|
11
|
+
let { onChangeMulti: t, onChangeSingle: i } = l(e);
|
|
12
|
+
return c ? /* @__PURE__ */ r(n, {
|
|
13
|
+
...s,
|
|
14
|
+
isMulti: !0,
|
|
15
|
+
value: e.value,
|
|
16
|
+
onChange: t
|
|
17
|
+
}) : /* @__PURE__ */ r(n, {
|
|
18
|
+
...s,
|
|
19
|
+
isMulti: !1,
|
|
20
|
+
value: e.value,
|
|
21
|
+
onChange: i
|
|
22
|
+
});
|
|
23
|
+
}, o[0] = s, o[1] = l, o[2] = c, o[3] = u) : u = o[3];
|
|
24
|
+
let d;
|
|
25
|
+
return o[4] !== a || o[5] !== u ? (d = /* @__PURE__ */ r(e, {
|
|
26
|
+
...a,
|
|
27
|
+
children: u
|
|
28
|
+
}), o[4] = a, o[5] = u, o[6] = d) : d = o[6], d;
|
|
66
29
|
}
|
|
67
|
-
export {
|
|
30
|
+
export { a as FormSelect };
|
package/dist/index237.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e){let{rules:r={},value:i,onChange:a,showEmpty:o}=e,s=r.required!==void 0&&r.required!==!1;return{isRequired:s,processedRules:n(r,s),parseValue:e=>i===void 0?o?``:String(e??``):String(i),emitChange:(e,t)=>{e(t),a?.(t)},sizeClasses:t}}var t={large:``,middle:``,small:``};function n(e={},t){let n={...e};return t&&typeof n.required!=`string`&&typeof n.required!=`object`?n.required=`This field is required`:typeof n.required==`object`&&!n.required.message&&(n.required={...n.required,message:`This field is required`}),n}exports.radioSizeClasses=t,exports.useFormRadio=e;
|
package/dist/index237.js
CHANGED
|
@@ -1,43 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function n({ rules: n, inputClassName: r, stepper: i, min: a, max: o, onChange: s, passthroughProps: c }) {
|
|
5
|
-
let l = n?.required !== void 0 && n.required !== !1;
|
|
1
|
+
// src/Form/FormRadioGroup/useFormRadio.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let { rules: r = {}, value: i, onChange: a, showEmpty: o } = e, s = r.required !== void 0 && r.required !== !1;
|
|
6
4
|
return {
|
|
7
|
-
isRequired:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}), e;
|
|
15
|
-
})(),
|
|
16
|
-
numericClass: e(t, r),
|
|
17
|
-
getHandlers: ({ currentValue: e, field: t }) => {
|
|
18
|
-
let n = () => {
|
|
19
|
-
let n = Math.min((e ?? 0) + i, o);
|
|
20
|
-
t.onChange(n), s?.(n);
|
|
21
|
-
}, r = () => {
|
|
22
|
-
let n = Math.max((e ?? 0) - i, a);
|
|
23
|
-
t.onChange(n), s?.(n);
|
|
24
|
-
};
|
|
25
|
-
return {
|
|
26
|
-
handleIncrement: n,
|
|
27
|
-
handleDecrement: r,
|
|
28
|
-
handleKeyDown: (e) => {
|
|
29
|
-
e.key === "ArrowUp" ? (e.preventDefault(), n()) : e.key === "ArrowDown" && (e.preventDefault(), r()), c.onKeyDown && c.onKeyDown(e);
|
|
30
|
-
},
|
|
31
|
-
handleBlur: () => {
|
|
32
|
-
let n = e;
|
|
33
|
-
n !== void 0 && (n < a ? (t.onChange(a), s?.(a)) : n > o && (t.onChange(o), s?.(o))), t.onBlur(), c.onBlur && c.onBlur();
|
|
34
|
-
},
|
|
35
|
-
numericOnValueChange: (e) => {
|
|
36
|
-
let n = e.floatValue === void 0 ? void 0 : e.floatValue;
|
|
37
|
-
t.onChange(n), s?.(n);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
5
|
+
isRequired: s,
|
|
6
|
+
processedRules: n(r, s),
|
|
7
|
+
parseValue: (e) => i === void 0 ? o ? "" : String(e ?? "") : String(i),
|
|
8
|
+
emitChange: (e, t) => {
|
|
9
|
+
e(t), a?.(t);
|
|
10
|
+
},
|
|
11
|
+
sizeClasses: t
|
|
41
12
|
};
|
|
42
13
|
}
|
|
43
|
-
|
|
14
|
+
var t = {
|
|
15
|
+
large: "",
|
|
16
|
+
middle: "",
|
|
17
|
+
small: ""
|
|
18
|
+
};
|
|
19
|
+
function n(e = {}, t) {
|
|
20
|
+
let n = { ...e };
|
|
21
|
+
return t && typeof n.required != "string" && typeof n.required != "object" ? n.required = "This field is required" : typeof n.required == "object" && !n.required.message && (n.required = {
|
|
22
|
+
...n.required,
|
|
23
|
+
message: "This field is required"
|
|
24
|
+
}), n;
|
|
25
|
+
}
|
|
26
|
+
export { t as radioSizeClasses, e as useFormRadio };
|
package/dist/index238.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index2.cjs"),t=require("./
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index110.cjs"),n=require("./index137.cjs"),r=require("./index179.cjs"),i=require("./index237.cjs");let a=require("@stylexjs/stylex");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={list:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`xb6y1gh`,keoZOQ:`x72edsj`,$$css:!0},label:{kkrTdU:`x1ypdohk`,k63SB2:`xo1l8bm`,kGuDYH:`xkpwil5`,kMwMTN:`x84br7x`,kfSwDN:`x87ps6o`,$$css:!0},scrollable:{kORKVm:`x1odjw0f`,$$css:!0}};function c({name:e,control:a,label:c=``,size:l=`middle`,options:u=[],onChange:d,value:f,rules:p={},disabled:m=!1,optionType:h=`default`,buttonStyle:g,autoHeightMax:_,showEmpty:v=!1,hideErrorMessage:y=!1,className:b}){let{processedRules:x,parseValue:S,emitChange:C}=i.useFormRadio({rules:p,value:f,onChange:d,showEmpty:v});return(0,o.jsx)(r.FormBase,{name:e,control:a,label:c,rules:x,className:b,children:r=>(0,o.jsx)(n.RadioGroup,{value:S(f??r.value),onValueChange:e=>C(r.onChange,e),disabled:m,sx:[s.list,_?s.scrollable:void 0],style:_?{maxHeight:`${_}px`}:void 0,children:u.map(r=>(0,o.jsxs)(`div`,{className:`x78zum5 x6s0dn4 x13z6uf9`,children:[(0,o.jsx)(n.RadioGroupItem,{value:String(r.value),id:`${String(e)}-${r.value}`,disabled:m||r.disabled}),(0,o.jsx)(t.Label,{htmlFor:`${String(e)}-${r.value}`,sx:s.label,children:r.label})]},String(r.value)))})})}exports.FormRadio=c;
|
package/dist/index238.js
CHANGED
|
@@ -1,67 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useFormNumberInput as i } from "./index237.js";
|
|
1
|
+
import { Label as e } from "./index110.js";
|
|
2
|
+
import { RadioGroup as t, RadioGroupItem as n } from "./index137.js";
|
|
3
|
+
import { FormBase as r } from "./index179.js";
|
|
4
|
+
import { useFormRadio as i } from "./index237.js";
|
|
6
5
|
import "@stylexjs/stylex";
|
|
7
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
-
// src/Form/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
// src/Form/FormRadioGroup/FormRadio.tsx
|
|
8
|
+
var s = {
|
|
9
|
+
list: {
|
|
10
|
+
k1xSpc: "x78zum5",
|
|
11
|
+
kXwgrk: "xdt5ytf",
|
|
12
|
+
kOIVth: "xb6y1gh",
|
|
13
|
+
keoZOQ: "x72edsj",
|
|
14
|
+
$$css: !0
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
kkrTdU: "x1ypdohk",
|
|
18
|
+
k63SB2: "xo1l8bm",
|
|
19
|
+
kGuDYH: "xkpwil5",
|
|
20
|
+
kMwMTN: "x84br7x",
|
|
21
|
+
kfSwDN: "x87ps6o",
|
|
22
|
+
$$css: !0
|
|
23
|
+
},
|
|
24
|
+
scrollable: {
|
|
25
|
+
kORKVm: "x1odjw0f",
|
|
26
|
+
$$css: !0
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function c({ name: c, control: l, label: u = "", size: d = "middle", options: f = [], onChange: p, value: m, rules: h = {}, disabled: g = !1, optionType: _ = "default", buttonStyle: v, autoHeightMax: y, showEmpty: b = !1, hideErrorMessage: x = !1, className: S }) {
|
|
30
|
+
let { processedRules: C, parseValue: w, emitChange: T } = i({
|
|
31
|
+
rules: h,
|
|
32
|
+
value: m,
|
|
33
|
+
onChange: p,
|
|
34
|
+
showEmpty: b
|
|
18
35
|
});
|
|
19
|
-
return /* @__PURE__ */ a(
|
|
20
|
-
control: s,
|
|
36
|
+
return /* @__PURE__ */ a(r, {
|
|
21
37
|
name: c,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
rules:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
className: "x78zum5 x6s0dn4 xh8yej3",
|
|
38
|
+
control: l,
|
|
39
|
+
label: u,
|
|
40
|
+
rules: C,
|
|
41
|
+
className: S,
|
|
42
|
+
children: (r) => /* @__PURE__ */ a(t, {
|
|
43
|
+
value: w(m ?? r.value),
|
|
44
|
+
onValueChange: (e) => T(r.onChange, e),
|
|
45
|
+
disabled: g,
|
|
46
|
+
sx: [s.list, y ? s.scrollable : void 0],
|
|
47
|
+
style: y ? { maxHeight: `${y}px` } : void 0,
|
|
48
|
+
children: f.map((t) => /* @__PURE__ */ o("div", {
|
|
49
|
+
className: "x78zum5 x6s0dn4 x13z6uf9",
|
|
35
50
|
children: [/* @__PURE__ */ a(n, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
fixedDecimalScale: _,
|
|
44
|
-
allowNegative: p < 0,
|
|
45
|
-
valueIsNumericString: !1,
|
|
46
|
-
onBlur: S,
|
|
47
|
-
suffix: y,
|
|
48
|
-
prefix: b,
|
|
49
|
-
placeholder: g || "0",
|
|
50
|
-
getInputRef: s.ref,
|
|
51
|
-
onKeyDown: x,
|
|
52
|
-
name: s.name,
|
|
53
|
-
...O,
|
|
54
|
-
id: t,
|
|
55
|
-
...w,
|
|
56
|
-
className: e(w.className, A, O.className)
|
|
57
|
-
}), /* @__PURE__ */ a(r, {
|
|
58
|
-
onIncrement: l,
|
|
59
|
-
onDecrement: u,
|
|
60
|
-
disableIncrement: c !== void 0 && c >= m,
|
|
61
|
-
disableDecrement: c !== void 0 && c <= p
|
|
51
|
+
value: String(t.value),
|
|
52
|
+
id: `${String(c)}-${t.value}`,
|
|
53
|
+
disabled: g || t.disabled
|
|
54
|
+
}), /* @__PURE__ */ a(e, {
|
|
55
|
+
htmlFor: `${String(c)}-${t.value}`,
|
|
56
|
+
sx: s.label,
|
|
57
|
+
children: t.label
|
|
62
58
|
})]
|
|
63
|
-
})
|
|
64
|
-
}
|
|
59
|
+
}, String(t.value)))
|
|
60
|
+
})
|
|
65
61
|
});
|
|
66
62
|
}
|
|
67
|
-
export {
|
|
63
|
+
export { c as FormRadio };
|
package/dist/index239.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=require("
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index14.cjs"),r=require("./index22.cjs"),i=require("./index113.cjs"),a=require("./index114.cjs");let o=require("@stylexjs/stylex");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("react"),l=e.__toESM(c,1);c=e.__toESM(c);let u=require("react/compiler-runtime");var d={avatarDropzone:{kVAEAm:`x1n2onr6`,kzqmXN:`x1eyvef`,kZKoxP:`xw76nk8`,kaIpWk:`x7xypw4`,kMzoRj:`xdh2fpr`,ksu8eU:`xbsl7fq`,kVAM5u:`xb30jbz`,kWkggS:`x1mlyrtw`,kVQacm:`xb3r6kr`,kmVPX3:`x1717udv`,kkrTdU:`x1ypdohk`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,k1ekBW:`xq90yva`,kIyJzY:`x13dflua`,kaVNsj:`x14aqmuz`,$$css:!0},avatarItem:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kXwgrk:`xdt5ytf`,kaIpWk:`x2u8bby`,kMzoRj:`xc342km`,kmVPX3:`x1717udv`,$$css:!0},avatarPreview:{kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kaIpWk:`x2u8bby`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,$$css:!0},avatarImg:{kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kVIFPx:`xl1xv1r`,$$css:!0},compactDropzone:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`x1q0g3np`,kGNEyG:`x6s0dn4`,kOIVth:`x8233eu`,kaIpWk:`x1mr5ieh`,kMzoRj:`xmkeg23`,ksu8eU:`xbsl7fq`,kVAM5u:`xb30jbz`,kWkggS:`x1mlyrtw`,kmVPX3:`x19btat0`,kkrTdU:`x1ypdohk`,k1ekBW:`xq90yva`,kIyJzY:`xx6bhzk`,kaVNsj:`x14aqmuz`,kGzVvX:`x9p52ec`,$$css:!0},clearBtnRow:{k1xSpc:`x78zum5`,kjj79g:`x13a6bvl`,kzqmXN:`xh8yej3`,$$css:!0},clearBtn:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xvh977a`,kGuDYH:`xboafo0`,kMwMTN:`xw3nh4a`,kWkggS:`xjbqb8w`,kMzoRj:`xc342km`,kkrTdU:`x1ypdohk`,kmVPX3:`x48ff29`,kaIpWk:`x1q0v2j7`,kGzVvX:`x9p52ec`,kDPRdz:`x1mqvv6a`,$$css:!0},deleteBtn:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kzqmXN:`xs5h3dt`,kZKoxP:`xettwda`,kaIpWk:`x1q0v2j7`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,kMwMTN:`xw3nh4a`,kkrTdU:`x1ypdohk`,kmuXW:`x2lah0s`,k1ekBW:`x1gbuem2`,kIyJzY:`xx6bhzk`,kGzVvX:`x9p52ec`,kDPRdz:`x1mqvv6a`,$$css:!0},whiteText:{kMwMTN:`x1f7m26b`,$$css:!0}};function f(e){let t=(0,u.c)(6),{onChange:n,autoUpload:r,maxFiles:i}=e,o=a.useFileUpload(_),s=l.useRef(null),c=l.useRef(!0),d,f;return t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==o?(d=()=>{if(!n)return;let e=Array.from(o.files.values());if(c.current&&(c.current=!1,e.length===0))return;let t=(()=>{if(r){let t=e.filter(g).map(h).filter(m);return i===1?t.length>0?t[t.length-1]:null:t}let t=e.map(p);return i===1?t.length>0?t[t.length-1]:null:t})(),a=s.current;(r?JSON.stringify(a)===JSON.stringify(t):Array.isArray(t)&&Array.isArray(a)?t.length===a.length&&t.every((e,t)=>e===a[t]):t===a)||(s.current=t,n(t))},f=[o,r,i,n],t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=d,t[5]=f):(d=t[4],f=t[5]),l.useEffect(d,f),null}function p(e){return e.file}function m(e){return!!e}function h(e){return e.file.uploadedUrl}function g(e){return e.status===`success`}function _(e){return e}function v(e,t=``){let n=e.split(`/`).pop()?.split(`?`)[0]||`file`,r=n.split(`.`).pop()?.toLowerCase(),i=r&&{jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`}[r];i||=t.includes(`image`)?`image/jpeg`:`application/octet-stream`;let a=new File([``],n,{type:i});return a.isUploadedUrl=!0,a.uploadedUrl=e,a}function y({showPreview:e,showProgress:n,orientation:i=`vertical`,avatarImgSx:c,deleteBtnSx:l}){let u=a.useFileUpload(e=>Array.from(e.files.values()).map(e=>e.file));return u.length===0?null:(0,s.jsx)(a.FileUploadList,{orientation:i,children:u.map((u,d)=>(0,s.jsxs)(a.FileUploadItem,{value:u,children:[e&&(0,s.jsx)(a.FileUploadItemPreview,{render:(e,t)=>{let n=e.uploadedUrl||(e.type.startsWith(`image/`)&&typeof URL<`u`&&URL.createObjectURL?URL.createObjectURL(e):null);return n&&e.type.startsWith(`image/`)?(0,s.jsx)(`img`,{src:n,alt:e.name,...o.props(c)}):t()}}),(0,s.jsx)(a.FileUploadItemMetadata,{}),n&&(0,s.jsx)(a.FileUploadItemProgress,{variant:`bottom`}),(0,s.jsx)(a.FileUploadItemDelete,{asChild:!0,children:(0,s.jsx)(r.Button,{variant:`ghost`,size:`icon`,"aria-label":`Delete ${u.name}`,sx:l,children:(0,s.jsx)(t.Icons.Trash2,{size:i===`horizontal`?15:16})})})]},`${u.name}-${d}`))})}function b(e){let n=(0,u.c)(10),{clearBtnRowSx:r,clearBtnSx:i}=e;if(a.useFileUpload(x)===0)return null;let c;n[0]===r?c=n[1]:(c=o.props(r),n[0]=r,n[1]=c);let l;n[2]===i?l=n[3]:(l=o.props(i),n[2]=i,n[3]=l);let d;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,s.jsx)(t.Icons.Trash2,{size:13}),n[4]=d):d=n[4];let f;n[5]===l?f=n[6]:(f=(0,s.jsx)(a.FileUploadClear,{asChild:!0,children:(0,s.jsxs)(`button`,{type:`button`,...l,children:[d,`Clear all`]})}),n[5]=l,n[6]=f);let p;return n[7]!==c||n[8]!==f?(p=(0,s.jsx)(`div`,{...c,children:f}),n[7]=c,n[8]=f,n[9]=p):p=n[9],p}function x(e){return e.files.size}function S(e){let r=(0,u.c)(8),{showProgress:o,maxSize:c}=e,l=a.useFileUpload(w),f;r[0]!==l||r[1]!==o?(f=(0,s.jsx)(a.FileUploadDropzone,{sx:d.avatarDropzone,children:l?(0,s.jsxs)(a.FileUploadItem,{value:l,sx:d.avatarItem,children:[(0,s.jsx)(a.FileUploadItemPreview,{sx:d.avatarPreview,render:C}),(0,s.jsxs)(`div`,{className:`x10l6tqk x10a8y8t x78zum5 xdt5ytf x6s0dn4 xl56j7k xvh977a xa44r0r x1f7m26b xg01cxk x19991ni x13dflua x1o7uuvo`,children:[(0,s.jsx)(t.Icons.Camera,{size:22}),(0,s.jsx)(n.Text,{size:`xs`,weight:`semibold`,sx:d.whiteText,children:`Change photo`})]}),o&&(0,s.jsx)(a.FileUploadItemProgress,{variant:`fill`,style:{opacity:.5}})]}):(0,s.jsxs)(`div`,{className:`x78zum5 xh8yej3 x5yr21d xdt5ytf x6s0dn4 xl56j7k xvh977a x1jgryid xw3nh4a x15406qy x13dflua`,children:[(0,s.jsx)(t.Icons.Camera,{size:24}),(0,s.jsx)(n.Text,{size:`xs`,weight:`medium`,children:`Upload`})]})}),r[0]=l,r[1]=o,r[2]=f):f=r[2];let p;r[3]===c?p=r[4]:(p=c?(0,s.jsxs)(n.Text,{size:`xs`,type:`muted`,children:[`Max `,i.formatFileSize(c)]}):null,r[3]=c,r[4]=p);let m;return r[5]!==f||r[6]!==p?(m=(0,s.jsxs)(`div`,{className:`x78zum5 xdt5ytf x6s0dn4 x13z6uf9`,children:[f,p]}),r[5]=f,r[6]=p,r[7]=m):m=r[7],m}function C(e){let r=e.uploadedUrl||(e.type.startsWith(`image/`)&&typeof URL<`u`&&URL.createObjectURL?URL.createObjectURL(e):null);return r?(0,s.jsx)(`img`,{src:r,alt:`Avatar`,className:`xh8yej3 x5yr21d xl1xv1r`}):(0,s.jsxs)(`div`,{className:`x78zum5 xh8yej3 x5yr21d xdt5ytf x6s0dn4 xl56j7k xvh977a x1jgryid xw3nh4a x15406qy x13dflua`,children:[(0,s.jsx)(t.Icons.Camera,{size:24}),(0,s.jsx)(n.Text,{size:`xs`,weight:`medium`,children:`Upload`})]})}function w(e){let t=e.files.values().next();return t.done?null:t.value.file}function T({value:e,onChange:o,autoUpload:c=!1,uploadFile:u,apiConfig:p,uploadThingConfig:m,uploadHandler:h,maxFiles:g=1,maxSize:_=5242880,accept:x=`image/*`,multiple:C,disabled:w,className:T,sx:E,variant:D=`default`,dropzoneTitle:O,dropzoneSubtitle:k,icon:A,showFileList:j=!0,showProgress:M=!0,showPreview:N=!0,showClear:P=!1}){let F=l.useRef(new Map),I=l.useMemo(()=>(Array.isArray(e)?e:e?[e]:[]).map(e=>{if(e instanceof File)return e;if(typeof e==`string`){let t=F.current.get(e);return t||(t=v(e,x),F.current.set(e,t)),t}return e}),[e,x]),L=l.useMemo(()=>h||(m?i.createUploadThingUploadHandler(m):p?i.createApiUploadHandler(p):null),[h,m,p]),R=async(e,t)=>{if(!c)e.forEach(e=>t.onSuccess(e));else if(L)try{(await L(e,{onProgress:t.onProgress,onSuccess:(e,n)=>{e.uploadedUrl=n.url,t.onSuccess(e)},onError:(e,n)=>{t.onError(e,n)}})).forEach((t,n)=>{let r=e[n];r&&(r.uploadedUrl=t.url)})}catch{}else u?await Promise.all(e.map(async e=>{let n=e;if(n.isUploadedUrl)t.onSuccess(e);else try{t.onProgress(e,20),n.uploadedUrl=await u(e),t.onProgress(e,100),t.onSuccess(e)}catch(n){t.onError(e,n instanceof Error?n:Error(`Upload failed`))}})):(console.warn(`FileUpload: autoUpload is true but no upload handler or config was provided.`),e.forEach(e=>t.onError(e,Error(`Missing upload configuration`))))},z=`${g>1?`Up to ${g} files`:`1 file max`} ${_?`(Max ${i.formatFileSize(_)})`:``}`,B=D===`avatar`?!1:C??g>1;return(0,s.jsxs)(a.FileUpload,{value:I,maxFiles:D===`avatar`?1:g,maxSize:_,accept:x,multiple:B,disabled:w,onUpload:R,className:T,sx:E,children:[(0,s.jsx)(f,{onChange:o,autoUpload:!!c,maxFiles:D===`avatar`?1:g}),D===`avatar`?(0,s.jsx)(S,{showProgress:M,maxSize:_}):D===`compact`?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(a.FileUploadDropzone,{sx:d.compactDropzone,children:[(0,s.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k xs5h3dt xettwda x7xypw4 xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a x2lah0s`,children:A||(0,s.jsx)(t.Icons.CloudUpload,{size:18})}),(0,s.jsxs)(`div`,{className:`x78zum5 xdt5ytf x98rzlu xeuugli`,children:[(0,s.jsx)(n.Text,{size:`sm`,weight:`medium`,children:O||`Choose or drop files to upload`}),(0,s.jsx)(n.Text,{size:`xs`,type:`muted`,children:k||z})]}),(0,s.jsx)(a.FileUploadTrigger,{asChild:!0,children:(0,s.jsx)(r.Button,{variant:`outline`,size:`sm`,disabled:w,children:`Browse`})})]}),P&&(0,s.jsx)(b,{clearBtnRowSx:d.clearBtnRow,clearBtnSx:d.clearBtn}),j&&(0,s.jsx)(y,{showPreview:N,showProgress:M,orientation:`horizontal`,avatarImgSx:d.avatarImg,deleteBtnSx:d.deleteBtn})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(a.FileUploadDropzone,{children:[(0,s.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x7xypw4 xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a x1hpqcdg`,children:A||(0,s.jsx)(t.Icons.CloudUpload,{size:20})}),(0,s.jsx)(n.Text,{size:`md`,weight:`medium`,children:O||`Drag & drop files here, or click to select`}),(0,s.jsx)(n.Text,{size:`xs`,type:`muted`,children:k||z})]}),P&&(0,s.jsx)(b,{clearBtnRowSx:d.clearBtnRow,clearBtnSx:d.clearBtn}),j&&(0,s.jsx)(y,{showPreview:N,showProgress:M,orientation:`vertical`,avatarImgSx:d.avatarImg,deleteBtnSx:d.deleteBtn})]})]})}exports.FileUpload=T;
|