langgraph-ui-components 0.0.4 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es10.js +31 -16
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +143 -3134
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +202 -36
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +14 -5
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +27 -70
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +28 -31
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +3157 -5
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +18 -2
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +5 -11
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +2 -503
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +11 -5
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es11.js +166 -123
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es110.js +503 -2
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +5 -146
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +2 -908
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +128 -262
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +907 -3
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +262 -426
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +3 -47
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +443 -21
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +42 -75
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +22 -129
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es12.js +13 -103
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es120.js +74 -44
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +129 -10
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +47 -43
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +9 -98
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +43 -51
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +96 -13
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +52 -14
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +156 -81
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +2 -2
- package/dist/index.es129.js +14 -55
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es13.js +126 -32
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es130.js +87 -98
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +2 -191
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +54 -108
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +98 -33
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +191 -10
- package/dist/index.es134.js.map +1 -1
- package/dist/index.es135.js +109 -10
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es136.js +35 -12
- package/dist/index.es136.js.map +1 -1
- package/dist/index.es137.js +10 -91
- package/dist/index.es137.js.map +1 -1
- package/dist/index.es138.js +11 -275
- package/dist/index.es138.js.map +1 -1
- package/dist/index.es139.js +12 -2
- package/dist/index.es139.js.map +1 -1
- package/dist/index.es140.js +88 -161
- package/dist/index.es140.js.map +1 -1
- package/dist/index.es141.js +270 -46
- package/dist/index.es141.js.map +1 -1
- package/dist/index.es142.js +2 -40
- package/dist/index.es142.js.map +1 -1
- package/dist/index.es143.js +164 -35
- package/dist/index.es143.js.map +1 -1
- package/dist/index.es144.js +45 -34
- package/dist/index.es144.js.map +1 -1
- package/dist/index.es145.js +37 -21
- package/dist/index.es145.js.map +1 -1
- package/dist/index.es146.js +32 -588
- package/dist/index.es146.js.map +1 -1
- package/dist/index.es147.js +32 -117
- package/dist/index.es147.js.map +1 -1
- package/dist/index.es148.js +22 -162
- package/dist/index.es148.js.map +1 -1
- package/dist/index.es149.js +591 -2
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es15.js +15 -15
- package/dist/index.es150.js +125 -2
- package/dist/index.es150.js.map +1 -1
- package/dist/index.es151.js +2 -2
- package/dist/index.es152.js +2 -22
- package/dist/index.es152.js.map +1 -1
- package/dist/index.es153.js +22 -2
- package/dist/index.es153.js.map +1 -1
- package/dist/index.es154.js +2 -25
- package/dist/index.es154.js.map +1 -1
- package/dist/index.es155.js +25 -8
- package/dist/index.es155.js.map +1 -1
- package/dist/index.es156.js +4 -5
- package/dist/index.es156.js.map +1 -1
- package/dist/index.es157.js +7 -12
- package/dist/index.es157.js.map +1 -1
- package/dist/index.es158.js +5 -6
- package/dist/index.es158.js.map +1 -1
- package/dist/index.es159.js +12 -63
- package/dist/index.es159.js.map +1 -1
- package/dist/index.es160.js +5 -21
- package/dist/index.es160.js.map +1 -1
- package/dist/index.es161.js +24 -5
- package/dist/index.es161.js.map +1 -1
- package/dist/index.es162.js +11 -348
- package/dist/index.es162.js.map +1 -1
- package/dist/index.es163.js +52 -23
- package/dist/index.es163.js.map +1 -1
- package/dist/index.es164.js +63 -11
- package/dist/index.es164.js.map +1 -1
- package/dist/index.es165.js +21 -53
- package/dist/index.es165.js.map +1 -1
- package/dist/index.es166.js +6 -7
- package/dist/index.es166.js.map +1 -1
- package/dist/index.es167.js +342 -96
- package/dist/index.es167.js.map +1 -1
- package/dist/index.es168.js +6 -118
- package/dist/index.es168.js.map +1 -1
- package/dist/index.es169.js +98 -131
- package/dist/index.es169.js.map +1 -1
- package/dist/index.es17.js +2 -2
- package/dist/index.es170.js +108 -104
- package/dist/index.es170.js.map +1 -1
- package/dist/index.es171.js +136 -6
- package/dist/index.es171.js.map +1 -1
- package/dist/index.es172.js +114 -3
- package/dist/index.es172.js.map +1 -1
- package/dist/index.es173.js +6 -2
- package/dist/index.es173.js.map +1 -1
- package/dist/index.es174.js +2 -3737
- package/dist/index.es174.js.map +1 -1
- package/dist/index.es175.js +3682 -287
- package/dist/index.es175.js.map +1 -1
- package/dist/index.es176.js +321 -88
- package/dist/index.es176.js.map +1 -1
- package/dist/index.es177.js +95 -119
- package/dist/index.es177.js.map +1 -1
- package/dist/index.es178.js +131 -13
- package/dist/index.es178.js.map +1 -1
- package/dist/index.es179.js +13 -150
- package/dist/index.es179.js.map +1 -1
- package/dist/index.es180.js +150 -13
- package/dist/index.es180.js.map +1 -1
- package/dist/index.es181.js +13 -6
- package/dist/index.es181.js.map +1 -1
- package/dist/index.es182.js +6 -19
- package/dist/index.es182.js.map +1 -1
- package/dist/index.es183.js +17 -86
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +69 -222
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +242 -23
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +23 -5
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +6 -4
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +4 -18
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +16 -6
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es19.js +119 -15
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es190.js +7 -141
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +142 -2
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +2 -32
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +31 -5
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +5 -105
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +106 -13
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +12 -17
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +15 -28
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +30 -3
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +3 -4
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es2.js +24 -16
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es20.js +17 -68
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es200.js +5 -5
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +4 -36
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +36 -7
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +7 -5
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +5 -6
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +6 -41
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +41 -12
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +11 -240
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +239 -48
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es209.js +49 -33
- package/dist/index.es209.js.map +1 -1
- package/dist/index.es21.js +3 -3
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es210.js +32 -10
- package/dist/index.es210.js.map +1 -1
- package/dist/index.es211.js +12 -7
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es212.js +7 -6
- package/dist/index.es212.js.map +1 -1
- package/dist/index.es213.js +6 -64
- package/dist/index.es213.js.map +1 -1
- package/dist/index.es214.js +60 -36
- package/dist/index.es214.js.map +1 -1
- package/dist/index.es215.js +39 -30
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es216.js +30 -60
- package/dist/index.es216.js.map +1 -1
- package/dist/index.es217.js +60 -13
- package/dist/index.es217.js.map +1 -1
- package/dist/index.es218.js +9 -17
- package/dist/index.es218.js.map +1 -1
- package/dist/index.es219.js +23 -5
- package/dist/index.es219.js.map +1 -1
- package/dist/index.es22.js +1 -1
- package/dist/index.es220.js +4 -16
- package/dist/index.es220.js.map +1 -1
- package/dist/index.es221.js +14 -30
- package/dist/index.es221.js.map +1 -1
- package/dist/index.es222.js +32 -4
- package/dist/index.es222.js.map +1 -1
- package/dist/index.es223.js +4 -4
- package/dist/index.es223.js.map +1 -1
- package/dist/index.es224.js +5 -5
- package/dist/index.es224.js.map +1 -1
- package/dist/index.es225.js +5 -8
- package/dist/index.es225.js.map +1 -1
- package/dist/index.es226.js +6 -90
- package/dist/index.es226.js.map +1 -1
- package/dist/index.es227.js +90 -16
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es228.js +17 -761
- package/dist/index.es228.js.map +1 -1
- package/dist/index.es229.js +762 -66
- package/dist/index.es229.js.map +1 -1
- package/dist/index.es230.js +66 -174
- package/dist/index.es230.js.map +1 -1
- package/dist/index.es231.js +169 -33
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +37 -136
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +136 -92
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +92 -32
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +32 -284
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +284 -25
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +22 -20
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +22 -13
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +12 -12
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +103 -305
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es240.js +13 -24
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +22 -42
- package/dist/index.es241.js.map +1 -1
- package/dist/index.es242.js +45 -11
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +10 -10
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +10 -10
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +11 -14
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +14 -11
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +11 -11
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +10 -10
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +11 -15
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +68 -121
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +15 -11
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +10 -10
- package/dist/index.es251.js.map +1 -1
- package/dist/index.es252.js +11 -11
- package/dist/index.es252.js.map +1 -1
- package/dist/index.es253.js +10 -10
- package/dist/index.es253.js.map +1 -1
- package/dist/index.es254.js +10 -10
- package/dist/index.es254.js.map +1 -1
- package/dist/index.es255.js +10 -10
- package/dist/index.es255.js.map +1 -1
- package/dist/index.es256.js +10 -10
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +10 -10
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +11 -56
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +53 -46
- package/dist/index.es259.js.map +1 -1
- package/dist/index.es26.js +305 -5
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es260.js +42 -112
- package/dist/index.es260.js.map +1 -1
- package/dist/index.es261.js +87 -352
- package/dist/index.es261.js.map +1 -1
- package/dist/index.es262.js +381 -15
- package/dist/index.es262.js.map +1 -1
- package/dist/index.es263.js +17 -10
- package/dist/index.es263.js.map +1 -1
- package/dist/index.es264.js +10 -30
- package/dist/index.es264.js.map +1 -1
- package/dist/index.es265.js +17 -17
- package/dist/index.es265.js.map +1 -1
- package/dist/index.es266.js +25 -56
- package/dist/index.es266.js.map +1 -1
- package/dist/index.es267.js +59 -14
- package/dist/index.es267.js.map +1 -1
- package/dist/index.es268.js +14 -74
- package/dist/index.es268.js.map +1 -1
- package/dist/index.es269.js +77 -11
- package/dist/index.es269.js.map +1 -1
- package/dist/index.es270.js +10 -10
- package/dist/index.es270.js.map +1 -1
- package/dist/index.es271.js +11 -15
- package/dist/index.es271.js.map +1 -1
- package/dist/index.es272.js +14 -51
- package/dist/index.es272.js.map +1 -1
- package/dist/index.es273.js +44 -158
- package/dist/index.es273.js.map +1 -1
- package/dist/index.es274.js +167 -2
- package/dist/index.es274.js.map +1 -1
- package/dist/index.es275.js +2 -11
- package/dist/index.es275.js.map +1 -1
- package/dist/index.es276.js +9 -18
- package/dist/index.es276.js.map +1 -1
- package/dist/index.es277.js +17 -36
- package/dist/index.es277.js.map +1 -1
- package/dist/index.es278.js +42 -0
- package/dist/index.es278.js.map +1 -0
- package/dist/index.es28.js +7 -7
- package/dist/index.es29.js +1 -1
- package/dist/index.es32.js +4 -4
- package/dist/index.es33.js +1191 -13
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +6 -117
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +8 -70
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +148 -19
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +112 -255
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +68 -40
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +17 -214
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es40.js +247 -53
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +24 -123
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +205 -14
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +58 -221
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +140 -7
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +17 -1185
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +229 -6
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +15 -146
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +6 -8
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +84 -87
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es50.js +7 -3
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +14 -35
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +7 -71
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +89 -33
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +3 -305
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +36 -9
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +64 -83
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +36 -6
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +303 -12
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +9 -143
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +5 -299
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +158 -61
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +658 -199
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +138 -29
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +299 -8
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +65 -11
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +201 -175
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +33 -23
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +8 -1399
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +12 -9
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +187 -8
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +24 -6
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +1384 -147
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +9 -672
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +8 -12
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +35 -38
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +5 -34
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +64 -223
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +36 -29
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +11 -74
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +37 -73
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +32 -50
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +228 -26
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +6 -19
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +72 -54
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +76 -13
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +47 -132
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +29 -20
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +37 -176
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +49 -233
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +13 -355
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +128 -128
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +21 -70
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +179 -34
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +230 -26
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +346 -157
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +129 -195
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +70 -14
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +35 -28
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +34 -31
- package/dist/index.es99.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -11
package/dist/index.es26.js
CHANGED
|
@@ -1,9 +1,309 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "./index.es48.js";
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
"inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
12
|
+
destructive: "bg-destructive text-primary-foreground hover:bg-destructive/90",
|
|
13
|
+
cool: "dark:inset-shadow-2xs dark:inset-shadow-white/10 bg-linear-to-t border border-b-2 border-zinc-950/40 from-primary to-primary/85 shadow-md shadow-primary/20 ring-1 ring-inset ring-white/25 transition-[filter] duration-200 hover:brightness-110 active:brightness-90 dark:border-x-0 text-primary-foreground dark:text-primary-foreground dark:border-t-0 dark:border-primary/50 dark:ring-white/5",
|
|
14
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 px-4 py-2",
|
|
21
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
22
|
+
lg: "h-10 rounded-md px-8",
|
|
23
|
+
icon: "h-9 w-9"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
const Button = React.forwardRef(
|
|
33
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
34
|
+
const Comp = asChild ? Slot : "button";
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Comp,
|
|
37
|
+
{
|
|
38
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
39
|
+
ref,
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
Button.displayName = "Button";
|
|
46
|
+
const liquidbuttonVariants = cva(
|
|
47
|
+
"inline-flex items-center transition-colors justify-center cursor-pointer gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
48
|
+
{
|
|
49
|
+
variants: {
|
|
50
|
+
variant: {
|
|
51
|
+
default: "bg-transparent hover:scale-105 duration-300 transition text-primary",
|
|
52
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
53
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
54
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
55
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
56
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
57
|
+
},
|
|
58
|
+
size: {
|
|
59
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
60
|
+
sm: "h-8 text-xs gap-1.5 px-4 has-[>svg]:px-4",
|
|
61
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
62
|
+
xl: "h-12 rounded-md px-8 has-[>svg]:px-6",
|
|
63
|
+
xxl: "h-14 rounded-md px-10 has-[>svg]:px-8",
|
|
64
|
+
icon: "size-9"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: {
|
|
68
|
+
variant: "default",
|
|
69
|
+
size: "xxl"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
function LiquidButton({
|
|
74
|
+
className,
|
|
75
|
+
variant,
|
|
76
|
+
size,
|
|
77
|
+
asChild = false,
|
|
78
|
+
children,
|
|
79
|
+
...props
|
|
80
|
+
}) {
|
|
81
|
+
const Comp = asChild ? Slot : "button";
|
|
82
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
83
|
+
Comp,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "button",
|
|
86
|
+
className: cn(
|
|
87
|
+
"relative",
|
|
88
|
+
liquidbuttonVariants({ variant, size, className })
|
|
89
|
+
),
|
|
90
|
+
...props,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 z-0 h-full w-full rounded-full \n shadow-[0_0_6px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3px_rgba(0,0,0,0.9),inset_-3px_-3px_0.5px_-3px_rgba(0,0,0,0.85),inset_1px_1px_1px_-0.5px_rgba(0,0,0,0.6),inset_-1px_-1px_1px_-0.5px_rgba(0,0,0,0.6),inset_0_0_6px_6px_rgba(0,0,0,0.12),inset_0_0_2px_2px_rgba(0,0,0,0.06),0_0_12px_rgba(255,255,255,0.15)] \n transition-all \n dark:shadow-[0_0_8px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3.5px_rgba(255,255,255,0.09),inset_-3px_-3px_0.5px_-3.5px_rgba(255,255,255,0.85),inset_1px_1px_1px_-0.5px_rgba(255,255,255,0.6),inset_-1px_-1px_1px_-0.5px_rgba(255,255,255,0.6),inset_0_0_6px_6px_rgba(255,255,255,0.12),inset_0_0_2px_2px_rgba(255,255,255,0.06),0_0_12px_rgba(0,0,0,0.15)]" }),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
className: "absolute top-0 left-0 w-full h-full overflow-hidden rounded-md isolate -z-10",
|
|
97
|
+
style: { backdropFilter: 'url("#container-glass")' }
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ jsx("div", { className: "z-10 pointer-events-none ", children }),
|
|
101
|
+
/* @__PURE__ */ jsx(GlassFilter, {})
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
) });
|
|
5
105
|
}
|
|
106
|
+
function GlassFilter() {
|
|
107
|
+
return /* @__PURE__ */ jsx("svg", { className: "hidden", children: /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
108
|
+
"filter",
|
|
109
|
+
{
|
|
110
|
+
id: "container-glass",
|
|
111
|
+
x: "0%",
|
|
112
|
+
y: "0%",
|
|
113
|
+
width: "100%",
|
|
114
|
+
height: "100%",
|
|
115
|
+
colorInterpolationFilters: "sRGB",
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
"feTurbulence",
|
|
119
|
+
{
|
|
120
|
+
type: "fractalNoise",
|
|
121
|
+
baseFrequency: "0.05 0.05",
|
|
122
|
+
numOctaves: "1",
|
|
123
|
+
seed: "1",
|
|
124
|
+
result: "turbulence"
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { in: "turbulence", stdDeviation: "2", result: "blurredNoise" }),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"feDisplacementMap",
|
|
130
|
+
{
|
|
131
|
+
in: "SourceGraphic",
|
|
132
|
+
in2: "blurredNoise",
|
|
133
|
+
scale: "70",
|
|
134
|
+
xChannelSelector: "R",
|
|
135
|
+
yChannelSelector: "B",
|
|
136
|
+
result: "displaced"
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { in: "displaced", stdDeviation: "4", result: "finalBlur" }),
|
|
140
|
+
/* @__PURE__ */ jsx("feComposite", { in: "finalBlur", in2: "finalBlur", operator: "over" })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
) }) });
|
|
144
|
+
}
|
|
145
|
+
const colorVariants = {
|
|
146
|
+
default: {
|
|
147
|
+
outer: "bg-gradient-to-b from-[#000] to-[#A0A0A0]",
|
|
148
|
+
inner: "bg-gradient-to-b from-[#FAFAFA] via-[#3E3E3E] to-[#E5E5E5]",
|
|
149
|
+
button: "bg-gradient-to-b from-[#B9B9B9] to-[#969696]",
|
|
150
|
+
textColor: "text-white",
|
|
151
|
+
textShadow: "[text-shadow:0-1px_0_rgb(80_80_80_/_100%)]"
|
|
152
|
+
},
|
|
153
|
+
primary: {
|
|
154
|
+
outer: "bg-gradient-to-b from-[#000] to-[#A0A0A0]",
|
|
155
|
+
inner: "bg-gradient-to-b from-primary via-secondary to-muted",
|
|
156
|
+
button: "bg-gradient-to-b from-primary to-primary/40",
|
|
157
|
+
textColor: "text-white",
|
|
158
|
+
textShadow: "[text-shadow:0-1px_0_rgb(30_58_138_/_100%)]"
|
|
159
|
+
},
|
|
160
|
+
success: {
|
|
161
|
+
outer: "bg-gradient-to-b from-[#005A43] to-[#7CCB9B]",
|
|
162
|
+
inner: "bg-gradient-to-b from-[#E5F8F0] via-[#00352F] to-[#D1F0E6]",
|
|
163
|
+
button: "bg-gradient-to-b from-[#9ADBC8] to-[#3E8F7C]",
|
|
164
|
+
textColor: "text-[#FFF7F0]",
|
|
165
|
+
textShadow: "[text-shadow:0-1px_0_rgb(6_78_59_/_100%)]"
|
|
166
|
+
},
|
|
167
|
+
error: {
|
|
168
|
+
outer: "bg-gradient-to-b from-[#5A0000] to-[#FFAEB0]",
|
|
169
|
+
inner: "bg-gradient-to-b from-[#FFDEDE] via-[#680002] to-[#FFE9E9]",
|
|
170
|
+
button: "bg-gradient-to-b from-[#F08D8F] to-[#A45253]",
|
|
171
|
+
textColor: "text-[#FFF7F0]",
|
|
172
|
+
textShadow: "[text-shadow:0-1px_0_rgb(146_64_14_/_100%)]"
|
|
173
|
+
},
|
|
174
|
+
gold: {
|
|
175
|
+
outer: "bg-gradient-to-b from-[#917100] to-[#EAD98F]",
|
|
176
|
+
inner: "bg-gradient-to-b from-[#FFFDDD] via-[#856807] to-[#FFF1B3]",
|
|
177
|
+
button: "bg-gradient-to-b from-[#FFEBA1] to-[#9B873F]",
|
|
178
|
+
textColor: "text-[#FFFDE5]",
|
|
179
|
+
textShadow: "[text-shadow:0-1px_0_rgb(178_140_2_/_100%)]"
|
|
180
|
+
},
|
|
181
|
+
bronze: {
|
|
182
|
+
outer: "bg-gradient-to-b from-[#864813] to-[#E9B486]",
|
|
183
|
+
inner: "bg-gradient-to-b from-[#EDC5A1] via-[#5F2D01] to-[#FFDEC1]",
|
|
184
|
+
button: "bg-gradient-to-b from-[#FFE3C9] to-[#A36F3D]",
|
|
185
|
+
textColor: "text-[#FFF7F0]",
|
|
186
|
+
textShadow: "[text-shadow:0-1px_0_rgb(124_45_18_/_100%)]"
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const metalButtonVariants = (variant = "default", isPressed, isHovered, isTouchDevice) => {
|
|
190
|
+
const colors = colorVariants[variant];
|
|
191
|
+
const transitionStyle = "all 250ms cubic-bezier(0.1, 0.4, 0.2, 1)";
|
|
192
|
+
return {
|
|
193
|
+
wrapper: cn(
|
|
194
|
+
"relative inline-flex transform-gpu rounded-md p-[1.25px] will-change-transform",
|
|
195
|
+
colors.outer
|
|
196
|
+
),
|
|
197
|
+
wrapperStyle: {
|
|
198
|
+
transform: isPressed ? "translateY(2.5px) scale(0.99)" : "translateY(0) scale(1)",
|
|
199
|
+
boxShadow: isPressed ? "0 1px 2px rgba(0, 0, 0, 0.15)" : isHovered && !isTouchDevice ? "0 4px 12px rgba(0, 0, 0, 0.12)" : "0 3px 8px rgba(0, 0, 0, 0.08)",
|
|
200
|
+
transition: transitionStyle,
|
|
201
|
+
transformOrigin: "center center"
|
|
202
|
+
},
|
|
203
|
+
inner: cn(
|
|
204
|
+
"absolute inset-[1px] transform-gpu rounded-lg will-change-transform",
|
|
205
|
+
colors.inner
|
|
206
|
+
),
|
|
207
|
+
innerStyle: {
|
|
208
|
+
transition: transitionStyle,
|
|
209
|
+
transformOrigin: "center center",
|
|
210
|
+
filter: isHovered && !isPressed && !isTouchDevice ? "brightness(1.05)" : "none"
|
|
211
|
+
},
|
|
212
|
+
button: cn(
|
|
213
|
+
"relative z-10 m-[1px] rounded-md inline-flex h-11 transform-gpu cursor-pointer items-center justify-center overflow-hidden rounded-md px-6 py-2 text-sm leading-none font-semibold will-change-transform outline-none",
|
|
214
|
+
colors.button,
|
|
215
|
+
colors.textColor,
|
|
216
|
+
colors.textShadow
|
|
217
|
+
),
|
|
218
|
+
buttonStyle: {
|
|
219
|
+
transform: isPressed ? "scale(0.97)" : "scale(1)",
|
|
220
|
+
transition: transitionStyle,
|
|
221
|
+
transformOrigin: "center center",
|
|
222
|
+
filter: isHovered && !isPressed && !isTouchDevice ? "brightness(1.02)" : "none"
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
const ShineEffect = ({ isPressed }) => {
|
|
227
|
+
return /* @__PURE__ */ jsx(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
className: cn(
|
|
231
|
+
"pointer-events-none absolute inset-0 z-20 overflow-hidden transition-opacity duration-300",
|
|
232
|
+
isPressed ? "opacity-20" : "opacity-0"
|
|
233
|
+
),
|
|
234
|
+
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-md bg-gradient-to-r from-transparent via-neutral-100 to-transparent" })
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
const MetalButton = React.forwardRef(({ children, className, variant = "default", ...props }, ref) => {
|
|
239
|
+
const [isPressed, setIsPressed] = React.useState(false);
|
|
240
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
241
|
+
const [isTouchDevice, setIsTouchDevice] = React.useState(false);
|
|
242
|
+
React.useEffect(() => {
|
|
243
|
+
setIsTouchDevice("ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
244
|
+
}, []);
|
|
245
|
+
const buttonText = children || "Button";
|
|
246
|
+
const variants = metalButtonVariants(
|
|
247
|
+
variant,
|
|
248
|
+
isPressed,
|
|
249
|
+
isHovered,
|
|
250
|
+
isTouchDevice
|
|
251
|
+
);
|
|
252
|
+
const handleInternalMouseDown = () => {
|
|
253
|
+
setIsPressed(true);
|
|
254
|
+
};
|
|
255
|
+
const handleInternalMouseUp = () => {
|
|
256
|
+
setIsPressed(false);
|
|
257
|
+
};
|
|
258
|
+
const handleInternalMouseLeave = () => {
|
|
259
|
+
setIsPressed(false);
|
|
260
|
+
setIsHovered(false);
|
|
261
|
+
};
|
|
262
|
+
const handleInternalMouseEnter = () => {
|
|
263
|
+
if (!isTouchDevice) {
|
|
264
|
+
setIsHovered(true);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
const handleInternalTouchStart = () => {
|
|
268
|
+
setIsPressed(true);
|
|
269
|
+
};
|
|
270
|
+
const handleInternalTouchEnd = () => {
|
|
271
|
+
setIsPressed(false);
|
|
272
|
+
};
|
|
273
|
+
const handleInternalTouchCancel = () => {
|
|
274
|
+
setIsPressed(false);
|
|
275
|
+
};
|
|
276
|
+
return /* @__PURE__ */ jsxs("div", { className: variants.wrapper, style: variants.wrapperStyle, children: [
|
|
277
|
+
/* @__PURE__ */ jsx("div", { className: variants.inner, style: variants.innerStyle }),
|
|
278
|
+
/* @__PURE__ */ jsxs(
|
|
279
|
+
"button",
|
|
280
|
+
{
|
|
281
|
+
ref,
|
|
282
|
+
className: cn(variants.button, className),
|
|
283
|
+
style: variants.buttonStyle,
|
|
284
|
+
...props,
|
|
285
|
+
onMouseDown: handleInternalMouseDown,
|
|
286
|
+
onMouseUp: handleInternalMouseUp,
|
|
287
|
+
onMouseLeave: handleInternalMouseLeave,
|
|
288
|
+
onMouseEnter: handleInternalMouseEnter,
|
|
289
|
+
onTouchStart: handleInternalTouchStart,
|
|
290
|
+
onTouchEnd: handleInternalTouchEnd,
|
|
291
|
+
onTouchCancel: handleInternalTouchCancel,
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ jsx(ShineEffect, { isPressed }),
|
|
294
|
+
buttonText,
|
|
295
|
+
isHovered && !isPressed && !isTouchDevice && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-lg pointer-events-none bg-gradient-to-t from-transparent to-white/5" })
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
] });
|
|
300
|
+
});
|
|
301
|
+
MetalButton.displayName = "MetalButton";
|
|
6
302
|
export {
|
|
7
|
-
|
|
303
|
+
Button,
|
|
304
|
+
LiquidButton,
|
|
305
|
+
MetalButton,
|
|
306
|
+
buttonVariants,
|
|
307
|
+
liquidbuttonVariants
|
|
8
308
|
};
|
|
9
309
|
//# sourceMappingURL=index.es26.js.map
|
package/dist/index.es26.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es26.js","sources":["../src/utils/tailwindUtil.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}"],"names":[],"mappings":";;AAIO,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;"}
|
|
1
|
+
{"version":3,"file":"index.es26.js","sources":["../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/tailwindUtil\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-primary-foreground hover:bg-destructive/90\",\n cool: \"dark:inset-shadow-2xs dark:inset-shadow-white/10 bg-linear-to-t border border-b-2 border-zinc-950/40 from-primary to-primary/85 shadow-md shadow-primary/20 ring-1 ring-inset ring-white/25 transition-[filter] duration-200 hover:brightness-110 active:brightness-90 dark:border-x-0 text-primary-foreground dark:text-primary-foreground dark:border-t-0 dark:border-primary/50 dark:ring-white/5\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nconst liquidbuttonVariants = cva(\n \"inline-flex items-center transition-colors justify-center cursor-pointer gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-transparent hover:scale-105 duration-300 transition text-primary\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 text-xs gap-1.5 px-4 has-[>svg]:px-4\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n xl: \"h-12 rounded-md px-8 has-[>svg]:px-6\",\n xxl: \"h-14 rounded-md px-10 has-[>svg]:px-8\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"xxl\",\n },\n }\n)\n\nfunction LiquidButton({\n className,\n variant,\n size,\n asChild = false,\n children,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof liquidbuttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <>\n <Comp\n data-slot=\"button\"\n className={cn(\n \"relative\",\n liquidbuttonVariants({ variant, size, className })\n )}\n {...props}\n >\n <div className=\"absolute top-0 left-0 z-0 h-full w-full rounded-full \n shadow-[0_0_6px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3px_rgba(0,0,0,0.9),inset_-3px_-3px_0.5px_-3px_rgba(0,0,0,0.85),inset_1px_1px_1px_-0.5px_rgba(0,0,0,0.6),inset_-1px_-1px_1px_-0.5px_rgba(0,0,0,0.6),inset_0_0_6px_6px_rgba(0,0,0,0.12),inset_0_0_2px_2px_rgba(0,0,0,0.06),0_0_12px_rgba(255,255,255,0.15)] \n transition-all \n dark:shadow-[0_0_8px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3.5px_rgba(255,255,255,0.09),inset_-3px_-3px_0.5px_-3.5px_rgba(255,255,255,0.85),inset_1px_1px_1px_-0.5px_rgba(255,255,255,0.6),inset_-1px_-1px_1px_-0.5px_rgba(255,255,255,0.6),inset_0_0_6px_6px_rgba(255,255,255,0.12),inset_0_0_2px_2px_rgba(255,255,255,0.06),0_0_12px_rgba(0,0,0,0.15)]\" />\n <div\n className=\"absolute top-0 left-0 w-full h-full overflow-hidden rounded-md isolate -z-10\"\n style={{ backdropFilter: 'url(\"#container-glass\")' }}\n />\n\n <div className=\"z-10 pointer-events-none \">\n {children}\n </div>\n <GlassFilter />\n </Comp>\n </>\n )\n}\n\n\nfunction GlassFilter() {\n return (\n <svg className=\"hidden\">\n <defs>\n <filter\n id=\"container-glass\"\n x=\"0%\"\n y=\"0%\"\n width=\"100%\"\n height=\"100%\"\n colorInterpolationFilters=\"sRGB\"\n >\n {/* Generate turbulent noise for distortion */}\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency=\"0.05 0.05\"\n numOctaves=\"1\"\n seed=\"1\"\n result=\"turbulence\"\n />\n\n {/* Blur the turbulence pattern slightly */}\n <feGaussianBlur in=\"turbulence\" stdDeviation=\"2\" result=\"blurredNoise\" />\n\n {/* Displace the source graphic with the noise */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"blurredNoise\"\n scale=\"70\"\n xChannelSelector=\"R\"\n yChannelSelector=\"B\"\n result=\"displaced\"\n />\n\n {/* Apply overall blur on the final result */}\n <feGaussianBlur in=\"displaced\" stdDeviation=\"4\" result=\"finalBlur\" />\n\n {/* Output the result */}\n <feComposite in=\"finalBlur\" in2=\"finalBlur\" operator=\"over\" />\n </filter>\n </defs>\n </svg>\n );\n}\n\ntype ColorVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"error\"\n | \"gold\"\n | \"bronze\";\n \ninterface MetalButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ColorVariant;\n}\n \nconst colorVariants: Record<\n ColorVariant,\n {\n outer: string;\n inner: string;\n button: string;\n textColor: string;\n textShadow: string;\n }\n> = {\n default: {\n outer: \"bg-gradient-to-b from-[#000] to-[#A0A0A0]\",\n inner: \"bg-gradient-to-b from-[#FAFAFA] via-[#3E3E3E] to-[#E5E5E5]\",\n button: \"bg-gradient-to-b from-[#B9B9B9] to-[#969696]\",\n textColor: \"text-white\",\n textShadow: \"[text-shadow:0-1px_0_rgb(80_80_80_/_100%)]\",\n },\n primary: {\n outer: \"bg-gradient-to-b from-[#000] to-[#A0A0A0]\",\n inner: \"bg-gradient-to-b from-primary via-secondary to-muted\",\n button: \"bg-gradient-to-b from-primary to-primary/40\",\n textColor: \"text-white\",\n textShadow: \"[text-shadow:0-1px_0_rgb(30_58_138_/_100%)]\",\n },\n success: {\n outer: \"bg-gradient-to-b from-[#005A43] to-[#7CCB9B]\",\n inner: \"bg-gradient-to-b from-[#E5F8F0] via-[#00352F] to-[#D1F0E6]\",\n button: \"bg-gradient-to-b from-[#9ADBC8] to-[#3E8F7C]\",\n textColor: \"text-[#FFF7F0]\",\n textShadow: \"[text-shadow:0-1px_0_rgb(6_78_59_/_100%)]\",\n },\n error: {\n outer: \"bg-gradient-to-b from-[#5A0000] to-[#FFAEB0]\",\n inner: \"bg-gradient-to-b from-[#FFDEDE] via-[#680002] to-[#FFE9E9]\",\n button: \"bg-gradient-to-b from-[#F08D8F] to-[#A45253]\",\n textColor: \"text-[#FFF7F0]\",\n textShadow: \"[text-shadow:0-1px_0_rgb(146_64_14_/_100%)]\",\n },\n gold: {\n outer: \"bg-gradient-to-b from-[#917100] to-[#EAD98F]\",\n inner: \"bg-gradient-to-b from-[#FFFDDD] via-[#856807] to-[#FFF1B3]\",\n button: \"bg-gradient-to-b from-[#FFEBA1] to-[#9B873F]\",\n textColor: \"text-[#FFFDE5]\",\n textShadow: \"[text-shadow:0-1px_0_rgb(178_140_2_/_100%)]\",\n },\n bronze: {\n outer: \"bg-gradient-to-b from-[#864813] to-[#E9B486]\",\n inner: \"bg-gradient-to-b from-[#EDC5A1] via-[#5F2D01] to-[#FFDEC1]\",\n button: \"bg-gradient-to-b from-[#FFE3C9] to-[#A36F3D]\",\n textColor: \"text-[#FFF7F0]\",\n textShadow: \"[text-shadow:0-1px_0_rgb(124_45_18_/_100%)]\",\n },\n};\n \nconst metalButtonVariants = (\n variant: ColorVariant = \"default\",\n isPressed: boolean,\n isHovered: boolean,\n isTouchDevice: boolean,\n) => {\n const colors = colorVariants[variant];\n const transitionStyle = \"all 250ms cubic-bezier(0.1, 0.4, 0.2, 1)\";\n \n return {\n wrapper: cn(\n \"relative inline-flex transform-gpu rounded-md p-[1.25px] will-change-transform\",\n colors.outer,\n ),\n wrapperStyle: {\n transform: isPressed\n ? \"translateY(2.5px) scale(0.99)\"\n : \"translateY(0) scale(1)\",\n boxShadow: isPressed\n ? \"0 1px 2px rgba(0, 0, 0, 0.15)\"\n : isHovered && !isTouchDevice\n ? \"0 4px 12px rgba(0, 0, 0, 0.12)\"\n : \"0 3px 8px rgba(0, 0, 0, 0.08)\",\n transition: transitionStyle,\n transformOrigin: \"center center\",\n },\n inner: cn(\n \"absolute inset-[1px] transform-gpu rounded-lg will-change-transform\",\n colors.inner,\n ),\n innerStyle: {\n transition: transitionStyle,\n transformOrigin: \"center center\",\n filter:\n isHovered && !isPressed && !isTouchDevice ? \"brightness(1.05)\" : \"none\",\n },\n button: cn(\n \"relative z-10 m-[1px] rounded-md inline-flex h-11 transform-gpu cursor-pointer items-center justify-center overflow-hidden rounded-md px-6 py-2 text-sm leading-none font-semibold will-change-transform outline-none\",\n colors.button,\n colors.textColor,\n colors.textShadow,\n ),\n buttonStyle: {\n transform: isPressed ? \"scale(0.97)\" : \"scale(1)\",\n transition: transitionStyle,\n transformOrigin: \"center center\",\n filter:\n isHovered && !isPressed && !isTouchDevice ? \"brightness(1.02)\" : \"none\",\n },\n };\n};\n \nconst ShineEffect = ({ isPressed }: { isPressed: boolean }) => {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 z-20 overflow-hidden transition-opacity duration-300\",\n isPressed ? \"opacity-20\" : \"opacity-0\",\n )}\n >\n <div className=\"absolute inset-0 rounded-md bg-gradient-to-r from-transparent via-neutral-100 to-transparent\" />\n </div>\n );\n};\n \nexport const MetalButton = React.forwardRef<\n HTMLButtonElement,\n MetalButtonProps\n>(({ children, className, variant = \"default\", ...props }, ref) => {\n const [isPressed, setIsPressed] = React.useState(false);\n const [isHovered, setIsHovered] = React.useState(false);\n const [isTouchDevice, setIsTouchDevice] = React.useState(false);\n \n React.useEffect(() => {\n setIsTouchDevice(\"ontouchstart\" in window || navigator.maxTouchPoints > 0);\n }, []);\n \n const buttonText = children || \"Button\";\n const variants = metalButtonVariants(\n variant,\n isPressed,\n isHovered,\n isTouchDevice,\n );\n \n const handleInternalMouseDown = () => {\n setIsPressed(true);\n };\n const handleInternalMouseUp = () => {\n setIsPressed(false);\n };\n const handleInternalMouseLeave = () => {\n setIsPressed(false);\n setIsHovered(false);\n };\n const handleInternalMouseEnter = () => {\n if (!isTouchDevice) {\n setIsHovered(true);\n }\n };\n const handleInternalTouchStart = () => {\n setIsPressed(true);\n };\n const handleInternalTouchEnd = () => {\n setIsPressed(false);\n };\n const handleInternalTouchCancel = () => {\n setIsPressed(false);\n };\n \n return (\n <div className={variants.wrapper} style={variants.wrapperStyle}>\n <div className={variants.inner} style={variants.innerStyle}></div>\n <button\n ref={ref}\n className={cn(variants.button, className)}\n style={variants.buttonStyle}\n {...props}\n onMouseDown={handleInternalMouseDown}\n onMouseUp={handleInternalMouseUp}\n onMouseLeave={handleInternalMouseLeave}\n onMouseEnter={handleInternalMouseEnter}\n onTouchStart={handleInternalTouchStart}\n onTouchEnd={handleInternalTouchEnd}\n onTouchCancel={handleInternalTouchCancel}\n >\n <ShineEffect isPressed={isPressed} />\n {buttonText}\n {isHovered && !isPressed && !isTouchDevice && (\n <div className=\"absolute inset-0 rounded-lg pointer-events-none bg-gradient-to-t from-transparent to-white/5\" />\n )}\n </button>\n </div>\n );\n});\n \nMetalButton.displayName = \"MetalButton\";\n\nexport { Button, buttonVariants, liquidbuttonVariants, LiquidButton }\n"],"names":[],"mappings":";;;;;AAMA,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,MAAM;AAAA,QACN,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,MAER,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAA,GAAS,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAA,CAAW,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,OAAO,cAAc;AAErB,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,MAER,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,KAAK;AAAA,QACL,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF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A;AAGF,QAAM,0BAA0B,MAAM;AACpC,iBAAa,IAAI;AAAA,EACnB;AACA,QAAM,wBAAwB,MAAM;AAClC,iBAAa,KAAK;AAAA,EACpB;AACA,QAAM,2BAA2B,MAAM;AACrC,iBAAa,KAAK;AAClB,iBAAa,KAAK;AAAA,EACpB;AACA,QAAM,2BAA2B,MAAM;AACrC,QAAI,CAAC,eAAe;AAClB,mBAAa,IAAI;AAAA,IACnB;AAAA,EACF;AACA,QAAM,2BAA2B,MAAM;AACrC,iBAAa,IAAI;AAAA,EACnB;AACA,QAAM,yBAAyB,MAAM;AACnC,iBAAa,KAAK;AAAA,EACpB;AACA,QAAM,4BAA4B,MAAM;AACtC,iBAAa,KAAK;AAAA,EACpB;AAEA,8BACG,OAAA,EAAI,WAAW,SAAS,SAAS,OAAO,SAAS,cAChD,UAAA;AAAA,IAAA,oBAAC,SAAI,WAAW,SAAS,OAAO,OAAO,SAAS,YAAY;AAAA,IAC5D;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,SAAS,QAAQ,SAAS;AAAA,QACxC,OAAO,SAAS;AAAA,QACf,GAAG;AAAA,QACJ,aAAa;AAAA,QACb,WAAW;AAAA,QACX,cAAc;AAAA,QACd,cAAc;AAAA,QACd,cAAc;AAAA,QACd,YAAY;AAAA,QACZ,eAAe;AAAA,QAEf,UAAA;AAAA,UAAA,oBAAC,eAAY,WAAsB;AAAA,UAClC;AAAA,UACA,aAAa,CAAC,aAAa,CAAC,iBAC3B,oBAAC,OAAA,EAAI,WAAU,+FAAA,CAA+F;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAElH,GACF;AAEJ,CAAC;AAED,YAAY,cAAc;"}
|
package/dist/index.es260.js
CHANGED
|
@@ -1,123 +1,53 @@
|
|
|
1
|
-
import { __require as
|
|
2
|
-
import { __require as
|
|
3
|
-
import { __require as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return ANY;
|
|
16
|
-
}
|
|
17
|
-
constructor(comp, options) {
|
|
18
|
-
options = parseOptions(options);
|
|
19
|
-
if (comp instanceof Comparator) {
|
|
20
|
-
if (comp.loose === !!options.loose) {
|
|
21
|
-
return comp;
|
|
22
|
-
} else {
|
|
23
|
-
comp = comp.value;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
27
|
-
debug("comparator", comp, options);
|
|
28
|
-
this.options = options;
|
|
29
|
-
this.loose = !!options.loose;
|
|
30
|
-
this.parse(comp);
|
|
31
|
-
if (this.semver === ANY) {
|
|
32
|
-
this.value = "";
|
|
33
|
-
} else {
|
|
34
|
-
this.value = this.operator + this.semver.version;
|
|
35
|
-
}
|
|
36
|
-
debug("comp", this);
|
|
1
|
+
import { __require as requireSemver } from "./index.es236.js";
|
|
2
|
+
import { __require as requireParse } from "./index.es238.js";
|
|
3
|
+
import { __require as requireRe } from "./index.es234.js";
|
|
4
|
+
var coerce_1;
|
|
5
|
+
var hasRequiredCoerce;
|
|
6
|
+
function requireCoerce() {
|
|
7
|
+
if (hasRequiredCoerce) return coerce_1;
|
|
8
|
+
hasRequiredCoerce = 1;
|
|
9
|
+
const SemVer = requireSemver();
|
|
10
|
+
const parse = requireParse();
|
|
11
|
+
const { safeRe: re, t } = requireRe();
|
|
12
|
+
const coerce = (version, options) => {
|
|
13
|
+
if (version instanceof SemVer) {
|
|
14
|
+
return version;
|
|
37
15
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const m = comp.match(r);
|
|
41
|
-
if (!m) {
|
|
42
|
-
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
43
|
-
}
|
|
44
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
45
|
-
if (this.operator === "=") {
|
|
46
|
-
this.operator = "";
|
|
47
|
-
}
|
|
48
|
-
if (!m[2]) {
|
|
49
|
-
this.semver = ANY;
|
|
50
|
-
} else {
|
|
51
|
-
this.semver = new SemVer(m[2], this.options.loose);
|
|
52
|
-
}
|
|
16
|
+
if (typeof version === "number") {
|
|
17
|
+
version = String(version);
|
|
53
18
|
}
|
|
54
|
-
|
|
55
|
-
return
|
|
19
|
+
if (typeof version !== "string") {
|
|
20
|
+
return null;
|
|
56
21
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
22
|
+
options = options || {};
|
|
23
|
+
let match = null;
|
|
24
|
+
if (!options.rtl) {
|
|
25
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
26
|
+
} else {
|
|
27
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
28
|
+
let next;
|
|
29
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
30
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
31
|
+
match = next;
|
|
67
32
|
}
|
|
33
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
68
34
|
}
|
|
69
|
-
|
|
35
|
+
coerceRtlRegex.lastIndex = -1;
|
|
70
36
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
throw new TypeError("a Comparator is required");
|
|
74
|
-
}
|
|
75
|
-
if (this.operator === "") {
|
|
76
|
-
if (this.value === "") {
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return new Range(comp.value, options).test(this.value);
|
|
80
|
-
} else if (comp.operator === "") {
|
|
81
|
-
if (comp.value === "") {
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
return new Range(this.value, options).test(comp.semver);
|
|
85
|
-
}
|
|
86
|
-
options = parseOptions(options);
|
|
87
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
37
|
+
if (match === null) {
|
|
38
|
+
return null;
|
|
109
39
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return
|
|
40
|
+
const major = match[2];
|
|
41
|
+
const minor = match[3] || "0";
|
|
42
|
+
const patch = match[4] || "0";
|
|
43
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
44
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
45
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
46
|
+
};
|
|
47
|
+
coerce_1 = coerce;
|
|
48
|
+
return coerce_1;
|
|
119
49
|
}
|
|
120
50
|
export {
|
|
121
|
-
|
|
51
|
+
requireCoerce as __require
|
|
122
52
|
};
|
|
123
53
|
//# sourceMappingURL=index.es260.js.map
|
package/dist/index.es260.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es260.js","sources":["../node_modules/.pnpm/semver@7.7.3/node_modules/semver/
|
|
1
|
+
{"version":3,"file":"index.es260.js","sources":["../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js"],"sourcesContent":["'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]\n let next\n while ((next = coerceRtlRegex.exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n coerceRtlRegex.lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n const major = match[2]\n const minor = match[3] || '0'\n const patch = match[4] || '0'\n const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''\n const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''\n\n return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)\n}\nmodule.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