@rpcbase/ui 0.230.0 → 0.232.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/dist/components/I18nField/index.d.ts.map +1 -1
- package/dist/components/PhoneNumberInput/index.d.ts.map +1 -1
- package/dist/index11.js +291 -278
- package/dist/index11.js.map +1 -1
- package/dist/index127.js +36 -36
- package/dist/index139.js +6 -6
- package/dist/index142.js +10 -10
- package/dist/index144.js +2 -2
- package/dist/index145.js +3 -3
- package/dist/index146.js +1 -1
- package/dist/index148.js +2 -2
- package/dist/index150.js +2 -2
- package/dist/index171.js +11 -13
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +62 -148
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +37 -30
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +14 -10
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +23 -48
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +109 -10
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +13 -45
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +4 -95
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -87
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +247 -240
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +5 -106
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +11 -52
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +19 -11
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +13 -38
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +261 -8
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +4 -116
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +28 -18
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +126 -15
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +5 -3
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +76 -34
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +65 -19
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +8 -9
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +15 -8
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +91 -18
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +63 -26
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +44 -15
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +13 -58
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +154 -8
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +28 -64
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +9 -19
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +46 -14
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +11 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +43 -4
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +95 -6
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +86 -4
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +105 -6
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +52 -16
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +11 -4
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +37 -4
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +8 -12
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +116 -9
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +17 -13
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +15 -13
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +3 -4
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +36 -5
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +20 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +9 -5
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +8 -54
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +19 -8
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +28 -4
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +16 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +58 -8
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +8 -4
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +66 -4
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +19 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +16 -10
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +5 -9
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +5 -9
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -10
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +4 -10
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +6 -9
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +16 -6
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -5
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +4 -4
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +12 -5
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +9 -6
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +13 -5
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +13 -16
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +4 -7
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +5 -10
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +6 -10
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +5 -21
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +54 -10
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +8 -9
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +4 -9
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +4 -4
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +8 -5
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +4 -16
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +4 -9
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +3 -18
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +10 -15
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +9 -12
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -29
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +10 -12
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +10 -25
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +9 -5
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +7 -20
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -66
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +4 -6
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +5 -5
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +6 -11
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +5 -50
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +17 -4
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +7 -29
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +10 -16
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +10 -5
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +21 -21
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +10 -51
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +9 -25
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +9 -41
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +4 -39
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +6 -45
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +16 -23
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +9 -19
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +18 -20
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +15 -70
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +12 -17
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +29 -11
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +12 -27
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +25 -13
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +5 -18
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +20 -37
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +64 -63
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +6 -262
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +10 -277
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +49 -67
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +4 -46
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +27 -97
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +15 -82
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +6 -13
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +21 -3
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +50 -28
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +25 -16
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +42 -38
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +39 -34
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +45 -69
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +20 -16
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +70 -3
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +15 -108
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +11 -26
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +26 -27
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +14 -4
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +18 -126
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +36 -4
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +258 -74
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +269 -260
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +68 -11
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +97 -25
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +83 -15
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +3 -10
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +28 -24
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +16 -16
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +34 -125
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +15 -4
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +3 -40
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +24 -63
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +28 -13
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +4 -14
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +78 -7
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +270 -13
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +11 -5
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +10 -3
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +25 -10
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +16 -7
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +109 -117
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +5 -261
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +39 -398
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +65 -52
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +14 -12
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +7 -11
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +5 -4
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +3 -11
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +11 -4
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +8 -5
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +133 -11
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +395 -74
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +51 -65
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +11 -8
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +11 -92
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +7 -19
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +4 -4
- package/dist/index340.js +11 -4
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +8 -17
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +13 -12
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +3 -8
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +3 -11
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +16 -7
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +50 -12
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +5 -3
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +122 -3
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +33 -4
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +5 -5
- package/dist/index350.js +74 -15
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +141 -7
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +61 -51
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +49 -11
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +15 -17
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +8 -5
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +4 -5
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +11 -20
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +21 -44
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +21 -18
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +10 -10
- package/dist/index360.js +5 -5
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +16 -199
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +12 -77
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +4 -123
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +10 -16
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +16 -32
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +5 -73
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +20 -142
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +45 -62
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +17 -49
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +3 -3
- package/dist/index370.js +4 -4
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +200 -11
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +76 -20
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +8 -4
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +26 -5
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +27 -4
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +136 -14
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +12 -8
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +226 -5
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +3 -4
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +4 -4
- package/dist/index380.js +19 -545
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +77 -46
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +12 -18
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +3 -5
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +71 -7
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +9 -7
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +15 -7
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +4 -11
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +4 -8
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +4 -13
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +5 -5
- package/dist/index390.js +16 -3
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +9 -3
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +5 -8
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +5 -26
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +543 -24
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +44 -135
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +16 -11
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +5 -226
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +7 -3
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +6 -19
- package/dist/index399.js.map +1 -1
- package/dist/index40.js +3 -3
- package/dist/index400.js +7 -77
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +12 -12
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +8 -3
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +12 -71
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +3 -9
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +3 -16
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +14 -4
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +490 -54
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +5 -68
- package/dist/index408.js.map +1 -1
- package/dist/index409.js +55 -30
- package/dist/index409.js.map +1 -1
- package/dist/index41.js +10 -10
- package/dist/index410.js +68 -9
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +26 -148
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +9 -108
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +153 -8
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +108 -2
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +7 -43
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +2 -56
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +43 -7
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +56 -2
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +7 -54
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +2 -56
- package/dist/index420.js.map +1 -1
- package/dist/index421.js +54 -14
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +51 -487
- package/dist/index422.js.map +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.js +2 -2
- package/dist/index49.js +34 -34
- package/dist/index50.js +29 -29
- package/dist/index51.js +2 -2
- package/dist/index52.js +12 -12
- package/dist/index53.js +4 -4
- package/dist/index54.js +1 -1
- package/dist/index55.js +22 -22
- package/dist/index56.js +5 -5
- package/dist/index57.js +5 -5
- package/dist/index58.js +8 -8
- package/dist/index59.js +5 -5
- package/dist/index60.js +17 -17
- package/dist/index61.js +5 -5
- package/dist/index62.js +3 -3
- package/dist/index66.js +1 -1
- package/dist/index67.js +1 -1
- package/dist/index72.js +6 -2
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +8 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +5 -5
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +2 -8
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +2 -6
- package/dist/index76.js.map +1 -1
- package/dist/index80.js +4 -4
- package/dist/index85.js +1 -1
- package/dist/index86.js +1 -1
- package/dist/index93.js +1 -1
- package/dist/index94.js +6 -6
- package/dist/index96.js +4 -4
- package/dist/index98.js +1 -1
- package/package.json +1 -1
package/dist/index298.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index298.js","sources":["../../../node_modules/@base-ui/react/esm/internals/use-button/useButton.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.js\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.js\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.js\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n const type = isNativeButton ? 'button' : undefined;\n return mergeProps({\n type,\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n if (isLink || isNativeButton && isButton) {\n currentTarget.click();\n event.preventBaseUIHandler();\n } else if (shouldClick) {\n externalOnClick?.(event);\n event.preventBaseUIHandler();\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (shouldClick) {\n if (!isNativeButton && (isSpaceKey || isEnterKey)) {\n event.preventDefault();\n }\n if (!isNativeButton && isEnterKey) {\n externalOnClick?.(event);\n }\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === ' ') {\n externalOnClick?.(event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, !isNativeButton ? {\n role: 'button'\n } : undefined, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return Boolean(elem?.tagName === 'A' && elem?.href);\n}"],"names":["useButton","parameters","disabled","focusableWhenDisabled","tabIndex","isNativeButton","compositeProp","elementRef","React","compositeRootContext","useCompositeRootContext","isCompositeItem","focusableWhenDisabledProps","useFocusableWhenDisabled","isButtonTag","isButtonElement","ownerStackMessage","SafeReact","error","updateDisabled","element","useIsoLayoutEffect","getButtonProps","externalProps","externalOnClick","externalOnMouseDown","externalOnKeyUp","externalOnKeyDown","externalOnPointerDown","otherExternalProps","mergeProps","event","makeEventPreventable","isCurrentTarget","currentTarget","isButton","isLink","isValidLinkElement","shouldClick","isEnterKey","isSpaceKey","role","isTextNavigationRole","buttonRef","useStableCallback","elem","isHTMLElement"],"mappings":";;;;;;;;;AAWO,SAASA,EAAUC,IAAa,IAAI;AACzC,QAAM;AAAA,IACJ,UAAAC,IAAW;AAAA,IACX,uBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,QAAQC,IAAiB;AAAA,IACzB,WAAWC;AAAA,EACf,IAAML,GACEM,IAAaC,EAAM,OAAO,IAAI,GAC9BC,IAAuBC,EAAwB,EAAI,GACnDC,IAAkBL,KAAiBG,MAAyB,QAC5D;AAAA,IACJ,OAAOG;AAAA,EACX,IAAMC,EAAyB;AAAA,IAC3B,uBAAAV;AAAA,IACA,UAAAD;AAAA,IACA,WAAWS;AAAA,IACX,UAAAP;AAAA,IACA,gBAAAC;AAAA,EACJ,CAAG;AACD,EAAI,QAAQ,IAAI,aAAa,gBAE3BG,EAAM,UAAU,MAAM;AACpB,QAAI,CA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iB,CAAkB;AAAA,EAC/D,GAAG,CAAC3B,GAAUU,GAA4BD,GAAiBN,CAAc,CAAC,GACpEsC,IAAYC,EAAkB,CAAAxB,MAAW;AAC7C,IAAAb,EAAW,UAAUa,GACrBD,EAAc;AAAA,EAChB,CAAC;AACD,SAAO;AAAA,IACL,gBAAAG;AAAA,IACA,WAAAqB;AAAA,EACJ;AACA;AACA,SAAS5B,EAAgB8B,GAAM;AAC7B,SAAOC,EAAcD,CAAI,KAAKA,EAAK,YAAY;AACjD;AACA,SAASR,EAAmBQ,GAAM;AAChC,SAAO,GAAQA,GAAM,YAAY,OAAOA,GAAM;AAChD;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index298.js","sources":["../../../node_modules/@base-ui/react/esm/internals/itemEquality.js"],"sourcesContent":["export const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues || selectedValues.length === 0) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues || itemValues.length === 0) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}"],"names":["defaultItemEquality","itemValue","selectedValue","compareItemEquality","comparer","selectedValueIncludes","selectedValues","findItemIndex","itemValues","removeItem"],"mappings":"AAAY,MAACA,IAAsB,CAACC,GAAWC,MAAkB,OAAO,GAAGD,GAAWC,CAAa;AAC5F,SAASC,EAAoBF,GAAWC,GAAeE,GAAU;AACtE,SAAIH,KAAa,QAAQC,KAAiB,OACjC,OAAO,GAAGD,GAAWC,CAAa,IAEpCE,EAASH,GAAWC,CAAa;AAC1C;AACO,SAASG,EAAsBC,GAAgBL,GAAWG,GAAU;AACzE,SAAI,CAACE,KAAkBA,EAAe,WAAW,IACxC,KAEFA,EAAe,KAAK,CAAAJ,MACrBA,MAAkB,SACb,KAEFC,EAAoBF,GAAWC,GAAeE,CAAQ,CAC9D;AACH;AACO,SAASG,EAAcC,GAAYN,GAAeE,GAAU;AACjE,SAAI,CAACI,KAAcA,EAAW,WAAW,IAChC,KAEFA,EAAW,UAAU,CAAAP,MACtBA,MAAc,SACT,KAEFE,EAAoBF,GAAWC,GAAeE,CAAQ,CAC9D;AACH;AACO,SAASK,EAAWH,GAAgBL,GAAWG,GAAU;AAC9D,SAAOE,EAAe,OAAO,CAAAJ,MAAiB,CAACC,EAAoBF,GAAWC,GAAeE,CAAQ,CAAC;AACxG;","x_google_ignoreList":[0]}
|
package/dist/index299.js
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
function b(t) {
|
|
12
|
-
return t.matches("html,body");
|
|
13
|
-
}
|
|
14
|
-
function e(t) {
|
|
15
|
-
return i(t) && t.matches(n);
|
|
16
|
-
}
|
|
17
|
-
function f(t) {
|
|
18
|
-
return t ? t.getAttribute("role") === "combobox" && e(t) : !1;
|
|
19
|
-
}
|
|
20
|
-
function T(t) {
|
|
21
|
-
return t ? t.hasAttribute(u) ? t : t.querySelector(`[${u}]`) || t : null;
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { useIsoLayoutEffect as o } from "./index286.js";
|
|
3
|
+
import { useStableCallback as f } from "./index287.js";
|
|
4
|
+
function u(r, n) {
|
|
5
|
+
const t = c.useRef(r), e = f(n);
|
|
6
|
+
o(() => {
|
|
7
|
+
t.current !== r && e(t.current);
|
|
8
|
+
}, [r, e]), o(() => {
|
|
9
|
+
t.current = r;
|
|
10
|
+
}, [r]);
|
|
22
11
|
}
|
|
23
12
|
export {
|
|
24
|
-
|
|
25
|
-
a as isEventTargetWithin,
|
|
26
|
-
b as isRootElement,
|
|
27
|
-
f as isTypeableCombobox,
|
|
28
|
-
e as isTypeableElement
|
|
13
|
+
u as useValueChanged
|
|
29
14
|
};
|
|
30
15
|
//# sourceMappingURL=index299.js.map
|
package/dist/index299.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index299.js","sources":["../../../node_modules/@base-ui/react/esm/
|
|
1
|
+
{"version":3,"file":"index299.js","sources":["../../../node_modules/@base-ui/react/esm/internals/useValueChanged.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nexport function useValueChanged(value, onChange) {\n const valueRef = React.useRef(value);\n const onChangeCallback = useStableCallback(onChange);\n useIsoLayoutEffect(() => {\n if (valueRef.current === value) {\n return;\n }\n onChangeCallback(valueRef.current);\n }, [value, onChangeCallback]);\n useIsoLayoutEffect(() => {\n valueRef.current = value;\n }, [value]);\n}"],"names":["useValueChanged","value","onChange","valueRef","React","onChangeCallback","useStableCallback","useIsoLayoutEffect"],"mappings":";;;AAKO,SAASA,EAAgBC,GAAOC,GAAU;AAC/C,QAAMC,IAAWC,EAAM,OAAOH,CAAK,GAC7BI,IAAmBC,EAAkBJ,CAAQ;AACnD,EAAAK,EAAmB,MAAM;AACvB,IAAIJ,EAAS,YAAYF,KAGzBI,EAAiBF,EAAS,OAAO;AAAA,EACnC,GAAG,CAACF,GAAOI,CAAgB,CAAC,GAC5BE,EAAmB,MAAM;AACvB,IAAAJ,EAAS,UAAUF;AAAA,EACrB,GAAG,CAACA,CAAK,CAAC;AACZ;","x_google_ignoreList":[0]}
|
package/dist/index300.js
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { useStableCallback as c } from "./index287.js";
|
|
3
|
+
import { useEnhancedClickHandler as u } from "./index365.js";
|
|
4
|
+
import { isIOS as m } from "./index326.js";
|
|
5
|
+
import { useValueChanged as p } from "./index299.js";
|
|
6
|
+
function C(e) {
|
|
7
|
+
const [o, t] = l.useState(null), s = c((i, a) => {
|
|
8
|
+
e || t(a || // On iOS Safari, the hitslop around touch targets means tapping outside an element's
|
|
9
|
+
// bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`
|
|
10
|
+
// will be "" in that case.
|
|
11
|
+
(m ? "touch" : ""));
|
|
12
|
+
});
|
|
13
|
+
p(e, (i) => {
|
|
14
|
+
i && !e && t(null);
|
|
15
|
+
});
|
|
16
|
+
const {
|
|
17
|
+
onClick: r,
|
|
18
|
+
onPointerDown: n
|
|
19
|
+
} = u(s);
|
|
20
|
+
return l.useMemo(() => ({
|
|
21
|
+
openMethod: o,
|
|
22
|
+
triggerProps: {
|
|
23
|
+
onClick: r,
|
|
24
|
+
onPointerDown: n
|
|
20
25
|
}
|
|
21
|
-
}
|
|
22
|
-
return !1;
|
|
23
|
-
}
|
|
24
|
-
function f(t) {
|
|
25
|
-
return "composedPath" in t ? t.composedPath()[0] : t.target;
|
|
26
|
+
}), [o, r, n]);
|
|
26
27
|
}
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
-
u as contains,
|
|
30
|
-
f as getTarget
|
|
29
|
+
C as useOpenInteractionType
|
|
31
30
|
};
|
|
32
31
|
//# sourceMappingURL=index300.js.map
|
package/dist/index300.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index300.js","sources":["../../../node_modules/@base-ui/react/esm/
|
|
1
|
+
{"version":3,"file":"index300.js","sources":["../../../node_modules/@base-ui/react/esm/utils/useOpenInteractionType.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { isIOS } from '@base-ui/utils/detectBrowser';\nimport { useValueChanged } from \"../internals/useValueChanged.js\";\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n if (!open) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n isIOS ? 'touch' : ''));\n }\n });\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n openMethod,\n triggerProps: {\n onClick,\n onPointerDown\n }\n }), [openMethod, onClick, onPointerDown]);\n}"],"names":["useOpenInteractionType","open","openMethod","setOpenMethod","React","handleTriggerClick","useStableCallback","_","interactionType","isIOS","useValueChanged","previousOpen","onClick","onPointerDown","useEnhancedClickHandler"],"mappings":";;;;;AAaO,SAASA,EAAuBC,GAAM;AAC3C,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAM,SAAS,IAAI,GACjDC,IAAqBC,EAAkB,CAACC,GAAGC,MAAoB;AACnE,IAAKP,KACHE,EAAcK;AAAA;AAAA;AAAA,KAIdC,IAAQ,UAAU,GAAG;AAAA,EAEzB,CAAC;AACD,EAAAC,EAAgBT,GAAM,CAAAU,MAAgB;AACpC,IAAIA,KAAgB,CAACV,KACnBE,EAAc,IAAI;AAAA,EAEtB,CAAC;AACD,QAAM;AAAA,IACJ,SAAAS;AAAA,IACA,eAAAC;AAAA,EACJ,IAAMC,EAAwBT,CAAkB;AAC9C,SAAOD,EAAM,QAAQ,OAAO;AAAA,IAC1B,YAAAF;AAAA,IACA,cAAc;AAAA,MACZ,SAAAU;AAAA,MACA,eAAAC;AAAA,IACN;AAAA,EACA,IAAM,CAACX,GAAYU,GAASC,CAAa,CAAC;AAC1C;","x_google_ignoreList":[0]}
|
package/dist/index301.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { clamp as s } from "./index331.js";
|
|
2
|
+
const f = 1;
|
|
3
|
+
function a(n, t) {
|
|
4
|
+
return Math.max(0, n - t);
|
|
5
|
+
}
|
|
6
|
+
function u(n, t) {
|
|
7
|
+
if (t <= 0)
|
|
8
|
+
return 0;
|
|
9
|
+
const r = s(n, 0, t), e = r, c = t - r, o = e <= f, i = c <= f;
|
|
10
|
+
return o && i ? e <= c ? 0 : t : o ? 0 : i ? t : r;
|
|
11
|
+
}
|
|
4
12
|
export {
|
|
5
|
-
|
|
13
|
+
f as SCROLL_EDGE_TOLERANCE_PX,
|
|
14
|
+
a as getMaxScrollOffset,
|
|
15
|
+
u as normalizeScrollOffset
|
|
6
16
|
};
|
|
7
17
|
//# sourceMappingURL=index301.js.map
|
package/dist/index301.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index301.js","sources":["../../../node_modules/@base-ui/react/esm/
|
|
1
|
+
{"version":3,"file":"index301.js","sources":["../../../node_modules/@base-ui/react/esm/utils/scrollEdges.js"],"sourcesContent":["import { clamp } from \"../internals/clamp.js\";\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}"],"names":["SCROLL_EDGE_TOLERANCE_PX","getMaxScrollOffset","scrollSize","clientSize","normalizeScrollOffset","value","max","clamped","clamp","startDistance","endDistance","withinStartTolerance","withinEndTolerance"],"mappings":";AACY,MAACA,IAA2B;AACjC,SAASC,EAAmBC,GAAYC,GAAY;AACzD,SAAO,KAAK,IAAI,GAAGD,IAAaC,CAAU;AAC5C;AACO,SAASC,EAAsBC,GAAOC,GAAK;AAChD,MAAIA,KAAO;AACT,WAAO;AAET,QAAMC,IAAUC,EAAMH,GAAO,GAAGC,CAAG,GAC7BG,IAAgBF,GAChBG,IAAcJ,IAAMC,GACpBI,IAAuBF,KAAiBT,GACxCY,IAAqBF,KAAeV;AAC1C,SAAIW,KAAwBC,IACnBH,KAAiBC,IAAc,IAAIJ,IAExCK,IACK,IAELC,IACKN,IAEFC;AACT;","x_google_ignoreList":[0]}
|
package/dist/index302.js
CHANGED
|
@@ -1,130 +1,22 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const g = /* @__PURE__ */ o.createContext(null);
|
|
19
|
-
process.env.NODE_ENV !== "production" && (g.displayName = "PortalContext");
|
|
20
|
-
const Q = () => o.useContext(g), U = J("portal");
|
|
21
|
-
function W(F = {}) {
|
|
22
|
-
const {
|
|
23
|
-
ref: d,
|
|
24
|
-
container: n,
|
|
25
|
-
componentProps: R = k,
|
|
26
|
-
elementProps: x
|
|
27
|
-
} = F, m = G(), a = Q()?.portalNode, [E, c] = o.useState(null), [e, u] = o.useState(null), p = L((t) => {
|
|
28
|
-
t !== null && u(t);
|
|
29
|
-
}), r = o.useRef(null);
|
|
30
|
-
_(() => {
|
|
31
|
-
if (n === null) {
|
|
32
|
-
r.current && (r.current = null, u(null), c(null));
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (m == null)
|
|
36
|
-
return;
|
|
37
|
-
const t = (n && (V(n) ? n : n.current)) ?? a ?? document.body;
|
|
38
|
-
if (t == null) {
|
|
39
|
-
r.current && (r.current = null, u(null), c(null));
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
r.current !== t && (r.current = t, u(null), c(t));
|
|
43
|
-
}, [n, a, m]);
|
|
44
|
-
const f = Y("div", R, {
|
|
45
|
-
ref: [d, p],
|
|
46
|
-
props: [{
|
|
47
|
-
id: m,
|
|
48
|
-
[U]: ""
|
|
49
|
-
}, x]
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
portalNode: e,
|
|
53
|
-
portalSubtree: E && f ? /* @__PURE__ */ I.createPortal(f, E) : null
|
|
54
|
-
};
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { s as u } from "./index404.js";
|
|
3
|
+
import { w as i } from "./index405.js";
|
|
4
|
+
import { isReactVersionAtLeast as S } from "./index347.js";
|
|
5
|
+
const a = S(19), m = a ? f : l;
|
|
6
|
+
function g(t, e, r, n, o) {
|
|
7
|
+
return m(t, e, r, n, o);
|
|
8
|
+
}
|
|
9
|
+
function p(t, e, r, n, o) {
|
|
10
|
+
const s = c.useCallback(() => e(t.getSnapshot(), r, n, o), [t, e, r, n, o]);
|
|
11
|
+
return u.useSyncExternalStore(t.subscribe, s, s);
|
|
12
|
+
}
|
|
13
|
+
function f(t, e, r, n, o) {
|
|
14
|
+
return p(t, e, r, n, o);
|
|
15
|
+
}
|
|
16
|
+
function l(t, e, r, n, o) {
|
|
17
|
+
return i.useSyncExternalStoreWithSelector(t.subscribe, t.getSnapshot, t.getSnapshot, (s) => e(s, r, n, o));
|
|
55
18
|
}
|
|
56
|
-
const X = /* @__PURE__ */ o.forwardRef(function(d, n) {
|
|
57
|
-
const {
|
|
58
|
-
children: R,
|
|
59
|
-
container: x,
|
|
60
|
-
className: m,
|
|
61
|
-
render: j,
|
|
62
|
-
renderGuards: a,
|
|
63
|
-
style: E,
|
|
64
|
-
...c
|
|
65
|
-
} = d, {
|
|
66
|
-
portalNode: e,
|
|
67
|
-
portalSubtree: u
|
|
68
|
-
} = W({
|
|
69
|
-
container: x,
|
|
70
|
-
ref: n,
|
|
71
|
-
componentProps: d,
|
|
72
|
-
elementProps: c
|
|
73
|
-
}), p = o.useRef(null), r = o.useRef(null), f = o.useRef(null), P = o.useRef(null), [t, h] = o.useState(null), b = o.useRef(!1), v = t?.modal, y = t?.open, N = typeof a == "boolean" ? a : !!t && !t.modal && t.open && !!e;
|
|
74
|
-
o.useEffect(() => {
|
|
75
|
-
if (!e || v)
|
|
76
|
-
return;
|
|
77
|
-
function s(l) {
|
|
78
|
-
e && l.relatedTarget && C(l) && (l.type === "focusin" ? b.current && (T(e), b.current = !1) : (B(e), b.current = !0));
|
|
79
|
-
}
|
|
80
|
-
return w(O(e, "focusin", s, !0), O(e, "focusout", s, !0));
|
|
81
|
-
}, [e, v]), o.useEffect(() => {
|
|
82
|
-
!e || y !== !1 || (T(e), b.current = !1);
|
|
83
|
-
}, [y, e]);
|
|
84
|
-
const D = o.useMemo(() => ({
|
|
85
|
-
beforeOutsideRef: p,
|
|
86
|
-
afterOutsideRef: r,
|
|
87
|
-
beforeInsideRef: f,
|
|
88
|
-
afterInsideRef: P,
|
|
89
|
-
portalNode: e,
|
|
90
|
-
setFocusManagerState: h
|
|
91
|
-
}), [e]);
|
|
92
|
-
return /* @__PURE__ */ i.jsxs(o.Fragment, {
|
|
93
|
-
children: [u, /* @__PURE__ */ i.jsxs(g.Provider, {
|
|
94
|
-
value: D,
|
|
95
|
-
children: [N && e && /* @__PURE__ */ i.jsx(S, {
|
|
96
|
-
"data-type": "outside",
|
|
97
|
-
ref: p,
|
|
98
|
-
onFocus: (s) => {
|
|
99
|
-
if (C(s, e))
|
|
100
|
-
f.current?.focus();
|
|
101
|
-
else {
|
|
102
|
-
const l = t ? t.domReference : null;
|
|
103
|
-
q(l)?.focus();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}), N && e && /* @__PURE__ */ i.jsx("span", {
|
|
107
|
-
"aria-owns": e.id,
|
|
108
|
-
style: z
|
|
109
|
-
}), e && /* @__PURE__ */ I.createPortal(R, e), N && e && /* @__PURE__ */ i.jsx(S, {
|
|
110
|
-
"data-type": "outside",
|
|
111
|
-
ref: r,
|
|
112
|
-
onFocus: (s) => {
|
|
113
|
-
if (C(s, e))
|
|
114
|
-
P.current?.focus();
|
|
115
|
-
else {
|
|
116
|
-
const l = t ? t.domReference : null;
|
|
117
|
-
A(l)?.focus(), t?.closeOnFocusOut && t?.onOpenChange(!1, H(K, s.nativeEvent));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
})]
|
|
121
|
-
})]
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
process.env.NODE_ENV !== "production" && (X.displayName = "FloatingPortal");
|
|
125
19
|
export {
|
|
126
|
-
|
|
127
|
-
W as useFloatingPortalNode,
|
|
128
|
-
Q as usePortalContext
|
|
20
|
+
g as useStore
|
|
129
21
|
};
|
|
130
22
|
//# sourceMappingURL=index302.js.map
|
package/dist/index302.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index302.js","sources":["../../../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.js\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { createAttribute } from \"../utils/createAttribute.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { ownerVisuallyHidden } from \"../../internals/constants.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n\n // React 17 does not use React.useId().\n if (uniqueId == null) {\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode, uniqueId]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n portalNode,\n portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n children,\n container,\n className,\n render,\n renderGuards,\n style,\n ...elementProps\n } = componentProps;\n const {\n portalNode,\n portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = typeof renderGuards === 'boolean' ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n React.useEffect(() => {\n if (!portalNode || open !== false) {\n return;\n }\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n \"aria-owns\": portalNode.id,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";"],"names":["PortalContext","React","usePortalContext","attr","createAttribute","useFloatingPortalNode","props","ref","containerProp","componentProps","EMPTY_OBJECT","elementProps","uniqueId","useId","parentPortalNode","containerElement","setContainerElement","portalNode","setPortalNode","setPortalNodeRef","useStableCallback","node","containerRef","useIsoLayoutEffect","resolvedContainer","isNode","portalElement","useRenderElement","ReactDOM","FloatingPortal","forwardedRef","children","container","className","render","renderGuards","style","portalSubtree","beforeOutsideRef","afterOutsideRef","beforeInsideRef","afterInsideRef","focusManagerState","setFocusManagerState","focusInsideDisabledRef","modal","open","shouldRenderGuards","onFocus","event","isOutsideEvent","enableFocusInside","disableFocusInside","mergeCleanups","addEventListener","portalContextValue","_jsxs","_jsx","FocusGuard","domReference","getPreviousTabbable","ownerVisuallyHidden","getNextTabbable","createChangeEventDetails","REASONS.focusOut"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,MAAMA,IAA6B,gBAAAC,EAAM,cAAc,IAAI;AACvD,QAAQ,IAAI,aAAa,iBAAcD,EAAc,cAAc;AAC3D,MAACE,IAAmB,MAAMD,EAAM,WAAWD,CAAa,GAC9DG,IAAOC,EAAgB,QAAQ;AAC9B,SAASC,EAAsBC,IAAQ,IAAI;AAChD,QAAM;AAAA,IACJ,KAAAC;AAAA,IACA,WAAWC;AAAA,IAC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,EAAgBH,CAAY,GACnC,MAAK,GACfjB,GAAmB,mBACrBA,GAAmB,aAAa,IAAOqB,EAAyBC,GAAkBf,EAAM,WAAW,CAAC;AAAA,UAExG;AAAA,QACF;AAAA,MACR,CAAO,CAAC;AAAA,IACR,CAAK,CAAC;AAAA,EACN,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcpB,EAAe,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index302.js","sources":["../../../node_modules/@base-ui/utils/esm/store/useStore.js"],"sourcesContent":["import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.js\";\nimport { register, getInstance } from \"../fastHooks.js\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (hook.didChange || !Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n hook.didChange = false;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3),\n didChange: false\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.didChange = true;\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}"],"names":["canUseRawUseSyncExternalStore","isReactVersionAtLeast","useStoreImplementation","useStoreFast","useStoreLegacy","useStore","store","selector","a1","a2","a3","useStoreR19","getSelection","React","useSyncExternalStore","useSyncExternalStoreWithSelector","state"],"mappings":";;;;AASA,MAAMA,IAAgCC,EAAsB,EAAE,GACxDC,IAAyBF,IAAgCG,IAAeC;AACvE,SAASC,EAASC,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AACpD,SAAOR,EAAuBI,GAAOC,GAAUC,GAAIC,GAAIC,CAAE;AAC3D;AACA,SAASC,EAAYL,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AAChD,QAAME,IAAeC,EAAM,YAAY,MAAMN,EAASD,EAAM,eAAeE,GAAIC,GAAIC,CAAE,GAAG,CAACJ,GAAOC,GAAUC,GAAIC,GAAIC,CAAE,CAAC;AACrH,SAAOI,EAAAA,qBAAqBR,EAAM,WAAWM,GAAcA,CAAY;AACzE;AAmDA,SAAST,EAAaG,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AAI/C,SAAOC,EAAYL,GAAOC,GAAUC,GAAIC,GAAIC,CAAE;AA+BlD;AACA,SAASN,EAAeE,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AACnD,SAAOK,EAAAA,iCAAiCT,EAAM,WAAWA,EAAM,aAAaA,EAAM,aAAa,CAAAU,MAAST,EAASS,GAAOR,GAAIC,GAAIC,CAAE,CAAC;AACrI;","x_google_ignoreList":[0]}
|
package/dist/index303.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { isElement as l } from "./index334.js";
|
|
2
|
+
import { useId as c } from "./index345.js";
|
|
3
|
+
import { useRefWithInit as a } from "./index283.js";
|
|
4
|
+
import { useIsoLayoutEffect as m } from "./index286.js";
|
|
5
|
+
import { useFloatingParentNodeId as u } from "./index382.js";
|
|
6
|
+
import { FloatingRootStore as p } from "./index384.js";
|
|
7
|
+
import { PopupTriggerMap as d } from "./index352.js";
|
|
8
|
+
function y(s) {
|
|
9
|
+
const {
|
|
10
|
+
open: o = !1,
|
|
11
|
+
onOpenChange: f,
|
|
12
|
+
elements: e = {}
|
|
13
|
+
} = s, r = c(), i = u() != null;
|
|
14
|
+
if (process.env.NODE_ENV !== "production") {
|
|
15
|
+
const n = e.reference;
|
|
16
|
+
n && !l(n) && console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead.");
|
|
17
|
+
}
|
|
18
|
+
const t = a(() => new p({
|
|
19
|
+
open: o,
|
|
20
|
+
transitionStatus: void 0,
|
|
21
|
+
onOpenChange: f,
|
|
22
|
+
referenceElement: e.reference ?? null,
|
|
23
|
+
floatingElement: e.floating ?? null,
|
|
24
|
+
triggerElements: new d(),
|
|
25
|
+
floatingId: r,
|
|
26
|
+
syncOnly: !1,
|
|
27
|
+
nested: i
|
|
28
|
+
})).current;
|
|
29
|
+
return m(() => {
|
|
30
|
+
const n = {
|
|
31
|
+
open: o,
|
|
32
|
+
floatingId: r
|
|
33
|
+
};
|
|
34
|
+
e.reference !== void 0 && (n.referenceElement = e.reference, n.domReferenceElement = l(e.reference) ? e.reference : null), e.floating !== void 0 && (n.floatingElement = e.floating), t.update(n);
|
|
35
|
+
}, [o, r, e.reference, e.floating, t]), t.context.onOpenChange = f, t.context.nested = i, t;
|
|
4
36
|
}
|
|
5
37
|
export {
|
|
6
|
-
|
|
38
|
+
y as useFloatingRootContext
|
|
7
39
|
};
|
|
8
40
|
//# sourceMappingURL=index303.js.map
|
package/dist/index303.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index303.js","sources":["../../../node_modules/@base-ui/
|
|
1
|
+
{"version":3,"file":"index303.js","sources":["../../../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js"],"sourcesContent":["'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.js\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.js\";\nimport { PopupTriggerMap } from \"../../utils/popups/index.js\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n\n // Only sync elements that are defined to avoid overwriting existing ones\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}"],"names":["useFloatingRootContext","options","open","onOpenChange","elements","floatingId","useId","nested","useFloatingParentNodeId","optionDomReference","isElement","store","useRefWithInit","FloatingRootStore","PopupTriggerMap","useIsoLayoutEffect","valuesToSync"],"mappings":";;;;;;;AASO,SAASA,EAAuBC,GAAS;AAC9C,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,cAAAC;AAAA,IACA,UAAAC,IAAW,CAAA;AAAA,EACf,IAAMH,GACEI,IAAaC,EAAK,GAClBC,IAASC,EAAuB,KAAM;AAC5C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAMC,IAAqBL,EAAS;AACpC,IAAIK,KAAsB,CAACC,EAAUD,CAAkB,KACrD,QAAQ,MAAM,qEAAqE,0EAA0E,UAAU;AAAA,EAE3K;AACA,QAAME,IAAQC,EAAe,MAAM,IAAIC,EAAkB;AAAA,IACvD,MAAAX;AAAA,IACA,kBAAkB;AAAA,IAClB,cAAAC;AAAA,IACA,kBAAkBC,EAAS,aAAa;AAAA,IACxC,iBAAiBA,EAAS,YAAY;AAAA,IACtC,iBAAiB,IAAIU,EAAe;AAAA,IACpC,YAAAT;AAAA,IACA,UAAU;AAAA,IACV,QAAAE;AAAA,EACJ,CAAG,CAAC,EAAE;AACJ,SAAAQ,EAAmB,MAAM;AACvB,UAAMC,IAAe;AAAA,MACnB,MAAAd;AAAA,MACA,YAAAG;AAAA,IACN;AAGI,IAAID,EAAS,cAAc,WACzBY,EAAa,mBAAmBZ,EAAS,WACzCY,EAAa,sBAAsBN,EAAUN,EAAS,SAAS,IAAIA,EAAS,YAAY,OAEtFA,EAAS,aAAa,WACxBY,EAAa,kBAAkBZ,EAAS,WAE1CO,EAAM,OAAOK,CAAY;AAAA,EAC3B,GAAG,CAACd,GAAMG,GAAYD,EAAS,WAAWA,EAAS,UAAUO,CAAK,CAAC,GACnEA,EAAM,QAAQ,eAAeR,GAC7BQ,EAAM,QAAQ,SAASJ,GAChBI;AACT;","x_google_ignoreList":[0]}
|