freemium-ui 2.0.91 → 2.1.0-alpha.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/lib/Accordion-Ccv-p2G6.js +134 -0
- package/lib/Accordion.d.ts +56 -0
- package/lib/Accordion.js +7 -0
- package/lib/Alert-BtEbkVK1.js +52 -0
- package/lib/Alert.d.ts +66 -0
- package/lib/Alert.js +6 -0
- package/lib/AutoComplete-DF33_uur.js +608 -0
- package/lib/AutoComplete.d.ts +105 -0
- package/lib/AutoComplete.js +14 -0
- package/lib/BoxedRadio-D5Kiintm.js +75 -0
- package/lib/BoxedRadio.d.ts +61 -0
- package/lib/BoxedRadio.js +10 -0
- package/lib/Button-Bd1O8_k7.js +34 -0
- package/lib/Button.d.ts +34 -0
- package/lib/Button.js +2 -0
- package/lib/ButtonDropdown-BZvCwUDe.js +37 -0
- package/lib/ButtonDropdown.d.ts +82 -0
- package/lib/ButtonDropdown.js +11 -0
- package/lib/Calendar-C0xW_pPO.js +32 -0
- package/lib/Calendar.d.ts +25 -0
- package/lib/Calendar.js +2 -0
- package/lib/Checkbox-By1CgFUJ.js +66 -0
- package/lib/Checkbox.d.ts +28 -0
- package/lib/Checkbox.js +7 -0
- package/lib/ChevronUp-BWiG3XYd.js +7 -0
- package/lib/Combination-AmN1Cqrf.js +210 -0
- package/lib/Confirmation-49GhlyzQ.js +66 -0
- package/lib/Confirmation.d.ts +72 -0
- package/lib/Confirmation.js +8 -0
- package/lib/Cross-CIeKwtq6.js +7 -0
- package/lib/CustomizeColumns-BSF8e_we.js +865 -0
- package/lib/Drawer-CnmXL5_B.js +33 -0
- package/lib/Drawer.d.ts +50 -0
- package/lib/Drawer.js +8 -0
- package/lib/Dropdown-D59u6zOt.js +89 -0
- package/lib/Dropdown.d.ts +162 -0
- package/lib/Dropdown.js +15 -0
- package/lib/ErrorText-Uvye7uop.js +8 -0
- package/lib/Info-BsILbpCG.js +9 -0
- package/lib/Input.d.ts +66 -0
- package/lib/Input.js +5 -0
- package/lib/Loader-b8lHCp4N.js +13 -0
- package/lib/Loader.d.ts +21 -0
- package/lib/Loader.js +3 -0
- package/lib/Menu-DoE00Mg-.js +19 -0
- package/lib/Menu.d.ts +80 -0
- package/lib/Menu.js +11 -0
- package/lib/Modal-D5RJHnbn.js +51 -0
- package/lib/Modal.d.ts +51 -0
- package/lib/Modal.js +7 -0
- package/lib/MultiSelectDropdown-DblSkVpv.js +84 -0
- package/lib/MultiSelectDropdown.d.ts +116 -0
- package/lib/MultiSelectDropdown.js +14 -0
- package/lib/Pickers.d.ts +94 -0
- package/lib/Pickers.js +16 -0
- package/lib/Popover-BU73-g73.js +90 -0
- package/lib/Popover.d.ts +94 -0
- package/lib/Popover.js +8 -0
- package/lib/QuillEditor.d.ts +29 -0
- package/lib/QuillEditor.js +3369 -0
- package/lib/Radio.d.ts +69 -0
- package/lib/Radio.js +10 -0
- package/lib/RadioGroup-DM_Y48_b.js +42 -0
- package/lib/Reorder-DUSHsq7i.js +697 -0
- package/lib/Reorder.d.ts +36 -0
- package/lib/Reorder.js +5 -0
- package/lib/SortDropdown-B0SSCJX6.js +17 -0
- package/lib/SortDropdown.d.ts +47 -0
- package/lib/SortDropdown.js +10 -0
- package/lib/Table-cidceyn5.js +117 -0
- package/lib/Table.d.ts +95 -0
- package/lib/Table.js +18 -0
- package/lib/Tabs-j1c7ybY-.js +50 -0
- package/lib/Tabs.d.ts +68 -0
- package/lib/Tabs.js +6 -0
- package/lib/Tag-Cu75ReQP.js +49 -0
- package/lib/Tag.d.ts +50 -0
- package/lib/Tag.js +4 -0
- package/lib/TextArea--fiwZ_QM.js +98 -0
- package/lib/ThemeProvider-bWL8hyYA.js +7 -0
- package/lib/ThemeProvider.d.ts +158 -0
- package/lib/ThemeProvider.js +9 -0
- package/lib/TickIcon-BJqSAG4_.js +7 -0
- package/lib/TimePicker-7Uqb3xJn.js +6598 -0
- package/lib/Toast.d.ts +61 -0
- package/lib/Toast.js +10 -0
- package/lib/ToastProvider-CMk1PSzB.js +264 -0
- package/lib/Toggle-BGV7Nc6t.js +59 -0
- package/lib/Toggle.d.ts +35 -0
- package/lib/Toggle.js +6 -0
- package/lib/Tooltip-DU_ATFRB.js +127 -0
- package/lib/Tooltip.d.ts +53 -0
- package/lib/Tooltip.js +8 -0
- package/lib/Typography-BcAppjDF.js +11 -0
- package/lib/Typography.d.ts +20 -0
- package/lib/Typography.js +2 -0
- package/lib/WorkspaceTable-BV5zccyt.js +100 -0
- package/lib/WorkspaceTable.d.ts +85 -0
- package/lib/WorkspaceTable.js +18 -0
- package/lib/_commonjsHelpers-fGXyuM93.js +4 -0
- package/lib/allPaths-DKtiSqHL.js +19 -0
- package/lib/allPathsLoader-Drb6xO2O.js +5 -0
- package/lib/index-B9EcTy5B.js +46 -0
- package/lib/index-BPxkexqj.js +60 -0
- package/lib/index-BROhcSiX.js +8 -0
- package/lib/index-BT1o947S.js +8 -0
- package/lib/index-BY9lf-do.js +2 -0
- package/lib/index-BdTXfGkV.js +24 -0
- package/lib/index-BnDw8kbT.js +135 -0
- package/lib/index-BrF1HKA1.js +338 -0
- package/lib/index-BxNZ3C71.js +4 -0
- package/lib/index-ByHJlnsx.js +26 -0
- package/lib/index-COoRg_pp.js +55 -0
- package/lib/index-CeIB4COQ.js +10 -0
- package/lib/index-Cjkk7z9c.js +19 -0
- package/lib/index-D6iTv28r.js +607 -0
- package/lib/index-D8E8s0tV.js +60 -0
- package/lib/index-DtILdK5l.js +48 -0
- package/lib/index-DtzckyT3.js +4 -0
- package/lib/index-Dy5ztCxm.js +27 -0
- package/lib/index-KMLwCm58.js +607 -0
- package/lib/index-_WvIFKTM.js +6 -0
- package/lib/index.d.ts +1826 -1842
- package/lib/index.js +54 -17049
- package/lib/isTypedArray-DN-UDJh5.js +89 -0
- package/lib/keyframes-PnzFl0I5.js +20 -0
- package/lib/package.json +133 -3
- package/lib/rollup.config.d.ts.map +1 -0
- package/lib/splitPathsBySizeLoader-Cm_vHo5k.js +23 -0
- package/lib/styled-components.browser.esm-Bq2p-e5F.js +479 -0
- package/lib/styles-BbwNLGy3.js +177 -0
- package/lib/styles-BlCCKAZq.js +1192 -0
- package/lib/use-toasts-GqvPVmSy.js +5 -0
- package/package.json +148 -12
- package/buildspec.yml +0 -22
- package/freemium-ui-2.0.91.tgz +0 -0
- package/lib/index.cjs.js +0 -17225
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var r={primary:{elephant:"#12344d",smoke:"#ebeff3",milk:"#ffffff",
|
|
2
|
+
E900:"#12344d",E800:"#264966",E700:"#345c7c",E600:"#447093",E500:"#527fa5",
|
|
3
|
+
E400:"#6b92b6",E300:"#83a6c8",E200:"#a2c0de",E100:"#bedbf5",E50:"#dff0ff",
|
|
4
|
+
S900:"#27313a",S800:"#384551",S700:"#475867",S600:"#576c7d",S500:"#647a8e",
|
|
5
|
+
S400:"#7b8e9f",S300:"#92a2b1",S200:"#b1bdc8",S100:"#cfd7df",S75:"#e6e8eb",
|
|
6
|
+
S50:"#ebeff3",S25:"#f5f7f9",S10:"#f7f9fa"},secondary:{jungle:"#005c3f",
|
|
7
|
+
J900:"#005c3f",J800:"#00795b",J700:"#008969",J600:"#009a79",J500:"#00a886",
|
|
8
|
+
J400:"#1cb697",J300:"#4dc4aa",J200:"#82d5c2",J100:"#b4e5da",J50:"#e0f5f1",
|
|
9
|
+
azure:"#2c5cc5",A900:"#283da5",A800:"#2c5cc5",A700:"#2e6ed8",A600:"#2f80eb",
|
|
10
|
+
A500:"#2e8efa",A400:"#459ffc",A300:"#64b0fc",A200:"#90c6fe",A100:"#bbdcfe",
|
|
11
|
+
A50:"#e5f2fd",persimmon:"#e43538",P900:"#c82124",P800:"#d72d30",P700:"#e43538",
|
|
12
|
+
P600:"#f73f3e",P500:"#ff473e",P400:"#ff5959",P300:"#f2797b",P200:"#f89fa1",
|
|
13
|
+
P100:"#ffd0d6",P50:"#ffecf0",casablanca:"#e86f25",C900:"#d7461f",C800:"#e16023",
|
|
14
|
+
C700:"#e86f25",C600:"#ef7e27",C500:"#f48928",C400:"#f69a3c",C300:"#f8ab59",
|
|
15
|
+
C200:"#fac386",C100:"#fddbb5",C50:"#fef1e1"},common:{black:"#000000",
|
|
16
|
+
white:"#ffffff",neutral:{light_mild:"#ffffff",light_normal:"#f6f7f8",
|
|
17
|
+
light_bold:"#eceff1",dark_mild:"#0b0c0d",dark_normal:"#141617",
|
|
18
|
+
dark_bold:"#191a1c"}}
|
|
19
|
+
},o="-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial, sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol'",e=function(r,o){
|
|
20
|
+
void 0===o&&(o=1);var e=o,a=r.replace(/^#/,"")
|
|
21
|
+
;8===r.length||4===r.length?(e=parseInt(r.slice(-2),16)/255,
|
|
22
|
+
a=r.slice(0,-2)):3===a.length&&(a=a.replace(/(.)/g,"$1$1"))
|
|
23
|
+
;var n=[0,2,4].map((function(r){return parseInt(a.slice(r,r+2),16)
|
|
24
|
+
})),i=n[0],c=n[1],d=n[2]
|
|
25
|
+
;return"rgba(".concat(i,", ").concat(c,", ").concat(d,", ").concat(e.toFixed(2),")")
|
|
26
|
+
},a={popover:900,dropdown:900,mobileStepper:1e3,fab:1050,speedDial:1050,
|
|
27
|
+
appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},n={mode:"light",
|
|
28
|
+
direction:"ltr",breakpoints:{keys:["xs","sm","md","lg","xl"],values:{xs:0,
|
|
29
|
+
sm:600,md:900,lg:1200,xl:1536},unit:"px"},colors:{common:{black:r.common.black,
|
|
30
|
+
white:r.common.white,accent:r.secondary.A800},text:{link:r.secondary.A800,
|
|
31
|
+
primary:r.primary.E900,secondary:r.primary.S700,disabled:r.primary.S400,
|
|
32
|
+
placeholder:r.primary.S300,error:r.secondary.P800,inverse:r.common.white,
|
|
33
|
+
semantic:{success:r.secondary.J500,warning:r.secondary.C500,
|
|
34
|
+
error:r.secondary.P500,info:r.secondary.A500}},fill:{base:r.primary.S25,
|
|
35
|
+
medium:r.primary.S50,dark:r.primary.S100,surface:r.common.white,
|
|
36
|
+
inverse:r.primary.E900,hover:r.primary.S50,disabled:r.primary.S50,
|
|
37
|
+
hilight:r.secondary.A50},semantic:{error:{bg:r.secondary.P50,
|
|
38
|
+
border:r.secondary.P100},warning:{bg:r.secondary.C50,border:r.secondary.C100},
|
|
39
|
+
info:{bg:r.secondary.A50,border:r.secondary.A100},success:{bg:r.secondary.J50,
|
|
40
|
+
border:r.secondary.J100}},border:{light:r.primary.S50,normal:r.primary.S100,
|
|
41
|
+
divider:r.primary.S100,hover:r.primary.S300,active:r.secondary.A800,
|
|
42
|
+
disabled:r.primary.S50,error:r.secondary.P800},shadow:r.primary.E900,
|
|
43
|
+
scrim:r.primary.E900},typography:{fontFamily:o,fontWeight:{bold:700,
|
|
44
|
+
"semi-bold":600,regular:400},primary:{fontSize:"14px",fontWeight:400,
|
|
45
|
+
lineHeight:1.5},secondary:{fontSize:"12px",fontWeight:400,lineHeight:1.5},
|
|
46
|
+
heading:{fontSize:"16px",fontWeight:400,lineHeight:1.25},heading1:{
|
|
47
|
+
fontSize:"44px",fontWeight:400,lineHeight:1.25},heading2:{fontSize:"32px",
|
|
48
|
+
fontWeight:400,lineHeight:1.25},heading3:{fontSize:"24px",fontWeight:400,
|
|
49
|
+
lineHeight:1.25},heading4:{fontSize:"18px",fontWeight:400,lineHeight:1.25},
|
|
50
|
+
caption:{fontSize:"12px",fontWeight:400,lineHeight:1}},
|
|
51
|
+
shadows:["none","0px 2px 1px -1px ".concat(e(r.common.black,.2),",0px 1px 1px 0px ").concat(e(r.common.black,.14),",0px 1px 3px 0px ").concat(e(r.common.black,.12)),"0px 3px 1px -2px ".concat(e(r.common.black,.2),",0px 2px 2px 0px ").concat(e(r.common.black,.14),",0px 1px 5px 0px ").concat(e(r.common.black,.12)),"0px 3px 3px -2px ".concat(e(r.common.black,.2),",0px 3px 4px 0px ").concat(e(r.common.black,.14),",0px 1px 8px 0px ").concat(e(r.common.black,.12))],
|
|
52
|
+
transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",
|
|
53
|
+
easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.16, 1, 0.3, 1)",
|
|
54
|
+
sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{short:"250ms",standard:"300ms",
|
|
55
|
+
complex:"450ms"}},zIndex:a,components:{toast:{position:"center"},button:{
|
|
56
|
+
primary:{backgroundFrom:r.primary.E800,backgroundTo:r.primary.E900,
|
|
57
|
+
color:r.common.white,disabledColor:r.primary.S10,
|
|
58
|
+
activeBackgroundColor:r.primary.E800,hoverColor:r.primary.E900,
|
|
59
|
+
borderColor:r.primary.E900,activeBorderColor:r.primary.E900,
|
|
60
|
+
disabledBorderColor:r.primary.S400,disabledBackgroundFrom:r.primary.S300,
|
|
61
|
+
disabledBackgroundTo:r.primary.S400},secondary:{backgroundFrom:r.common.white,
|
|
62
|
+
backgroundTo:r.primary.S25,color:r.primary.E900,disabledColor:r.primary.S300,
|
|
63
|
+
activeBackgroundColor:r.primary.S25,hoverColor:r.primary.S25,
|
|
64
|
+
borderColor:r.primary.S100,activeBorderColor:r.primary.S25,
|
|
65
|
+
disabledBorderColor:r.primary.S100,disabledBackgroundFrom:r.primary.S50,
|
|
66
|
+
disabledBackgroundTo:r.primary.S50},danger:{backgroundFrom:r.secondary.P800,
|
|
67
|
+
backgroundTo:r.secondary.P900,color:r.common.white,
|
|
68
|
+
disabledColor:r.secondary.P100,activeBackgroundColor:r.secondary.P800,
|
|
69
|
+
hoverColor:r.secondary.P900,borderColor:r.secondary.P900,
|
|
70
|
+
activeBorderColor:r.secondary.P200,disabledBorderColor:r.secondary.P300,
|
|
71
|
+
disabledBackgroundFrom:r.secondary.P200,disabledBackgroundTo:r.secondary.P300},
|
|
72
|
+
link:{backgroundFrom:r.common.white,backgroundTo:r.common.white,
|
|
73
|
+
color:r.secondary.A800,disabledColor:r.secondary.A100,
|
|
74
|
+
activeBackgroundColor:r.primary.S25,hoverColor:r.primary.S50,
|
|
75
|
+
borderColor:r.common.white,activeBorderColor:r.primary.S25,
|
|
76
|
+
disabledBorderColor:r.common.white,disabledBackgroundFrom:r.common.white,
|
|
77
|
+
disabledBackgroundTo:r.common.white}}}},i={mode:"dark",direction:"ltr",
|
|
78
|
+
breakpoints:{keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:900,lg:1200,
|
|
79
|
+
xl:1536},unit:"px"},colors:{common:{black:r.common.neutral.dark_mild,
|
|
80
|
+
white:r.common.white,accent:r.secondary.A400},text:{link:r.secondary.A400,
|
|
81
|
+
primary:r.primary.S100,secondary:r.primary.S300,disabled:r.primary.S500,
|
|
82
|
+
placeholder:r.primary.S400,error:r.secondary.P400,inverse:r.common.black,
|
|
83
|
+
semantic:{success:r.secondary.J400,warning:r.secondary.C400,
|
|
84
|
+
error:r.secondary.P400,info:r.secondary.A400}},fill:{
|
|
85
|
+
base:r.common.neutral.dark_bold,medium:r.common.neutral.dark_normal,
|
|
86
|
+
dark:r.primary.S100,surface:r.common.neutral.dark_mild,inverse:r.primary.E100,
|
|
87
|
+
hover:r.primary.S700,disabled:r.primary.S50,hilight:r.secondary.A50},semantic:{
|
|
88
|
+
error:{bg:e(r.secondary.P700,.2),border:r.secondary.P500},warning:{
|
|
89
|
+
bg:e(r.secondary.C700,.2),border:r.secondary.C500},info:{
|
|
90
|
+
bg:e(r.secondary.A700,.2),border:r.secondary.A500},success:{
|
|
91
|
+
bg:e(r.secondary.J700,.2),border:r.secondary.J500}},border:{
|
|
92
|
+
light:r.primary.S800,normal:r.primary.S500,divider:r.primary.S800,
|
|
93
|
+
hover:r.primary.S500,active:r.secondary.A400,disabled:r.primary.S50,
|
|
94
|
+
error:r.secondary.P500},shadow:r.primary.E50,scrim:r.primary.E900},typography:{
|
|
95
|
+
fontFamily:o,fontWeight:{bold:700,"semi-bold":600,regular:400},primary:{
|
|
96
|
+
fontSize:"14px",fontWeight:400,lineHeight:1.5},secondary:{fontSize:"12px",
|
|
97
|
+
fontWeight:400,lineHeight:1.5},heading:{fontSize:"16px",fontWeight:400,
|
|
98
|
+
lineHeight:1.25},heading1:{fontSize:"44px",fontWeight:400,lineHeight:1.25},
|
|
99
|
+
heading2:{fontSize:"32px",fontWeight:400,lineHeight:1.25},heading3:{
|
|
100
|
+
fontSize:"24px",fontWeight:400,lineHeight:1.25},heading4:{fontSize:"18px",
|
|
101
|
+
fontWeight:400,lineHeight:1.25},caption:{fontSize:"12px",fontWeight:400,
|
|
102
|
+
lineHeight:1}},
|
|
103
|
+
shadows:["none","0px 2px 1px -1px ".concat(e(r.primary.E900,.2),",0px 1px 1px 0px ").concat(e(r.primary.E900,.14),",0px 1px 3px 0px ").concat(e(r.primary.E900,.12)),"0px 3px 1px -2px ".concat(e(r.primary.E900,.2),",0px 2px 2px 0px ").concat(e(r.primary.E900,.14),",0px 1px 5px 0px ").concat(e(r.primary.E900,.12)),"0px 3px 3px -2px ".concat(e(r.primary.E900,.2),",0px 3px 4px 0px ").concat(e(r.primary.E900,.14),",0px 1px 8px 0px ").concat(e(r.primary.E900,.12))],
|
|
104
|
+
transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",
|
|
105
|
+
easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.16, 1, 0.3, 1)",
|
|
106
|
+
sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{short:"250ms",standard:"300ms",
|
|
107
|
+
complex:"450ms"}},zIndex:a,components:{toast:{position:"center"},button:{
|
|
108
|
+
primary:{backgroundFrom:r.primary.E100,backgroundTo:r.primary.E100,
|
|
109
|
+
color:r.common.black,disabledColor:r.common.black,
|
|
110
|
+
activeBackgroundColor:r.primary.E50,hoverColor:r.primary.E50,
|
|
111
|
+
borderColor:r.primary.E50,activeBorderColor:r.primary.E50,
|
|
112
|
+
disabledBorderColor:r.primary.E50,disabledBackgroundFrom:r.primary.E100,
|
|
113
|
+
disabledBackgroundTo:r.primary.E100},secondary:{
|
|
114
|
+
backgroundFrom:r.common.neutral.dark_mild,
|
|
115
|
+
backgroundTo:r.common.neutral.dark_mild,color:r.primary.S100,
|
|
116
|
+
disabledColor:r.primary.S500,activeBackgroundColor:r.common.neutral.dark_normal,
|
|
117
|
+
hoverColor:r.common.neutral.dark_normal,borderColor:r.primary.S800,
|
|
118
|
+
activeBorderColor:r.primary.S800,disabledBorderColor:r.primary.S800,
|
|
119
|
+
disabledBackgroundFrom:r.common.neutral.dark_bold,
|
|
120
|
+
disabledBackgroundTo:r.common.neutral.dark_bold},danger:{
|
|
121
|
+
backgroundFrom:r.secondary.P400,backgroundTo:r.secondary.P400,
|
|
122
|
+
color:r.common.black,disabledColor:r.secondary.P100,
|
|
123
|
+
activeBackgroundColor:r.secondary.P400,hoverColor:r.secondary.P300,
|
|
124
|
+
borderColor:r.secondary.P300,activeBorderColor:r.secondary.P800,
|
|
125
|
+
disabledBorderColor:r.secondary.P300,disabledBackgroundFrom:r.secondary.P400,
|
|
126
|
+
disabledBackgroundTo:r.secondary.P400},link:{
|
|
127
|
+
backgroundFrom:r.common.neutral.dark_mild,
|
|
128
|
+
backgroundTo:r.common.neutral.dark_mild,color:r.secondary.A400,
|
|
129
|
+
disabledColor:r.secondary.A100,activeBackgroundColor:r.common.neutral.dark_mild,
|
|
130
|
+
hoverColor:r.common.neutral.dark_mild,borderColor:"transparent",
|
|
131
|
+
activeBorderColor:r.secondary.A400,disabledBorderColor:"transparent",
|
|
132
|
+
disabledBackgroundFrom:r.common.neutral.dark_mild,
|
|
133
|
+
disabledBackgroundTo:r.common.neutral.dark_mild}}}},c=Object.freeze({
|
|
134
|
+
__proto__:null,Z_INDEX:a,dark:i,hextoRGB:e,light:n})
|
|
135
|
+
;export{a as Z,e as h,c as i,r as p};
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import{a as t,_ as e,$ as n}from"./index-ByHJlnsx.js";import*as o from"react"
|
|
2
|
+
;import{useLayoutEffect as r,useEffect as i,forwardRef as l,createElement as a,useState as s,useRef as c}from"react"
|
|
3
|
+
;import*as f from"react-dom"
|
|
4
|
+
;import{$ as u,b as d,c as p}from"./index-BdTXfGkV.js"
|
|
5
|
+
;import{$ as m}from"./index-BROhcSiX.js"
|
|
6
|
+
;const h=["top","right","bottom","left"],g=Math.min,y=Math.max,w=Math.round,x=Math.floor,v=t=>({
|
|
7
|
+
x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"},A={
|
|
8
|
+
start:"end",end:"start"};function R(t,e,n){return y(t,g(e,n))}function P(t,e){
|
|
9
|
+
return"function"==typeof t?t(e):t}function O(t){return t.split("-")[0]}
|
|
10
|
+
function S(t){return t.split("-")[1]}function T(t){return"x"===t?"y":"x"}
|
|
11
|
+
function E(t){return"y"===t?"height":"width"}function L(t){
|
|
12
|
+
return["top","bottom"].includes(O(t))?"y":"x"}function C(t){return T(L(t))}
|
|
13
|
+
function D(t){return t.replace(/start|end/g,(t=>A[t]))}function H(t){
|
|
14
|
+
return t.replace(/left|right|bottom|top/g,(t=>b[t]))}function k(t){
|
|
15
|
+
return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}
|
|
16
|
+
}(t):{top:t,right:t,bottom:t,left:t}}function F(t){
|
|
17
|
+
const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,
|
|
18
|
+
right:e+o,bottom:n+r,x:e,y:n}}function $(t,e,n){let{reference:o,floating:r}=t
|
|
19
|
+
;const i=L(e),l=C(e),a=E(l),s=O(e),c="y"===i,f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,d=o[a]/2-r[a]/2
|
|
20
|
+
;let p;switch(s){case"top":p={x:f,y:o.y-r.height};break;case"bottom":p={x:f,
|
|
21
|
+
y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={
|
|
22
|
+
x:o.x-r.width,y:u};break;default:p={x:o.x,y:o.y}}switch(S(e)){case"start":
|
|
23
|
+
p[l]-=d*(n&&c?-1:1);break;case"end":p[l]+=d*(n&&c?-1:1)}return p}
|
|
24
|
+
async function W(t,e){var n;void 0===e&&(e={})
|
|
25
|
+
;const{x:o,y:r,platform:i,rects:l,elements:a,strategy:s}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=P(e,t),m=k(p),h=a[d?"floating"===u?"reference":"floating":u],g=F(await i.getClippingRect({
|
|
26
|
+
element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),
|
|
27
|
+
boundary:c,rootBoundary:f,strategy:s})),y="floating"===u?{x:o,y:r,
|
|
28
|
+
width:l.floating.width,height:l.floating.height
|
|
29
|
+
}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{
|
|
30
|
+
x:1,y:1
|
|
31
|
+
},v=F(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
32
|
+
elements:a,rect:y,offsetParent:w,strategy:s}):y);return{
|
|
33
|
+
top:(g.top-v.top+m.top)/x.y,bottom:(v.bottom-g.bottom+m.bottom)/x.y,
|
|
34
|
+
left:(g.left-v.left+m.left)/x.x,right:(v.right-g.right+m.right)/x.x}}
|
|
35
|
+
function M(t,e){return{top:t.top-e.height,right:t.right-e.width,
|
|
36
|
+
bottom:t.bottom-e.height,left:t.left-e.width}}function B(t){
|
|
37
|
+
return h.some((e=>t[e]>=0))}function _(t){
|
|
38
|
+
return j(t)?(t.nodeName||"").toLowerCase():"#document"}function z(t){var e
|
|
39
|
+
;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}
|
|
40
|
+
function V(t){var e
|
|
41
|
+
;return null==(e=(j(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement
|
|
42
|
+
}function j(t){return t instanceof Node||t instanceof z(t).Node}function Y(t){
|
|
43
|
+
return t instanceof Element||t instanceof z(t).Element}function N(t){
|
|
44
|
+
return t instanceof HTMLElement||t instanceof z(t).HTMLElement}function X(t){
|
|
45
|
+
return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof z(t).ShadowRoot)
|
|
46
|
+
}function I(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Q(t)
|
|
47
|
+
;return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)
|
|
48
|
+
}function q(t){return["table","td","th"].includes(_(t))}function G(t){
|
|
49
|
+
const e=J(),n=Q(t)
|
|
50
|
+
;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))
|
|
51
|
+
}function J(){
|
|
52
|
+
return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")
|
|
53
|
+
}function K(t){return["html","body","#document"].includes(_(t))}function Q(t){
|
|
54
|
+
return z(t).getComputedStyle(t)}function U(t){return Y(t)?{
|
|
55
|
+
scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,
|
|
56
|
+
scrollTop:t.pageYOffset}}function Z(t){if("html"===_(t))return t
|
|
57
|
+
;const e=t.assignedSlot||t.parentNode||X(t)&&t.host||V(t);return X(e)?e.host:e}
|
|
58
|
+
function tt(t){const e=Z(t)
|
|
59
|
+
;return K(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&I(e)?e:tt(e)}
|
|
60
|
+
function et(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0)
|
|
61
|
+
;const r=tt(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),l=z(r)
|
|
62
|
+
;return i?e.concat(l,l.visualViewport||[],I(r)?r:[],l.frameElement&&n?et(l.frameElement):[]):e.concat(r,et(r,[],n))
|
|
63
|
+
}function nt(t){const e=Q(t)
|
|
64
|
+
;let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0
|
|
65
|
+
;const r=N(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,a=w(n)!==i||w(o)!==l
|
|
66
|
+
;return a&&(n=i,o=l),{width:n,height:o,$:a}}function ot(t){
|
|
67
|
+
return Y(t)?t:t.contextElement}function rt(t){const e=ot(t);if(!N(e))return v(1)
|
|
68
|
+
;const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=nt(e)
|
|
69
|
+
;let l=(i?w(n.width):n.width)/o,a=(i?w(n.height):n.height)/r
|
|
70
|
+
;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}
|
|
71
|
+
const it=v(0);function lt(t){const e=z(t);return J()&&e.visualViewport?{
|
|
72
|
+
x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:it}
|
|
73
|
+
function at(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1)
|
|
74
|
+
;const r=t.getBoundingClientRect(),i=ot(t);let l=v(1)
|
|
75
|
+
;e&&(o?Y(o)&&(l=rt(o)):l=rt(t));const a=function(t,e,n){
|
|
76
|
+
return void 0===e&&(e=!1),!(!n||e&&n!==z(t))&&e}(i,n,o)?lt(i):v(0)
|
|
77
|
+
;let s=(r.left+a.x)/l.x,c=(r.top+a.y)/l.y,f=r.width/l.x,u=r.height/l.y;if(i){
|
|
78
|
+
const t=z(i),e=o&&Y(o)?z(o):o;let n=t,r=n.frameElement;for(;r&&o&&e!==n;){
|
|
79
|
+
const t=rt(r),e=r.getBoundingClientRect(),o=Q(r),i=e.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(r.clientTop+parseFloat(o.paddingTop))*t.y
|
|
80
|
+
;s*=t.x,c*=t.y,f*=t.x,u*=t.y,s+=i,c+=l,n=z(r),r=n.frameElement}}return F({
|
|
81
|
+
width:f,height:u,x:s,y:c})}const st=[":popover-open",":modal"];function ct(t){
|
|
82
|
+
return st.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}
|
|
83
|
+
function ft(t){return at(V(t)).left+U(t).scrollLeft}function ut(t,e,n){let o
|
|
84
|
+
;if("viewport"===e)o=function(t,e){const n=z(t),o=V(t),r=n.visualViewport
|
|
85
|
+
;let i=o.clientWidth,l=o.clientHeight,a=0,s=0;if(r){i=r.width,l=r.height
|
|
86
|
+
;const t=J();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,s=r.offsetTop)}return{
|
|
87
|
+
width:i,height:l,x:a,y:s}}(t,n);else if("document"===e)o=function(t){
|
|
88
|
+
const e=V(t),n=U(t),o=t.ownerDocument.body,r=y(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=y(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight)
|
|
89
|
+
;let l=-n.scrollLeft+ft(t);const a=-n.scrollTop
|
|
90
|
+
;return"rtl"===Q(o).direction&&(l+=y(e.clientWidth,o.clientWidth)-r),{width:r,
|
|
91
|
+
height:i,x:l,y:a}}(V(t));else if(Y(e))o=function(t,e){
|
|
92
|
+
const n=at(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=N(t)?rt(t):v(1)
|
|
93
|
+
;return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}
|
|
94
|
+
}(e,n);else{const n=lt(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return F(o)}
|
|
95
|
+
function dt(t,e){const n=Z(t)
|
|
96
|
+
;return!(n===e||!Y(n)||K(n))&&("fixed"===Q(n).position||dt(n,e))}
|
|
97
|
+
function pt(t,e,n){const o=N(e),r=V(e),i="fixed"===n,l=at(t,!0,i,e);let a={
|
|
98
|
+
scrollLeft:0,scrollTop:0};const s=v(0)
|
|
99
|
+
;if(o||!o&&!i)if(("body"!==_(e)||I(r))&&(a=U(e)),o){const t=at(e,!0,i,e)
|
|
100
|
+
;s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else r&&(s.x=ft(r));return{
|
|
101
|
+
x:l.left+a.scrollLeft-s.x,y:l.top+a.scrollTop-s.y,width:l.width,height:l.height}
|
|
102
|
+
}function mt(t,e){
|
|
103
|
+
return N(t)&&"fixed"!==Q(t).position?e?e(t):t.offsetParent:null}
|
|
104
|
+
function ht(t,e){const n=z(t);if(!N(t)||ct(t))return n;let o=mt(t,e)
|
|
105
|
+
;for(;o&&q(o)&&"static"===Q(o).position;)o=mt(o,e)
|
|
106
|
+
;return o&&("html"===_(o)||"body"===_(o)&&"static"===Q(o).position&&!G(o))?n:o||function(t){
|
|
107
|
+
let e=Z(t);for(;N(e)&&!K(e);){if(G(e))return e;e=Z(e)}return null}(t)||n}
|
|
108
|
+
const gt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){
|
|
109
|
+
let{elements:e,rect:n,offsetParent:o,strategy:r}=t
|
|
110
|
+
;const i="fixed"===r,l=V(o),a=!!e&&ct(e.floating);if(o===l||a&&i)return n
|
|
111
|
+
;let s={scrollLeft:0,scrollTop:0},c=v(1);const f=v(0),u=N(o)
|
|
112
|
+
;if((u||!u&&!i)&&(("body"!==_(o)||I(l))&&(s=U(o)),N(o))){const t=at(o)
|
|
113
|
+
;c=rt(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}return{width:n.width*c.x,
|
|
114
|
+
height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+f.x,y:n.y*c.y-s.scrollTop*c.y+f.y
|
|
115
|
+
}},getDocumentElement:V,getClippingRect:function(t){
|
|
116
|
+
let{element:e,boundary:n,rootBoundary:o,strategy:r}=t
|
|
117
|
+
;const i=[..."clippingAncestors"===n?function(t,e){const n=e.get(t)
|
|
118
|
+
;if(n)return n;let o=et(t,[],!1).filter((t=>Y(t)&&"body"!==_(t))),r=null
|
|
119
|
+
;const i="fixed"===Q(t).position;let l=i?Z(t):t;for(;Y(l)&&!K(l);){
|
|
120
|
+
const e=Q(l),n=G(l)
|
|
121
|
+
;n||"fixed"!==e.position||(r=null),(i?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||I(l)&&!n&&dt(t,l))?o=o.filter((t=>t!==l)):r=e,
|
|
122
|
+
l=Z(l)}return e.set(t,o),o
|
|
123
|
+
}(e,this._c):[].concat(n),o],l=i[0],a=i.reduce(((t,n)=>{const o=ut(e,n,r)
|
|
124
|
+
;return t.top=y(o.top,t.top),
|
|
125
|
+
t.right=g(o.right,t.right),t.bottom=g(o.bottom,t.bottom),
|
|
126
|
+
t.left=y(o.left,t.left),t}),ut(e,l,r));return{width:a.right-a.left,
|
|
127
|
+
height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ht,
|
|
128
|
+
getElementRects:async function(t){
|
|
129
|
+
const e=this.getOffsetParent||ht,n=this.getDimensions,o=await n(t.floating)
|
|
130
|
+
;return{reference:pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,
|
|
131
|
+
y:0,width:o.width,height:o.height}}},getClientRects:function(t){
|
|
132
|
+
return Array.from(t.getClientRects())},getDimensions:function(t){
|
|
133
|
+
const{width:e,height:n}=nt(t);return{width:e,height:n}},getScale:rt,isElement:Y,
|
|
134
|
+
isRTL:function(t){return"rtl"===Q(t).direction}};function yt(t,e,n,o){
|
|
135
|
+
void 0===o&&(o={})
|
|
136
|
+
;const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=ot(t),f=r||i?[...c?et(c):[],...et(e)]:[]
|
|
137
|
+
;f.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0
|
|
138
|
+
}),i&&t.addEventListener("resize",n)}));const u=c&&a?function(t,e){let n,o=null
|
|
139
|
+
;const r=V(t);function i(){var t
|
|
140
|
+
;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(a,s){
|
|
141
|
+
void 0===a&&(a=!1),void 0===s&&(s=1),i()
|
|
142
|
+
;const{left:c,top:f,width:u,height:d}=t.getBoundingClientRect()
|
|
143
|
+
;if(a||e(),!u||!d)return;const p={
|
|
144
|
+
rootMargin:-x(f)+"px "+-x(r.clientWidth-(c+u))+"px "+-x(r.clientHeight-(f+d))+"px "+-x(c)+"px",
|
|
145
|
+
threshold:y(0,g(1,s))||1};let m=!0;function h(t){const e=t[0].intersectionRatio
|
|
146
|
+
;if(e!==s){if(!m)return l();e?l(!1,e):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}m=!1}
|
|
147
|
+
try{o=new IntersectionObserver(h,{...p,root:r.ownerDocument})}catch(t){
|
|
148
|
+
o=new IntersectionObserver(h,p)}o.observe(t)}(!0),i}(c,n):null;let d,p=-1,m=null
|
|
149
|
+
;l&&(m=new ResizeObserver((t=>{let[o]=t
|
|
150
|
+
;o&&o.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(p),
|
|
151
|
+
p=requestAnimationFrame((()=>{var t;null==(t=m)||t.observe(e)}))),n()
|
|
152
|
+
})),c&&!s&&m.observe(c),m.observe(e));let h=s?at(t):null;return s&&function e(){
|
|
153
|
+
const o=at(t)
|
|
154
|
+
;!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n()
|
|
155
|
+
;h=o,d=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach((t=>{
|
|
156
|
+
r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)
|
|
157
|
+
})),null==u||u(),null==(t=m)||t.disconnect(),m=null,s&&cancelAnimationFrame(d)}}
|
|
158
|
+
const wt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,
|
|
159
|
+
async fn(e){var n,o
|
|
160
|
+
;const{x:r,y:i,placement:l,middlewareData:a}=e,s=await async function(t,e){
|
|
161
|
+
const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=O(n),a=S(n),s="y"===L(n),c=["left","top"].includes(l)?-1:1,f=i&&s?-1:1,u=P(e,t)
|
|
162
|
+
;let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof u?{mainAxis:u,
|
|
163
|
+
crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u}
|
|
164
|
+
;return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*f,y:d*c}:{x:d*c,y:p*f
|
|
165
|
+
}}(e,t)
|
|
166
|
+
;return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{
|
|
167
|
+
x:r+s.x,y:i+s.y,data:{...s,placement:l}}}}},xt=function(t){
|
|
168
|
+
return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){
|
|
169
|
+
const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:t=>{
|
|
170
|
+
let{x:e,y:n}=t;return{x:e,y:n}}},...s}=P(t,e),c={x:n,y:o
|
|
171
|
+
},f=await W(e,s),u=L(O(r)),d=T(u);let p=c[d],m=c[u];if(i){
|
|
172
|
+
const t="y"===d?"bottom":"right";p=R(p+f["y"===d?"top":"left"],p,p-f[t])}if(l){
|
|
173
|
+
const t="y"===u?"bottom":"right";m=R(m+f["y"===u?"top":"left"],m,m-f[t])}
|
|
174
|
+
const h=a.fn({...e,[d]:p,[u]:m});return{...h,data:{x:h.x-n,y:h.y-o}}}}
|
|
175
|
+
},vt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){
|
|
176
|
+
var n,o
|
|
177
|
+
;const{placement:r,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=P(t,e)
|
|
178
|
+
;if(null!=(n=i.arrow)&&n.alignmentOffset)return{}
|
|
179
|
+
;const y=O(r),w=O(a)===a,x=await(null==s.isRTL?void 0:s.isRTL(c.floating)),v=d||(w||!h?[H(a)]:function(t){
|
|
180
|
+
const e=H(t);return[D(t),e,D(e)]}(a))
|
|
181
|
+
;d||"none"===m||v.push(...function(t,e,n,o){const r=S(t);let i=function(t,e,n){
|
|
182
|
+
const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"]
|
|
183
|
+
;switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":
|
|
184
|
+
return e?i:l;default:return[]}}(O(t),"start"===n,o)
|
|
185
|
+
;return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(D)))),i}(a,h,m,x))
|
|
186
|
+
;const b=[a,...v],A=await W(e,g),R=[]
|
|
187
|
+
;let T=(null==(o=i.flip)?void 0:o.overflows)||[];if(f&&R.push(A[y]),u){
|
|
188
|
+
const t=function(t,e,n){void 0===n&&(n=!1);const o=S(t),r=C(t),i=E(r)
|
|
189
|
+
;let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top"
|
|
190
|
+
;return e.reference[i]>e.floating[i]&&(l=H(l)),[l,H(l)]}(r,l,x)
|
|
191
|
+
;R.push(A[t[0]],A[t[1]])}if(T=[...T,{placement:r,overflows:R
|
|
192
|
+
}],!R.every((t=>t<=0))){var L,k
|
|
193
|
+
;const t=((null==(L=i.flip)?void 0:L.index)||0)+1,e=b[t];if(e)return{data:{
|
|
194
|
+
index:t,overflows:T},reset:{placement:e}}
|
|
195
|
+
;let n=null==(k=T.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:k.placement
|
|
196
|
+
;if(!n)switch(p){case"bestFit":{var F
|
|
197
|
+
;const t=null==(F=T.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:F[0]
|
|
198
|
+
;t&&(n=t);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}
|
|
199
|
+
return{}}}},bt=function(t){return void 0===t&&(t={}),{name:"size",options:t,
|
|
200
|
+
async fn(e){
|
|
201
|
+
const{placement:n,rects:o,platform:r,elements:i}=e,{apply:l=(()=>{}),...a}=P(t,e),s=await W(e,a),c=O(n),f=S(n),u="y"===L(n),{width:d,height:p}=o.floating
|
|
202
|
+
;let m,h
|
|
203
|
+
;"top"===c||"bottom"===c?(m=c,h=f===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(h=c,
|
|
204
|
+
m="end"===f?"top":"bottom");const w=p-s[m],x=d-s[h],v=!e.middlewareData.shift
|
|
205
|
+
;let b=w,A=x;if(u){const t=d-s.left-s.right;A=f||v?g(x,t):t}else{
|
|
206
|
+
const t=p-s.top-s.bottom;b=f||v?g(w,t):t}if(v&&!f){
|
|
207
|
+
const t=y(s.left,0),e=y(s.right,0),n=y(s.top,0),o=y(s.bottom,0)
|
|
208
|
+
;u?A=d-2*(0!==t||0!==e?t+e:y(s.left,s.right)):b=p-2*(0!==n||0!==o?n+o:y(s.top,s.bottom))
|
|
209
|
+
}await l({...e,availableWidth:A,availableHeight:b})
|
|
210
|
+
;const R=await r.getDimensions(i.floating);return d!==R.width||p!==R.height?{
|
|
211
|
+
reset:{rects:!0}}:{}}}},At=function(t){return void 0===t&&(t={}),{name:"hide",
|
|
212
|
+
options:t,async fn(e){
|
|
213
|
+
const{rects:n}=e,{strategy:o="referenceHidden",...r}=P(t,e);switch(o){
|
|
214
|
+
case"referenceHidden":{const t=M(await W(e,{...r,elementContext:"reference"
|
|
215
|
+
}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:B(t)}}}
|
|
216
|
+
case"escaped":{const t=M(await W(e,{...r,altBoundary:!0}),n.floating);return{
|
|
217
|
+
data:{escapedOffsets:t,escaped:B(t)}}}default:return{}}}}},Rt=t=>({name:"arrow",
|
|
218
|
+
options:t,async fn(e){
|
|
219
|
+
const{x:n,y:o,placement:r,rects:i,platform:l,elements:a,middlewareData:s}=e,{element:c,padding:f=0}=P(t,e)||{}
|
|
220
|
+
;if(null==c)return{};const u=k(f),d={x:n,y:o
|
|
221
|
+
},p=C(r),m=E(p),h=await l.getDimensions(c),y="y"===p,w=y?"top":"left",x=y?"bottom":"right",v=y?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],A=d[p]-i.reference[p],O=await(null==l.getOffsetParent?void 0:l.getOffsetParent(c))
|
|
222
|
+
;let T=O?O[v]:0
|
|
223
|
+
;T&&await(null==l.isElement?void 0:l.isElement(O))||(T=a.floating[v]||i.floating[m])
|
|
224
|
+
;const L=b/2-A/2,D=T/2-h[m]/2-1,H=g(u[w],D),F=g(u[x],D),$=H,W=T-h[m]-F,M=T/2-h[m]/2+L,B=R($,M,W),_=!s.arrow&&null!=S(r)&&M!==B&&i.reference[m]/2-(M<$?H:F)-h[m]/2<0,z=_?M<$?M-$:M-W:0
|
|
225
|
+
;return{[p]:d[p]+z,data:{[p]:B,centerOffset:M-B-z,..._&&{alignmentOffset:z}},
|
|
226
|
+
reset:_}}}),Pt=function(t){return void 0===t&&(t={}),{options:t,fn(e){
|
|
227
|
+
const{x:n,y:o,placement:r,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=P(t,e),f={
|
|
228
|
+
x:n,y:o},u=L(r),d=T(u);let p=f[d],m=f[u];const h=P(a,e),g="number"==typeof h?{
|
|
229
|
+
mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){
|
|
230
|
+
const t="y"===d?"height":"width",e=i.reference[d]-i.floating[t]+g.mainAxis,n=i.reference[d]+i.reference[t]-g.mainAxis
|
|
231
|
+
;p<e?p=e:p>n&&(p=n)}if(c){var y,w
|
|
232
|
+
;const t="y"===d?"width":"height",e=["top","left"].includes(O(r)),n=i.reference[u]-i.floating[t]+(e&&(null==(y=l.offset)?void 0:y[u])||0)+(e?0:g.crossAxis),o=i.reference[u]+i.reference[t]+(e?0:(null==(w=l.offset)?void 0:w[u])||0)-(e?g.crossAxis:0)
|
|
233
|
+
;m<n?m=n:m>o&&(m=o)}return{[d]:p,[u]:m}}}},Ot=(t,e,n)=>{const o=new Map,r={
|
|
234
|
+
platform:gt,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{
|
|
235
|
+
const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e))
|
|
236
|
+
;let c=await l.getElementRects({reference:t,floating:e,strategy:r
|
|
237
|
+
}),{x:f,y:u}=$(c,o,s),d=o,p={},m=0;for(let n=0;n<a.length;n++){
|
|
238
|
+
const{name:i,fn:h}=a[n],{x:g,y,data:w,reset:x}=await h({x:f,y:u,
|
|
239
|
+
initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:c,platform:l,
|
|
240
|
+
elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,p={...p,[i]:{
|
|
241
|
+
...p[i],...w}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),
|
|
242
|
+
x.rects&&(c=!0===x.rects?await l.getElementRects({reference:t,floating:e,
|
|
243
|
+
strategy:r}):x.rects),({x:f,y:u}=$(c,d,s))),n=-1)}return{x:f,y:u,placement:d,
|
|
244
|
+
strategy:r,middlewareData:p}})(t,e,{...r,platform:i})},St=t=>({name:"arrow",
|
|
245
|
+
options:t,fn(e){const{element:n,padding:o}="function"==typeof t?t(e):t
|
|
246
|
+
;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Rt({
|
|
247
|
+
element:n.current,padding:o}).fn(e):{}:n?Rt({element:n,padding:o}).fn(e):{}
|
|
248
|
+
;var r}});var Tt="undefined"!=typeof document?r:i;function Et(t,e){
|
|
249
|
+
if(t===e)return!0;if(typeof t!=typeof e)return!1
|
|
250
|
+
;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,o,r
|
|
251
|
+
;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){
|
|
252
|
+
if(n=t.length,n!==e.length)return!1;for(o=n;0!=o--;)if(!Et(t[o],e[o]))return!1
|
|
253
|
+
;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1
|
|
254
|
+
;for(o=n;0!=o--;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;0!=o--;){
|
|
255
|
+
const n=r[o];if(("_owner"!==n||!t.$$typeof)&&!Et(t[n],e[n]))return!1}return!0}
|
|
256
|
+
return t!=t&&e!=e}function Lt(t){if("undefined"==typeof window)return 1
|
|
257
|
+
;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}
|
|
258
|
+
function Ct(t,e){const n=Lt(t);return Math.round(e*n)/n}function Dt(t){
|
|
259
|
+
const e=o.useRef(t);return Tt((()=>{e.current=t})),e}const Ht=l(((n,o)=>{
|
|
260
|
+
const{children:r,width:i=10,height:l=5,...s}=n;return a(t.svg,e({},s,{ref:o,
|
|
261
|
+
width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none"
|
|
262
|
+
}),n.asChild?r:a("polygon",{points:"0,0 30,0 15,10"}))
|
|
263
|
+
})),kt="Popper",[Ft,$t]=u(kt),[Wt,Mt]=Ft(kt),Bt=l(((o,r)=>{
|
|
264
|
+
const{__scopePopper:l,virtualRef:s,...f}=o,u=Mt("PopperAnchor",l),d=c(null),p=n(r,d)
|
|
265
|
+
;return i((()=>{u.onAnchorChange((null==s?void 0:s.current)||d.current)
|
|
266
|
+
})),s?null:a(t.div,e({},f,{ref:p}))
|
|
267
|
+
})),_t="PopperContent",[zt,Vt]=Ft(_t),jt=l(((r,i)=>{var l,c,u,h,g,y,w,x
|
|
268
|
+
;const{__scopePopper:v,side:b="bottom",sideOffset:A=0,align:R="center",alignOffset:P=0,arrowPadding:O=0,avoidCollisions:S=!0,collisionBoundary:T=[],collisionPadding:E=0,sticky:L="partial",hideWhenDetached:C=!1,updatePositionStrategy:D="optimized",onPlaced:H,...k}=r,F=Mt(_t,v),[$,W]=s(null),M=n(i,(t=>W(t))),[B,_]=s(null),z=m(B),V=null!==(l=null==z?void 0:z.width)&&void 0!==l?l:0,j=null!==(c=null==z?void 0:z.height)&&void 0!==c?c:0,Y=b+("center"!==R?"-"+R:""),N="number"==typeof E?E:{
|
|
269
|
+
top:0,right:0,bottom:0,left:0,...E},X=Array.isArray(T)?T:[T],I=X.length>0,q={
|
|
270
|
+
padding:N,boundary:X.filter(It),altBoundary:I
|
|
271
|
+
},{refs:G,floatingStyles:J,placement:K,isPositioned:Q,middlewareData:U}=function(t){
|
|
272
|
+
void 0===t&&(t={})
|
|
273
|
+
;const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:a}={},transform:s=!0,whileElementsMounted:c,open:u}=t,[d,p]=o.useState({
|
|
274
|
+
x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1
|
|
275
|
+
}),[m,h]=o.useState(r);Et(m,r)||h(r)
|
|
276
|
+
;const[g,y]=o.useState(null),[w,x]=o.useState(null),v=o.useCallback((t=>{
|
|
277
|
+
t!==P.current&&(P.current=t,y(t))}),[]),b=o.useCallback((t=>{
|
|
278
|
+
t!==O.current&&(O.current=t,x(t))
|
|
279
|
+
}),[]),A=l||g,R=a||w,P=o.useRef(null),O=o.useRef(null),S=o.useRef(d),T=null!=c,E=Dt(c),L=Dt(i),C=o.useCallback((()=>{
|
|
280
|
+
if(!P.current||!O.current)return;const t={placement:e,strategy:n,middleware:m}
|
|
281
|
+
;L.current&&(t.platform=L.current),Ot(P.current,O.current,t).then((t=>{const e={
|
|
282
|
+
...t,isPositioned:!0}
|
|
283
|
+
;D.current&&!Et(S.current,e)&&(S.current=e,f.flushSync((()=>{p(e)})))}))
|
|
284
|
+
}),[m,e,n,L]);Tt((()=>{
|
|
285
|
+
!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,p((t=>({...t,
|
|
286
|
+
isPositioned:!1}))))}),[u]);const D=o.useRef(!1);Tt((()=>(D.current=!0,()=>{
|
|
287
|
+
D.current=!1})),[]),Tt((()=>{if(A&&(P.current=A),R&&(O.current=R),A&&R){
|
|
288
|
+
if(E.current)return E.current(A,R,C);C()}}),[A,R,C,E,T])
|
|
289
|
+
;const H=o.useMemo((()=>({reference:P,floating:O,setReference:v,setFloating:b
|
|
290
|
+
})),[v,b]),k=o.useMemo((()=>({reference:A,floating:R
|
|
291
|
+
})),[A,R]),F=o.useMemo((()=>{const t={position:n,left:0,top:0}
|
|
292
|
+
;if(!k.floating)return t;const e=Ct(k.floating,d.x),o=Ct(k.floating,d.y)
|
|
293
|
+
;return s?{...t,transform:"translate("+e+"px, "+o+"px)",
|
|
294
|
+
...Lt(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:e,top:o}
|
|
295
|
+
}),[n,s,k.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:C,refs:H,
|
|
296
|
+
elements:k,floatingStyles:F})),[d,C,H,k,F])}({strategy:"fixed",placement:Y,
|
|
297
|
+
whileElementsMounted:(...t)=>yt(...t,{animationFrame:"always"===D}),elements:{
|
|
298
|
+
reference:F.anchor},middleware:[wt({mainAxis:A+j,alignmentAxis:P}),S&&xt({
|
|
299
|
+
mainAxis:!0,crossAxis:!1,limiter:"partial"===L?Pt():void 0,...q}),S&&vt({...q
|
|
300
|
+
}),bt({...q,apply:({elements:t,rects:e,availableWidth:n,availableHeight:o})=>{
|
|
301
|
+
const{width:r,height:i}=e.reference,l=t.floating.style
|
|
302
|
+
;l.setProperty("--radix-popper-available-width",`${n}px`),
|
|
303
|
+
l.setProperty("--radix-popper-available-height",`${o}px`),
|
|
304
|
+
l.setProperty("--radix-popper-anchor-width",`${r}px`),
|
|
305
|
+
l.setProperty("--radix-popper-anchor-height",`${i}px`)}}),B&&St({element:B,
|
|
306
|
+
padding:O}),qt({arrowWidth:V,arrowHeight:j}),C&&At({strategy:"referenceHidden",
|
|
307
|
+
...q})]}),[Z,tt]=Gt(K),et=d(H);p((()=>{Q&&(null==et||et())}),[Q,et])
|
|
308
|
+
;const nt=null===(u=U.arrow)||void 0===u?void 0:u.x,ot=null===(h=U.arrow)||void 0===h?void 0:h.y,rt=0!==(null===(g=U.arrow)||void 0===g?void 0:g.centerOffset),[it,lt]=s()
|
|
309
|
+
;return p((()=>{$&<(window.getComputedStyle($).zIndex)}),[$]),a("div",{
|
|
310
|
+
ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,
|
|
311
|
+
transform:Q?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:it,
|
|
312
|
+
"--radix-popper-transform-origin":[null===(y=U.transformOrigin)||void 0===y?void 0:y.x,null===(w=U.transformOrigin)||void 0===w?void 0:w.y].join(" ")
|
|
313
|
+
},dir:r.dir},a(zt,{scope:v,placedSide:Z,onArrowChange:_,arrowX:nt,arrowY:ot,
|
|
314
|
+
shouldHideArrow:rt},a(t.div,e({"data-side":Z,"data-align":tt},k,{ref:M,style:{
|
|
315
|
+
...k.style,animation:Q?void 0:"none",
|
|
316
|
+
opacity:null!==(x=U.hide)&&void 0!==x&&x.referenceHidden?0:void 0}}))))
|
|
317
|
+
})),Yt="PopperArrow",Nt={top:"bottom",right:"left",bottom:"top",left:"right"
|
|
318
|
+
},Xt=l((function(t,n){
|
|
319
|
+
const{__scopePopper:o,...r}=t,i=Vt(Yt,o),l=Nt[i.placedSide];return a("span",{
|
|
320
|
+
ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,
|
|
321
|
+
transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"
|
|
322
|
+
}[i.placedSide],transform:{top:"translateY(100%)",
|
|
323
|
+
right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",
|
|
324
|
+
left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],
|
|
325
|
+
visibility:i.shouldHideArrow?"hidden":void 0}},a(Ht,e({},r,{ref:n,style:{
|
|
326
|
+
...r.style,display:"block"}})))}));function It(t){return null!==t}const qt=t=>({
|
|
327
|
+
name:"transformOrigin",options:t,fn(e){var n,o,r,i,l
|
|
328
|
+
;const{placement:a,rects:s,middlewareData:c}=e,f=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),u=f?0:t.arrowWidth,d=f?0:t.arrowHeight,[p,m]=Gt(a),h={
|
|
329
|
+
start:"0%",center:"50%",end:"100%"
|
|
330
|
+
}[m],g=(null!==(o=null===(r=c.arrow)||void 0===r?void 0:r.x)&&void 0!==o?o:0)+u/2,y=(null!==(i=null===(l=c.arrow)||void 0===l?void 0:l.y)&&void 0!==i?i:0)+d/2
|
|
331
|
+
;let w="",x=""
|
|
332
|
+
;return"bottom"===p?(w=f?h:`${g}px`,x=-d+"px"):"top"===p?(w=f?h:`${g}px`,
|
|
333
|
+
x=`${s.floating.height+d}px`):"right"===p?(w=-d+"px",
|
|
334
|
+
x=f?h:`${y}px`):"left"===p&&(w=`${s.floating.width+d}px`,x=f?h:`${y}px`),{data:{
|
|
335
|
+
x:w,y:x}}}});function Gt(t){const[e,n="center"]=t.split("-");return[e,n]}
|
|
336
|
+
const Jt=t=>{const{__scopePopper:e,children:n}=t,[o,r]=s(null);return a(Wt,{
|
|
337
|
+
scope:e,anchor:o,onAnchorChange:r},n)},Kt=Bt,Qt=jt,Ut=Xt
|
|
338
|
+
;export{$t as $,Jt as a,Kt as b,Qt as c,Ut as d};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{useCallback as n,forwardRef as r,Children as t,isValidElement as o,createElement as e,cloneElement as i,Fragment as l,useEffect as c}from"react"
|
|
2
|
+
;import{flushSync as s}from"react-dom";function a(){
|
|
3
|
+
return a=Object.assign?Object.assign.bind():function(n){
|
|
4
|
+
for(var r=1;r<arguments.length;r++){var t=arguments[r]
|
|
5
|
+
;for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n
|
|
6
|
+
},a.apply(this,arguments)}function u(...n){
|
|
7
|
+
return r=>n.forEach((n=>function(n,r){
|
|
8
|
+
"function"==typeof n?n(r):null!=n&&(n.current=r)}(n,r)))}function f(...r){
|
|
9
|
+
return n(u(...r),r)}const p=r(((n,r)=>{
|
|
10
|
+
const{children:l,...c}=n,s=t.toArray(l),u=s.find(h);if(u){
|
|
11
|
+
const n=u.props.children,l=s.map((r=>r===u?t.count(n)>1?t.only(null):o(n)?n.props.children:null:r))
|
|
12
|
+
;return e(d,a({},c,{ref:r}),o(n)?i(n,void 0,l):null)}return e(d,a({},c,{ref:r
|
|
13
|
+
}),l)}));p.displayName="Slot";const d=r(((n,r)=>{const{children:e,...l}=n
|
|
14
|
+
;return o(e)?i(e,{...y(l,e.props),ref:r?u(r,e.ref):e.ref
|
|
15
|
+
}):t.count(e)>1?t.only(null):null}));d.displayName="SlotClone"
|
|
16
|
+
;const m=({children:n})=>e(l,null,n);function h(n){return o(n)&&n.type===m}
|
|
17
|
+
function y(n,r){const t={...r};for(const o in r){const e=n[o],i=r[o]
|
|
18
|
+
;/^on[A-Z]/.test(o)?e&&i?t[o]=(...n)=>{i(...n),e(...n)
|
|
19
|
+
}:e&&(t[o]=e):"style"===o?t[o]={...e,...i
|
|
20
|
+
}:"className"===o&&(t[o]=[e,i].filter(Boolean).join(" "))}return{...n,...t}}
|
|
21
|
+
const v=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((n,t)=>{
|
|
22
|
+
const o=r(((n,r)=>{const{asChild:o,...i}=n,l=o?p:t;return c((()=>{
|
|
23
|
+
window[Symbol.for("radix-ui")]=!0}),[]),e(l,a({},i,{ref:r}))}))
|
|
24
|
+
;return o.displayName=`Primitive.${t}`,{...n,[t]:o}}),{});function b(n,r){
|
|
25
|
+
n&&s((()=>n.dispatchEvent(r)))}
|
|
26
|
+
export{f as $,a as _,v as a,p as b,m as c,b as d,u as e};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import{$ as e,a as n,_ as t,d as o}from"./index-ByHJlnsx.js"
|
|
2
|
+
;import{useEffect as r,forwardRef as s,useContext as i,useState as l,createElement as a,useRef as u,createContext as d}from"react"
|
|
3
|
+
;import{$ as c}from"./index-CeIB4COQ.js";import{b as v}from"./index-BdTXfGkV.js"
|
|
4
|
+
;import b from"react-dom"
|
|
5
|
+
;const m="dismissableLayer.update",E="dismissableLayer.pointerDownOutside",p="dismissableLayer.focusOutside"
|
|
6
|
+
;let h;const y=d({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,
|
|
7
|
+
branches:new Set}),f=s(((o,s)=>{var d
|
|
8
|
+
;const{disableOutsidePointerEvents:b=!1,onEscapeKeyDown:f,onPointerDownOutside:T,onFocusOutside:D,onInteractOutside:P,onDismiss:L,...O}=o,C=i(y),[k,W]=l(null),x=null!==(d=null==k?void 0:k.ownerDocument)&&void 0!==d?d:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,F]=l({}),z=e(s,(e=>W(e))),B=Array.from(C.layers),[j]=[...C.layersWithOutsidePointerEventsDisabled].slice(-1),S=B.indexOf(j),$=k?B.indexOf(k):-1,A=C.layersWithOutsidePointerEventsDisabled.size>0,I=$>=S,K=function(e,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){
|
|
9
|
+
const t=v(e),o=u(!1),s=u((()=>{}));return r((()=>{const e=e=>{
|
|
10
|
+
if(e.target&&!o.current){const r={originalEvent:e};function i(){w(E,t,r,{
|
|
11
|
+
discrete:!0})}"touch"===e.pointerType?(n.removeEventListener("click",s.current),
|
|
12
|
+
s.current=i,n.addEventListener("click",s.current,{once:!0})):i()
|
|
13
|
+
}else n.removeEventListener("click",s.current);o.current=!1
|
|
14
|
+
},r=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{
|
|
15
|
+
window.clearTimeout(r),
|
|
16
|
+
n.removeEventListener("pointerdown",e),n.removeEventListener("click",s.current)}
|
|
17
|
+
}),[n,t]),{onPointerDownCapture:()=>o.current=!0}}((e=>{
|
|
18
|
+
const n=e.target,t=[...C.branches].some((e=>e.contains(n)))
|
|
19
|
+
;I&&!t&&(null==T||T(e),null==P||P(e),e.defaultPrevented||null==L||L())
|
|
20
|
+
}),x),_=function(e,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){
|
|
21
|
+
const t=v(e),o=u(!1);return r((()=>{const e=e=>{if(e.target&&!o.current){w(p,t,{
|
|
22
|
+
originalEvent:e},{discrete:!1})}}
|
|
23
|
+
;return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)
|
|
24
|
+
}),[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}
|
|
25
|
+
}((e=>{const n=e.target
|
|
26
|
+
;[...C.branches].some((e=>e.contains(n)))||(null==D||D(e),
|
|
27
|
+
null==P||P(e),e.defaultPrevented||null==L||L())}),x)
|
|
28
|
+
;return function(e,n=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){
|
|
29
|
+
const t=v(e);r((()=>{const e=e=>{"Escape"===e.key&&t(e)}
|
|
30
|
+
;return n.addEventListener("keydown",e),()=>n.removeEventListener("keydown",e)
|
|
31
|
+
}),[t,n])}((e=>{
|
|
32
|
+
$===C.layers.size-1&&(null==f||f(e),!e.defaultPrevented&&L&&(e.preventDefault(),
|
|
33
|
+
L()))}),x),r((()=>{
|
|
34
|
+
if(k)return b&&(0===C.layersWithOutsidePointerEventsDisabled.size&&(h=x.body.style.pointerEvents,
|
|
35
|
+
x.body.style.pointerEvents="none"),
|
|
36
|
+
C.layersWithOutsidePointerEventsDisabled.add(k)),C.layers.add(k),g(),()=>{
|
|
37
|
+
b&&1===C.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=h)
|
|
38
|
+
}}),[k,x,b,C]),r((()=>()=>{
|
|
39
|
+
k&&(C.layers.delete(k),C.layersWithOutsidePointerEventsDisabled.delete(k),g())
|
|
40
|
+
}),[k,C]),r((()=>{const e=()=>F({})
|
|
41
|
+
;return document.addEventListener(m,e),()=>document.removeEventListener(m,e)
|
|
42
|
+
}),[]),a(n.div,t({},O,{ref:z,style:{pointerEvents:A?I?"auto":"none":void 0,
|
|
43
|
+
...o.style},onFocusCapture:c(o.onFocusCapture,_.onFocusCapture),
|
|
44
|
+
onBlurCapture:c(o.onBlurCapture,_.onBlurCapture),
|
|
45
|
+
onPointerDownCapture:c(o.onPointerDownCapture,K.onPointerDownCapture)}))}))
|
|
46
|
+
;function g(){const e=new CustomEvent(m);document.dispatchEvent(e)}
|
|
47
|
+
function w(e,n,t,{discrete:r}){
|
|
48
|
+
const s=t.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,
|
|
49
|
+
detail:t});n&&s.addEventListener(e,n,{once:!0}),r?o(s,i):s.dispatchEvent(i)}
|
|
50
|
+
const T=f,D=s(((o,s)=>{const l=i(y),d=u(null),c=e(s,d);return r((()=>{
|
|
51
|
+
const e=d.current;if(e)return l.branches.add(e),()=>{l.branches.delete(e)}
|
|
52
|
+
}),[l.branches]),a(n.div,t({},o,{ref:c}))})),P=s(((e,o)=>{var r
|
|
53
|
+
;const{container:s=(null===globalThis||void 0===globalThis||null===(r=globalThis.document)||void 0===r?void 0:r.body),...i}=e
|
|
54
|
+
;return s?b.createPortal(a(n.div,t({},i,{ref:o})),s):null}))
|
|
55
|
+
;export{f as $,P as a,D as b,T as c};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{useCallback as n,useState as e,useRef as t,useEffect as r}from"react"
|
|
2
|
+
;import{b as o}from"./index-BdTXfGkV.js"
|
|
3
|
+
;function u(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){
|
|
4
|
+
if(null==n||n(r),!1===t||!r.defaultPrevented)return null==e?void 0:e(r)}}
|
|
5
|
+
function f({prop:u,defaultProp:f,onChange:a=(()=>{})}){
|
|
6
|
+
const[c,i]=function({defaultProp:n,onChange:u}){const f=e(n),[a]=f,c=t(a),i=o(u)
|
|
7
|
+
;return r((()=>{c.current!==a&&(i(a),c.current=a)}),[a,c,i]),f}({defaultProp:f,
|
|
8
|
+
onChange:a}),l=void 0!==u,d=l?u:c,p=o(a);return[d,n((n=>{if(l){
|
|
9
|
+
const e="function"==typeof n?n(u):n;e!==u&&p(e)}else i(n)}),[l,u,i,p])]}
|
|
10
|
+
export{u as $,f as a};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import e from"react";import{$ as r}from"./index-BdTXfGkV.js"
|
|
2
|
+
;import{$ as t,b as o}from"./index-ByHJlnsx.js";function n(n){
|
|
3
|
+
const c=n+"CollectionProvider",[l,i]=r(c),[f,a]=l(c,{collectionRef:{current:null
|
|
4
|
+
},itemMap:new Map
|
|
5
|
+
}),s=n+"CollectionSlot",u=n+"CollectionItemSlot",m="data-radix-collection-item"
|
|
6
|
+
;return[{Provider:r=>{
|
|
7
|
+
const{scope:t,children:o}=r,n=e.useRef(null),c=e.useRef(new Map).current
|
|
8
|
+
;return e.createElement(f,{scope:t,itemMap:c,collectionRef:n},o)},
|
|
9
|
+
Slot:e.forwardRef(((r,n)=>{
|
|
10
|
+
const{scope:c,children:l}=r,i=a(s,c),f=t(n,i.collectionRef)
|
|
11
|
+
;return e.createElement(o,{ref:f},l)})),ItemSlot:e.forwardRef(((r,n)=>{
|
|
12
|
+
const{scope:c,children:l,...i}=r,f=e.useRef(null),s=t(n,f),p=a(u,c)
|
|
13
|
+
;return e.useEffect((()=>(p.itemMap.set(f,{ref:f,...i}),()=>{p.itemMap.delete(f)
|
|
14
|
+
}))),e.createElement(o,{[m]:"",ref:s},l)}))},function(r){
|
|
15
|
+
const t=a(n+"CollectionConsumer",r);return e.useCallback((()=>{
|
|
16
|
+
const e=t.collectionRef.current;if(!e)return[]
|
|
17
|
+
;const r=Array.from(e.querySelectorAll(`[${m}]`))
|
|
18
|
+
;return Array.from(t.itemMap.values()).sort(((e,t)=>r.indexOf(e.ref.current)-r.indexOf(t.ref.current)))
|
|
19
|
+
}),[t.collectionRef,t.itemMap])},i]}export{n as $};
|