@anoki/fse-ui 1.0.712 → 1.0.714
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/dist/index.cjs10.js +1 -1
- package/dist/index.cjs119.js +1 -1
- package/dist/index.cjs119.js.map +1 -1
- package/dist/index.cjs130.js +1 -1
- package/dist/index.cjs131.js +1 -1
- package/dist/index.cjs132.js +1 -1
- package/dist/index.cjs133.js +1 -1
- package/dist/index.cjs134.js +1 -1
- package/dist/index.cjs135.js +1 -1
- package/dist/index.cjs136.js +1 -1
- package/dist/index.cjs137.js +1 -1
- package/dist/index.cjs138.js +1 -1
- package/dist/index.cjs139.js +1 -1
- package/dist/index.cjs140.js +1 -1
- package/dist/index.cjs141.js +1 -1
- package/dist/index.cjs142.js +1 -1
- package/dist/index.cjs143.js +1 -1
- package/dist/index.cjs144.js +1 -1
- package/dist/index.cjs145.js +1 -1
- package/dist/index.cjs146.js +1 -1
- package/dist/index.cjs147.js +1 -1
- package/dist/index.cjs148.js +1 -1
- package/dist/index.cjs149.js +1 -1
- package/dist/index.cjs150.js +1 -1
- package/dist/index.cjs151.js +1 -1
- package/dist/index.cjs152.js +1 -1
- package/dist/index.cjs156.js +1 -1
- package/dist/index.cjs157.js +1 -1
- package/dist/index.cjs158.js +1 -1
- package/dist/index.cjs160.js +1 -1
- package/dist/index.cjs161.js +1 -1
- package/dist/index.cjs162.js +1 -1
- package/dist/index.cjs163.js +1 -1
- package/dist/index.cjs164.js +1 -1
- package/dist/index.cjs165.js +1 -1
- package/dist/index.cjs166.js +1 -1
- package/dist/index.cjs167.js +1 -1
- package/dist/index.cjs168.js +1 -1
- package/dist/index.cjs170.js +1 -1
- package/dist/index.cjs171.js +1 -1
- package/dist/index.cjs172.js +1 -1
- package/dist/index.cjs173.js +1 -1
- package/dist/index.cjs174.js +1 -1
- package/dist/index.cjs175.js +1 -1
- package/dist/index.cjs176.js +1 -1
- package/dist/index.cjs178.js +1 -1
- package/dist/index.cjs179.js +1 -1
- package/dist/index.cjs180.js +1 -1
- package/dist/index.cjs181.js +1 -1
- package/dist/index.cjs182.js +1 -1
- package/dist/index.cjs183.js +1 -1
- package/dist/index.cjs184.js +1 -1
- package/dist/index.cjs191.js +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs227.js +1 -1
- package/dist/index.cjs227.js.map +1 -1
- package/dist/index.cjs229.js +2 -0
- package/dist/index.cjs229.js.map +1 -0
- package/dist/index.cjs237.js +1 -1
- package/dist/index.cjs244.js +1 -1
- package/dist/index.cjs247.js +1 -1
- package/dist/index.cjs248.js +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs255.js +1 -1
- package/dist/index.cjs265.js +1 -1
- package/dist/index.cjs269.js +1 -1
- package/dist/index.cjs271.js +1 -1
- package/dist/index.cjs278.js +1 -1
- package/dist/index.cjs283.js +1 -1
- package/dist/index.cjs290.js +1 -1
- package/dist/index.cjs296.js +1 -1
- package/dist/index.cjs297.js +1 -1
- package/dist/index.cjs298.js +1 -1
- package/dist/index.cjs337.js +1 -1
- package/dist/index.cjs378.js +1 -1
- package/dist/index.cjs379.js +1 -1
- package/dist/index.cjs385.js +1 -1
- package/dist/index.cjs385.js.map +1 -1
- package/dist/index.cjs386.js +1 -1
- package/dist/index.cjs386.js.map +1 -1
- package/dist/{index.cjs394.js → index.cjs387.js} +1 -1
- package/dist/{index.cjs394.js.map → index.cjs387.js.map} +1 -1
- package/dist/index.cjs388.js +2 -0
- package/dist/index.cjs388.js.map +1 -0
- package/dist/index.cjs389.js +2 -0
- package/dist/index.cjs389.js.map +1 -0
- package/dist/index.cjs390.js +2 -0
- package/dist/index.cjs390.js.map +1 -0
- package/dist/{index.cjs395.js → index.cjs391.js} +2 -2
- package/dist/{index.cjs395.js.map → index.cjs391.js.map} +1 -1
- package/dist/index.cjs393.js +1 -1
- package/dist/index.cjs393.js.map +1 -1
- package/dist/index.cjs396.js +1 -1
- package/dist/index.cjs396.js.map +1 -1
- package/dist/index.cjs397.js +1 -1
- package/dist/index.cjs397.js.map +1 -1
- package/dist/index.cjs398.js +1 -1
- package/dist/index.cjs398.js.map +1 -1
- package/dist/index.cjs399.js +1 -1
- package/dist/index.cjs399.js.map +1 -1
- package/dist/index.cjs400.js +1 -1
- package/dist/index.cjs400.js.map +1 -1
- package/dist/index.cjs401.js +1 -1
- package/dist/index.cjs401.js.map +1 -1
- package/dist/index.cjs407.js +2 -0
- package/dist/index.cjs407.js.map +1 -0
- package/dist/index.cjs408.js +2 -0
- package/dist/index.cjs408.js.map +1 -0
- package/dist/index.cjs409.js +1 -1
- package/dist/index.cjs409.js.map +1 -1
- package/dist/{index.cjs402.js → index.cjs410.js} +1 -1
- package/dist/{index.cjs402.js.map → index.cjs410.js.map} +1 -1
- package/dist/index.cjs411.js +1 -1
- package/dist/index.cjs411.js.map +1 -1
- package/dist/index.cjs412.js +1 -1
- package/dist/index.cjs412.js.map +1 -1
- package/dist/index.cjs413.js +1 -1
- package/dist/index.cjs413.js.map +1 -1
- package/dist/index.cjs421.js +1 -1
- package/dist/index.cjs421.js.map +1 -1
- package/dist/index.cjs422.js +1 -1
- package/dist/index.cjs422.js.map +1 -1
- package/dist/index.cjs423.js +1 -4
- package/dist/index.cjs423.js.map +1 -1
- package/dist/index.cjs424.js +1 -1
- package/dist/index.cjs424.js.map +1 -1
- package/dist/index.cjs425.js +1 -1
- package/dist/index.cjs425.js.map +1 -1
- package/dist/index.cjs426.js +1 -38
- package/dist/index.cjs426.js.map +1 -1
- package/dist/index.cjs430.js +1 -1
- package/dist/index.cjs430.js.map +1 -1
- package/dist/index.cjs431.js +1 -1
- package/dist/index.cjs431.js.map +1 -1
- package/dist/index.cjs432.js +1 -1
- package/dist/index.cjs432.js.map +1 -1
- package/dist/index.cjs433.js +1 -1
- package/dist/index.cjs433.js.map +1 -1
- package/dist/index.cjs434.js +1 -1
- package/dist/index.cjs434.js.map +1 -1
- package/dist/index.cjs435.js +1 -1
- package/dist/index.cjs435.js.map +1 -1
- package/dist/index.cjs436.js +1 -1
- package/dist/index.cjs436.js.map +1 -1
- package/dist/index.cjs437.js +1 -1
- package/dist/index.cjs437.js.map +1 -1
- package/dist/index.cjs438.js +1 -1
- package/dist/index.cjs438.js.map +1 -1
- package/dist/index.cjs439.js +1 -1
- package/dist/index.cjs439.js.map +1 -1
- package/dist/index.cjs440.js +4 -1
- package/dist/index.cjs440.js.map +1 -1
- package/dist/index.cjs441.js +1 -1
- package/dist/index.cjs441.js.map +1 -1
- package/dist/index.cjs442.js +1 -1
- package/dist/index.cjs442.js.map +1 -1
- package/dist/index.cjs443.js +1 -1
- package/dist/index.cjs443.js.map +1 -1
- package/dist/index.cjs444.js +1 -1
- package/dist/index.cjs444.js.map +1 -1
- package/dist/index.cjs445.js +1 -1
- package/dist/index.cjs445.js.map +1 -1
- package/dist/index.cjs446.js +38 -1
- package/dist/index.cjs446.js.map +1 -1
- package/dist/index.cjs447.js +1 -1
- package/dist/index.cjs447.js.map +1 -1
- package/dist/{index.cjs428.js → index.cjs448.js} +1 -1
- package/dist/{index.cjs428.js.map → index.cjs448.js.map} +1 -1
- package/dist/{index.cjs429.js → index.cjs449.js} +1 -1
- package/dist/{index.cjs429.js.map → index.cjs449.js.map} +1 -1
- package/dist/index.cjs450.js +2 -0
- package/dist/index.cjs450.js.map +1 -0
- package/dist/index.cjs451.js +2 -0
- package/dist/index.cjs451.js.map +1 -0
- package/dist/index.cjs452.js +2 -0
- package/dist/index.cjs452.js.map +1 -0
- package/dist/index.cjs453.js +2 -0
- package/dist/index.cjs453.js.map +1 -0
- package/dist/index.cjs454.js +2 -0
- package/dist/index.cjs454.js.map +1 -0
- package/dist/index.cjs455.js +2 -0
- package/dist/index.cjs455.js.map +1 -0
- package/dist/index.cjs462.js +1 -1
- package/dist/index.cjs465.js +1 -1
- package/dist/index.cjs468.js +1 -1
- package/dist/index.cjs476.js +1 -1
- package/dist/index.cjs476.js.map +1 -1
- package/dist/index.cjs477.js +1 -1
- package/dist/index.cjs477.js.map +1 -1
- package/dist/index.cjs478.js +1 -1
- package/dist/index.cjs478.js.map +1 -1
- package/dist/index.cjs479.js +1 -1
- package/dist/index.cjs479.js.map +1 -1
- package/dist/index.cjs480.js +1 -1
- package/dist/index.cjs480.js.map +1 -1
- package/dist/index.cjs481.js +1 -1
- package/dist/index.cjs481.js.map +1 -1
- package/dist/index.cjs482.js +1 -1
- package/dist/index.cjs482.js.map +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es10.js +2 -2
- package/dist/index.es119.js +13 -12
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es130.js +1 -1
- package/dist/index.es131.js +1 -1
- package/dist/index.es132.js +1 -1
- package/dist/index.es133.js +1 -1
- package/dist/index.es134.js +1 -1
- package/dist/index.es135.js +1 -1
- package/dist/index.es136.js +1 -1
- package/dist/index.es137.js +1 -1
- package/dist/index.es138.js +1 -1
- package/dist/index.es139.js +1 -1
- package/dist/index.es140.js +1 -1
- package/dist/index.es141.js +1 -1
- package/dist/index.es142.js +1 -1
- package/dist/index.es143.js +1 -1
- package/dist/index.es144.js +1 -1
- package/dist/index.es145.js +1 -1
- package/dist/index.es146.js +1 -1
- package/dist/index.es147.js +1 -1
- package/dist/index.es148.js +1 -1
- package/dist/index.es149.js +1 -1
- package/dist/index.es150.js +1 -1
- package/dist/index.es151.js +1 -1
- package/dist/index.es152.js +1 -1
- package/dist/index.es156.js +1 -1
- package/dist/index.es157.js +1 -1
- package/dist/index.es158.js +1 -1
- package/dist/index.es160.js +1 -1
- package/dist/index.es161.js +1 -1
- package/dist/index.es162.js +1 -1
- package/dist/index.es163.js +1 -1
- package/dist/index.es164.js +1 -1
- package/dist/index.es165.js +1 -1
- package/dist/index.es166.js +1 -1
- package/dist/index.es167.js +1 -1
- package/dist/index.es168.js +1 -1
- package/dist/index.es170.js +1 -1
- package/dist/index.es171.js +1 -1
- package/dist/index.es172.js +1 -1
- package/dist/index.es173.js +1 -1
- package/dist/index.es174.js +1 -1
- package/dist/index.es175.js +1 -1
- package/dist/index.es176.js +1 -1
- package/dist/index.es178.js +1 -1
- package/dist/index.es179.js +1 -1
- package/dist/index.es180.js +1 -1
- package/dist/index.es181.js +1 -1
- package/dist/index.es182.js +1 -1
- package/dist/index.es183.js +1 -1
- package/dist/index.es184.js +1 -1
- package/dist/index.es191.js +1 -1
- package/dist/index.es22.js +1 -1
- package/dist/index.es227.js +27 -2
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es229.js +5 -0
- package/dist/index.es229.js.map +1 -0
- package/dist/index.es237.js +1 -1
- package/dist/index.es244.js +7 -7
- package/dist/index.es247.js +1 -1
- package/dist/index.es248.js +1 -1
- package/dist/index.es25.js +1 -1
- package/dist/index.es255.js +8 -8
- package/dist/index.es265.js +1 -1
- package/dist/index.es269.js +1 -1
- package/dist/index.es271.js +14 -14
- package/dist/index.es278.js +1 -1
- package/dist/index.es283.js +1 -1
- package/dist/index.es290.js +1 -1
- package/dist/index.es296.js +1 -1
- package/dist/index.es297.js +1 -1
- package/dist/index.es298.js +7 -7
- package/dist/index.es337.js +4 -4
- package/dist/index.es378.js +1 -1
- package/dist/index.es379.js +1 -1
- package/dist/index.es385.js +7 -2
- package/dist/index.es385.js.map +1 -1
- package/dist/index.es386.js +27 -2
- package/dist/index.es386.js.map +1 -1
- package/dist/{index.es394.js → index.es387.js} +1 -1
- package/dist/{index.es394.js.map → index.es387.js.map} +1 -1
- package/dist/index.es388.js +55 -0
- package/dist/index.es388.js.map +1 -0
- package/dist/index.es389.js +37 -0
- package/dist/index.es389.js.map +1 -0
- package/dist/index.es390.js +625 -0
- package/dist/index.es390.js.map +1 -0
- package/dist/{index.es395.js → index.es391.js} +2 -2
- package/dist/{index.es395.js.map → index.es391.js.map} +1 -1
- package/dist/index.es393.js +15 -27
- package/dist/index.es393.js.map +1 -1
- package/dist/index.es396.js +5 -51
- package/dist/index.es396.js.map +1 -1
- package/dist/index.es397.js +23 -123
- package/dist/index.es397.js.map +1 -1
- package/dist/index.es398.js +60 -126
- package/dist/index.es398.js.map +1 -1
- package/dist/index.es399.js +2 -14
- package/dist/index.es399.js.map +1 -1
- package/dist/index.es400.js +2 -69
- package/dist/index.es400.js.map +1 -1
- package/dist/index.es401.js +14 -33
- package/dist/index.es401.js.map +1 -1
- package/dist/index.es407.js +128 -0
- package/dist/index.es407.js.map +1 -0
- package/dist/index.es408.js +138 -0
- package/dist/index.es408.js.map +1 -0
- package/dist/index.es409.js +14 -15
- package/dist/index.es409.js.map +1 -1
- package/dist/{index.es402.js → index.es410.js} +1 -1
- package/dist/{index.es402.js.map → index.es410.js.map} +1 -1
- package/dist/index.es411.js +9 -4
- package/dist/index.es411.js.map +1 -1
- package/dist/index.es412.js +50 -11
- package/dist/index.es412.js.map +1 -1
- package/dist/index.es413.js +53 -11
- package/dist/index.es413.js.map +1 -1
- package/dist/index.es421.js +4 -3
- package/dist/index.es421.js.map +1 -1
- package/dist/index.es422.js +44 -22
- package/dist/index.es422.js.map +1 -1
- package/dist/index.es423.js +7 -109
- package/dist/index.es423.js.map +1 -1
- package/dist/index.es424.js +216 -14
- package/dist/index.es424.js.map +1 -1
- package/dist/index.es425.js +160 -601
- package/dist/index.es425.js.map +1 -1
- package/dist/index.es426.js +10 -68
- package/dist/index.es426.js.map +1 -1
- package/dist/index.es430.js +11 -64
- package/dist/index.es430.js.map +1 -1
- package/dist/index.es431.js +201 -42
- package/dist/index.es431.js.map +1 -1
- package/dist/index.es432.js +22 -8
- package/dist/index.es432.js.map +1 -1
- package/dist/index.es433.js +391 -212
- package/dist/index.es433.js.map +1 -1
- package/dist/index.es434.js +21 -177
- package/dist/index.es434.js.map +1 -1
- package/dist/index.es435.js +29 -4
- package/dist/index.es435.js.map +1 -1
- package/dist/index.es436.js +5 -23
- package/dist/index.es436.js.map +1 -1
- package/dist/index.es437.js +5 -205
- package/dist/index.es437.js.map +1 -1
- package/dist/index.es438.js +3 -22
- package/dist/index.es438.js.map +1 -1
- package/dist/index.es439.js +20 -393
- package/dist/index.es439.js.map +1 -1
- package/dist/index.es440.js +110 -23
- package/dist/index.es440.js.map +1 -1
- package/dist/index.es441.js +15 -12
- package/dist/index.es441.js.map +1 -1
- package/dist/index.es442.js +521 -22
- package/dist/index.es442.js.map +1 -1
- package/dist/index.es443.js +126 -4
- package/dist/index.es443.js.map +1 -1
- package/dist/index.es444.js +120 -518
- package/dist/index.es444.js.map +1 -1
- package/dist/index.es445.js +62 -124
- package/dist/index.es445.js.map +1 -1
- package/dist/index.es446.js +67 -127
- package/dist/index.es446.js.map +1 -1
- package/dist/index.es447.js +8 -14
- package/dist/index.es447.js.map +1 -1
- package/dist/{index.es428.js → index.es448.js} +1 -1
- package/dist/{index.es428.js.map → index.es448.js.map} +1 -1
- package/dist/{index.es429.js → index.es449.js} +1 -1
- package/dist/{index.es429.js.map → index.es449.js.map} +1 -1
- package/dist/index.es450.js +7 -0
- package/dist/index.es450.js.map +1 -0
- package/dist/index.es451.js +26 -0
- package/dist/index.es451.js.map +1 -0
- package/dist/index.es452.js +26 -0
- package/dist/index.es452.js.map +1 -0
- package/dist/index.es453.js +16 -0
- package/dist/index.es453.js.map +1 -0
- package/dist/index.es454.js +31 -0
- package/dist/index.es454.js.map +1 -0
- package/dist/index.es455.js +8 -0
- package/dist/index.es455.js.map +1 -0
- package/dist/index.es462.js +2 -2
- package/dist/index.es465.js +3 -3
- package/dist/index.es468.js +9 -9
- package/dist/index.es476.js +4 -2
- package/dist/index.es476.js.map +1 -1
- package/dist/index.es477.js +3 -2
- package/dist/index.es477.js.map +1 -1
- package/dist/index.es478.js +2 -3
- package/dist/index.es478.js.map +1 -1
- package/dist/index.es479.js +4 -2
- package/dist/index.es479.js.map +1 -1
- package/dist/index.es480.js +4 -3
- package/dist/index.es480.js.map +1 -1
- package/dist/index.es481.js +3 -4
- package/dist/index.es481.js.map +1 -1
- package/dist/index.es482.js +2 -6
- package/dist/index.es482.js.map +1 -1
- package/dist/index.es57.js +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/index.es7.js +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +2 -2
- package/dist/sections/HomeServices/HomeServices.css +1 -1
- package/package.json +1 -1
- package/dist/index.cjs228.js +0 -2
- package/dist/index.cjs228.js.map +0 -1
- package/dist/index.cjs392.js +0 -2
- package/dist/index.cjs392.js.map +0 -1
- package/dist/index.cjs403.js +0 -2
- package/dist/index.cjs403.js.map +0 -1
- package/dist/index.cjs404.js +0 -2
- package/dist/index.cjs404.js.map +0 -1
- package/dist/index.cjs405.js +0 -2
- package/dist/index.cjs405.js.map +0 -1
- package/dist/index.cjs415.js +0 -2
- package/dist/index.cjs415.js.map +0 -1
- package/dist/index.cjs416.js +0 -2
- package/dist/index.cjs416.js.map +0 -1
- package/dist/index.cjs417.js +0 -2
- package/dist/index.cjs417.js.map +0 -1
- package/dist/index.cjs418.js +0 -2
- package/dist/index.cjs418.js.map +0 -1
- package/dist/index.cjs419.js +0 -2
- package/dist/index.cjs419.js.map +0 -1
- package/dist/index.cjs420.js +0 -2
- package/dist/index.cjs420.js.map +0 -1
- package/dist/index.cjs427.js +0 -2
- package/dist/index.cjs427.js.map +0 -1
- package/dist/index.es228.js +0 -30
- package/dist/index.es228.js.map +0 -1
- package/dist/index.es392.js +0 -10
- package/dist/index.es392.js.map +0 -1
- package/dist/index.es403.js +0 -12
- package/dist/index.es403.js.map +0 -1
- package/dist/index.es404.js +0 -53
- package/dist/index.es404.js.map +0 -1
- package/dist/index.es405.js +0 -57
- package/dist/index.es405.js.map +0 -1
- package/dist/index.es415.js +0 -28
- package/dist/index.es415.js.map +0 -1
- package/dist/index.es416.js +0 -32
- package/dist/index.es416.js.map +0 -1
- package/dist/index.es417.js +0 -8
- package/dist/index.es417.js.map +0 -1
- package/dist/index.es418.js +0 -9
- package/dist/index.es418.js.map +0 -1
- package/dist/index.es419.js +0 -28
- package/dist/index.es419.js.map +0 -1
- package/dist/index.es420.js +0 -8
- package/dist/index.es420.js.map +0 -1
- package/dist/index.es427.js +0 -12
- package/dist/index.es427.js.map +0 -1
- /package/dist/components/ui/{DoctorModal/DoctorModalFooter/DoctorModalFooter.css → DoctorConfirmModal/DoctorConfirmModalFooter/DoctorConfirmModalFooter.css} +0 -0
package/dist/index.es413.js
CHANGED
@@ -1,15 +1,57 @@
|
|
1
|
-
import * as
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import * as l from "react";
|
2
|
+
import { useComposedRefs as y } from "./index.es386.js";
|
3
|
+
import { j as p } from "./index.es212.js";
|
4
|
+
// @__NO_SIDE_EFFECTS__
|
5
|
+
function b(e) {
|
6
|
+
const r = /* @__PURE__ */ E(e), n = l.forwardRef((o, t) => {
|
7
|
+
const { children: i, ...c } = o, a = l.Children.toArray(i), s = a.find(S);
|
8
|
+
if (s) {
|
9
|
+
const f = s.props.children, m = a.map((u) => u === s ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : u);
|
10
|
+
return /* @__PURE__ */ p.jsx(r, { ...c, ref: t, children: l.isValidElement(f) ? l.cloneElement(f, void 0, m) : null });
|
11
|
+
}
|
12
|
+
return /* @__PURE__ */ p.jsx(r, { ...c, ref: t, children: i });
|
13
|
+
});
|
14
|
+
return n.displayName = `${e}.Slot`, n;
|
15
|
+
}
|
16
|
+
// @__NO_SIDE_EFFECTS__
|
17
|
+
function E(e) {
|
18
|
+
const r = l.forwardRef((n, o) => {
|
19
|
+
const { children: t, ...i } = n, c = l.isValidElement(t) ? C(t) : void 0, a = y(c, o);
|
20
|
+
if (l.isValidElement(t)) {
|
21
|
+
const s = g(i, t.props);
|
22
|
+
return t.type !== l.Fragment && (s.ref = a), l.cloneElement(t, s);
|
23
|
+
}
|
24
|
+
return l.Children.count(t) > 1 ? l.Children.only(null) : null;
|
25
|
+
});
|
26
|
+
return r.displayName = `${e}.SlotClone`, r;
|
27
|
+
}
|
28
|
+
var d = Symbol("radix.slottable");
|
29
|
+
// @__NO_SIDE_EFFECTS__
|
30
|
+
function h(e) {
|
31
|
+
const r = ({ children: n }) => /* @__PURE__ */ p.jsx(p.Fragment, { children: n });
|
32
|
+
return r.displayName = `${e}.Slottable`, r.__radixId = d, r;
|
33
|
+
}
|
34
|
+
function S(e) {
|
35
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === d;
|
36
|
+
}
|
37
|
+
function g(e, r) {
|
38
|
+
const n = { ...r };
|
39
|
+
for (const o in r) {
|
40
|
+
const t = e[o], i = r[o];
|
41
|
+
/^on[A-Z]/.test(o) ? t && i ? n[o] = (...a) => {
|
42
|
+
const s = i(...a);
|
43
|
+
return t(...a), s;
|
44
|
+
} : t && (n[o] = t) : o === "style" ? n[o] = { ...t, ...i } : o === "className" && (n[o] = [t, i].filter(Boolean).join(" "));
|
45
|
+
}
|
46
|
+
return { ...e, ...n };
|
47
|
+
}
|
48
|
+
function C(e) {
|
49
|
+
var o, t;
|
50
|
+
let r = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = r && "isReactWarning" in r && r.isReactWarning;
|
51
|
+
return n ? e.ref : (r = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, n = r && "isReactWarning" in r && r.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
11
52
|
}
|
12
53
|
export {
|
13
|
-
|
54
|
+
b as createSlot,
|
55
|
+
h as createSlottable
|
14
56
|
};
|
15
57
|
//# sourceMappingURL=index.es413.js.map
|
package/dist/index.es413.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es413.js","sources":["../node_modules/@radix-ui/react-
|
1
|
+
{"version":3,"file":"index.es413.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenRef = React.isValidElement(children) ? getElementRef(children) : void 0;\n const ref = useComposedRefs(childrenRef, forwardedRef);\n if (React.isValidElement(children)) {\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = ref;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","ref","useComposedRefs","props2","mergeProps","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","element","getter","_a","mayWarn","_b"],"mappings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AO,KAAK,MAApD,gBAAAE,EAAuD,KAChEC,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO;AAC7D,SAAIE,IACKH,EAAQ,OAEjBC,KAASG,IAAA,OAAO,yBAAyBJ,GAAS,KAAK,MAA9C,gBAAAI,EAAiD,KAC1DD,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDE,IACKH,EAAQ,MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
|
package/dist/index.es421.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import
|
2
|
-
var
|
1
|
+
import * as t from "react";
|
2
|
+
var e = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
|
3
|
+
};
|
3
4
|
export {
|
4
|
-
|
5
|
+
e as useLayoutEffect
|
5
6
|
};
|
6
7
|
//# sourceMappingURL=index.es421.js.map
|
package/dist/index.es421.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es421.js","sources":["../node_modules/react-
|
1
|
+
{"version":3,"file":"index.es421.js","sources":["../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs"],"sourcesContent":["// packages/react/use-layout-effect/src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect2","React"],"mappings":";AAEG,IAACA,IAAmB,iCAAY,WAAWC,EAAM,kBAAkB,MAAM;AAC5E;","x_google_ignoreList":[0]}
|
package/dist/index.es422.js
CHANGED
@@ -1,27 +1,49 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
})
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
});
|
1
|
+
import r from "react";
|
2
|
+
import { createContextScope as y } from "./index.es387.js";
|
3
|
+
import { useComposedRefs as S } from "./index.es386.js";
|
4
|
+
import { createSlot as M } from "./index.es413.js";
|
5
|
+
import { j as d } from "./index.es212.js";
|
6
|
+
function D(s) {
|
7
|
+
const m = s + "CollectionProvider", [A, E] = y(m), [N, f] = A(
|
8
|
+
m,
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
10
|
+
), p = (c) => {
|
11
|
+
const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
|
12
|
+
return /* @__PURE__ */ d.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
|
13
|
+
};
|
14
|
+
p.displayName = m;
|
15
|
+
const a = s + "CollectionSlot", _ = M(a), C = r.forwardRef(
|
16
|
+
(c, e) => {
|
17
|
+
const { scope: l, children: o } = c, t = f(a, l), n = S(e, t.collectionRef);
|
18
|
+
return /* @__PURE__ */ d.jsx(_, { ref: n, children: o });
|
20
19
|
}
|
21
|
-
|
22
|
-
|
20
|
+
);
|
21
|
+
C.displayName = a;
|
22
|
+
const u = s + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
|
23
|
+
(c, e) => {
|
24
|
+
const { scope: l, children: o, ...t } = c, n = r.useRef(null), I = S(e, n), i = f(u, l);
|
25
|
+
return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: o });
|
26
|
+
}
|
27
|
+
);
|
28
|
+
x.displayName = u;
|
29
|
+
function O(c) {
|
30
|
+
const e = f(s + "CollectionConsumer", c);
|
31
|
+
return r.useCallback(() => {
|
32
|
+
const o = e.collectionRef.current;
|
33
|
+
if (!o) return [];
|
34
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
35
|
+
return Array.from(e.itemMap.values()).sort(
|
36
|
+
(i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
|
37
|
+
);
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
39
|
+
}
|
40
|
+
return [
|
41
|
+
{ Provider: p, Slot: C, ItemSlot: x },
|
42
|
+
O,
|
43
|
+
E
|
44
|
+
];
|
23
45
|
}
|
24
46
|
export {
|
25
|
-
|
47
|
+
D as createCollection
|
26
48
|
};
|
27
49
|
//# sourceMappingURL=index.es422.js.map
|
package/dist/index.es422.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es422.js","sources":["../node_modules/use-callback-ref/dist/es2015/useMergeRef.js"],"sourcesContent":["import * as React from 'react';\nimport { assignRef } from './assignRef';\nimport { useCallbackRef } from './useRef';\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar currentValues = new WeakMap();\n/**\n * Merges two or more refs together providing a single interface to set their value\n * @param {RefObject|Ref} refs\n * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}\n *\n * @see {@link mergeRefs} a version without buit-in memoization\n * @see https://github.com/theKashey/use-callback-ref#usemergerefs\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const ownRef = useRef();\n * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together\n * return <div ref={domRef}>...</div>\n * }\n */\nexport function useMergeRefs(refs, defaultValue) {\n var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {\n return refs.forEach(function (ref) { return assignRef(ref, newValue); });\n });\n // handle refs changes - added or removed\n useIsomorphicLayoutEffect(function () {\n var oldValue = currentValues.get(callbackRef);\n if (oldValue) {\n var prevRefs_1 = new Set(oldValue);\n var nextRefs_1 = new Set(refs);\n var current_1 = callbackRef.current;\n prevRefs_1.forEach(function (ref) {\n if (!nextRefs_1.has(ref)) {\n assignRef(ref, null);\n }\n });\n nextRefs_1.forEach(function (ref) {\n if (!prevRefs_1.has(ref)) {\n assignRef(ref, current_1);\n }\n });\n }\n currentValues.set(callbackRef, refs);\n }, [refs]);\n return callbackRef;\n}\n"],"names":["useIsomorphicLayoutEffect","React","currentValues","useMergeRefs","refs","defaultValue","callbackRef","useCallbackRef","newValue","ref","assignRef","oldValue","prevRefs_1","nextRefs_1","current_1"],"mappings":";;;AAGA,IAAIA,IAA4B,OAAO,SAAW,MAAcC,EAAM,kBAAkBA,EAAM,WAC1FC,IAAgB,oBAAI,QAAS;AAe1B,SAASC,EAAaC,GAAMC,GAAc;AAC7C,MAAIC,IAAcC,EAA+B,MAAM,SAAUC,GAAU;AACvE,WAAOJ,EAAK,QAAQ,SAAUK,GAAK;AAAE,aAAOC,EAAUD,GAAKD,CAAQ;AAAA,KAAI;AAAA,EAC/E,CAAK;AAED,SAAAR,EAA0B,WAAY;AAClC,QAAIW,IAAWT,EAAc,IAAII,CAAW;AAC5C,QAAIK,GAAU;AACV,UAAIC,IAAa,IAAI,IAAID,CAAQ,GAC7BE,IAAa,IAAI,IAAIT,CAAI,GACzBU,IAAYR,EAAY;AAC5B,MAAAM,EAAW,QAAQ,SAAUH,GAAK;AAC9B,QAAKI,EAAW,IAAIJ,CAAG,KACnBC,EAAUD,GAAK,IAAI;AAAA,MAEvC,CAAa,GACDI,EAAW,QAAQ,SAAUJ,GAAK;AAC9B,QAAKG,EAAW,IAAIH,CAAG,KACnBC,EAAUD,GAAKK,CAAS;AAAA,MAE5C,CAAa;AAAA,IACb;AACQ,IAAAZ,EAAc,IAAII,GAAaF,CAAI;AAAA,EAC3C,GAAO,CAACA,CAAI,CAAC,GACFE;AACX;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.es422.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAK,EAAA;AAAA,EACvE,GACKM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuBE,gBAAAA,EAAG,IAACT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACpG;AACD,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAqBC,EAAWF,CAAoB,GACpDG,IAAiBN,EAAM;AAAA,IAC3B,CAACJ,GAAOW,MAAiB;AACvB,YAAM,EAAE,OAAAV,GAAO,UAAAC,EAAQ,IAAKF,GACtBY,IAAUd,EAAqBS,GAAsBN,CAAK,GAC1DY,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuBN,gBAAAA,EAAAA,IAAIE,GAAoB,EAAE,KAAKK,GAAc,UAAAX,EAAQ,CAAE;AAAA,IACpF;AAAA,EACG;AACD,EA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_google_ignoreList":[0]}
|
package/dist/index.es423.js
CHANGED
@@ -1,113 +1,11 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
var b = function(t) {
|
8
|
-
return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
|
9
|
-
}, Y = function(t) {
|
10
|
-
return [t.deltaX, t.deltaY];
|
11
|
-
}, B = function(t) {
|
12
|
-
return t && "current" in t ? t.current : t;
|
13
|
-
}, p = function(t, c) {
|
14
|
-
return t[0] === c[0] && t[1] === c[1];
|
15
|
-
}, F = function(t) {
|
16
|
-
return `
|
17
|
-
.block-interactivity-`.concat(t, ` {pointer-events: none;}
|
18
|
-
.allow-interactivity-`).concat(t, ` {pointer-events: all;}
|
19
|
-
`);
|
20
|
-
}, K = 0, f = [];
|
21
|
-
function z(t) {
|
22
|
-
var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), h = n.useState(K++)[0], m = n.useState(I)[0], g = n.useRef(t);
|
23
|
-
n.useEffect(function() {
|
24
|
-
g.current = t;
|
25
|
-
}, [t]), n.useEffect(function() {
|
26
|
-
if (t.inert) {
|
27
|
-
document.body.classList.add("block-interactivity-".concat(h));
|
28
|
-
var e = x([t.lockRef.current], (t.shards || []).map(B), !0).filter(Boolean);
|
29
|
-
return e.forEach(function(r) {
|
30
|
-
return r.classList.add("allow-interactivity-".concat(h));
|
31
|
-
}), function() {
|
32
|
-
document.body.classList.remove("block-interactivity-".concat(h)), e.forEach(function(r) {
|
33
|
-
return r.classList.remove("allow-interactivity-".concat(h));
|
34
|
-
});
|
35
|
-
};
|
36
|
-
}
|
37
|
-
}, [t.inert, t.lockRef.current, t.shards]);
|
38
|
-
var k = n.useCallback(function(e, r) {
|
39
|
-
if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey)
|
40
|
-
return !g.current.allowPinchZoom;
|
41
|
-
var l = b(e), o = E.current, u = "deltaX" in e ? e.deltaX : o[0] - l[0], i = "deltaY" in e ? e.deltaY : o[1] - l[1], a, C = e.target, v = Math.abs(u) > Math.abs(i) ? "h" : "v";
|
42
|
-
if ("touches" in e && v === "h" && C.type === "range")
|
43
|
-
return !1;
|
44
|
-
var y = T(v, C);
|
45
|
-
if (!y)
|
46
|
-
return !0;
|
47
|
-
if (y ? a = v : (a = v === "v" ? "h" : "v", y = T(v, C)), !y)
|
48
|
-
return !1;
|
49
|
-
if (!d.current && "changedTouches" in e && (u || i) && (d.current = a), !a)
|
50
|
-
return !0;
|
51
|
-
var P = d.current || a;
|
52
|
-
return W(P, r, e, P === "h" ? u : i);
|
53
|
-
}, []), S = n.useCallback(function(e) {
|
54
|
-
var r = e;
|
55
|
-
if (!(!f.length || f[f.length - 1] !== m)) {
|
56
|
-
var l = "deltaY" in r ? Y(r) : b(r), o = c.current.filter(function(a) {
|
57
|
-
return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && p(a.delta, l);
|
58
|
-
})[0];
|
59
|
-
if (o && o.should) {
|
60
|
-
r.cancelable && r.preventDefault();
|
61
|
-
return;
|
62
|
-
}
|
63
|
-
if (!o) {
|
64
|
-
var u = (g.current.shards || []).map(B).filter(Boolean).filter(function(a) {
|
65
|
-
return a.contains(r.target);
|
66
|
-
}), i = u.length > 0 ? k(r, u[0]) : !g.current.noIsolation;
|
67
|
-
i && r.cancelable && r.preventDefault();
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}, []), R = n.useCallback(function(e, r, l, o) {
|
71
|
-
var u = { name: e, delta: r, target: l, should: o, shadowParent: O(l) };
|
72
|
-
c.current.push(u), setTimeout(function() {
|
73
|
-
c.current = c.current.filter(function(i) {
|
74
|
-
return i !== u;
|
75
|
-
});
|
76
|
-
}, 1);
|
77
|
-
}, []), w = n.useCallback(function(e) {
|
78
|
-
E.current = b(e), d.current = void 0;
|
79
|
-
}, []), L = n.useCallback(function(e) {
|
80
|
-
R(e.type, Y(e), e.target, k(e, t.lockRef.current));
|
81
|
-
}, []), M = n.useCallback(function(e) {
|
82
|
-
R(e.type, b(e), e.target, k(e, t.lockRef.current));
|
83
|
-
}, []);
|
84
|
-
n.useEffect(function() {
|
85
|
-
return f.push(m), t.setCallbacks({
|
86
|
-
onScrollCapture: L,
|
87
|
-
onWheelCapture: L,
|
88
|
-
onTouchMoveCapture: M
|
89
|
-
}), document.addEventListener("wheel", S, s), document.addEventListener("touchmove", S, s), document.addEventListener("touchstart", w, s), function() {
|
90
|
-
f = f.filter(function(e) {
|
91
|
-
return e !== m;
|
92
|
-
}), document.removeEventListener("wheel", S, s), document.removeEventListener("touchmove", S, s), document.removeEventListener("touchstart", w, s);
|
93
|
-
};
|
94
|
-
}, []);
|
95
|
-
var X = t.removeScrollBar, D = t.inert;
|
96
|
-
return n.createElement(
|
97
|
-
n.Fragment,
|
98
|
-
null,
|
99
|
-
D ? n.createElement(m, { styles: F(h) }) : null,
|
100
|
-
X ? n.createElement(A, { gapMode: t.gapMode }) : null
|
101
|
-
);
|
102
|
-
}
|
103
|
-
function O(t) {
|
104
|
-
for (var c = null; t !== null; )
|
105
|
-
t instanceof ShadowRoot && (c = t.host, t = t.host), t = t.parentNode;
|
106
|
-
return c;
|
1
|
+
import * as t from "react";
|
2
|
+
import "./index.es212.js";
|
3
|
+
var r = t.createContext(void 0);
|
4
|
+
function n(o) {
|
5
|
+
const e = t.useContext(r);
|
6
|
+
return o || e || "ltr";
|
107
7
|
}
|
108
8
|
export {
|
109
|
-
|
110
|
-
Y as getDeltaXY,
|
111
|
-
b as getTouchXY
|
9
|
+
n as useDirection
|
112
10
|
};
|
113
11
|
//# sourceMappingURL=index.es423.js.map
|
package/dist/index.es423.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es423.js","sources":["../node_modules/react-remove-scroll/dist/es2015/SideEffect.js"],"sourcesContent":["import { __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScrollBar } from 'react-remove-scroll-bar';\nimport { styleSingleton } from 'react-style-singleton';\nimport { nonPassive } from './aggresiveCapture';\nimport { handleScroll, locationCouldBeScrolled } from './handleScroll';\nexport var getTouchXY = function (event) {\n return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];\n};\nexport var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };\nvar extractRef = function (ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\nvar deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };\nvar generateStyle = function (id) { return \"\\n .block-interactivity-\".concat(id, \" {pointer-events: none;}\\n .allow-interactivity-\").concat(id, \" {pointer-events: all;}\\n\"); };\nvar idCounter = 0;\nvar lockStack = [];\nexport function RemoveScrollSideCar(props) {\n var shouldPreventQueue = React.useRef([]);\n var touchStartRef = React.useRef([0, 0]);\n var activeAxis = React.useRef();\n var id = React.useState(idCounter++)[0];\n var Style = React.useState(styleSingleton)[0];\n var lastProps = React.useRef(props);\n React.useEffect(function () {\n lastProps.current = props;\n }, [props]);\n React.useEffect(function () {\n if (props.inert) {\n document.body.classList.add(\"block-interactivity-\".concat(id));\n var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);\n allow_1.forEach(function (el) { return el.classList.add(\"allow-interactivity-\".concat(id)); });\n return function () {\n document.body.classList.remove(\"block-interactivity-\".concat(id));\n allow_1.forEach(function (el) { return el.classList.remove(\"allow-interactivity-\".concat(id)); });\n };\n }\n return;\n }, [props.inert, props.lockRef.current, props.shards]);\n var shouldCancelEvent = React.useCallback(function (event, parent) {\n if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {\n return !lastProps.current.allowPinchZoom;\n }\n var touch = getTouchXY(event);\n var touchStart = touchStartRef.current;\n var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];\n var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];\n var currentAxis;\n var target = event.target;\n var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';\n // allow horizontal touch move on Range inputs. They will not cause any scroll\n if ('touches' in event && moveDirection === 'h' && target.type === 'range') {\n return false;\n }\n var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n if (!canBeScrolledInMainDirection) {\n return true;\n }\n if (canBeScrolledInMainDirection) {\n currentAxis = moveDirection;\n }\n else {\n currentAxis = moveDirection === 'v' ? 'h' : 'v';\n canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n // other axis might be not scrollable\n }\n if (!canBeScrolledInMainDirection) {\n return false;\n }\n if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {\n activeAxis.current = currentAxis;\n }\n if (!currentAxis) {\n return true;\n }\n var cancelingAxis = activeAxis.current || currentAxis;\n return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);\n }, []);\n var shouldPrevent = React.useCallback(function (_event) {\n var event = _event;\n if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {\n // not the last active\n return;\n }\n var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);\n var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];\n // self event, and should be canceled\n if (sourceEvent && sourceEvent.should) {\n if (event.cancelable) {\n event.preventDefault();\n }\n return;\n }\n // outside or shard event\n if (!sourceEvent) {\n var shardNodes = (lastProps.current.shards || [])\n .map(extractRef)\n .filter(Boolean)\n .filter(function (node) { return node.contains(event.target); });\n var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;\n if (shouldStop) {\n if (event.cancelable) {\n event.preventDefault();\n }\n }\n }\n }, []);\n var shouldCancel = React.useCallback(function (name, delta, target, should) {\n var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };\n shouldPreventQueue.current.push(event);\n setTimeout(function () {\n shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });\n }, 1);\n }, []);\n var scrollTouchStart = React.useCallback(function (event) {\n touchStartRef.current = getTouchXY(event);\n activeAxis.current = undefined;\n }, []);\n var scrollWheel = React.useCallback(function (event) {\n shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n var scrollTouchMove = React.useCallback(function (event) {\n shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n React.useEffect(function () {\n lockStack.push(Style);\n props.setCallbacks({\n onScrollCapture: scrollWheel,\n onWheelCapture: scrollWheel,\n onTouchMoveCapture: scrollTouchMove,\n });\n document.addEventListener('wheel', shouldPrevent, nonPassive);\n document.addEventListener('touchmove', shouldPrevent, nonPassive);\n document.addEventListener('touchstart', scrollTouchStart, nonPassive);\n return function () {\n lockStack = lockStack.filter(function (inst) { return inst !== Style; });\n document.removeEventListener('wheel', shouldPrevent, nonPassive);\n document.removeEventListener('touchmove', shouldPrevent, nonPassive);\n document.removeEventListener('touchstart', scrollTouchStart, nonPassive);\n };\n }, []);\n var removeScrollBar = props.removeScrollBar, inert = props.inert;\n return (React.createElement(React.Fragment, null,\n inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,\n removeScrollBar ? React.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null));\n}\nfunction getOutermostShadowParent(node) {\n var shadowParent = null;\n while (node !== null) {\n if (node instanceof ShadowRoot) {\n shadowParent = node.host;\n node = node.host;\n }\n node = node.parentNode;\n }\n return shadowParent;\n}\n"],"names":["getTouchXY","event","getDeltaXY","extractRef","ref","deltaCompare","x","y","generateStyle","id","idCounter","lockStack","RemoveScrollSideCar","props","shouldPreventQueue","React","touchStartRef","activeAxis","Style","styleSingleton","lastProps","allow_1","__spreadArray","el","shouldCancelEvent","parent","touch","touchStart","deltaX","deltaY","currentAxis","target","moveDirection","canBeScrolledInMainDirection","locationCouldBeScrolled","cancelingAxis","handleScroll","shouldPrevent","_event","delta","sourceEvent","e","shardNodes","node","shouldStop","shouldCancel","name","should","getOutermostShadowParent","scrollTouchStart","scrollWheel","scrollTouchMove","nonPassive","inst","removeScrollBar","inert","RemoveScrollBar","shadowParent"],"mappings":";;;;;;AAMU,IAACA,IAAa,SAAUC,GAAO;AACrC,SAAO,oBAAoBA,IAAQ,CAACA,EAAM,eAAe,CAAC,EAAE,SAASA,EAAM,eAAe,CAAC,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC;AACjH,GACWC,IAAa,SAAUD,GAAO;AAAE,SAAO,CAACA,EAAM,QAAQA,EAAM,MAAM;AAAE,GAC3EE,IAAa,SAAUC,GAAK;AAC5B,SAAOA,KAAO,aAAaA,IAAMA,EAAI,UAAUA;AACnD,GACIC,IAAe,SAAUC,GAAGC,GAAG;AAAE,SAAOD,EAAE,CAAC,MAAMC,EAAE,CAAC,KAAKD,EAAE,CAAC,MAAMC,EAAE,CAAC;AAAI,GACzEC,IAAgB,SAAUC,GAAI;AAAE,SAAO;AAAA,yBAA4B,OAAOA,GAAI;AAAA,wBAAmD,EAAE,OAAOA,GAAI;AAAA,CAA2B;AAAI,GAC7KC,IAAY,GACZC,IAAY,CAAE;AACX,SAASC,EAAoBC,GAAO;AACvC,MAAIC,IAAqBC,EAAM,OAAO,EAAE,GACpCC,IAAgBD,EAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GACnCE,IAAaF,EAAM,OAAQ,GAC3BN,IAAKM,EAAM,SAASL,GAAW,EAAE,CAAC,GAClCQ,IAAQH,EAAM,SAASI,CAAc,EAAE,CAAC,GACxCC,IAAYL,EAAM,OAAOF,CAAK;AAClC,EAAAE,EAAM,UAAU,WAAY;AACxB,IAAAK,EAAU,UAAUP;AAAA,EAC5B,GAAO,CAACA,CAAK,CAAC,GACVE,EAAM,UAAU,WAAY;AACxB,QAAIF,EAAM,OAAO;AACb,eAAS,KAAK,UAAU,IAAI,uBAAuB,OAAOJ,CAAE,CAAC;AAC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AoB,aAAaf,GAAee,CAAU,GACnE,SAAS,oBAAoB,cAAcH,GAAkBG,CAAU;AAAA,IAC1E;AAAA,EACJ,GAAE,EAAE;AACL,MAAIE,IAAkBzC,EAAM,iBAAiB0C,IAAQ1C,EAAM;AAC3D,SAAQE,EAAM;AAAA,IAAcA,EAAM;AAAA,IAAU;AAAA,IACxCwC,IAAQxC,EAAM,cAAcG,GAAO,EAAE,QAAQV,EAAcC,CAAE,EAAG,CAAA,IAAI;AAAA,IACpE6C,IAAkBvC,EAAM,cAAcyC,GAAiB,EAAE,SAAS3C,EAAM,SAAS,IAAI;AAAA,EAAI;AACjG;AACA,SAASmC,EAAyBL,GAAM;AAEpC,WADIc,IAAe,MACZd,MAAS;AACZ,IAAIA,aAAgB,eAChBc,IAAed,EAAK,MACpBA,IAAOA,EAAK,OAEhBA,IAAOA,EAAK;AAEhB,SAAOc;AACX;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.es423.js","sources":["../node_modules/@radix-ui/react-direction/dist/index.mjs"],"sourcesContent":["// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DirectionContext","React","useDirection","localDir","globalDir"],"mappings":";;AAGA,IAAIA,IAAmBC,EAAM,cAAc,MAAM;AAKjD,SAASC,EAAaC,GAAU;AAC9B,QAAMC,IAAYH,EAAM,WAAWD,CAAgB;AACnD,SAAOG,KAAYC,KAAa;AAClC;","x_google_ignoreList":[0]}
|
package/dist/index.es424.js
CHANGED
@@ -1,19 +1,221 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import * as s from "react";
|
2
|
+
import { useFloating as xe, offset as Pe, shift as ye, flip as Ae, size as ve, arrow as Ce, hide as be, limitShift as Se } from "./index.es431.js";
|
3
|
+
import { Root as Oe } from "./index.es432.js";
|
4
|
+
import { useComposedRefs as T } from "./index.es386.js";
|
5
|
+
import { createContextScope as Re } from "./index.es387.js";
|
6
|
+
import { Primitive as z } from "./index.es389.js";
|
7
|
+
import { useCallbackRef as Ee } from "./index.es426.js";
|
8
|
+
import { useLayoutEffect as B } from "./index.es421.js";
|
9
|
+
import { useSize as Ne } from "./index.es397.js";
|
10
|
+
import { j as f } from "./index.es212.js";
|
11
|
+
import { autoUpdate as _e } from "./index.es433.js";
|
12
|
+
var N = "Popper", [L, Ue] = Re(N), [$e, Z] = L(N), U = (e) => {
|
13
|
+
const { __scopePopper: i, children: n } = e, [t, a] = s.useState(null);
|
14
|
+
return /* @__PURE__ */ f.jsx($e, { scope: i, anchor: t, onAnchorChange: a, children: n });
|
11
15
|
};
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
U.displayName = N;
|
17
|
+
var q = "PopperAnchor", G = s.forwardRef(
|
18
|
+
(e, i) => {
|
19
|
+
const { __scopePopper: n, virtualRef: t, ...a } = e, r = Z(q, n), o = s.useRef(null), w = T(i, o);
|
20
|
+
return s.useEffect(() => {
|
21
|
+
r.onAnchorChange((t == null ? void 0 : t.current) || o.current);
|
22
|
+
}), t ? null : /* @__PURE__ */ f.jsx(z.div, { ...a, ref: w });
|
23
|
+
}
|
24
|
+
);
|
25
|
+
G.displayName = q;
|
26
|
+
var _ = "PopperContent", [je, He] = L(_), J = s.forwardRef(
|
27
|
+
(e, i) => {
|
28
|
+
var I, Y, M, X, D, F;
|
29
|
+
const {
|
30
|
+
__scopePopper: n,
|
31
|
+
side: t = "bottom",
|
32
|
+
sideOffset: a = 0,
|
33
|
+
align: r = "center",
|
34
|
+
alignOffset: o = 0,
|
35
|
+
arrowPadding: w = 0,
|
36
|
+
avoidCollisions: p = !0,
|
37
|
+
collisionBoundary: c = [],
|
38
|
+
collisionPadding: x = 0,
|
39
|
+
sticky: m = "partial",
|
40
|
+
hideWhenDetached: y = !1,
|
41
|
+
updatePositionStrategy: A = "optimized",
|
42
|
+
onPlaced: l,
|
43
|
+
...d
|
44
|
+
} = e, v = Z(_, n), [h, C] = s.useState(null), ee = T(i, (P) => C(P)), [E, te] = s.useState(null), g = Ne(E), re = (g == null ? void 0 : g.width) ?? 0, $ = (g == null ? void 0 : g.height) ?? 0, oe = t + (r !== "center" ? "-" + r : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, j = Array.isArray(c) ? c : [c], ae = j.length > 0, b = {
|
45
|
+
padding: ne,
|
46
|
+
boundary: j.filter(Ie),
|
47
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
48
|
+
altBoundary: ae
|
49
|
+
}, { refs: ie, floatingStyles: H, placement: se, isPositioned: S, middlewareData: u } = xe({
|
50
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
51
|
+
strategy: "fixed",
|
52
|
+
placement: oe,
|
53
|
+
whileElementsMounted: (...P) => _e(...P, {
|
54
|
+
animationFrame: A === "always"
|
55
|
+
}),
|
56
|
+
elements: {
|
57
|
+
reference: v.anchor
|
58
|
+
},
|
59
|
+
middleware: [
|
60
|
+
Pe({ mainAxis: a + $, alignmentAxis: o }),
|
61
|
+
p && ye({
|
62
|
+
mainAxis: !0,
|
63
|
+
crossAxis: !1,
|
64
|
+
limiter: m === "partial" ? Se() : void 0,
|
65
|
+
...b
|
66
|
+
}),
|
67
|
+
p && Ae({ ...b }),
|
68
|
+
ve({
|
69
|
+
...b,
|
70
|
+
apply: ({ elements: P, rects: k, availableWidth: he, availableHeight: ge }) => {
|
71
|
+
const { width: ue, height: we } = k.reference, R = P.floating.style;
|
72
|
+
R.setProperty("--radix-popper-available-width", `${he}px`), R.setProperty("--radix-popper-available-height", `${ge}px`), R.setProperty("--radix-popper-anchor-width", `${ue}px`), R.setProperty("--radix-popper-anchor-height", `${we}px`);
|
73
|
+
}
|
74
|
+
}),
|
75
|
+
E && Ce({ element: E, padding: w }),
|
76
|
+
Ye({ arrowWidth: re, arrowHeight: $ }),
|
77
|
+
y && be({ strategy: "referenceHidden", ...b })
|
78
|
+
]
|
79
|
+
}), [W, pe] = V(se), O = Ee(l);
|
80
|
+
B(() => {
|
81
|
+
S && (O == null || O());
|
82
|
+
}, [S, O]);
|
83
|
+
const ce = (I = u.arrow) == null ? void 0 : I.x, de = (Y = u.arrow) == null ? void 0 : Y.y, le = ((M = u.arrow) == null ? void 0 : M.centerOffset) !== 0, [fe, me] = s.useState();
|
84
|
+
return B(() => {
|
85
|
+
h && me(window.getComputedStyle(h).zIndex);
|
86
|
+
}, [h]), /* @__PURE__ */ f.jsx(
|
87
|
+
"div",
|
88
|
+
{
|
89
|
+
ref: ie.setFloating,
|
90
|
+
"data-radix-popper-content-wrapper": "",
|
91
|
+
style: {
|
92
|
+
...H,
|
93
|
+
transform: S ? H.transform : "translate(0, -200%)",
|
94
|
+
// keep off the page when measuring
|
95
|
+
minWidth: "max-content",
|
96
|
+
zIndex: fe,
|
97
|
+
"--radix-popper-transform-origin": [
|
98
|
+
(X = u.transformOrigin) == null ? void 0 : X.x,
|
99
|
+
(D = u.transformOrigin) == null ? void 0 : D.y
|
100
|
+
].join(" "),
|
101
|
+
// hide the content if using the hide middleware and should be hidden
|
102
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
103
|
+
// as if the PopperContent isn't there at all
|
104
|
+
...((F = u.hide) == null ? void 0 : F.referenceHidden) && {
|
105
|
+
visibility: "hidden",
|
106
|
+
pointerEvents: "none"
|
107
|
+
}
|
108
|
+
},
|
109
|
+
dir: e.dir,
|
110
|
+
children: /* @__PURE__ */ f.jsx(
|
111
|
+
je,
|
112
|
+
{
|
113
|
+
scope: n,
|
114
|
+
placedSide: W,
|
115
|
+
onArrowChange: te,
|
116
|
+
arrowX: ce,
|
117
|
+
arrowY: de,
|
118
|
+
shouldHideArrow: le,
|
119
|
+
children: /* @__PURE__ */ f.jsx(
|
120
|
+
z.div,
|
121
|
+
{
|
122
|
+
"data-side": W,
|
123
|
+
"data-align": pe,
|
124
|
+
...d,
|
125
|
+
ref: ee,
|
126
|
+
style: {
|
127
|
+
...d.style,
|
128
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
129
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
130
|
+
animation: S ? void 0 : "none"
|
131
|
+
}
|
132
|
+
}
|
133
|
+
)
|
134
|
+
}
|
135
|
+
)
|
136
|
+
}
|
137
|
+
);
|
138
|
+
}
|
139
|
+
);
|
140
|
+
J.displayName = _;
|
141
|
+
var K = "PopperArrow", We = {
|
142
|
+
top: "bottom",
|
143
|
+
right: "left",
|
144
|
+
bottom: "top",
|
145
|
+
left: "right"
|
146
|
+
}, Q = s.forwardRef(function(i, n) {
|
147
|
+
const { __scopePopper: t, ...a } = i, r = He(K, t), o = We[r.placedSide];
|
148
|
+
return (
|
149
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
150
|
+
// doesn't report size as we'd expect on SVG elements.
|
151
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
152
|
+
/* @__PURE__ */ f.jsx(
|
153
|
+
"span",
|
154
|
+
{
|
155
|
+
ref: r.onArrowChange,
|
156
|
+
style: {
|
157
|
+
position: "absolute",
|
158
|
+
left: r.arrowX,
|
159
|
+
top: r.arrowY,
|
160
|
+
[o]: 0,
|
161
|
+
transformOrigin: {
|
162
|
+
top: "",
|
163
|
+
right: "0 0",
|
164
|
+
bottom: "center 0",
|
165
|
+
left: "100% 0"
|
166
|
+
}[r.placedSide],
|
167
|
+
transform: {
|
168
|
+
top: "translateY(100%)",
|
169
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
170
|
+
bottom: "rotate(180deg)",
|
171
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
172
|
+
}[r.placedSide],
|
173
|
+
visibility: r.shouldHideArrow ? "hidden" : void 0
|
174
|
+
},
|
175
|
+
children: /* @__PURE__ */ f.jsx(
|
176
|
+
Oe,
|
177
|
+
{
|
178
|
+
...a,
|
179
|
+
ref: n,
|
180
|
+
style: {
|
181
|
+
...a.style,
|
182
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
183
|
+
display: "block"
|
184
|
+
}
|
185
|
+
}
|
186
|
+
)
|
187
|
+
}
|
188
|
+
)
|
189
|
+
);
|
190
|
+
});
|
191
|
+
Q.displayName = K;
|
192
|
+
function Ie(e) {
|
193
|
+
return e !== null;
|
15
194
|
}
|
195
|
+
var Ye = (e) => ({
|
196
|
+
name: "transformOrigin",
|
197
|
+
options: e,
|
198
|
+
fn(i) {
|
199
|
+
var v, h, C;
|
200
|
+
const { placement: n, rects: t, middlewareData: a } = i, o = ((v = a.arrow) == null ? void 0 : v.centerOffset) !== 0, w = o ? 0 : e.arrowWidth, p = o ? 0 : e.arrowHeight, [c, x] = V(n), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = a.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((C = a.arrow) == null ? void 0 : C.y) ?? 0) + p / 2;
|
201
|
+
let l = "", d = "";
|
202
|
+
return c === "bottom" ? (l = o ? m : `${y}px`, d = `${-p}px`) : c === "top" ? (l = o ? m : `${y}px`, d = `${t.floating.height + p}px`) : c === "right" ? (l = `${-p}px`, d = o ? m : `${A}px`) : c === "left" && (l = `${t.floating.width + p}px`, d = o ? m : `${A}px`), { data: { x: l, y: d } };
|
203
|
+
}
|
204
|
+
});
|
205
|
+
function V(e) {
|
206
|
+
const [i, n = "center"] = e.split("-");
|
207
|
+
return [i, n];
|
208
|
+
}
|
209
|
+
var qe = U, Ge = G, Je = J, Ke = Q;
|
16
210
|
export {
|
17
|
-
|
211
|
+
Ge as Anchor,
|
212
|
+
Ke as Arrow,
|
213
|
+
Je as Content,
|
214
|
+
U as Popper,
|
215
|
+
G as PopperAnchor,
|
216
|
+
Q as PopperArrow,
|
217
|
+
J as PopperContent,
|
218
|
+
qe as Root,
|
219
|
+
Ue as createPopperScope
|
18
220
|
};
|
19
221
|
//# sourceMappingURL=index.es424.js.map
|