@rpcbase/ui 0.247.0 → 0.248.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/Notifications/NotificationsDrawer.d.ts.map +1 -1
- package/dist/index105.js +36 -36
- package/dist/index117.js +6 -6
- package/dist/index120.js +10 -10
- package/dist/index122.js +2 -2
- package/dist/index123.js +3 -3
- package/dist/index124.js +1 -1
- package/dist/index126.js +2 -2
- package/dist/index128.js +2 -2
- package/dist/index150.js +3 -3
- package/dist/index156.js +1 -1
- package/dist/index16.js +157 -157
- package/dist/index16.js.map +1 -1
- package/dist/index163.js +2 -2
- package/dist/index164.js +7 -7
- package/dist/index167.js +4 -4
- package/dist/index169.js +1 -1
- package/dist/index171.js +14 -58
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +68 -8
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +37 -87
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +13 -19
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +23 -16
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +111 -5
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +13 -6
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +4 -6
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -5
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +5 -7
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +11 -16
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +19 -4
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +11 -5
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +176 -12
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +279 -9
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +4 -13
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +28 -14
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +126 -4
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +63 -5
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +8 -6
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +16 -6
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +29 -53
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +69 -8
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +58 -4
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +8 -4
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +87 -8
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +19 -4
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +16 -4
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +5 -3
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +5 -10
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +6 -9
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +4 -9
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +6 -10
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +16 -10
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +4 -9
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +4 -6
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +12 -5
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +9 -4
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +13 -5
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +13 -6
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +4 -5
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +5 -16
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +6 -7
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -10
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +54 -10
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +8 -21
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +4 -8
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +4 -9
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +8 -9
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +4 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +4 -5
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -16
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +9 -18
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +9 -20
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +10 -12
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +10 -29
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +9 -12
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +6 -25
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -5
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +4 -14
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +5 -68
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +7 -38
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +6 -14
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +16 -23
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +7 -111
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +11 -13
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +10 -4
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +22 -4
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +9 -5
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +9 -11
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +9 -19
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +5 -11
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -176
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +15 -278
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +9 -4
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +19 -28
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +18 -124
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +12 -63
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +29 -8
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +12 -15
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +25 -30
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +5 -69
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +20 -155
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +65 -31
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +6 -11
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -49
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +11 -9
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +3 -11
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +48 -41
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +4 -98
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +27 -84
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +14 -103
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +5 -52
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +21 -11
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +53 -4
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +20 -37
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +41 -8
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +39 -3
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +46 -10
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +18 -133
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +69 -16
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +17 -15
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +3 -36
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +11 -20
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +13 -8
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +18 -24
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +35 -27
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +239 -16
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +253 -20
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +66 -64
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +99 -6
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +83 -5
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +3 -11
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +29 -3
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -50
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +35 -4
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +16 -28
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +3 -16
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +26 -5
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +27 -20
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -54
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +76 -18
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +268 -37
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +11 -39
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +10 -45
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +25 -20
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +15 -69
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +122 -14
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +5 -3
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +65 -11
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -14
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7 -18
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -36
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +3 -239
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -252
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +7 -68
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +128 -94
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +391 -75
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +5 -4
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +51 -28
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +10 -15
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +28 -35
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +11 -17
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +154 -3
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +31 -25
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +11 -28
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +50 -4
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +9 -78
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +10 -271
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +43 -11
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +97 -10
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +86 -25
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +104 -15
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +50 -123
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +11 -5
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +4 -65
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +37 -13
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +8 -7
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +135 -5
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +17 -3
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +15 -10
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +3 -7
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +32 -129
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +18 -397
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +10 -5
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +8 -52
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +8 -11
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +11 -27
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +2 -2
- package/dist/index340.js +8 -11
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +13 -4
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +4 -18
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +3 -12
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +16 -7
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +22 -9
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +27 -7
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +14 -11
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +51 -3
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +61 -3
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +5 -5
- package/dist/index350.js +65 -16
- package/dist/index350.js.map +1 -1
- package/dist/index352.js +8 -51
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +5 -62
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +11 -66
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +21 -8
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +17 -5
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +8 -12
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +144 -21
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +77 -14
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +11 -11
- package/dist/index360.js +62 -8
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +15 -145
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +4 -79
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +17 -61
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +13 -15
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +4 -5
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +10 -19
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +6 -4
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +3 -6
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +21 -3
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +3 -3
- package/dist/index370.js +44 -11
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +17 -20
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +5 -45
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +198 -15
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +74 -5
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +115 -192
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +4 -73
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +19 -122
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +8 -4
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +27 -5
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +4 -4
- package/dist/index380.js +138 -4
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +12 -15
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +46 -8
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +3 -5
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +21 -4
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +72 -542
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +11 -46
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +3 -17
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +71 -5
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +35 -7
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +5 -5
- package/dist/index390.js +7 -7
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +15 -7
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +4 -11
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +4 -8
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +4 -13
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +15 -8
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +9 -27
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +5 -137
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +4 -12
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +543 -44
- package/dist/index399.js.map +1 -1
- package/dist/index40.js +3 -3
- package/dist/index400.js +47 -4
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +17 -21
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +5 -75
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +8 -12
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +6 -3
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +7 -71
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +11 -35
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +9 -7
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +12 -15
- package/dist/index408.js.map +1 -1
- package/dist/index41.js +10 -10
- package/dist/index411.js +14 -4
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +3 -56
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +490 -66
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +5 -31
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +56 -9
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +61 -146
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +26 -103
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +9 -15
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +153 -3
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +106 -490
- package/dist/index420.js.map +1 -1
- package/dist/index49.js +36 -36
- 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 +21 -21
- 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/package.json +1 -1
package/dist/index348.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index348.js","sources":["../../../node_modules/@base-ui/react/
|
|
1
|
+
{"version":3,"file":"index348.js","sources":["../../../node_modules/@base-ui/react/internals/useAnimationsFinished.mjs"],"sourcesContent":["'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\nimport { TransitionStatusDataAttributes } from \"./stateAttributesMapping.mjs\";\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param treatAbortedAsFinished - Whether to treat aborted animations as finished. If `false`, and there are aborted animations,\n * the function will check again if any new animations have started and wait for them to finish.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n ReactDOM.flushSync(fnToExecute);\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }).catch(() => {\n if (treatAbortedAsFinished) {\n if (!signal?.aborted) {\n done();\n }\n return;\n }\n const currentAnimations = resolvedElement.getAnimations();\n if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n }\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}"],"names":["useAnimationsFinished","elementOrRef","waitForStartingStyleRemoved","treatAbortedAsFinished","frame","useAnimationFrame","useStableCallback","fnToExecute","signal","element","resolveRef","resolvedElement","done","ReactDOM","exec","animation","currentAnimations","startingStyleAttribute","TransitionStatusDataAttributes","attributeObserver"],"mappings":";;;;;AAgBO,SAASA,EAAsBC,GAAcC,IAA8B,IAAOC,IAAyB,IAAM;AACtH,QAAMC,IAAQC,EAAiB;AAC/B,SAAOC,EAAkB,CAACC,GAM1BC,IAAS,SAAS;AAChB,IAAAJ,EAAM,OAAM;AACZ,UAAMK,IAAUC,EAAWT,CAAY;AACvC,QAAIQ,KAAW;AACb;AAEF,UAAME,IAAkBF,GAClBG,IAAO,MAAM;AAGjB,MAAAC,EAAS,UAAUN,CAAW;AAAA,IAChC;AACA,QAAI,OAAOI,EAAgB,iBAAkB,cAAc,WAAW,6BAA6B;AACjG,MAAAJ,EAAW;AACX;AAAA,IACF;AACA,aAASO,IAAO;AACd,cAAQ,IAAIH,EAAgB,gBAAgB,IAAI,CAAAI,MAAaA,EAAU,QAAQ,CAAC,EAAE,KAAK,MAAM;AAC3F,QAAKP,GAAQ,WACXI,EAAI;AAAA,MAER,CAAC,EAAE,MAAM,MAAM;AACb,YAAIT,GAAwB;AAC1B,UAAKK,GAAQ,WACXI,EAAI;AAEN;AAAA,QACF;AACA,cAAMI,IAAoBL,EAAgB,cAAa;AACvD,QAAI,CAACH,GAAQ,WAAWQ,EAAkB,SAAS,KAAKA,EAAkB,KAAK,CAAAD,MAAaA,EAAU,WAAWA,EAAU,cAAc,UAAU,KAGjJD,EAAI;AAAA,MAER,CAAC;AAAA,IACH;AACA,QAAIZ,GAA6B;AAC/B,YAAMe,IAAyBC,EAA+B;AAI9D,UAAI,CAACP,EAAgB,aAAaM,CAAsB,GAAG;AACzD,QAAAb,EAAM,QAAQU,CAAI;AAClB;AAAA,MACF;AAGA,YAAMK,IAAoB,IAAI,iBAAiB,MAAM;AACnD,QAAKR,EAAgB,aAAaM,CAAsB,MACtDE,EAAkB,WAAU,GAC5BL,EAAI;AAAA,MAER,CAAC;AACD,MAAAK,EAAkB,QAAQR,GAAiB;AAAA,QACzC,YAAY;AAAA,QACZ,iBAAiB,CAACM,CAAsB;AAAA,MAChD,CAAO,GACDT,GAAQ,iBAAiB,SAAS,MAAMW,EAAkB,WAAU,GAAI;AAAA,QACtE,MAAM;AAAA,MACd,CAAO;AACD;AAAA,IACF;AACA,IAAAf,EAAM,QAAQU,CAAI;AAAA,EACpB,CAAC;AACH;","x_google_ignoreList":[0]}
|
package/dist/index349.js
CHANGED
|
@@ -1,7 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { useScrollLock as P } from "./index375.js";
|
|
3
|
+
import { EMPTY_OBJECT as f } from "./index264.js";
|
|
4
|
+
import { createChangeEventDetails as C } from "./index175.js";
|
|
5
|
+
import { usePopupRootSync as S, useImplicitActiveTrigger as k, useOpenStateTransitions as E, usePopupInteractionProps as T } from "./index184.js";
|
|
6
|
+
import { useDismiss as h } from "./index279.js";
|
|
7
|
+
import { getTarget as w, contains as x } from "./index291.js";
|
|
8
|
+
import { imperativeAction as I } from "./index177.js";
|
|
9
|
+
function L(e) {
|
|
10
|
+
const {
|
|
11
|
+
store: t,
|
|
12
|
+
actionsRef: a
|
|
13
|
+
} = e, o = t.useState("open");
|
|
14
|
+
S(t, o), k(t);
|
|
15
|
+
const {
|
|
16
|
+
forceUnmount: c
|
|
17
|
+
} = E(o, t), s = r.useCallback(() => {
|
|
18
|
+
t.setOpen(!1, C(I));
|
|
19
|
+
}, [t]);
|
|
20
|
+
r.useImperativeHandle(a, () => ({
|
|
21
|
+
unmount: c,
|
|
22
|
+
close: s
|
|
23
|
+
}), [c, s]);
|
|
24
|
+
}
|
|
25
|
+
function M({
|
|
26
|
+
store: e,
|
|
27
|
+
parentContext: t,
|
|
28
|
+
isDrawer: a
|
|
29
|
+
}) {
|
|
30
|
+
const o = e.useState("open"), c = e.useState("disablePointerDismissal"), s = e.useState("modal"), d = e.useState("popupElement"), O = e.useState("floatingRootContext"), [u, m] = r.useState(0), [l, g] = r.useState(0), D = u === 0, p = h(O, {
|
|
31
|
+
outsidePressEvent() {
|
|
32
|
+
return e.context.internalBackdropRef.current || e.context.backdropRef.current ? "intentional" : {
|
|
33
|
+
mouse: s === "trap-focus" ? "sloppy" : "intentional",
|
|
34
|
+
touch: "sloppy"
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
outsidePress(n) {
|
|
38
|
+
if (!e.context.outsidePressEnabledRef.current || "button" in n && n.button !== 0 || "touches" in n && n.touches.length !== 1)
|
|
39
|
+
return !1;
|
|
40
|
+
const i = w(n);
|
|
41
|
+
return D && !c ? s && (e.context.internalBackdropRef.current || e.context.backdropRef.current) ? e.context.internalBackdropRef.current === i || e.context.backdropRef.current === i || x(i, d) && !i?.hasAttribute("data-base-ui-portal") : !0 : !1;
|
|
42
|
+
},
|
|
43
|
+
escapeKey: D
|
|
44
|
+
});
|
|
45
|
+
P(o && s === !0, d), e.useContextCallback("onNestedDialogOpen", (n, i) => {
|
|
46
|
+
m(n), g(i);
|
|
47
|
+
}), e.useContextCallback("onNestedDialogClose", () => {
|
|
48
|
+
m(0), g(0);
|
|
49
|
+
}), r.useEffect(() => (t?.onNestedDialogOpen && o && t.onNestedDialogOpen(u + 1, l + (a ? 1 : 0)), t?.onNestedDialogClose && !o && t.onNestedDialogClose(), () => {
|
|
50
|
+
t?.onNestedDialogClose && o && t.onNestedDialogClose();
|
|
51
|
+
}), [a, o, u, l, t]);
|
|
52
|
+
const b = p.reference ?? f, R = p.trigger ?? f, N = p.floating ?? f;
|
|
53
|
+
return T(e, {
|
|
54
|
+
activeTriggerProps: b,
|
|
55
|
+
inactiveTriggerProps: R,
|
|
56
|
+
popupProps: N,
|
|
57
|
+
nestedOpenDialogCount: u,
|
|
58
|
+
nestedOpenDrawerCount: l
|
|
59
|
+
}), null;
|
|
3
60
|
}
|
|
4
61
|
export {
|
|
5
|
-
|
|
62
|
+
M as DialogInteractions,
|
|
63
|
+
L as useDialogRoot
|
|
6
64
|
};
|
|
7
65
|
//# sourceMappingURL=index349.js.map
|
package/dist/index349.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index349.js","sources":["../../../node_modules/@base-ui/react/
|
|
1
|
+
{"version":3,"file":"index349.js","sources":["../../../node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions, usePopupInteractionProps, usePopupRootSync } from \"../../utils/popups/index.mjs\";\nexport function useDialogRoot(params) {\n const {\n store,\n actionsRef\n } = params;\n const open = store.useState('open');\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }, [store]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n}\nexport function DialogInteractions({\n store,\n parentContext,\n isDrawer\n}) {\n const open = store.useState('open');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const floatingRootContext = store.useState('floatingRootContext');\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event && event.touches.length !== 1) {\n return false;\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n return store.context.internalBackdropRef.current || store.context.backdropRef.current ? store.context.internalBackdropRef.current === target || store.context.backdropRef.current === target || contains(target, popupElement) && !target?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n\n // Listen for nested open/close events on this store to maintain the counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n store.useContextCallback('onNestedDialogClose', () => {\n setOwnNestedOpenDialogs(0);\n setOwnNestedOpenDrawers(0);\n });\n\n // Notify parent of our open/close state using parent callbacks, if any\n React.useEffect(() => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n }\n if (parentContext?.onNestedDialogClose && !open) {\n parentContext.onNestedDialogClose();\n }\n return () => {\n if (parentContext?.onNestedDialogClose && open) {\n parentContext.onNestedDialogClose();\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n const activeTriggerProps = dismiss.reference ?? EMPTY_OBJECT;\n const inactiveTriggerProps = dismiss.trigger ?? EMPTY_OBJECT;\n // Consumers (DialogPopup/DrawerPopup) already spread `FOCUSABLE_POPUP_PROPS`\n // directly, so the popup props only need to carry the dismiss handlers.\n const popupProps = dismiss.floating ?? EMPTY_OBJECT;\n usePopupInteractionProps(store, {\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n return null;\n}"],"names":["useDialogRoot","params","store","actionsRef","open","usePopupRootSync","useImplicitActiveTrigger","forceUnmount","useOpenStateTransitions","handleImperativeClose","React","createChangeEventDetails","REASONS.imperativeAction","DialogInteractions","parentContext","isDrawer","disablePointerDismissal","modal","popupElement","floatingRootContext","ownNestedOpenDialogs","setOwnNestedOpenDialogs","ownNestedOpenDrawers","setOwnNestedOpenDrawers","isTopmost","dismiss","useDismiss","event","target","getTarget","contains","useScrollLock","dialogCount","drawerCount","activeTriggerProps","EMPTY_OBJECT","inactiveTriggerProps","popupProps","usePopupInteractionProps"],"mappings":";;;;;;;;AAUO,SAASA,EAAcC,GAAQ;AACpC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,YAAAC;AAAA,EACJ,IAAMF,GACEG,IAAOF,EAAM,SAAS,MAAM;AAClC,EAAAG,EAAiBH,GAAOE,CAAI,GAC5BE,EAAyBJ,CAAK;AAC9B,QAAM;AAAA,IACJ,cAAAK;AAAA,EACJ,IAAMC,EAAwBJ,GAAMF,CAAK,GACjCO,IAAwBC,EAAM,YAAY,MAAM;AACpD,IAAAR,EAAM,QAAQ,IAAOS,EAAyBC,CAAwB,CAAC;AAAA,EACzE,GAAG,CAACV,CAAK,CAAC;AACV,EAAAQ,EAAM,oBAAoBP,GAAY,OAAO;AAAA,IAC3C,SAASI;AAAA,IACT,OAAOE;AAAA,EACX,IAAM,CAACF,GAAcE,CAAqB,CAAC;AAC3C;AACO,SAASI,EAAmB;AAAA,EACjC,OAAAX;AAAA,EACA,eAAAY;AAAA,EACA,UAAAC;AACF,GAAG;AACD,QAAMX,IAAOF,EAAM,SAAS,MAAM,GAC5Bc,IAA0Bd,EAAM,SAAS,yBAAyB,GAClEe,IAAQf,EAAM,SAAS,OAAO,GAC9BgB,IAAehB,EAAM,SAAS,cAAc,GAC5CiB,IAAsBjB,EAAM,SAAS,qBAAqB,GAC1D,CAACkB,GAAsBC,CAAuB,IAAIX,EAAM,SAAS,CAAC,GAClE,CAACY,GAAsBC,CAAuB,IAAIb,EAAM,SAAS,CAAC,GAClEc,IAAYJ,MAAyB,GACrCK,IAAUC,EAAWP,GAAqB;AAAA,IAC9C,oBAAoB;AAClB,aAAIjB,EAAM,QAAQ,oBAAoB,WAAWA,EAAM,QAAQ,YAAY,UAClE,gBAIF;AAAA,QACL,OAAOe,MAAU,eAAe,WAAW;AAAA,QAC3C,OAAO;AAAA,MACf;AAAA,IACI;AAAA,IACA,aAAaU,GAAO;AAUlB,UATI,CAACzB,EAAM,QAAQ,uBAAuB,WAMtC,YAAYyB,KAASA,EAAM,WAAW,KAGtC,aAAaA,KAASA,EAAM,QAAQ,WAAW;AACjD,eAAO;AAET,YAAMC,IAASC,EAAUF,CAAK;AAC9B,aAAIH,KAAa,CAACR,IAIZC,MACKf,EAAM,QAAQ,oBAAoB,WAAWA,EAAM,QAAQ,YAAY,WAAUA,EAAM,QAAQ,oBAAoB,YAAY0B,KAAU1B,EAAM,QAAQ,YAAY,YAAY0B,KAAUE,EAASF,GAAQV,CAAY,KAAK,CAACU,GAAQ,aAAa,qBAAqB,IAExQ,KAEF;AAAA,IACT;AAAA,IACA,WAAWJ;AAAA,EACf,CAAG;AACD,EAAAO,EAAc3B,KAAQa,MAAU,IAAMC,CAAY,GAGlDhB,EAAM,mBAAmB,sBAAsB,CAAC8B,GAAaC,MAAgB;AAC3E,IAAAZ,EAAwBW,CAAW,GACnCT,EAAwBU,CAAW;AAAA,EACrC,CAAC,GACD/B,EAAM,mBAAmB,uBAAuB,MAAM;AACpD,IAAAmB,EAAwB,CAAC,GACzBE,EAAwB,CAAC;AAAA,EAC3B,CAAC,GAGDb,EAAM,UAAU,OACVI,GAAe,sBAAsBV,KACvCU,EAAc,mBAAmBM,IAAuB,GAAGE,KAAwBP,IAAW,IAAI,EAAE,GAElGD,GAAe,uBAAuB,CAACV,KACzCU,EAAc,oBAAmB,GAE5B,MAAM;AACX,IAAIA,GAAe,uBAAuBV,KACxCU,EAAc,oBAAmB;AAAA,EAErC,IACC,CAACC,GAAUX,GAAMgB,GAAsBE,GAAsBR,CAAa,CAAC;AAC9E,QAAMoB,IAAqBT,EAAQ,aAAaU,GAC1CC,IAAuBX,EAAQ,WAAWU,GAG1CE,IAAaZ,EAAQ,YAAYU;AACvC,SAAAG,EAAyBpC,GAAO;AAAA,IAC9B,oBAAAgC;AAAA,IACA,sBAAAE;AAAA,IACA,YAAAC;AAAA,IACA,uBAAuBjB;AAAA,IACvB,uBAAuBE;AAAA,EAC3B,CAAG,GACM;AACT;","x_google_ignoreList":[0]}
|
package/dist/index35.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as p from "react";
|
|
2
|
-
import { useDialogRootContext as u } from "./
|
|
3
|
-
import { useRenderElement as d } from "./
|
|
4
|
-
import { createChangeEventDetails as C } from "./
|
|
5
|
-
import { useButton as g } from "./
|
|
6
|
-
import { closePress as v } from "./
|
|
2
|
+
import { useDialogRootContext as u } from "./index171.js";
|
|
3
|
+
import { useRenderElement as d } from "./index172.js";
|
|
4
|
+
import { createChangeEventDetails as C } from "./index175.js";
|
|
5
|
+
import { useButton as g } from "./index176.js";
|
|
6
|
+
import { closePress as v } from "./index177.js";
|
|
7
7
|
const D = /* @__PURE__ */ p.forwardRef(function(e, n) {
|
|
8
8
|
const {
|
|
9
9
|
render: R,
|
package/dist/index350.js
CHANGED
|
@@ -1,21 +1,70 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import * as p from "react";
|
|
2
|
+
import { ReactStore as l } from "./index358.js";
|
|
3
|
+
import { createPopupFloatingRootContext as d, popupStoreSelectors as u, createInitialPopupStoreState as c } from "./index359.js";
|
|
4
|
+
import { PopupTriggerMap as m } from "./index360.js";
|
|
5
|
+
import { setPopupOpenState as f, usePopupStore as g } from "./index184.js";
|
|
6
|
+
import { createSelector as o } from "./index361.js";
|
|
7
|
+
const C = {
|
|
8
|
+
...u,
|
|
9
|
+
modal: o((e) => e.modal),
|
|
10
|
+
nested: o((e) => e.nested),
|
|
11
|
+
nestedOpenDialogCount: o((e) => e.nestedOpenDialogCount),
|
|
12
|
+
nestedOpenDrawerCount: o((e) => e.nestedOpenDrawerCount),
|
|
13
|
+
disablePointerDismissal: o((e) => e.disablePointerDismissal),
|
|
14
|
+
openMethod: o((e) => e.openMethod),
|
|
15
|
+
descriptionElementId: o((e) => e.descriptionElementId),
|
|
16
|
+
titleElementId: o((e) => e.titleElementId),
|
|
17
|
+
viewportElement: o((e) => e.viewportElement),
|
|
18
|
+
role: o((e) => e.role)
|
|
19
|
+
};
|
|
20
|
+
class a extends l {
|
|
21
|
+
constructor(n, t, r = !1) {
|
|
22
|
+
const i = new m(), s = h(n);
|
|
23
|
+
s.floatingRootContext = d(i, t, r), super(s, {
|
|
24
|
+
popupRef: /* @__PURE__ */ p.createRef(),
|
|
25
|
+
backdropRef: /* @__PURE__ */ p.createRef(),
|
|
26
|
+
internalBackdropRef: /* @__PURE__ */ p.createRef(),
|
|
27
|
+
outsidePressEnabledRef: {
|
|
28
|
+
current: !0
|
|
29
|
+
},
|
|
30
|
+
triggerElements: i,
|
|
31
|
+
onOpenChange: void 0,
|
|
32
|
+
onOpenChangeComplete: void 0
|
|
33
|
+
}, C);
|
|
15
34
|
}
|
|
16
|
-
|
|
35
|
+
setOpen = (n, t) => {
|
|
36
|
+
if (t.preventUnmountOnClose = () => {
|
|
37
|
+
this.set("preventUnmountingOnClose", !0);
|
|
38
|
+
}, !n && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(n, t), t.isCanceled)
|
|
39
|
+
return;
|
|
40
|
+
this.state.floatingRootContext.dispatchOpenChange(n, t);
|
|
41
|
+
const r = {
|
|
42
|
+
open: n
|
|
43
|
+
};
|
|
44
|
+
f(r, n, t.trigger), this.update(r);
|
|
45
|
+
};
|
|
46
|
+
static useStore(n, t) {
|
|
47
|
+
return g(n, (i, s) => new a(t, i, s), !0).store;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function h(e = {}) {
|
|
51
|
+
return {
|
|
52
|
+
...c(),
|
|
53
|
+
modal: !0,
|
|
54
|
+
disablePointerDismissal: !1,
|
|
55
|
+
popupElement: null,
|
|
56
|
+
viewportElement: null,
|
|
57
|
+
descriptionElementId: void 0,
|
|
58
|
+
titleElementId: void 0,
|
|
59
|
+
openMethod: null,
|
|
60
|
+
nested: !1,
|
|
61
|
+
nestedOpenDialogCount: 0,
|
|
62
|
+
nestedOpenDrawerCount: 0,
|
|
63
|
+
role: "dialog",
|
|
64
|
+
...e
|
|
65
|
+
};
|
|
17
66
|
}
|
|
18
67
|
export {
|
|
19
|
-
|
|
68
|
+
a as DialogStore
|
|
20
69
|
};
|
|
21
70
|
//# sourceMappingURL=index350.js.map
|
package/dist/index350.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index350.js","sources":["../../../node_modules/@base-ui/
|
|
1
|
+
{"version":3,"file":"index350.js","sources":["../../../node_modules/@base-ui/react/dialog/store/DialogStore.mjs"],"sourcesContent":["import * as React from 'react';\nimport { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { createPopupFloatingRootContext, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, setPopupOpenState, usePopupStore } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: createSelector(state => state.modal),\n nested: createSelector(state => state.nested),\n nestedOpenDialogCount: createSelector(state => state.nestedOpenDialogCount),\n nestedOpenDrawerCount: createSelector(state => state.nestedOpenDrawerCount),\n disablePointerDismissal: createSelector(state => state.disablePointerDismissal),\n openMethod: createSelector(state => state.openMethod),\n descriptionElementId: createSelector(state => state.descriptionElementId),\n titleElementId: createSelector(state => state.titleElementId),\n viewportElement: createSelector(state => state.viewportElement),\n role: createSelector(state => state.role)\n};\nexport class DialogStore extends ReactStore {\n constructor(initialState, floatingId, nested = false) {\n const triggerElements = new PopupTriggerMap();\n const state = createInitialState(initialState);\n state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);\n super(state, {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements,\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const updatedState = {\n open: nextOpen\n };\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger);\n this.update(updatedState);\n };\n static useStore(externalStore, initialState) {\n /* eslint-disable react-hooks/rules-of-hooks */\n const store = usePopupStore(externalStore, (floatingId, nested) => new DialogStore(initialState, floatingId, nested), true).store;\n /* eslint-enable react-hooks/rules-of-hooks */\n\n return store;\n }\n}\nfunction createInitialState(initialState = {}) {\n return {\n ...createInitialPopupStoreState(),\n modal: true,\n disablePointerDismissal: false,\n popupElement: null,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n}"],"names":["selectors","popupStoreSelectors","createSelector","state","DialogStore","ReactStore","initialState","floatingId","nested","triggerElements","PopupTriggerMap","createInitialState","createPopupFloatingRootContext","React","nextOpen","eventDetails","updatedState","setPopupOpenState","externalStore","usePopupStore","createInitialPopupStoreState"],"mappings":";;;;;;AAGA,MAAMA,IAAY;AAAA,EAChB,GAAGC;AAAA,EACH,OAAOC,EAAe,CAAAC,MAASA,EAAM,KAAK;AAAA,EAC1C,QAAQD,EAAe,CAAAC,MAASA,EAAM,MAAM;AAAA,EAC5C,uBAAuBD,EAAe,CAAAC,MAASA,EAAM,qBAAqB;AAAA,EAC1E,uBAAuBD,EAAe,CAAAC,MAASA,EAAM,qBAAqB;AAAA,EAC1E,yBAAyBD,EAAe,CAAAC,MAASA,EAAM,uBAAuB;AAAA,EAC9E,YAAYD,EAAe,CAAAC,MAASA,EAAM,UAAU;AAAA,EACpD,sBAAsBD,EAAe,CAAAC,MAASA,EAAM,oBAAoB;AAAA,EACxE,gBAAgBD,EAAe,CAAAC,MAASA,EAAM,cAAc;AAAA,EAC5D,iBAAiBD,EAAe,CAAAC,MAASA,EAAM,eAAe;AAAA,EAC9D,MAAMD,EAAe,CAAAC,MAASA,EAAM,IAAI;AAC1C;AACO,MAAMC,UAAoBC,EAAW;AAAA,EAC1C,YAAYC,GAAcC,GAAYC,IAAS,IAAO;AACpD,UAAMC,IAAkB,IAAIC,EAAe,GACrCP,IAAQQ,EAAmBL,CAAY;AAC7C,IAAAH,EAAM,sBAAsBS,EAA+BH,GAAiBF,GAAYC,CAAM,GAC9F,MAAML,GAAO;AAAA,MACX,UAAuB,gBAAAU,EAAM,UAAS;AAAA,MACtC,aAA0B,gBAAAA,EAAM,UAAS;AAAA,MACzC,qBAAkC,gBAAAA,EAAM,UAAS;AAAA,MACjD,wBAAwB;AAAA,QACtB,SAAS;AAAA,MACjB;AAAA,MACM,iBAAAJ;AAAA,MACA,cAAc;AAAA,MACd,sBAAsB;AAAA,IAC5B,GAAOT,CAAS;AAAA,EACd;AAAA,EACA,UAAU,CAACc,GAAUC,MAAiB;AAUpC,QATAA,EAAa,wBAAwB,MAAM;AACzC,WAAK,IAAI,4BAA4B,EAAI;AAAA,IAC3C,GACI,CAACD,KAAYC,EAAa,WAAW,QAAQ,KAAK,MAAM,mBAAmB,SAG7EA,EAAa,UAAU,KAAK,MAAM,wBAAwB,SAE5D,KAAK,QAAQ,eAAeD,GAAUC,CAAY,GAC9CA,EAAa;AACf;AAEF,SAAK,MAAM,oBAAoB,mBAAmBD,GAAUC,CAAY;AACxE,UAAMC,IAAe;AAAA,MACnB,MAAMF;AAAA,IACZ;AACI,IAAAG,EAAkBD,GAAcF,GAAUC,EAAa,OAAO,GAC9D,KAAK,OAAOC,CAAY;AAAA,EAC1B;AAAA,EACA,OAAO,SAASE,GAAeZ,GAAc;AAK3C,WAHca,EAAcD,GAAe,CAACX,GAAYC,MAAW,IAAIJ,EAAYE,GAAcC,GAAYC,CAAM,GAAG,EAAI,EAAE;AAAA,EAI9H;AACF;AACA,SAASG,EAAmBL,IAAe,IAAI;AAC7C,SAAO;AAAA,IACL,GAAGc,EAA4B;AAAA,IAC/B,OAAO;AAAA,IACP,yBAAyB;AAAA,IACzB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,IACvB,MAAM;AAAA,IACN,GAAGd;AAAA,EACP;AACA;","x_google_ignoreList":[0]}
|
package/dist/index352.js
CHANGED
|
@@ -1,55 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return A((s, n = null) => {
|
|
9
|
-
o.cancel();
|
|
10
|
-
const a = d(c);
|
|
11
|
-
if (a == null)
|
|
12
|
-
return;
|
|
13
|
-
const e = a, u = () => {
|
|
14
|
-
l.flushSync(s);
|
|
15
|
-
};
|
|
16
|
-
if (typeof e.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
|
|
17
|
-
s();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
function i() {
|
|
21
|
-
Promise.all(e.getAnimations().map((t) => t.finished)).then(() => {
|
|
22
|
-
n?.aborted || u();
|
|
23
|
-
}).catch(() => {
|
|
24
|
-
if (m) {
|
|
25
|
-
n?.aborted || u();
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const t = e.getAnimations();
|
|
29
|
-
!n?.aborted && t.length > 0 && t.some((r) => r.pending || r.playState !== "finished") && i();
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
if (f) {
|
|
33
|
-
const t = h.startingStyle;
|
|
34
|
-
if (!e.hasAttribute(t)) {
|
|
35
|
-
o.request(i);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const r = new MutationObserver(() => {
|
|
39
|
-
e.hasAttribute(t) || (r.disconnect(), i());
|
|
40
|
-
});
|
|
41
|
-
r.observe(e, {
|
|
42
|
-
attributes: !0,
|
|
43
|
-
attributeFilter: [t]
|
|
44
|
-
}), n?.addEventListener("abort", () => r.disconnect(), {
|
|
45
|
-
once: !0
|
|
46
|
-
});
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
o.request(i);
|
|
50
|
-
});
|
|
1
|
+
let o;
|
|
2
|
+
process.env.NODE_ENV !== "production" && (o = /* @__PURE__ */ new Set());
|
|
3
|
+
function s(...r) {
|
|
4
|
+
if (process.env.NODE_ENV !== "production") {
|
|
5
|
+
const e = r.join(" ");
|
|
6
|
+
o.has(e) || (o.add(e), console.error(`Base UI: ${e}`));
|
|
7
|
+
}
|
|
51
8
|
}
|
|
52
9
|
export {
|
|
53
|
-
|
|
10
|
+
s as error
|
|
54
11
|
};
|
|
55
12
|
//# sourceMappingURL=index352.js.map
|
package/dist/index352.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index352.js","sources":["../../../node_modules/@base-ui/
|
|
1
|
+
{"version":3,"file":"index352.js","sources":["../../../node_modules/@base-ui/utils/error.mjs"],"sourcesContent":["let set;\nif (process.env.NODE_ENV !== 'production') {\n set = new Set();\n}\nexport function error(...messages) {\n if (process.env.NODE_ENV !== 'production') {\n const messageKey = messages.join(' ');\n if (!set.has(messageKey)) {\n set.add(messageKey);\n console.error(`Base UI: ${messageKey}`);\n }\n }\n}\nexport function reset() {\n set?.clear();\n}"],"names":["set","error","messages","messageKey"],"mappings":"AAAA,IAAIA;AACA,QAAQ,IAAI,aAAa,iBAC3BA,IAAM,oBAAI,IAAG;AAER,SAASC,KAASC,GAAU;AACjC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAMC,IAAaD,EAAS,KAAK,GAAG;AACpC,IAAKF,EAAI,IAAIG,CAAU,MACrBH,EAAI,IAAIG,CAAU,GAClB,QAAQ,MAAM,YAAYA,CAAU,EAAE;AAAA,EAE1C;AACF;","x_google_ignoreList":[0]}
|
package/dist/index353.js
CHANGED
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { usePopupRootSync as S, useImplicitActiveTrigger as k, useOpenStateTransitions as E, usePopupInteractionProps as T } from "./index244.js";
|
|
6
|
-
import { useDismiss as h } from "./index305.js";
|
|
7
|
-
import { getTarget as w, contains as x } from "./index317.js";
|
|
8
|
-
import { imperativeAction as I } from "./index237.js";
|
|
9
|
-
function L(e) {
|
|
10
|
-
const {
|
|
11
|
-
store: t,
|
|
12
|
-
actionsRef: a
|
|
13
|
-
} = e, o = t.useState("open");
|
|
14
|
-
S(t, o), k(t);
|
|
15
|
-
const {
|
|
16
|
-
forceUnmount: c
|
|
17
|
-
} = E(o, t), s = r.useCallback(() => {
|
|
18
|
-
t.setOpen(!1, C(I));
|
|
19
|
-
}, [t]);
|
|
20
|
-
r.useImperativeHandle(a, () => ({
|
|
21
|
-
unmount: c,
|
|
22
|
-
close: s
|
|
23
|
-
}), [c, s]);
|
|
24
|
-
}
|
|
25
|
-
function M({
|
|
26
|
-
store: e,
|
|
27
|
-
parentContext: t,
|
|
28
|
-
isDrawer: a
|
|
29
|
-
}) {
|
|
30
|
-
const o = e.useState("open"), c = e.useState("disablePointerDismissal"), s = e.useState("modal"), d = e.useState("popupElement"), O = e.useState("floatingRootContext"), [u, m] = r.useState(0), [l, g] = r.useState(0), D = u === 0, p = h(O, {
|
|
31
|
-
outsidePressEvent() {
|
|
32
|
-
return e.context.internalBackdropRef.current || e.context.backdropRef.current ? "intentional" : {
|
|
33
|
-
mouse: s === "trap-focus" ? "sloppy" : "intentional",
|
|
34
|
-
touch: "sloppy"
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
outsidePress(n) {
|
|
38
|
-
if (!e.context.outsidePressEnabledRef.current || "button" in n && n.button !== 0 || "touches" in n && n.touches.length !== 1)
|
|
39
|
-
return !1;
|
|
40
|
-
const i = w(n);
|
|
41
|
-
return D && !c ? s && (e.context.internalBackdropRef.current || e.context.backdropRef.current) ? e.context.internalBackdropRef.current === i || e.context.backdropRef.current === i || x(i, d) && !i?.hasAttribute("data-base-ui-portal") : !0 : !1;
|
|
42
|
-
},
|
|
43
|
-
escapeKey: D
|
|
44
|
-
});
|
|
45
|
-
P(o && s === !0, d), e.useContextCallback("onNestedDialogOpen", (n, i) => {
|
|
46
|
-
m(n), g(i);
|
|
47
|
-
}), e.useContextCallback("onNestedDialogClose", () => {
|
|
48
|
-
m(0), g(0);
|
|
49
|
-
}), r.useEffect(() => (t?.onNestedDialogOpen && o && t.onNestedDialogOpen(u + 1, l + (a ? 1 : 0)), t?.onNestedDialogClose && !o && t.onNestedDialogClose(), () => {
|
|
50
|
-
t?.onNestedDialogClose && o && t.onNestedDialogClose();
|
|
51
|
-
}), [a, o, u, l, t]);
|
|
52
|
-
const b = p.reference ?? f, R = p.trigger ?? f, N = p.floating ?? f;
|
|
53
|
-
return T(e, {
|
|
54
|
-
activeTriggerProps: b,
|
|
55
|
-
inactiveTriggerProps: R,
|
|
56
|
-
popupProps: N,
|
|
57
|
-
nestedOpenDialogCount: u,
|
|
58
|
-
nestedOpenDrawerCount: l
|
|
59
|
-
}), null;
|
|
60
|
-
}
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
const a = {
|
|
3
|
+
...t
|
|
4
|
+
};
|
|
61
5
|
export {
|
|
62
|
-
|
|
63
|
-
L as useDialogRoot
|
|
6
|
+
a as SafeReact
|
|
64
7
|
};
|
|
65
8
|
//# sourceMappingURL=index353.js.map
|
package/dist/index353.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index353.js","sources":["../../../node_modules/@base-ui/
|
|
1
|
+
{"version":3,"file":"index353.js","sources":["../../../node_modules/@base-ui/utils/safeReact.mjs"],"sourcesContent":["import * as React from 'react';\n\n/**\n * A clone of the React namespace for reading APIs that may be missing in older\n * supported React versions. Bundlers can rewrite direct `React.someNewApi`\n * reads into named imports, which breaks React 17. Reading from this cloned\n * object keeps those lookups optional.\n *\n * @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\n */\nexport const SafeReact = {\n ...React\n};"],"names":["SafeReact","React"],"mappings":";AAUY,MAACA,IAAY;AAAA,EACvB,GAAGC;AACL;","x_google_ignoreList":[0]}
|
package/dist/index354.js
CHANGED
|
@@ -1,70 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
nested: o((e) => e.nested),
|
|
11
|
-
nestedOpenDialogCount: o((e) => e.nestedOpenDialogCount),
|
|
12
|
-
nestedOpenDrawerCount: o((e) => e.nestedOpenDrawerCount),
|
|
13
|
-
disablePointerDismissal: o((e) => e.disablePointerDismissal),
|
|
14
|
-
openMethod: o((e) => e.openMethod),
|
|
15
|
-
descriptionElementId: o((e) => e.descriptionElementId),
|
|
16
|
-
titleElementId: o((e) => e.titleElementId),
|
|
17
|
-
viewportElement: o((e) => e.viewportElement),
|
|
18
|
-
role: o((e) => e.role)
|
|
19
|
-
};
|
|
20
|
-
class a extends l {
|
|
21
|
-
constructor(n, t, r = !1) {
|
|
22
|
-
const i = new m(), s = h(n);
|
|
23
|
-
s.floatingRootContext = d(i, t, r), super(s, {
|
|
24
|
-
popupRef: /* @__PURE__ */ p.createRef(),
|
|
25
|
-
backdropRef: /* @__PURE__ */ p.createRef(),
|
|
26
|
-
internalBackdropRef: /* @__PURE__ */ p.createRef(),
|
|
27
|
-
outsidePressEnabledRef: {
|
|
28
|
-
current: !0
|
|
29
|
-
},
|
|
30
|
-
triggerElements: i,
|
|
31
|
-
onOpenChange: void 0,
|
|
32
|
-
onOpenChangeComplete: void 0
|
|
33
|
-
}, C);
|
|
34
|
-
}
|
|
35
|
-
setOpen = (n, t) => {
|
|
36
|
-
if (t.preventUnmountOnClose = () => {
|
|
37
|
-
this.set("preventUnmountingOnClose", !0);
|
|
38
|
-
}, !n && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(n, t), t.isCanceled)
|
|
39
|
-
return;
|
|
40
|
-
this.state.floatingRootContext.dispatchOpenChange(n, t);
|
|
41
|
-
const r = {
|
|
42
|
-
open: n
|
|
43
|
-
};
|
|
44
|
-
f(r, n, t.trigger), this.update(r);
|
|
45
|
-
};
|
|
46
|
-
static useStore(n, t) {
|
|
47
|
-
return g(n, (i, s) => new a(t, i, s), !0).store;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function h(e = {}) {
|
|
51
|
-
return {
|
|
52
|
-
...c(),
|
|
53
|
-
modal: !0,
|
|
54
|
-
disablePointerDismissal: !1,
|
|
55
|
-
popupElement: null,
|
|
56
|
-
viewportElement: null,
|
|
57
|
-
descriptionElementId: void 0,
|
|
58
|
-
titleElementId: void 0,
|
|
59
|
-
openMethod: null,
|
|
60
|
-
nested: !1,
|
|
61
|
-
nestedOpenDialogCount: 0,
|
|
62
|
-
nestedOpenDrawerCount: 0,
|
|
63
|
-
role: "dialog",
|
|
64
|
-
...e
|
|
65
|
-
};
|
|
1
|
+
import n from "./index190.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
const e = /* @__PURE__ */ t.createContext(void 0);
|
|
4
|
+
process.env.NODE_ENV !== "production" && (e.displayName = "CompositeRootContext");
|
|
5
|
+
function r(s = !1) {
|
|
6
|
+
const o = t.useContext(e);
|
|
7
|
+
if (o === void 0 && !s)
|
|
8
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : n(16));
|
|
9
|
+
return o;
|
|
66
10
|
}
|
|
67
11
|
export {
|
|
68
|
-
|
|
12
|
+
e as CompositeRootContext,
|
|
13
|
+
r as useCompositeRootContext
|
|
69
14
|
};
|
|
70
15
|
//# sourceMappingURL=index354.js.map
|
package/dist/index354.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index354.js","sources":["../../../node_modules/@base-ui/react/
|
|
1
|
+
{"version":3,"file":"index354.js","sources":["../../../node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}"],"names":["CompositeRootContext","React","useCompositeRootContext","optional","context","_formatErrorMessage"],"mappings":";;AAIY,MAACA,IAAoC,gBAAAC,EAAM,cAAc,MAAS;AAC1E,QAAQ,IAAI,aAAa,iBAAcD,EAAqB,cAAc;AACvE,SAASE,EAAwBC,IAAW,IAAO;AACxD,QAAMC,IAAUH,EAAM,WAAWD,CAAoB;AACrD,MAAII,MAAY,UAAa,CAACD;AAC5B,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,sGAAsGE,EAAoB,EAAE,CAAC;AAEvL,SAAOD;AACT;","x_google_ignoreList":[0]}
|
package/dist/index355.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
function f(l) {
|
|
3
|
+
const {
|
|
4
|
+
focusableWhenDisabled: e,
|
|
5
|
+
disabled: o,
|
|
6
|
+
composite: t = !1,
|
|
7
|
+
tabIndex: i = 0,
|
|
8
|
+
isNativeButton: s
|
|
9
|
+
} = l, n = t && e !== !1, b = t && e === !1;
|
|
10
|
+
return {
|
|
11
|
+
props: r.useMemo(() => {
|
|
12
|
+
const a = {
|
|
13
|
+
// allow Tabbing away from focusableWhenDisabled elements
|
|
14
|
+
onKeyDown(d) {
|
|
15
|
+
o && e && d.key !== "Tab" && d.preventDefault();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return t || (a.tabIndex = i, !s && o && (a.tabIndex = e ? i : -1)), (s && (e || n) || !s && o) && (a["aria-disabled"] = o), s && (!e || b) && (a.disabled = o), a;
|
|
19
|
+
}, [t, o, e, n, b, s, i])
|
|
20
|
+
};
|
|
8
21
|
}
|
|
9
22
|
export {
|
|
10
|
-
|
|
23
|
+
f as useFocusableWhenDisabled
|
|
11
24
|
};
|
|
12
25
|
//# sourceMappingURL=index355.js.map
|
package/dist/index355.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index355.js","sources":["../../../node_modules/@base-ui/utils/
|
|
1
|
+
{"version":3,"file":"index355.js","sources":["../../../node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}"],"names":["useFocusableWhenDisabled","parameters","focusableWhenDisabled","disabled","composite","tabIndexProp","isNativeButton","isFocusableComposite","isNonFocusableComposite","React","additionalProps","event"],"mappings":";AAGO,SAASA,EAAyBC,GAAY;AACnD,QAAM;AAAA,IACJ,uBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,UAAUC,IAAe;AAAA,IACzB,gBAAAC;AAAA,EACJ,IAAML,GACEM,IAAuBH,KAAaF,MAA0B,IAC9DM,IAA0BJ,KAAaF,MAA0B;AA2BvE,SAAO;AAAA,IACL,OAxBYO,EAAM,QAAQ,MAAM;AAChC,YAAMC,IAAkB;AAAA;AAAA,QAEtB,UAAUC,GAAO;AACf,UAAIR,KAAYD,KAAyBS,EAAM,QAAQ,SACrDA,EAAM,eAAc;AAAA,QAExB;AAAA,MACN;AACI,aAAKP,MACHM,EAAgB,WAAWL,GACvB,CAACC,KAAkBH,MACrBO,EAAgB,WAAWR,IAAwBG,IAAe,OAGlEC,MAAmBJ,KAAyBK,MAAyB,CAACD,KAAkBH,OAC1FO,EAAgB,eAAe,IAAIP,IAEjCG,MAAmB,CAACJ,KAAyBM,OAC/CE,EAAgB,WAAWP,IAEtBO;AAAA,IACT,GAAG,CAACN,GAAWD,GAAUD,GAAuBK,GAAsBC,GAAyBF,GAAgBD,CAAY,CAAC;AAAA,EAG9H;AACA;","x_google_ignoreList":[0]}
|
package/dist/index356.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
function t(i) {
|
|
3
|
+
const o = e.useRef(""), n = e.useCallback((r) => {
|
|
4
|
+
r.defaultPrevented || (o.current = r.pointerType, i(r, r.pointerType));
|
|
5
|
+
}, [i]);
|
|
6
|
+
return {
|
|
7
|
+
onClick: e.useCallback((r) => {
|
|
8
|
+
if (r.detail === 0) {
|
|
9
|
+
i(r, "keyboard");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
"pointerType" in r ? i(r, r.pointerType) : i(r, o.current), o.current = "";
|
|
13
|
+
}, [i]),
|
|
14
|
+
onPointerDown: n
|
|
15
|
+
};
|
|
16
|
+
}
|
|
5
17
|
export {
|
|
6
|
-
|
|
18
|
+
t as useEnhancedClickHandler
|
|
7
19
|
};
|
|
8
20
|
//# sourceMappingURL=index356.js.map
|