@ngrok/mantle 0.89.0 → 0.90.1
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/agent.json +1529 -1
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/{alert-CZYYlx9q.js → alert-ZaUBtgno.js} +1 -1
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/app-layout.d.ts +68 -13
- package/dist/app-layout.js +1 -1
- package/dist/card.d.ts +7 -0
- package/dist/combobox.d.ts +1 -1
- package/dist/command.js +1 -1
- package/dist/{dialog-BDzapPLR.js → dialog-CaGJD02w.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpRsyt_F.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +1 -1
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/empty.d.ts +7 -0
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/{icons-BMZnm4hM.js → icons-CAtjMNti.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.js +1 -1
- package/dist/llms.txt +117 -2
- package/dist/mantle.css +9 -0
- package/dist/migrations/0002-data-table-action-header.yml +526 -0
- package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
- package/dist/migrations/0004-priority-to-intent.yml +1728 -0
- package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
- package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
- package/dist/migrations/0008-tabs-separator.yml +1212 -0
- package/dist/migrations/0009-chart-root-mode.yml +871 -0
- package/dist/multi-select.d.ts +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/{primitive-B-6XILB2.js → primitive-AGoxSJBI.js} +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/{select-CxXb3aiC.d.ts → select-DlohFa54.d.ts} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/{separator-HzGvuD0B.d.ts → separator-BWGjCIl7.d.ts} +7 -0
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-DND_KjmS.js → sheet-H8zvhSuA.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +17 -10
- package/dist/sidebar.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/strata.d.ts +548 -0
- package/dist/strata.js +1 -0
- package/dist/tabs.d.ts +12 -2
- package/dist/tabs.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/truncated-text.d.ts +9 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/well.d.ts +7 -0
- package/package.json +4 -3
- package/dist/alert-vfeV_hso.js +0 -1
- package/dist/dropdown-menu-CWUzGFgf.d.ts +0 -1
- package/dist/theme-BlCZHClJ.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
package/dist/empty.d.ts
CHANGED
|
@@ -118,6 +118,13 @@ declare const Actions: ({ "data-slot": dataSlot, asChild, children, className, .
|
|
|
118
118
|
* Compound component for rendering empty states. Use with `Empty.Root`,
|
|
119
119
|
* `Empty.Icon`, `Empty.Title`, `Empty.Description`, and `Empty.Actions`.
|
|
120
120
|
*
|
|
121
|
+
* @useWhen A region has no data, no results, or no access to show.
|
|
122
|
+
*
|
|
123
|
+
* @siblings
|
|
124
|
+
* - `Skeleton`: the region is still loading.
|
|
125
|
+
* - `Alert`: a message sits beside content that still exists.
|
|
126
|
+
* - `Well`: the state needs an inset panel; compose `Empty.Root` inside a `Well`.
|
|
127
|
+
*
|
|
121
128
|
* @see https://mantle.ngrok.com/components/feedback/empty
|
|
122
129
|
*
|
|
123
130
|
* @example
|
package/dist/flag.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ComponentProps } from "react";
|
|
|
4
4
|
/** All valid values for a flag
|
|
5
5
|
* @see https://www.flagpack.xyz/docs/flag-index
|
|
6
6
|
*/
|
|
7
|
-
declare const countryCodes: readonly ["004", "008", "010", "016", "
|
|
7
|
+
declare const countryCodes: readonly ["004", "008", "010", "016", "020", "024", "028", "031", "032", "040", "044", "048", "050", "051", "052", "056", "060", "064", "068", "070", "072", "074", "076", "084", "086", "090", "092", "096", "100", "104", "108", "112", "116", "120", "124", "132", "136", "140", "144", "148", "152", "156", "158", "162", "166", "170", "174", "178", "180", "184", "188", "191", "192", "196", "203", "204", "208", "212", "214", "218", "222", "226", "231", "232", "233", "234", "238", "239", "242", "246", "248", "250", "254", "258", "260", "262", "266", "268", "270", "275", "276", "288", "292", "296", "300", "304", "308", "312", "316", "320", "324", "328", "332", "334", "336", "340", "344", "348", "352", "356", "360", "364", "368", "372", "376", "380", "384", "388", "392", "398", "400", "404", "408", "410", "414", "417", "418", "422", "426", "428", "430", "434", "438", "440", "442", "446", "450", "454", "458", "462", "466", "470", "474", "478", "480", "484", "492", "496", "498", "499", "500", "504", "508", "512", "516", "520", "524", "528", "531", "533", "534", "540", "548", "554", "558", "562", "566", "570", "574", "578", "580", "581", "583", "584", "585", "586", "591", "598", "600", "604", "608", "612", "616", "620", "624", "626", "630", "634", "638", "642", "643", "646", "652", "654", "659", "660", "662", "663", "666", "670", "674", "678", "682", "686", "688", "690", "694", "702", "703", "704", "705", "706", "710", "716", "724", "728", "729", "732", "740", "744", "748", "752", "756", "760", "762", "764", "768", "772", "776", "780", "784", "788", "792", "795", "796", "798", "800", "804", "807", "818", "831", "832", "833", "834", "836", "840", "850", "854", "858", "860", "862", "876", "882", "887", "894", "ABW", "AD", "AE", "AF", "AFG", "AFRUN", "AG", "AGO", "AI", "AIA", "AL", "ALA", "ALB", "AM", "AMS", "AND", "AO", "AQ", "AR", "ARE", "ARG", "ARM", "AS", "ASM", "AT", "ATA", "ATF", "ATG", "AU", "AUS", "AUT", "AW", "AX", "AZ", "AZE", "BA", "BB", "BD", "BDI", "BE", "BEL", "BEN", "BF", "BFA", "BG", "BGD", "BGR", "BH", "BHR", "BHS", "BI", "BIH", "BJ", "BL", "BLM", "BLR", "BLZ", "BM", "BMU", "BN", "BO", "BOL", "BQ-BO", "BQ-SA", "BQ-SE", "BR", "BRA", "BRB", "BRN", "BS", "BT", "BTN", "BV", "BVT", "BW", "BWA", "BY", "BZ", "CA", "CAF", "CAN", "CC", "CCK", "CD", "CF", "CG", "CH", "CHE", "CHL", "CHN", "CI", "CIV", "CK", "CL", "CM", "CMR", "CN", "CO", "COD", "COG", "COK", "COL", "COM", "CPV", "CR", "CRI", "CU", "CUB", "CUW", "CV", "CW", "CX", "CXR", "CY", "CYM", "CYP", "CZ", "CZE", "DE", "DEU", "DJ", "DJI", "DK", "DM", "DMA", "DNK", "DO", "DOM", "EC", "ECU", "EE", "EG", "EGY", "EH", "ER", "ERI", "ES", "ESH", "ESP", "EST", "ET", "ETH", "EU", "FI", "FIN", "FJ", "FJI", "FK", "FLK", "FM", "FO", "FR", "FRA", "FRO", "FSM", "GA", "GAB", "GB-ENG", "GB-NIR", "GB-SCT", "GB-UKM", "GB-WLS", "GB", "GBR", "GD", "GE", "GEO", "GF", "GG", "GGY", "GH", "GHA", "GI", "GIB", "GIN", "GL", "GLP", "GM", "GMB", "GN", "GNB", "GNQ", "GP", "GQ", "GR", "GRC", "GRD", "GRL", "GS", "GT", "GTM", "GU", "GUF", "GUM", "GUY", "GW", "GY", "HK", "HKG", "HM", "HMD", "HN", "HND", "HR", "HRV", "HT", "HTI", "HU", "HUN", "ID", "IDN", "IE", "IL", "IM", "IMN", "IN", "IND", "IO", "IOT", "IQ", "IR", "IRL", "IRN", "IRQ", "IS", "ISL", "ISR", "IT", "ITA", "JAM", "JE", "JEY", "JM", "JO", "JOR", "JP", "JPN", "KAZ", "KE", "KEN", "KG", "KGZ", "KH", "KHM", "KI", "KIR", "KM", "KN-SK", "KNA", "KOR", "KP", "KR", "KW", "KWT", "KY", "KZ", "LA", "LAO", "LB", "LBN", "LBR", "LBY", "LC", "LCA", "LI", "LIE", "LK", "LKA", "LR", "LS", "LSO", "LT", "LTU", "LU", "LUX", "LV", "LVA", "LY", "MA", "MAC", "MAF", "MAR", "MC", "MCO", "MD", "MDA", "MDG", "MDV", "ME", "MEX", "MF", "MG", "MH", "MHL", "MK", "MKD", "ML", "MLI", "MLT", "MM", "MMR", "MN", "MNE", "MNG", "MNP", "MO", "MOZ", "MP", "MQ", "MR", "MRT", "MS", "MSR", "MT", "MTQ", "MU", "MUS", "MV", "MW", "MWI", "MX", "MY", "MYS", "MZ", "NA", "NAM", "NC", "NCL", "NE", "NER", "NF", "NFK", "NG", "NGA", "NI", "NIC", "NIU", "NL", "NLD", "NO", "NOR", "NP", "NPL", "NR", "NRU", "NU", "NZ", "NZL", "OM", "OMN", "PA", "PAK", "PAN", "PCN", "PE", "PER", "PF", "PG", "PH", "PHL", "PK", "PL", "PLW", "PM", "PN", "PNG", "POL", "PR", "PRI", "PRK", "PRT", "PRY", "PS", "PSE", "PT", "PW", "PY", "PYF", "QA", "QAT", "RAINBOW", "RE", "REU", "RO", "ROU", "RS", "RU", "RUS", "RW", "RWA", "SA", "SAU", "SB", "SC", "SD", "SDN", "SE", "SEN", "SG", "SGP", "SGS", "SH", "SHN", "SI", "SJ", "SJM", "SK", "SL", "SLB", "SLE", "SLV", "SM", "SMR", "SN", "SO", "SOM", "SPM", "SR", "SRB", "SS", "SSD", "ST", "STP", "SUR", "SV", "SVK", "SVN", "SWE", "SWZ", "SX", "SXM", "SY", "SYC", "SYR", "SZ", "TC", "TCA", "TCD", "TD", "TF", "TG", "TGO", "TH", "THA", "TJ", "TJK", "TK", "TKL", "TKM", "TL", "TLS", "TM", "TN", "TO", "TON", "TR", "TT", "TTO", "TUN", "TUR", "TUV", "TV", "TW", "TWN", "TZ", "TZA", "UA", "UG", "UGA", "UKR", "UM", "UMI", "UNASUR", "URY", "US", "USA", "UY", "UZ", "UZB", "VA", "VAT", "VC", "VCT", "VE", "VEN", "VG", "VGB", "VI", "VIR", "VN", "VNM", "VU", "VUT", "WF", "WLF", "WS", "WSM", "YE", "YEM", "ZA", "ZAF", "ZM", "ZMB", "ZW", "ZWE"];
|
|
8
8
|
type CountryCode = (typeof countryCodes)[number];
|
|
9
9
|
/**
|
|
10
10
|
* Narrows an unknown value to a `CountryCode`. Only an exact, case-sensitive
|
package/dist/flag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(``,{variants:{size:{s:`rounded-[0.0625rem]`,m:`rounded-[0.09375rem]`,l:`rounded-xs`}}}),s=a(``,{variants:{size:{s:`w-4 h-3`,m:`w-5 h-3.75`,l:`w-8 h-6`}}});function c(a){let c=n(31),l,u,d,f,p,m;c[0]===a?(l=c[1],u=c[2],d=c[3],f=c[4],p=c[5],m=c[6]):({"data-slot":d,className:l,code:u,size:p,loading:m,...f}=a,c[0]=a,c[1]=l,c[2]=u,c[3]=d,c[4]=f,c[5]=p,c[6]=m);let h=p===void 0?`l`:p,g=m===void 0?`lazy`:m,_,v,y,b,x;if(c[7]!==l||c[8]!==d||c[9]!==f||c[10]!==h){let n=o({size:h}),r=s({size:h});c[16]===d?y=c[17]:(y=t(d,`flag`),c[16]=d,c[17]=y),b=e(`flag relative overflow-hidden`,n,r,l),x=f,_=!0,v=e(`absolute inset-0 border border-[#000]/10`,n),c[7]=l,c[8]=d,c[9]=f,c[10]=h,c[11]=_,c[12]=v,c[13]=y,c[14]=b,c[15]=x}else _=c[11],v=c[12],y=c[13],b=c[14],x=c[15];let S;c[18]!==_||c[19]!==v?(S=/* @__PURE__ */ r(`div`,{"aria-hidden":_,className:v}),c[18]=_,c[19]=v,c[20]=S):S=c[20];let C=`https://assets.ngrok.com/flags/${h}/${u}.svg`,w=`flag for ${u}`,T;c[21]!==g||c[22]!==w||c[23]!==C?(T=/* @__PURE__ */ r(`img`,{className:`h-full w-full block object-cover`,src:C,alt:w,loading:g}),c[21]=g,c[22]=w,c[23]=C,c[24]=T):T=c[24];let E;return c[25]!==T||c[26]!==y||c[27]!==b||c[28]!==x||c[29]!==S?(E=/* @__PURE__ */ i(`div`,{"data-slot":y,className:b,...x,children:[S,T]}),c[25]=T,c[26]=y,c[27]=b,c[28]=x,c[29]=S,c[30]=E):E=c[30],E}const l=/* @__PURE__ */ `004.008.010.016.
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(``,{variants:{size:{s:`rounded-[0.0625rem]`,m:`rounded-[0.09375rem]`,l:`rounded-xs`}}}),s=a(``,{variants:{size:{s:`w-4 h-3`,m:`w-5 h-3.75`,l:`w-8 h-6`}}});function c(a){let c=n(31),l,u,d,f,p,m;c[0]===a?(l=c[1],u=c[2],d=c[3],f=c[4],p=c[5],m=c[6]):({"data-slot":d,className:l,code:u,size:p,loading:m,...f}=a,c[0]=a,c[1]=l,c[2]=u,c[3]=d,c[4]=f,c[5]=p,c[6]=m);let h=p===void 0?`l`:p,g=m===void 0?`lazy`:m,_,v,y,b,x;if(c[7]!==l||c[8]!==d||c[9]!==f||c[10]!==h){let n=o({size:h}),r=s({size:h});c[16]===d?y=c[17]:(y=t(d,`flag`),c[16]=d,c[17]=y),b=e(`flag relative overflow-hidden`,n,r,l),x=f,_=!0,v=e(`absolute inset-0 border border-[#000]/10`,n),c[7]=l,c[8]=d,c[9]=f,c[10]=h,c[11]=_,c[12]=v,c[13]=y,c[14]=b,c[15]=x}else _=c[11],v=c[12],y=c[13],b=c[14],x=c[15];let S;c[18]!==_||c[19]!==v?(S=/* @__PURE__ */ r(`div`,{"aria-hidden":_,className:v}),c[18]=_,c[19]=v,c[20]=S):S=c[20];let C=`https://assets.ngrok.com/flags/${h}/${u}.svg`,w=`flag for ${u}`,T;c[21]!==g||c[22]!==w||c[23]!==C?(T=/* @__PURE__ */ r(`img`,{className:`h-full w-full block object-cover`,src:C,alt:w,loading:g}),c[21]=g,c[22]=w,c[23]=C,c[24]=T):T=c[24];let E;return c[25]!==T||c[26]!==y||c[27]!==b||c[28]!==x||c[29]!==S?(E=/* @__PURE__ */ i(`div`,{"data-slot":y,className:b,...x,children:[S,T]}),c[25]=T,c[26]=y,c[27]=b,c[28]=x,c[29]=S,c[30]=E):E=c[30],E}const l=/* @__PURE__ */ `004.008.010.016.020.024.028.031.032.040.044.048.050.051.052.056.060.064.068.070.072.074.076.084.086.090.092.096.100.104.108.112.116.120.124.132.136.140.144.148.152.156.158.162.166.170.174.178.180.184.188.191.192.196.203.204.208.212.214.218.222.226.231.232.233.234.238.239.242.246.248.250.254.258.260.262.266.268.270.275.276.288.292.296.300.304.308.312.316.320.324.328.332.334.336.340.344.348.352.356.360.364.368.372.376.380.384.388.392.398.400.404.408.410.414.417.418.422.426.428.430.434.438.440.442.446.450.454.458.462.466.470.474.478.480.484.492.496.498.499.500.504.508.512.516.520.524.528.531.533.534.540.548.554.558.562.566.570.574.578.580.581.583.584.585.586.591.598.600.604.608.612.616.620.624.626.630.634.638.642.643.646.652.654.659.660.662.663.666.670.674.678.682.686.688.690.694.702.703.704.705.706.710.716.724.728.729.732.740.744.748.752.756.760.762.764.768.772.776.780.784.788.792.795.796.798.800.804.807.818.831.832.833.834.836.840.850.854.858.860.862.876.882.887.894.ABW.AD.AE.AF.AFG.AFRUN.AG.AGO.AI.AIA.AL.ALA.ALB.AM.AMS.AND.AO.AQ.AR.ARE.ARG.ARM.AS.ASM.AT.ATA.ATF.ATG.AU.AUS.AUT.AW.AX.AZ.AZE.BA.BB.BD.BDI.BE.BEL.BEN.BF.BFA.BG.BGD.BGR.BH.BHR.BHS.BI.BIH.BJ.BL.BLM.BLR.BLZ.BM.BMU.BN.BO.BOL.BQ-BO.BQ-SA.BQ-SE.BR.BRA.BRB.BRN.BS.BT.BTN.BV.BVT.BW.BWA.BY.BZ.CA.CAF.CAN.CC.CCK.CD.CF.CG.CH.CHE.CHL.CHN.CI.CIV.CK.CL.CM.CMR.CN.CO.COD.COG.COK.COL.COM.CPV.CR.CRI.CU.CUB.CUW.CV.CW.CX.CXR.CY.CYM.CYP.CZ.CZE.DE.DEU.DJ.DJI.DK.DM.DMA.DNK.DO.DOM.EC.ECU.EE.EG.EGY.EH.ER.ERI.ES.ESH.ESP.EST.ET.ETH.EU.FI.FIN.FJ.FJI.FK.FLK.FM.FO.FR.FRA.FRO.FSM.GA.GAB.GB-ENG.GB-NIR.GB-SCT.GB-UKM.GB-WLS.GB.GBR.GD.GE.GEO.GF.GG.GGY.GH.GHA.GI.GIB.GIN.GL.GLP.GM.GMB.GN.GNB.GNQ.GP.GQ.GR.GRC.GRD.GRL.GS.GT.GTM.GU.GUF.GUM.GUY.GW.GY.HK.HKG.HM.HMD.HN.HND.HR.HRV.HT.HTI.HU.HUN.ID.IDN.IE.IL.IM.IMN.IN.IND.IO.IOT.IQ.IR.IRL.IRN.IRQ.IS.ISL.ISR.IT.ITA.JAM.JE.JEY.JM.JO.JOR.JP.JPN.KAZ.KE.KEN.KG.KGZ.KH.KHM.KI.KIR.KM.KN-SK.KNA.KOR.KP.KR.KW.KWT.KY.KZ.LA.LAO.LB.LBN.LBR.LBY.LC.LCA.LI.LIE.LK.LKA.LR.LS.LSO.LT.LTU.LU.LUX.LV.LVA.LY.MA.MAC.MAF.MAR.MC.MCO.MD.MDA.MDG.MDV.ME.MEX.MF.MG.MH.MHL.MK.MKD.ML.MLI.MLT.MM.MMR.MN.MNE.MNG.MNP.MO.MOZ.MP.MQ.MR.MRT.MS.MSR.MT.MTQ.MU.MUS.MV.MW.MWI.MX.MY.MYS.MZ.NA.NAM.NC.NCL.NE.NER.NF.NFK.NG.NGA.NI.NIC.NIU.NL.NLD.NO.NOR.NP.NPL.NR.NRU.NU.NZ.NZL.OM.OMN.PA.PAK.PAN.PCN.PE.PER.PF.PG.PH.PHL.PK.PL.PLW.PM.PN.PNG.POL.PR.PRI.PRK.PRT.PRY.PS.PSE.PT.PW.PY.PYF.QA.QAT.RAINBOW.RE.REU.RO.ROU.RS.RU.RUS.RW.RWA.SA.SAU.SB.SC.SD.SDN.SE.SEN.SG.SGP.SGS.SH.SHN.SI.SJ.SJM.SK.SL.SLB.SLE.SLV.SM.SMR.SN.SO.SOM.SPM.SR.SRB.SS.SSD.ST.STP.SUR.SV.SVK.SVN.SWE.SWZ.SX.SXM.SY.SYC.SYR.SZ.TC.TCA.TCD.TD.TF.TG.TGO.TH.THA.TJ.TJK.TK.TKL.TKM.TL.TLS.TM.TN.TO.TON.TR.TT.TTO.TUN.TUR.TUV.TV.TW.TWN.TZ.TZA.UA.UG.UGA.UKR.UM.UMI.UNASUR.URY.US.USA.UY.UZ.UZB.VA.VAT.VC.VCT.VE.VEN.VG.VGB.VI.VIR.VN.VNM.VU.VUT.WF.WLF.WS.WSM.YE.YEM.ZA.ZAF.ZM.ZMB.ZW.ZWE`.split(`.`),u=new Set(l);function d(e){return typeof e==`string`&&u.has(e)}export{c as Flag,l as countryCodes,d as isCountryCode};
|
package/dist/hooks.d.ts
CHANGED
|
@@ -256,6 +256,121 @@ type Options = {
|
|
|
256
256
|
*/
|
|
257
257
|
declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>(callbackFn: T, options: Options): (...args: Parameters<T>) => void;
|
|
258
258
|
//#endregion
|
|
259
|
+
//#region src/hooks/use-focus-trap.d.ts
|
|
260
|
+
/**
|
|
261
|
+
* The options for {@link useFocusTrap}.
|
|
262
|
+
*
|
|
263
|
+
* @see https://mantle.ngrok.com/hooks#usefocustrap
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```tsx
|
|
267
|
+
* useFocusTrap(panelRef, { active: open && coversThePage });
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
type UseFocusTrapOptions = {
|
|
271
|
+
/**
|
|
272
|
+
* Whether the trap holds focus. Flip it to engage and release the trap on
|
|
273
|
+
* one mounted element: a panel that covers the page at one viewport width
|
|
274
|
+
* and sits beside it at another keeps its DOM and turns the trap on and off.
|
|
275
|
+
*
|
|
276
|
+
* @default true
|
|
277
|
+
*/
|
|
278
|
+
active?: boolean;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Keeps keyboard focus inside the element `ref` points at while `active` is
|
|
282
|
+
* `true`. On activation, when focus is outside the element, it moves focus to
|
|
283
|
+
* the element's first tab stop, else to the element itself, which gets
|
|
284
|
+
* `tabindex="-1"` for the trap's lifetime when it has none. An element that
|
|
285
|
+
* opens with a transition can hold nothing focusable in the commit that
|
|
286
|
+
* activates the trap, so the move retries for up to a second of frames until
|
|
287
|
+
* focus lands. While active, Tab on the last tab stop wraps to the first and
|
|
288
|
+
* Shift+Tab on the first wraps to the last, in document order. A child that
|
|
289
|
+
* prevents the default on `Tab` keeps it. On release the trap leaves focus
|
|
290
|
+
* where it is, so the caller decides where focus returns.
|
|
291
|
+
*
|
|
292
|
+
* It traps the keyboard only. Focus that a pointer or a script moves out of
|
|
293
|
+
* the element stays out, so a menu, a popover, or a dialog that portals out of
|
|
294
|
+
* the element keeps working. Make the rest of the page `inert` to block
|
|
295
|
+
* pointer focus, the way `AppLayout.SidePanel` does when it covers the page.
|
|
296
|
+
*
|
|
297
|
+
* The element must be mounted when `active` turns on; the hook reads the ref
|
|
298
|
+
* then and not on a later mount.
|
|
299
|
+
*
|
|
300
|
+
* @see https://mantle.ngrok.com/hooks#usefocustrap
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```tsx
|
|
304
|
+
* function CoverPanel({ open, children }: { open: boolean; children: ReactNode }) {
|
|
305
|
+
* const panelRef = useRef<HTMLDivElement>(null);
|
|
306
|
+
* const coversThePage = useMatchesMediaQuery("(width < 48rem)");
|
|
307
|
+
* useFocusTrap(panelRef, { active: open && coversThePage });
|
|
308
|
+
*
|
|
309
|
+
* return (
|
|
310
|
+
* <div ref={panelRef} role="region" aria-label="Assistant" inert={!open}>
|
|
311
|
+
* {children}
|
|
312
|
+
* </div>
|
|
313
|
+
* );
|
|
314
|
+
* }
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
declare function useFocusTrap(ref: RefObject<HTMLElement | null>, { active }?: UseFocusTrapOptions): void;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/hooks/use-inert-siblings.d.ts
|
|
320
|
+
/**
|
|
321
|
+
* The options for {@link useInertSiblings}.
|
|
322
|
+
*
|
|
323
|
+
* @see https://mantle.ngrok.com/hooks#useinertsiblings
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```tsx
|
|
327
|
+
* useInertSiblings(panelRef, { active: open && coversThePage });
|
|
328
|
+
* ```
|
|
329
|
+
*/
|
|
330
|
+
type UseInertSiblingsOptions = {
|
|
331
|
+
/**
|
|
332
|
+
* Whether the siblings are inert. Flip it to make them inert and release
|
|
333
|
+
* them on one mounted element.
|
|
334
|
+
*
|
|
335
|
+
* @default true
|
|
336
|
+
*/
|
|
337
|
+
active?: boolean;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Sets `inert` on every other child of the element's parent while `active`
|
|
341
|
+
* is `true`, so nothing beside the element is clickable, focusable, or read
|
|
342
|
+
* by assistive technology. A sibling that mounts while the hook is active
|
|
343
|
+
* goes inert too. On release it clears `inert` from the siblings it set and
|
|
344
|
+
* leaves alone one that was inert already.
|
|
345
|
+
*
|
|
346
|
+
* It reaches siblings only, not the rest of the document, so it fits a
|
|
347
|
+
* surface that covers one row of a layout in place: a panel that covers the
|
|
348
|
+
* card and the rail beside it, with a notice above the row still usable.
|
|
349
|
+
* Pair it with `useFocusTrap` to keep keyboard focus inside the element.
|
|
350
|
+
*
|
|
351
|
+
* The element must be mounted when `active` turns on; the hook reads the ref
|
|
352
|
+
* then and not on a later mount.
|
|
353
|
+
*
|
|
354
|
+
* @see https://mantle.ngrok.com/hooks#useinertsiblings
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```tsx
|
|
358
|
+
* function CoverPanel({ open, children }: { open: boolean; children: ReactNode }) {
|
|
359
|
+
* const panelRef = useRef<HTMLDivElement>(null);
|
|
360
|
+
* const coversThePage = useMatchesMediaQuery("(width < 48rem)");
|
|
361
|
+
* useInertSiblings(panelRef, { active: open && coversThePage });
|
|
362
|
+
* useFocusTrap(panelRef, { active: open && coversThePage });
|
|
363
|
+
*
|
|
364
|
+
* return (
|
|
365
|
+
* <div ref={panelRef} role="region" aria-label="Assistant" inert={!open}>
|
|
366
|
+
* {children}
|
|
367
|
+
* </div>
|
|
368
|
+
* );
|
|
369
|
+
* }
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
declare function useInertSiblings(ref: RefObject<HTMLElement | null>, { active }?: UseInertSiblingsOptions): void;
|
|
373
|
+
//#endregion
|
|
259
374
|
//#region src/hooks/use-is-hydrated.d.ts
|
|
260
375
|
/**
|
|
261
376
|
* Returns `false` during server rendering and the initial hydration render,
|
|
@@ -563,6 +678,141 @@ type ScrollBehavior = "auto" | "smooth";
|
|
|
563
678
|
*/
|
|
564
679
|
export declare function useScrollBehavior(): ScrollBehavior;
|
|
565
680
|
//#endregion
|
|
681
|
+
//#region src/hooks/use-swipe-to-dismiss.d.ts
|
|
682
|
+
/**
|
|
683
|
+
* The direction a swipe travels to dismiss the target: the edge it slides
|
|
684
|
+
* off. A panel on the right edge of the page dismisses to the `"right"`.
|
|
685
|
+
*
|
|
686
|
+
* @see https://mantle.ngrok.com/hooks#useswipetodismiss
|
|
687
|
+
*/
|
|
688
|
+
type SwipeDirection = "left" | "right" | "up" | "down";
|
|
689
|
+
/**
|
|
690
|
+
* The CSS property a drag writes on the target. `translate` slides the target
|
|
691
|
+
* toward the edge. `flex-basis` shrinks the target from its current size
|
|
692
|
+
* toward nothing, for a flex item that collapses in a lane when dismissed.
|
|
693
|
+
*
|
|
694
|
+
* @see https://mantle.ngrok.com/hooks#useswipetodismiss
|
|
695
|
+
*/
|
|
696
|
+
type SwipeProperty = "translate" | "flex-basis";
|
|
697
|
+
/**
|
|
698
|
+
* The options for {@link useSwipeToDismiss}.
|
|
699
|
+
*
|
|
700
|
+
* @see https://mantle.ngrok.com/hooks#useswipetodismiss
|
|
701
|
+
*
|
|
702
|
+
* @example
|
|
703
|
+
* ```tsx
|
|
704
|
+
* useSwipeToDismiss(headerRef, {
|
|
705
|
+
* target: panelRef,
|
|
706
|
+
* direction: "right",
|
|
707
|
+
* property: () => (getComputedStyle(panel).position === "absolute" ? "translate" : "flex-basis"),
|
|
708
|
+
* onDismiss: () => setOpen(false),
|
|
709
|
+
* });
|
|
710
|
+
* ```
|
|
711
|
+
*/
|
|
712
|
+
type UseSwipeToDismissOptions = {
|
|
713
|
+
/**
|
|
714
|
+
* Called once when a released drag crosses the threshold or ends in a
|
|
715
|
+
* flick. The caller hides the target; the hook moves nothing after the
|
|
716
|
+
* release.
|
|
717
|
+
*/
|
|
718
|
+
onDismiss: () => void;
|
|
719
|
+
/**
|
|
720
|
+
* The element the drag moves and measures. Defaults to the handle itself.
|
|
721
|
+
* Pass the panel when a header row is the handle.
|
|
722
|
+
*/
|
|
723
|
+
target?: RefObject<HTMLElement | null>;
|
|
724
|
+
/**
|
|
725
|
+
* The edge the target slides off. A drag the other way meets rubber-band
|
|
726
|
+
* resistance and never dismisses.
|
|
727
|
+
*
|
|
728
|
+
* @default "right"
|
|
729
|
+
*/
|
|
730
|
+
direction?: SwipeDirection;
|
|
731
|
+
/**
|
|
732
|
+
* The CSS property the drag writes on the target. A function runs at
|
|
733
|
+
* pointer down, for a target that slides in one layout and collapses in
|
|
734
|
+
* another.
|
|
735
|
+
*
|
|
736
|
+
* @default "translate"
|
|
737
|
+
*/
|
|
738
|
+
property?: SwipeProperty | (() => SwipeProperty);
|
|
739
|
+
/**
|
|
740
|
+
* Whether a drag can start. A function runs at pointer down, for a
|
|
741
|
+
* condition CSS owns.
|
|
742
|
+
*
|
|
743
|
+
* @default true
|
|
744
|
+
*/
|
|
745
|
+
active?: boolean | (() => boolean);
|
|
746
|
+
/**
|
|
747
|
+
* The share of the target's size along the direction a drag must cross to
|
|
748
|
+
* dismiss, between `0` and `1`.
|
|
749
|
+
*
|
|
750
|
+
* @default 0.25
|
|
751
|
+
*/
|
|
752
|
+
threshold?: number;
|
|
753
|
+
/**
|
|
754
|
+
* The speed toward the edge, in CSS pixels per millisecond, that dismisses
|
|
755
|
+
* a shorter drag as a flick. A pointer that rests for 100ms before the
|
|
756
|
+
* release has no speed.
|
|
757
|
+
*
|
|
758
|
+
* @default 0.4
|
|
759
|
+
*/
|
|
760
|
+
flickVelocity?: number;
|
|
761
|
+
};
|
|
762
|
+
/**
|
|
763
|
+
* Makes the element `handle` points at a swipe handle that drags `target`
|
|
764
|
+
* toward one edge and calls `onDismiss` when the drag crosses `threshold` of
|
|
765
|
+
* the target's size or ends in a flick. A shorter drag springs back, and a
|
|
766
|
+
* drag the wrong way meets rubber-band resistance. The target's own
|
|
767
|
+
* transition on the property animates both the spring back and the slide the
|
|
768
|
+
* caller runs after `onDismiss`, so a `motion-reduce:` rule on the target
|
|
769
|
+
* turns them into cuts.
|
|
770
|
+
*
|
|
771
|
+
* The target follows the pointer one to one: while the pointer is down the
|
|
772
|
+
* hook writes the property and `transition: none` on the target's inline
|
|
773
|
+
* style, and clears both on release. `translate` slides the target;
|
|
774
|
+
* `flex-basis` shrinks a flex item from its size toward nothing, the way a
|
|
775
|
+
* lane collapses. A tap on a control inside the handle stays a tap: the drag
|
|
776
|
+
* starts after 8px of travel along the direction, a gesture that travels
|
|
777
|
+
* further across it never starts, and a release after a drag swallows the
|
|
778
|
+
* click that follows it. Give the handle `touch-action: pan-y`
|
|
779
|
+
* (`touch-pan-y`) for a horizontal swipe, or `pan-x` for a vertical one, so
|
|
780
|
+
* the other axis still scrolls.
|
|
781
|
+
*
|
|
782
|
+
* Only the primary pointer with its main button drags, and only one drag runs
|
|
783
|
+
* at a time. The handle must be mounted when the hook runs; it reads the ref
|
|
784
|
+
* once per mount.
|
|
785
|
+
*
|
|
786
|
+
* @see https://mantle.ngrok.com/hooks#useswipetodismiss
|
|
787
|
+
*
|
|
788
|
+
* @example
|
|
789
|
+
* ```tsx
|
|
790
|
+
* function FloatingPanel({ open, setOpen, children }: FloatingPanelProps) {
|
|
791
|
+
* const panelRef = useRef<HTMLElement>(null);
|
|
792
|
+
* const headerRef = useRef<HTMLDivElement>(null);
|
|
793
|
+
* useSwipeToDismiss(headerRef, {
|
|
794
|
+
* target: panelRef,
|
|
795
|
+
* onDismiss: () => setOpen(false),
|
|
796
|
+
* });
|
|
797
|
+
*
|
|
798
|
+
* return (
|
|
799
|
+
* <aside
|
|
800
|
+
* ref={panelRef}
|
|
801
|
+
* aria-label="Assistant"
|
|
802
|
+
* data-state={open ? "open" : "closed"}
|
|
803
|
+
* className="transition-[translate] duration-200 ease-out-strong motion-reduce:transition-none data-state-closed:translate-x-full"
|
|
804
|
+
* >
|
|
805
|
+
* <div ref={headerRef} className="touch-pan-y">
|
|
806
|
+
* Assistant
|
|
807
|
+
* </div>
|
|
808
|
+
* {children}
|
|
809
|
+
* </aside>
|
|
810
|
+
* );
|
|
811
|
+
* }
|
|
812
|
+
* ```
|
|
813
|
+
*/
|
|
814
|
+
declare function useSwipeToDismiss(handle: RefObject<HTMLElement | null>, options: UseSwipeToDismissOptions): void;
|
|
815
|
+
//#endregion
|
|
566
816
|
//#region src/hooks/use-in-view.d.ts
|
|
567
817
|
/**
|
|
568
818
|
* Options for the `useInView` hook.
|
|
@@ -715,4 +965,4 @@ type UseUndoRedoReturn<T> = {
|
|
|
715
965
|
*/
|
|
716
966
|
declare function useUndoRedo<T extends NonNullable<unknown>>(): UseUndoRedoReturn<T>;
|
|
717
967
|
//#endregion
|
|
718
|
-
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useIsHydratedAfterPaint, useLocalStorage, useSessionStorage, useUndoRedo };
|
|
968
|
+
export { type Breakpoint, type SwipeDirection, type SwipeProperty, type TailwindBreakpoint, type UseFocusTrapOptions, type UseInViewOptions, type UseInertSiblingsOptions, type UseSwipeToDismissOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useFocusTrap, useInView, useInertSiblings, useIsBelowBreakpoint, useIsHydrated, useIsHydratedAfterPaint, useLocalStorage, useSessionStorage, useSwipeToDismiss, useUndoRedo };
|
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{n,r,t as i}from"./use-swipe-to-dismiss-Cj-AayFd.js";import{t as a}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as o}from"./use-matches-media-query-m860lols.js";import{t as s}from"./use-is-hydrated-DDCqXmju.js";import{t as c}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as l}from"./use-callback-ref-BvVyI5K1.js";import{n as u,t as d}from"./use-prefers-reduced-motion-DimzRx-M.js";import{n as f,r as p,t as m}from"./use-breakpoint--mo7kr9d.js";import{t as h}from"./in-view-Dxv_GrUU.js";import{c as g}from"react/compiler-runtime";import{useEffect as _,useRef as v,useState as y,useSyncExternalStore as b}from"react";function x(e,t){let n=g(4),[r,i]=y(e),a,o;return n[0]!==t.waitMs||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t.waitMs);return()=>{window.clearTimeout(n)}},o=[e,t.waitMs],n[0]=t.waitMs,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),_(a,o),r}function S(e,t){let n=g(5),r=l(e),i=v(0),a,o;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>()=>window.clearTimeout(i.current),o=[],n[0]=a,n[1]=o):(a=n[0],o=n[1]),_(a,o);let s;return n[2]!==t.waitMs||n[3]!==r?(s=(...e)=>{let n=e;window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(...n),t.waitMs)},n[2]=t.waitMs,n[3]=r,n[4]=s):s=n[4],s}const C=/* @__PURE__ */ new Map;function w(e){e.key==null?C.clear():C.has(e.key)&&(e.newValue==null?C.delete(e.key):C.set(e.key,e.newValue))}function T(){try{return window.localStorage}catch{return null}}function E(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===T(),i=n.key==null||n.key===e;r&&i&&(w(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function D(){return null}function O(e){let t=C.get(e);if(t!=null)return t;try{return window.localStorage.getItem(e)}catch{return null}}function k(e,t){try{window.localStorage.setItem(e,t),C.delete(e)}catch{C.set(e,t)}}function A(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function j(e,t){let n=g(12),r;n[0]===e?r=n[1]:(r=E(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>O(e),n[2]=e,n[3]=a);let o=b(i,a,D),s;n[4]!==t||n[5]!==o?(s=o==null?t:A(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);k(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:T()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}const M=/* @__PURE__ */ new Map;function N(e){e.key==null?M.clear():M.has(e.key)&&(e.newValue==null?M.delete(e.key):M.set(e.key,e.newValue))}function P(){try{return window.sessionStorage}catch{return null}}function F(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===P(),i=n.key==null||n.key===e;r&&i&&(N(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function I(){return null}function L(e){let t=M.get(e);if(t!=null)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function R(e,t){try{window.sessionStorage.setItem(e,t),M.delete(e)}catch{M.set(e,t)}}function z(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function B(e,t){let n=g(12),r;n[0]===e?r=n[1]:(r=F(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>L(e),n[2]=e,n[3]=a);let o=b(i,a,I),s;n[4]!==t||n[5]!==o?(s=o==null?t:z(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);R(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:P()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}function V(){return u()?`auto`:`smooth`}function H(e,t){let n=g(14),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{root:i,margin:a,amount:o,once:s,initial:c}=r,l=s!==void 0&&s,u=c!==void 0&&c,[d,f]=y(u),p=v(u),m;n[2]!==o||n[3]!==a||n[4]!==l||n[5]!==e||n[6]!==i?.current?(m=()=>{let t=e.current;if(t==null||l&&p.current)return;let n=function(){if(p.current=!0,f(!0),!l)return()=>{p.current=!1,f(!1)}},r={root:i?.current??void 0,margin:a,amount:o};return h(t,n,r)},n[2]=o,n[3]=a,n[4]=l,n[5]=e,n[6]=i?.current,n[7]=m):m=n[7];let b;return n[8]!==o||n[9]!==a||n[10]!==l||n[11]!==e||n[12]!==i?(b=[i,e,a,l,o],n[8]=o,n[9]=a,n[10]=l,n[11]=e,n[12]=i,n[13]=b):b=n[13],_(m,b),d}function U(){let e=g(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=v(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1];let i=v(r),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={undo:0,redo:0},e[2]=a):a=e[2];let[o,s]=y(a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{n.current.push(e),i.current=[],s({undo:n.current.length,redo:0})},e[3]=c):c=e[3];let l=c,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=n.current[n.current.length-1];if(t!==void 0)return n.current.pop(),i.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[4]=u):u=e[4];let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=i.current[i.current.length-1];if(t!==void 0)return i.current.pop(),n.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[5]=f):f=e[5];let p=f,m=o.undo>0,h=o.redo>0,_;return e[6]!==h||e[7]!==m?(_={canUndo:m,canRedo:h,push:l,undo:d,redo:p},e[6]=h,e[7]=m,e[8]=_):_=e[8],_}export{m as breakpoints,d as getPrefersReducedMotion,f as useBreakpoint,l as useCallbackRef,t as useComposedRefs,c as useCopyToClipboard,x as useDebounce,S as useDebouncedCallback,r as useFocusTrap,H as useInView,n as useInertSiblings,p as useIsBelowBreakpoint,s as useIsHydrated,a as useIsHydratedAfterPaint,e as useIsomorphicLayoutEffect,j as useLocalStorage,o as useMatchesMediaQuery,u as usePrefersReducedMotion,V as useScrollBehavior,B as useSessionStorage,i as useSwipeToDismiss,U as useUndoRedo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./theme-
|
|
1
|
+
import{s as e}from"./theme-6Q65C1Rx.js";import{c as t}from"react/compiler-runtime";import{jsx as n}from"react/jsx-runtime";import{DesktopIcon as r}from"@phosphor-icons/react/Desktop";import{MoonIcon as i}from"@phosphor-icons/react/Moon";import{SunIcon as a}from"@phosphor-icons/react/Sun";function o(r){let i=t(3),a=e(),o;return i[0]!==a||i[1]!==r?(o=/* @__PURE__ */ n(s,{theme:a,...r}),i[0]=a,i[1]=r,i[2]=o):o=i[2],o}function s(e){let o=t(13),s,c;switch(o[0]===e?(s=o[1],c=o[2]):({theme:c,...s}=e,o[0]=e,o[1]=s,o[2]=c),c){case`system`:{let e;return o[3]===s?e=o[4]:(e=/* @__PURE__ */ n(r,{...s}),o[3]=s,o[4]=e),e}case`light`:{let e;return o[5]===s?e=o[6]:(e=/* @__PURE__ */ n(a,{...s}),o[5]=s,o[6]=e),e}case`dark`:{let e;return o[7]===s?e=o[8]:(e=/* @__PURE__ */ n(i,{...s}),o[7]=s,o[8]=e),e}case`light-high-contrast`:{let e;return o[9]===s?e=o[10]:(e=/* @__PURE__ */ n(a,{...s,weight:`fill`}),o[9]=s,o[10]=e),e}case`dark-high-contrast`:{let e;return o[11]===s?e=o[12]:(e=/* @__PURE__ */ n(i,{...s,weight:`fill`}),o[11]=s,o[12]=e),e}}}export{s as n,o as t};
|
package/dist/icons.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icons-CSwTVV2m.js";import{t}from"./icons-CH3tD_wq.js";import{n,t as r}from"./icons-
|
|
1
|
+
import{t as e}from"./icons-CSwTVV2m.js";import{t}from"./icons-CH3tD_wq.js";import{n,t as r}from"./icons-CAtjMNti.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";function o(e){let t=i(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ a(`path`,{d:`M32.272 12.011c-1.298-1.466-2.904-2.205-4.812-2.205-1.176 0-2.26.233-3.255.7a7.995 7.995 0 0 0-2.581 1.906 9.205 9.205 0 0 0-1.715 2.853 9.773 9.773 0 0 0-.628 3.546c0 1.25.194 2.39.58 3.419.362.98.918 1.877 1.635 2.636A7.543 7.543 0 0 0 24 26.584c.965.41 2.025.617 3.176.617.522 0 1.005-.041 1.445-.116.439-.075.858-.2 1.26-.37.4-.175.79-.398 1.18-.664.385-.27.792-.612 1.21-1.018v4.353h-.005v.421h-5.33l-4.005 4.64v.798h15.037v-24.98h-5.697v1.746Zm-.014 7.979a4.25 4.25 0 0 1-.786 1.215 3.555 3.555 0 0 1-2.592 1.1 3.627 3.627 0 0 1-1.464-.292 3.508 3.508 0 0 1-1.166-.808 3.93 3.93 0 0 1-1.054-2.72c0-.519.097-1.006.298-1.457a3.77 3.77 0 0 1 .804-1.181 4.114 4.114 0 0 1 1.162-.808 3.484 3.484 0 0 1 2.817-.016c.448.19.844.463 1.181.81.336.347.6.743.804 1.194.202.452.298.95.298 1.493 0 .505-.104 1.005-.302 1.47m-16.261-7.708a6.173 6.173 0 0 0-2.06-1.602 4.875 4.875 0 0 0-.57-.22 6.383 6.383 0 0 0-.923-.216H8.383L5.697 13.39v-3.082H.002v16.61h5.695V15.712h5.35l.444-.01v11.214h5.697V16.528c0-.885-.084-1.674-.25-2.366a4.655 4.655 0 0 0-.941-1.877zm38.367-2.018h-6.213l-2.47 2.863v-2.864h-5.7v16.61h5.71l.004-11.117h4.144l4.526-5.26zm31.051 7.672 7.79-7.392v-.281H85.7l-5.975 5.991V0h-5.696v26.87h5.696v-6.766l6.262 6.763h7.663v-.316l-8.233-8.617zm-16.11-5.78a9.436 9.436 0 0 0-3.085-1.842 10.953 10.953 0 0 0-3.855-.664c-1.407 0-2.705.226-3.884.678a9.611 9.611 0 0 0-3.072 1.858 8.488 8.488 0 0 0-2.016 2.788 8.281 8.281 0 0 0-.722 3.449c0 1.362.24 2.596.722 3.707a8.52 8.52 0 0 0 2.002 2.862c.85.798 1.86 1.415 3.036 1.847 1.177.432 2.455.647 3.842.647 1.406 0 2.707-.215 3.919-.647 1.204-.431 2.24-1.04 3.098-1.833a8.583 8.583 0 0 0 2.031-2.816c.493-1.09.742-2.29.742-3.611 0-1.316-.244-2.52-.722-3.612a8.424 8.424 0 0 0-2.035-2.81Zm-3.558 7.864c-.2.461-.463.869-.786 1.215a3.573 3.573 0 0 1-2.592 1.1c-.502 0-.981-.096-1.434-.291a3.44 3.44 0 0 1-1.16-.809 4.155 4.155 0 0 1-.788-1.215 3.825 3.825 0 0 1-.297-1.537c0-.517.098-1.004.297-1.456.201-.451.46-.849.787-1.194a3.579 3.579 0 0 1 2.597-1.1c.502 0 .98.096 1.43.29.448.19.839.461 1.16.81.328.345.586.752.786 1.214.2.461.297.954.297 1.471 0 .538-.096 1.04-.297 1.502`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=/* @__PURE__ */ a(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 94 36`,width:`2.61em`,...e,children:n}),t[1]=e,t[2]=r),r}function s(e){let t=i(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ a(`path`,{d:`M27.2 6.18a9.47 9.47 0 0 0-3.12-2.5A9.42 9.42 0 0 0 21.82 3h-6.14l-4.06 4.9V3.1H3V29h8.62V11.53h8.09l.67-.02v17.48H29V12.8c0-1.37-.13-2.6-.38-3.68a7.35 7.35 0 0 0-1.42-2.93Z`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=/* @__PURE__ */ a(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 32 32`,width:`1em`,...e,children:n}),t[1]=e,t[2]=r),r}export{r as AutoThemeIcon,s as NgrokLettermarkIcon,o as NgrokWordmarkIcon,t as SortIcon,n as ThemeIcon,e as TrafficPolicyFileIcon};
|
package/dist/input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{n as r,t as i}from"./input-D_DjD9lT.js";import{t as a}from"./use-prefers-reduced-motion-
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{n as r,t as i}from"./input-D_DjD9lT.js";import{t as a}from"./use-prefers-reduced-motion-DimzRx-M.js";import{t as o}from"./input-DQyN6gN0.js";import{c as s}from"react/compiler-runtime";import{useId as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{EyeIcon as p}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as m}from"@phosphor-icons/react/EyeClosed";const h=o=>{let h=s(34),g,_,v,y,b,x,S;h[0]===o?(g=h[1],_=h[2],v=h[3],y=h[4],b=h[5],x=h[6],S=h[7]):({"data-slot":g,disabled:_,id:v,onValueVisibilityChange:y,ref:x,showValue:S,...b}=o,h[0]=o,h[1]=g,h[2]=_,h[3]=v,h[4]=y,h[5]=b,h[6]=x,h[7]=S);let C=c(),w=v??C,T=S!=null,[E,D]=u(!1),O=T?S:E,k=O?`text`:`password`,A=O?p:m,j=l(null),M=l(O),N,P;h[8]===O?(N=h[9],P=h[10]):(N=()=>{if(M.current===O)return;M.current=O;let e=j.current;e==null||a()||e.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`})},P=[O],h[8]=O,h[9]=N,h[10]=P),e(N,P);let F;h[11]===g?F=h[12]:(F=t(g,`password-input`),h[11]=g,h[12]=F);let I;h[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=/* @__PURE__ */ d(r,{}),h[13]=I):I=h[13];let L;h[14]!==T||h[15]!==y||h[16]!==O?(L=()=>{let e=!O;T||D(e),y?.(e)},h[14]=T,h[15]=y,h[16]=O,h[17]=L):L=h[17];let R;h[18]===A?R=h[19]:(R=/* @__PURE__ */ d(n,{ref:j,svg:/* @__PURE__ */ d(A,{"aria-hidden":!0})}),h[18]=A,h[19]=R);let z;h[20]!==_||h[21]!==w||h[22]!==O||h[23]!==L||h[24]!==R?(z=/* @__PURE__ */ d(`button`,{type:`button`,disabled:_,"data-slot":`password-input-toggle`,"aria-label":`Show value`,"aria-pressed":O,"aria-controls":w,className:`text-body hover:text-strong focus-visible:ring-focus-accent ml-1 cursor-pointer rounded-xs bg-inherit p-0 focus-visible:ring-2 focus-visible:outline-hidden`,onClick:L,children:R}),h[20]=_,h[21]=w,h[22]=O,h[23]=L,h[24]=R,h[25]=z):z=h[25];let B;return h[26]!==_||h[27]!==w||h[28]!==b||h[29]!==x||h[30]!==F||h[31]!==z||h[32]!==k?(B=/* @__PURE__ */ f(i,{"data-slot":F,disabled:_,id:w,type:k,ref:x,...b,children:[I,z]}),h[26]=_,h[27]=w,h[28]=b,h[29]=x,h[30]=F,h[31]=z,h[32]=k,h[33]=B):B=h[33],B};export{i as Input,r as InputCapture,h as PasswordInput,o as isInput};
|
package/dist/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# @ngrok/mantle (0.
|
|
1
|
+
# @ngrok/mantle (0.90.1)
|
|
2
2
|
|
|
3
|
-
> Offline
|
|
3
|
+
> Offline index shipped inside the @ngrok/mantle npm package. The full records, with examples and sibling boundaries, are in agent.json beside this file. Live docs: https://mantle.ngrok.com/for-ai-agents.
|
|
4
4
|
|
|
5
5
|
Docs: https://mantle.ngrok.com/
|
|
6
6
|
Agent guide: https://mantle.ngrok.com/for-ai-agents
|
|
@@ -17,6 +17,120 @@ Full text: https://mantle.ngrok.com/llms-full.txt
|
|
|
17
17
|
- Search index: https://mantle.ngrok.com/api/search-index.json
|
|
18
18
|
- Schemas: https://mantle.ngrok.com/api/schema.json
|
|
19
19
|
|
|
20
|
+
## Components
|
|
21
|
+
|
|
22
|
+
- **Accordion** (`@ngrok/mantle/accordion`): A vertically stacked set of disclosure sections whose collapsed content stays in the DOM, so browser find-in-page (⌘F) can reveal it.
|
|
23
|
+
- **Alert** (`@ngrok/mantle/alert`): Displays a callout for user attention.
|
|
24
|
+
- **Alert Center** (`@ngrok/mantle/alert-center`): A single top-level bar that surfaces one-to-many account alerts and their upgrade CTAs, expanding additional alerts inline.
|
|
25
|
+
- **Alert Dialog** (`@ngrok/mantle/alert-dialog`): A modal dialog that interrupts the user with important content and expects a response.
|
|
26
|
+
- **Anchor** (`@ngrok/mantle/anchor`): Fundamental component for rendering links to external addresses.
|
|
27
|
+
- **Area Chart** (`@ngrok/mantle/area-chart`): A canvas-rendered area chart for showing how values — and, when stacked, a total and its parts — change over a continuous x axis.
|
|
28
|
+
- **Avatar** (`@ngrok/mantle/avatar`): A small image representing a person or an account, with a text or icon fallback.
|
|
29
|
+
- **Badge** (`@ngrok/mantle/badge`): A non-interactive label used to highlight short, scannable information — a status, a category tag, or a count — in the smallest possible footprint.
|
|
30
|
+
- **Bar Chart** (`@ngrok/mantle/bar-chart`): A canvas-rendered bar chart for comparing values across categories, with grouped and stacked variants.
|
|
31
|
+
- **Breadcrumb** (`@ngrok/mantle/breadcrumb`): Hierarchy-path navigation, an ordered list of links from a root to the current page, in a labeled nav landmark.
|
|
32
|
+
- **Browser Only** (`@ngrok/mantle/browser-only`): A wrapper component that renders its children in the browser only, after hydration completes.
|
|
33
|
+
- **Button** (`@ngrok/mantle/button`): Initiates an action, such as completing a task or submitting information.
|
|
34
|
+
- **Calendar** (`@ngrok/mantle/calendar`, preview): A calendar component that allows users to select a date or a range of dates.
|
|
35
|
+
- **Card** (`@ngrok/mantle/card`): A container used to display content in a box, resembling a physical card.
|
|
36
|
+
- **Checkbox** (`@ngrok/mantle/checkbox`): A form control that allows the user to toggle between checked and not checked. Supports indeterminate state.
|
|
37
|
+
- **Choice** (`@ngrok/mantle/choice`): A reusable indicator-left / content-right layout for a single choice (a control beside a titled, multi-line label).
|
|
38
|
+
- **Code** (`@ngrok/mantle/code`): Marks a short fragment of inline computer code — a function name, a variable, a CLI flag, a key.
|
|
39
|
+
- **Code Block** (`@ngrok/mantle/code-block`): Code blocks render and apply syntax highlighting to blocks of code using Shiki at build time.
|
|
40
|
+
- **Combobox** (`@ngrok/mantle/combobox`): Fill in a React input field with autocomplete & autosuggest functionalities. Choose from a list of suggested values with full keyboard support. Also called: autocomplete, typeahead.
|
|
41
|
+
- **Command** (`@ngrok/mantle/command`): A command palette that allows users to search and execute commands.
|
|
42
|
+
- **Data Table** (`@ngrok/mantle/data-table`): Tables purposefully designed for dynamic, application data with features like sorting, filtering, and pagination.
|
|
43
|
+
- **Description List** (`@ngrok/mantle/description-list`): A semantically correct description list built on the HTML dl element. Renders a list of label/value pairs, commonly used in detail views to display metadata about a resource.
|
|
44
|
+
- **Dialog** (`@ngrok/mantle/dialog`): A window overlaid on either the primary window or another dialog window, rendering the content underneath inert. Also called: modal.
|
|
45
|
+
- **Dropdown Menu** (`@ngrok/mantle/dropdown-menu`): Displays a menu to the user (such as a set of actions or functions), triggered by a button.
|
|
46
|
+
- **Empty** (`@ngrok/mantle/empty`): Display a placeholder when there is no data or content to show. Also called: empty state, zero state.
|
|
47
|
+
- **Field** (`@ngrok/mantle/field`): Layout primitive for a single form field: label, control, helper text, and error messaging stacked together with consistent spacing.
|
|
48
|
+
- **Flag** (`@ngrok/mantle/flag`): Displays a flag as an SVG for the country code you pass.
|
|
49
|
+
- **Hover Card** (`@ngrok/mantle/hover-card`): For sighted users to preview content available behind a link.
|
|
50
|
+
- **Icon** (`@ngrok/mantle/icon`): Decorates an svg icon with automatic sizing. Useful when applying base styles to phosphor icons.
|
|
51
|
+
- **Icon Button** (`@ngrok/mantle/button`): Initiates an action, such as completing a task or submitting information. Renders one icon and nothing else, with a required label prop that carries the accessible name.
|
|
52
|
+
- **Icons** (`@ngrok/mantle/icons`): Custom icons used throughout ngrok UI.
|
|
53
|
+
- **Input** (`@ngrok/mantle/input`): Fundamental component for inputs.
|
|
54
|
+
- **Kbd** (`@ngrok/mantle/kbd`): A square, centered keyboard "key" chip for rendering keyboard shortcut hints.
|
|
55
|
+
- **Label** (`@ngrok/mantle/label`): A Label represents a caption for an item in a user interface. Renders an accessible label associated with controls.
|
|
56
|
+
- **Line Chart** (`@ngrok/mantle/line-chart`): A canvas-rendered line chart for trends over a continuous x axis — time above all. Min/max decimation keeps 100,000+ point series smooth.
|
|
57
|
+
- **List** (`@ngrok/mantle/list`): A scrollable, optionally-virtualized list of clickable items.
|
|
58
|
+
- **Live Region** (`@ngrok/mantle/live-region`): A persistent, visually hidden region that announces its text to screen readers when the text changes.
|
|
59
|
+
- **Main** (`@ngrok/mantle/main`): A focusable `<main>` landmark for the page's primary content, designed to be paired with a skip link.
|
|
60
|
+
- **Media Object** (`@ngrok/mantle/media-object`): The Media Object is an image/icon (media) to the left, with descriptive content (title and subtitle/description) to the right.
|
|
61
|
+
- **Multi Select** (`@ngrok/mantle/multi-select`): A typeahead multi-select combobox that allows users to select multiple values with filtering. Selected values are displayed as removable tags.
|
|
62
|
+
- **OTP Input** (`@ngrok/mantle/otp-input`): Accessible one-time passcode (OTP) input with paste, autofill, and IME support.
|
|
63
|
+
- **Pagination** (`@ngrok/mantle/pagination`): Components and hooks for navigating through paged data with cursor-based and offset-based pagination strategies.
|
|
64
|
+
- **Password Input** (`@ngrok/mantle/input`): Fundamental component for password inputs.
|
|
65
|
+
- **Popover** (`@ngrok/mantle/popover`): Displays rich content in a portal, triggered by a button. Also called: popup.
|
|
66
|
+
- **Progress Bar** (`@ngrok/mantle/progress`): Displays an indicator showing the completion progress of a task as a linear progress bar with customizable colors.
|
|
67
|
+
- **Progress Donut** (`@ngrok/mantle/progress`): Displays an indicator showing the completion progress of a task as a circular progress bar.
|
|
68
|
+
- **QR Code** (`@ngrok/mantle/qr-code`): Render a scannable QR code, optionally branded with a centered logo.
|
|
69
|
+
- **Radio Group** (`@ngrok/mantle/radio-group`): A set of checkable buttons (known as radio buttons) where no more than one of the buttons can be checked at a time.
|
|
70
|
+
- **Sandbar** (`@ngrok/mantle/sandbar`): A floating save bar for unsaved changes. Batch save form state with save and discard actions, announce pending state to screen readers, and block navigation until changes are resolved.
|
|
71
|
+
- **SandboxedOnClick** (`@ngrok/mantle/sandboxed-on-click`): A container that prevents the click event from bubbling out of it.
|
|
72
|
+
- **Scatter Plot** (`@ngrok/mantle/scatter-plot`): A canvas-rendered scatter plot for correlating two continuous measures (three with the rotatable 3D projection).
|
|
73
|
+
- **Select** (`@ngrok/mantle/select`): Displays a list of options for the user to pick from—triggered by a button. Also called: dropdown.
|
|
74
|
+
- **Selectable List** (`@ngrok/mantle/selectable-list`): A filterable, multi-select grid of checkbox rows.
|
|
75
|
+
- **Separator** (`@ngrok/mantle/separator`): Visually or semantically separates content.
|
|
76
|
+
- **Sheet** (`@ngrok/mantle/sheet`): A container that overlays the current view from the edge of the screen. Also called: drawer, side panel.
|
|
77
|
+
- **Sidebar** (`@ngrok/mantle/sidebar`): A composable, collapsible app-navigation sidebar with a mobile sheet presentation and a trigger that mounts anywhere in your app shell.
|
|
78
|
+
- **Skeleton** (`@ngrok/mantle/skeleton`): Use to show a placeholder while content is loading.
|
|
79
|
+
- **Skip to Main Link** (`@ngrok/mantle/skip-to-main-link`): A visually-hidden-until-focused "skip link" that lets keyboard users jump to the page's main content landmark.
|
|
80
|
+
- **Slider** (`@ngrok/mantle/slider`): An input where the user selects a value from within a given range.
|
|
81
|
+
- **Slot** (`@ngrok/mantle/slot`): Merges its props onto its immediate child.
|
|
82
|
+
- **Split Button** (`@ngrok/mantle/split-button`): A button group that pairs a one-click default action with a dropdown menu of related alternatives.
|
|
83
|
+
- **Strata** (`@ngrok/mantle/strata`): A page of titled sections, each one explained beside its content — the shape of a settings page or a configuration editor.
|
|
84
|
+
- **Switch** (`@ngrok/mantle/switch`): A form control that toggles one setting on or off. Unlike Checkbox, it has no indeterminate state. Also called: toggle.
|
|
85
|
+
- **Table** (`@ngrok/mantle/table`): A structured way to display data in rows and columns.
|
|
86
|
+
- **Tabs** (`@ngrok/mantle/tabs`): Layered sections of content, called tab panels, that show one at a time.
|
|
87
|
+
- **Text Area** (`@ngrok/mantle/text-area`): A multi-line plain-text editing control.
|
|
88
|
+
- **Theme** (`@ngrok/mantle/theme`): Theme primitives (ThemeProvider, MantleStyleSheets, and FOUC prevention) for light, dark, and high-contrast modes.
|
|
89
|
+
- **Theme Switcher** (`@ngrok/mantle/theme-switcher`): The canonical picker for mantle's five themes (a compact dropdown switcher), plus a radio group that embeds theme selection in any dropdown menu.
|
|
90
|
+
- **Toast** (`@ngrok/mantle/toast`): A succinct message that appears temporarily. Also called: notification, snackbar.
|
|
91
|
+
- **Tooltip** (`@ngrok/mantle/tooltip`): A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
92
|
+
- **Truncated Text** (`@ngrok/mantle/truncated-text`): Renders one long opaque value on a single line and keeps its tail visible when it overflows.
|
|
93
|
+
- **Visually Hidden** (`@ngrok/mantle/visually-hidden`): Render content that screen readers announce and sighted users never see.
|
|
94
|
+
- **Well** (`@ngrok/mantle/well`): A recessed, inset container used to group and de-emphasize content.
|
|
95
|
+
|
|
96
|
+
## Layouts
|
|
97
|
+
|
|
98
|
+
- **App Layout** (`@ngrok/mantle/app-layout`): A viewport-locked application shell: a full-width notice strip, a toolbar header, and a rounded content card whose page region is the shell's only scroll container.
|
|
99
|
+
- **Centered Layout** (`@ngrok/mantle/centered-layout`): A viewport-filling centered page flow, with utility header and footer strips around a growing, centered content region.
|
|
100
|
+
|
|
101
|
+
## Hooks
|
|
102
|
+
|
|
103
|
+
- **getPrefersReducedMotion** (`@ngrok/mantle/hooks`): Imperatively reads the current `prefers-reduced-motion` preference once at the time of the call.
|
|
104
|
+
- **useBreakpoint** (`@ngrok/mantle/hooks`): The largest Tailwind breakpoint the viewport width matches, or `"default"` below `2xs`.
|
|
105
|
+
- **useCallbackRef** (`@ngrok/mantle/hooks`)
|
|
106
|
+
- **useComposedRefs** (`@ngrok/mantle/hooks`): A custom hook that composes up to three refs into a single callback ref.
|
|
107
|
+
- **useCopyToClipboard** (`@ngrok/mantle/hooks`): React hook that returns a stable async function for copying a string to the system clipboard.
|
|
108
|
+
- **useDebounce** (`@ngrok/mantle/hooks`): Returns a debounced copy of `value`: it only updates after `value` has stopped changing for `options.waitMs` milliseconds.
|
|
109
|
+
- **useDebouncedCallback** (`@ngrok/mantle/hooks`): Returns a debounced version of `callbackFn`.
|
|
110
|
+
- **useFocusTrap** (`@ngrok/mantle/hooks`): Keeps keyboard focus inside the element `ref` points at while `active` is `true`.
|
|
111
|
+
- **useInertSiblings** (`@ngrok/mantle/hooks`): Sets `inert` on every other child of the element's parent while `active` is `true`, so nothing beside the element is clickable, focusable, or read by assistive technology.
|
|
112
|
+
- **useInView** (`@ngrok/mantle/hooks`): React hook that tracks whether a DOM element is visible within the viewport (or a scrollable container) using the `IntersectionObserver` API.
|
|
113
|
+
- **useIsBelowBreakpoint** (`@ngrok/mantle/hooks`): `true` while the viewport is narrower than the given breakpoint.
|
|
114
|
+
- **useIsHydrated** (`@ngrok/mantle/hooks`): Returns `false` during server rendering and the initial hydration render, then `true` on the client — without hydration mismatches, because React uses the server snapshot for the hydration pass and re-renders once with the client snapshot afterwards.
|
|
115
|
+
- **useIsHydratedAfterPaint** (`@ngrok/mantle/hooks`): Returns `false` on the server, in the hydration render, and in the mount commit, then `true` from the next animation frame.
|
|
116
|
+
- **useIsomorphicLayoutEffect** (`@ngrok/mantle/hooks`): A drop-in replacement for `useLayoutEffect` that does not warn during server-side rendering.
|
|
117
|
+
- **useLocalStorage** (`@ngrok/mantle/hooks`): SSR-safe `useSyncExternalStore`-backed localStorage string state.
|
|
118
|
+
- **useMatchesMediaQuery** (`@ngrok/mantle/hooks`): React hook that subscribes to a CSS media query and returns whether it currently matches, re-rendering whenever the result changes.
|
|
119
|
+
- **usePrefersReducedMotion** (`@ngrok/mantle/hooks`): React hook that subscribes to the user's `prefers-reduced-motion` media query and re-renders when it changes.
|
|
120
|
+
- **useScrollBehavior** (`@ngrok/mantle/hooks`): React hook that returns a ScrollBehavior value (`"auto"` or `"smooth"`) that respects the user's motion preference.
|
|
121
|
+
- **useSessionStorage** (`@ngrok/mantle/hooks`): SSR-safe `useSyncExternalStore`-backed sessionStorage string state.
|
|
122
|
+
- **useSwipeToDismiss** (`@ngrok/mantle/hooks`): Makes the element `handle` points at a swipe handle that drags `target` toward one edge and calls `onDismiss` when the drag crosses `threshold` of the target's size or ends in a flick.
|
|
123
|
+
- **useUndoRedo** (`@ngrok/mantle/hooks`): Generic undo/redo hook that maintains two history stacks (undo and redo).
|
|
124
|
+
|
|
125
|
+
## Utilities
|
|
126
|
+
|
|
127
|
+
- **color** (`@ngrok/mantle/color`): Color palette named colors
|
|
128
|
+
- **composeRefs** (`@ngrok/mantle/utils`): A utility that composes multiple refs into a single callback ref.
|
|
129
|
+
- **cx** (`@ngrok/mantle/cx`): Conditionally compose class names and resolve Tailwind CSS conflicts, so later classes override earlier ones (the same precedence model as inline styles).
|
|
130
|
+
- **highlight-utils** (`@ngrok/mantle/highlight-utils`): React-free highlighting utilities for use in build tools, server-side rendering, and Web Workers.
|
|
131
|
+
- **inView** (`@ngrok/mantle/utils`): Observe when a DOM element enters or leaves the viewport (or a scrollable container) using the `IntersectionObserver` API.
|
|
132
|
+
- **sorting** (`@ngrok/mantle/utils`): Compare dates in newest-to-oldest (descending) order.
|
|
133
|
+
|
|
20
134
|
## Importable subpaths
|
|
21
135
|
|
|
22
136
|
- `@ngrok/mantle/accordion`
|
|
@@ -83,6 +197,7 @@ Full text: https://mantle.ngrok.com/llms-full.txt
|
|
|
83
197
|
- `@ngrok/mantle/slider`
|
|
84
198
|
- `@ngrok/mantle/slot`
|
|
85
199
|
- `@ngrok/mantle/split-button`
|
|
200
|
+
- `@ngrok/mantle/strata`
|
|
86
201
|
- `@ngrok/mantle/switch`
|
|
87
202
|
- `@ngrok/mantle/table`
|
|
88
203
|
- `@ngrok/mantle/tabs`
|
package/dist/mantle.css
CHANGED
|
@@ -174,6 +174,15 @@ MARK: THEME
|
|
|
174
174
|
/* A strong ease-out for UI that enters, exits, or changes shape in under 300ms.
|
|
175
175
|
Tailwind's `--ease-out` is too shallow to read as a settle at 200ms. */
|
|
176
176
|
--ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
|
|
177
|
+
/* The narrowest workspace row that holds the expanded rail (13rem), the content card at
|
|
178
|
+
the side panel's floor (21rem), the panel itself (21rem), and the three gutters (1.5rem).
|
|
179
|
+
Below it `AppLayout.SidePanel` floats over the card, so the page is never narrower than
|
|
180
|
+
the panel beside it. The budget holds whatever the viewport is: the panel's default width
|
|
181
|
+
reads the row (`24cqw`), so it sits at the floor in every row up to 87.5rem. */
|
|
182
|
+
--container-side-panel-lane: 56.5rem;
|
|
183
|
+
/* The same row with the icon rail (3.25rem) in place of the expanded one, or with no rail.
|
|
184
|
+
`AppLayout.SidePanel` reads this threshold when the row holds no expanded `Sidebar.Nav`. */
|
|
185
|
+
--container-side-panel-lane-icon-rail: 46.75rem;
|
|
177
186
|
--font-sans: "Roobert", ui-sans-serif, system-ui, sans-serif;
|
|
178
187
|
--font-mono:
|
|
179
188
|
"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono,
|