seppia 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -60
- package/dist/blocks/ai-chat.cjs +19 -0
- package/dist/blocks/ai-chat.d.cts +1 -0
- package/dist/blocks/ai-chat.d.ts +1 -0
- package/dist/blocks/ai-chat.js +10 -0
- package/dist/blocks/app-shell.cjs +49 -0
- package/dist/blocks/app-shell.d.cts +1 -0
- package/dist/blocks/app-shell.d.ts +1 -0
- package/dist/blocks/app-shell.js +16 -0
- package/dist/blocks/auth.cjs +58 -0
- package/dist/blocks/auth.d.cts +1 -0
- package/dist/blocks/auth.d.ts +1 -0
- package/dist/blocks/auth.js +13 -0
- package/dist/blocks/dashboard.cjs +23 -0
- package/dist/blocks/dashboard.d.cts +1 -0
- package/dist/blocks/dashboard.d.ts +1 -0
- package/dist/blocks/dashboard.js +10 -0
- package/dist/blocks/data-table.cjs +29 -0
- package/dist/blocks/data-table.d.cts +1 -0
- package/dist/blocks/data-table.d.ts +1 -0
- package/dist/blocks/data-table.js +20 -0
- package/dist/blocks/forms.cjs +33 -0
- package/dist/blocks/forms.d.cts +1 -0
- package/dist/blocks/forms.d.ts +1 -0
- package/dist/blocks/forms.js +16 -0
- package/dist/blocks/kanban.cjs +16 -0
- package/dist/blocks/kanban.d.cts +1 -0
- package/dist/blocks/kanban.d.ts +1 -0
- package/dist/blocks/kanban.js +7 -0
- package/dist/blocks/modals.cjs +33 -0
- package/dist/blocks/modals.d.cts +1 -0
- package/dist/blocks/modals.d.ts +1 -0
- package/dist/blocks/modals.js +16 -0
- package/dist/blocks/notifications.cjs +37 -0
- package/dist/blocks/notifications.d.cts +1 -0
- package/dist/blocks/notifications.d.ts +1 -0
- package/dist/blocks/notifications.js +16 -0
- package/dist/blocks/permissions.cjs +21 -0
- package/dist/blocks/permissions.d.cts +1 -0
- package/dist/blocks/permissions.d.ts +1 -0
- package/dist/blocks/permissions.js +12 -0
- package/dist/blocks/scheduling.cjs +24 -0
- package/dist/blocks/scheduling.d.cts +1 -0
- package/dist/blocks/scheduling.d.ts +1 -0
- package/dist/blocks/scheduling.js +7 -0
- package/dist/chunk-22XE2ZSK.js +115 -0
- package/dist/{chunk-T7AMVHIB.js → chunk-2AS3PZ62.js} +10 -9
- package/dist/{chunk-VHXWP5OX.cjs → chunk-2DW7PF2P.cjs} +22 -21
- package/dist/chunk-2HMUVVUR.cjs +45 -0
- package/dist/chunk-2IBDXUBG.js +2 -0
- package/dist/chunk-2L7GUYB2.js +152 -0
- package/dist/{chunk-AFGJQET4.js → chunk-2MX7EYXA.js} +16 -15
- package/dist/chunk-2UB2HKMF.cjs +131 -0
- package/dist/chunk-2YB44UOW.js +2 -0
- package/dist/chunk-32OCNZWB.js +2 -0
- package/dist/chunk-3BC4NA2C.cjs +126 -0
- package/dist/chunk-3ENS37RT.cjs +373 -0
- package/dist/{chunk-4YGBUMQC.js → chunk-3FLWYYDS.js} +13 -12
- package/dist/{chunk-EUQ6BCML.cjs → chunk-3GGOAJIG.cjs} +16 -15
- package/dist/chunk-3HME5VXL.cjs +3 -0
- package/dist/chunk-3S3MBTXC.cjs +3 -0
- package/dist/chunk-3WWOK2IV.cjs +104 -0
- package/dist/{chunk-6EABLOB7.js → chunk-3YOPOWUB.js} +9 -8
- package/dist/chunk-3Z5M2WVW.cjs +3 -0
- package/dist/chunk-43N5QL6C.cjs +3 -0
- package/dist/{chunk-WGFJLFTP.js → chunk-4C7VKLTU.js} +8 -1
- package/dist/chunk-4GLMIQUX.js +275 -0
- package/dist/{chunk-XLZPYDNI.js → chunk-4MTRY6D2.js} +15 -14
- package/dist/{chunk-NN3HMY7H.cjs → chunk-4Q6LY3TN.cjs} +24 -25
- package/dist/chunk-4STGAE4T.js +2 -0
- package/dist/chunk-4YXWES4C.cjs +81 -0
- package/dist/{chunk-GJ6WO63L.js → chunk-54SA4YJ7.js} +14 -13
- package/dist/chunk-5A46EAUE.js +42 -0
- package/dist/chunk-5CKY3233.js +2 -0
- package/dist/{chunk-QPWVBVDC.cjs → chunk-5IGY4W4T.cjs} +20 -19
- package/dist/chunk-5KNKWEIE.cjs +564 -0
- package/dist/chunk-5OOVB2S5.cjs +244 -0
- package/dist/{chunk-6FF73V3S.js → chunk-64WDKM52.js} +8 -7
- package/dist/chunk-6CZIXWOU.js +2 -0
- package/dist/{chunk-CCDDQHCS.js → chunk-6HPGI7VU.js} +13 -12
- package/dist/chunk-6HZLPZ5A.js +146 -0
- package/dist/chunk-6IH2PZO5.js +122 -0
- package/dist/{chunk-UFU5S3LK.cjs → chunk-6JZYZDCV.cjs} +11 -10
- package/dist/{chunk-ZF5HY2K4.cjs → chunk-6K3RXUKZ.cjs} +17 -16
- package/dist/chunk-6MJYJC3V.cjs +3 -0
- package/dist/{chunk-IUSSIILO.cjs → chunk-6OA3BX3U.cjs} +40 -39
- package/dist/chunk-6PE3ZGPD.cjs +239 -0
- package/dist/chunk-6QQPGNNK.js +2 -0
- package/dist/{chunk-SDWRKTFC.cjs → chunk-6W3OO6DK.cjs} +10 -9
- package/dist/chunk-744QNW5E.js +77 -0
- package/dist/chunk-7DCJW7LC.cjs +146 -0
- package/dist/chunk-7OOBMBHB.js +34 -0
- package/dist/chunk-7PWTWLXL.cjs +3 -0
- package/dist/chunk-7RZVSATZ.js +83 -0
- package/dist/chunk-7S3BMPK6.js +262 -0
- package/dist/chunk-7V6SXPFO.cjs +164 -0
- package/dist/chunk-7WZL3ZII.js +124 -0
- package/dist/chunk-7XYHI3LD.cjs +3 -0
- package/dist/chunk-A2QD7OLJ.js +213 -0
- package/dist/chunk-A3M6ALHJ.js +2 -0
- package/dist/{chunk-JV6GJ3JJ.js → chunk-AEQ6DMPS.js} +21 -20
- package/dist/chunk-APFW2I3Q.js +38 -0
- package/dist/chunk-AXWQJPZL.js +222 -0
- package/dist/chunk-B3D6KWG3.cjs +11 -0
- package/dist/{chunk-7B2YEOYF.js → chunk-B5Z4XIIF.js} +4 -4
- package/dist/chunk-BQUUTWTZ.cjs +129 -0
- package/dist/chunk-BRHXMXA7.cjs +3 -0
- package/dist/chunk-CIMKUKAG.cjs +3 -0
- package/dist/{chunk-GP32TY6P.cjs → chunk-CM7W446Z.cjs} +37 -36
- package/dist/chunk-CQZU4EHR.cjs +263 -0
- package/dist/{chunk-SSARMSS3.cjs → chunk-DKTUKZ5A.cjs} +22 -21
- package/dist/{chunk-AG3OBSP5.cjs → chunk-DLS6YGNX.cjs} +16 -15
- package/dist/chunk-DO4CSXWD.js +2 -0
- package/dist/chunk-DQQLYUXT.cjs +36 -0
- package/dist/chunk-DU2E5QXZ.js +2 -0
- package/dist/chunk-E2IMDHN3.cjs +286 -0
- package/dist/chunk-EAIDRCQS.js +2 -0
- package/dist/{chunk-AHRXESD2.js → chunk-EAQYTXY7.js} +15 -14
- package/dist/chunk-ECJ6AOAB.js +542 -0
- package/dist/chunk-EJV27E62.cjs +3 -0
- package/dist/chunk-ESHVB27V.cjs +3 -0
- package/dist/chunk-FDFQRXGC.cjs +3 -0
- package/dist/chunk-FG53BXIR.js +2 -0
- package/dist/{chunk-EYO4XMKU.js → chunk-FLLU5FAE.js} +10 -34
- package/dist/{chunk-EOPY2VWT.cjs → chunk-FO7ZZP52.cjs} +17 -16
- package/dist/chunk-FVVH37UH.js +57 -0
- package/dist/chunk-FXCVPRHV.cjs +52 -0
- package/dist/chunk-FXQKHROS.cjs +3 -0
- package/dist/chunk-GASIBRAJ.js +650 -0
- package/dist/{chunk-PBMXL53R.cjs → chunk-GHC7MKBR.cjs} +0 -8
- package/dist/chunk-GK7BIWGS.cjs +149 -0
- package/dist/{chunk-DO5WEBTN.cjs → chunk-GROWBVU5.cjs} +12 -11
- package/dist/{chunk-RFCZJPGM.js → chunk-GSF7YUXO.js} +7 -6
- package/dist/{chunk-4IHNW52F.cjs → chunk-GTU6TD5Q.cjs} +19 -19
- package/dist/chunk-HN3FTZJN.cjs +3 -0
- package/dist/chunk-HNALBJPN.cjs +36 -0
- package/dist/chunk-HSZEON5G.js +351 -0
- package/dist/chunk-HV4PLJGS.js +2 -0
- package/dist/{chunk-66ITQTT2.js → chunk-HWHAD4OZ.js} +10 -9
- package/dist/{chunk-YDJMVDAJ.cjs → chunk-I2QUKJX7.cjs} +19 -18
- package/dist/chunk-I2RCFWV3.cjs +174 -0
- package/dist/chunk-I3GJQHNE.cjs +144 -0
- package/dist/{chunk-CPUW5LDN.cjs → chunk-I3HEEAHX.cjs} +5 -5
- package/dist/chunk-I4VXNHO7.cjs +115 -0
- package/dist/chunk-IA664Z6A.js +2 -0
- package/dist/chunk-IEI6INUF.js +2 -0
- package/dist/chunk-IJSWK5ST.cjs +3 -0
- package/dist/chunk-IPNKP4DH.cjs +297 -0
- package/dist/{chunk-3XIEBFVO.cjs → chunk-IT27FHWR.cjs} +14 -13
- package/dist/chunk-IUZBQ5G2.cjs +3 -0
- package/dist/chunk-J2JRWEOR.js +2 -0
- package/dist/chunk-JC6MXMQZ.cjs +109 -0
- package/dist/chunk-JD4NHZXF.js +2 -0
- package/dist/chunk-JGIKKJAS.cjs +16 -0
- package/dist/{chunk-NU5MGYFP.cjs → chunk-JUMI5UBA.cjs} +18 -42
- package/dist/chunk-JXPOKP66.js +2 -0
- package/dist/chunk-JZUEW7WR.js +2 -0
- package/dist/{chunk-F7UECO7G.js → chunk-K2CVKVIF.js} +15 -15
- package/dist/{chunk-RIBXHAKG.cjs → chunk-K6MCWJ35.cjs} +15 -14
- package/dist/chunk-K6X6O42N.js +9 -0
- package/dist/{chunk-76MEQHGW.js → chunk-KA24K3XP.js} +18 -17
- package/dist/chunk-KEISLNT6.cjs +3 -0
- package/dist/{chunk-5Z32CAHE.cjs → chunk-KLJ4DMH2.cjs} +22 -21
- package/dist/chunk-KO5DJXD4.js +2 -0
- package/dist/chunk-KVDIEAWQ.cjs +3 -0
- package/dist/{chunk-I525FOTN.cjs → chunk-KVFBDLSA.cjs} +23 -22
- package/dist/chunk-KVXARKY4.js +136 -0
- package/dist/chunk-KXCKL4P2.cjs +3 -0
- package/dist/chunk-KZKDZRZJ.cjs +3 -0
- package/dist/chunk-KZOXFNUE.cjs +44 -0
- package/dist/chunk-L5JDNZS3.cjs +299 -0
- package/dist/chunk-L5P5R7QQ.cjs +3 -0
- package/dist/chunk-L5YN6PRP.js +2 -0
- package/dist/{chunk-SMY24MVU.js → chunk-LD3DXOQ7.js} +1 -1
- package/dist/{chunk-QWYHH465.cjs → chunk-LRI6V2NK.cjs} +2 -2
- package/dist/{chunk-ZZYMYQU2.js → chunk-LVE2WXGB.js} +18 -17
- package/dist/chunk-M4U2IWVW.js +54 -0
- package/dist/chunk-MCK6WCG2.cjs +168 -0
- package/dist/{chunk-AJPI65BL.cjs → chunk-MCQYUABH.cjs} +20 -19
- package/dist/chunk-MFFNV55T.cjs +223 -0
- package/dist/chunk-MGUOCT7T.cjs +1047 -0
- package/dist/{chunk-M42F5QS5.cjs → chunk-MHIFGXVD.cjs} +10 -9
- package/dist/chunk-MHS4TQAK.cjs +77 -0
- package/dist/chunk-MK7U7I4G.js +2 -0
- package/dist/chunk-MNDB6QKQ.js +2 -0
- package/dist/chunk-MO5QNNWF.cjs +99 -0
- package/dist/chunk-MQR6Y7I3.cjs +3 -0
- package/dist/chunk-MVAFOPND.cjs +3 -0
- package/dist/chunk-MX54ZBNC.js +108 -0
- package/dist/{chunk-IAPRIVJO.js → chunk-MYTU26NE.js} +10 -9
- package/dist/chunk-N4KGLSBT.cjs +85 -0
- package/dist/chunk-N64ZJPCO.cjs +3 -0
- package/dist/chunk-NGKH2EEJ.cjs +326 -0
- package/dist/{chunk-PGEK6DFE.cjs → chunk-NIT46ZG7.cjs} +26 -25
- package/dist/{chunk-I2XZ2WMY.js → chunk-NJEGW6SX.js} +32 -31
- package/dist/{chunk-ZXKEYL6L.js → chunk-NJYCQEIR.js} +11 -10
- package/dist/chunk-NNDDH7H7.cjs +91 -0
- package/dist/chunk-NTKJSGK3.cjs +3 -0
- package/dist/chunk-NUQUDBTT.js +142 -0
- package/dist/chunk-NYRO7BWG.cjs +283 -0
- package/dist/chunk-OGVNBCOT.cjs +3 -0
- package/dist/{chunk-HQLB5Z37.cjs → chunk-OLWS65QZ.cjs} +22 -21
- package/dist/chunk-OO5T2XLL.js +13 -0
- package/dist/chunk-OYCYKMKG.js +2 -0
- package/dist/chunk-PDP4YT3H.js +61 -0
- package/dist/chunk-PIXN6IV7.js +2 -0
- package/dist/{chunk-DAO7YH2R.cjs → chunk-POKS6BSL.cjs} +13 -12
- package/dist/{chunk-Y3UCNSXF.js → chunk-PSMIDELA.js} +15 -14
- package/dist/chunk-PT736HBJ.js +27 -0
- package/dist/{chunk-HSXGQNQ6.js → chunk-PWKKLWBX.js} +10 -9
- package/dist/chunk-PWV4XF5I.js +198 -0
- package/dist/chunk-Q6ZVUGRJ.js +2 -0
- package/dist/chunk-Q7PT2DJ7.js +22 -0
- package/dist/chunk-QCUKTEYH.cjs +3 -0
- package/dist/{chunk-6LRDNOZX.cjs → chunk-QHFMQWSO.cjs} +9 -8
- package/dist/chunk-QNLWPVUI.cjs +149 -0
- package/dist/chunk-QVTEK35C.js +22 -0
- package/dist/chunk-QYR4WKJI.js +124 -0
- package/dist/chunk-R6MVKE2B.cjs +331 -0
- package/dist/chunk-R7T6GOUN.cjs +3 -0
- package/dist/chunk-RDU664LO.js +253 -0
- package/dist/{chunk-T533JPW5.js → chunk-RZNIXIJU.js} +18 -17
- package/dist/chunk-RZUCUWKB.js +104 -0
- package/dist/chunk-RZXU6H5L.js +202 -0
- package/dist/chunk-SELSORIZ.js +2 -0
- package/dist/chunk-SMK542RT.js +273 -0
- package/dist/{chunk-DUUDPN7C.cjs → chunk-SS6DGMZY.cjs} +15 -14
- package/dist/chunk-SVUVXYWK.cjs +225 -0
- package/dist/chunk-SVZT7RT3.js +2 -0
- package/dist/chunk-T4DK7EUO.js +93 -0
- package/dist/chunk-T7M6256W.cjs +3 -0
- package/dist/chunk-TBSUIWGD.cjs +3 -0
- package/dist/chunk-TH7GDZUC.js +2 -0
- package/dist/{chunk-5PAJS63K.cjs → chunk-TLP4LLIX.cjs} +18 -17
- package/dist/chunk-TTUJ3IQK.cjs +225 -0
- package/dist/chunk-TTVLRRPE.js +241 -0
- package/dist/chunk-TWAJYDMC.cjs +3 -0
- package/dist/chunk-U3X4QBY4.js +2 -0
- package/dist/chunk-U7MANZTW.cjs +3 -0
- package/dist/chunk-UCWS7WMQ.cjs +677 -0
- package/dist/{chunk-TVGVZSIA.js → chunk-UGDDUI2N.js} +9 -8
- package/dist/chunk-UORTZAPR.js +2 -0
- package/dist/chunk-UTYMDSOE.cjs +3 -0
- package/dist/chunk-UWQGY3GT.cjs +60 -0
- package/dist/{chunk-LYYMITLC.js → chunk-UZS7VXCA.js} +20 -21
- package/dist/chunk-VACQZKYM.cjs +44 -0
- package/dist/{chunk-UFUN2OKY.js → chunk-VDQ3DWO4.js} +1 -8
- package/dist/chunk-VKYDWRL2.cjs +3 -0
- package/dist/chunk-VRFYJ4BN.js +80 -0
- package/dist/{chunk-5ARTY5RT.cjs → chunk-W3VOEVRS.cjs} +8 -0
- package/dist/chunk-W7OZ3DOL.js +14 -0
- package/dist/{chunk-LYEOVFOQ.cjs → chunk-WG4KHU2E.cjs} +24 -23
- package/dist/chunk-WHM3QKTO.js +1012 -0
- package/dist/chunk-WINVYCMX.js +380 -0
- package/dist/{chunk-WVWVJSU2.cjs → chunk-WPTNMFHO.cjs} +18 -17
- package/dist/chunk-WVZMSS2Z.cjs +411 -0
- package/dist/chunk-WX7H4YUM.js +2 -0
- package/dist/chunk-X355AHLF.js +2 -0
- package/dist/chunk-X47PLMHL.js +304 -0
- package/dist/chunk-X7WVGTJK.js +2 -0
- package/dist/chunk-XL2A3RFS.js +202 -0
- package/dist/{chunk-LGBMJIY6.js → chunk-XQMLBUHW.js} +16 -15
- package/dist/chunk-XSTQSKRP.cjs +3 -0
- package/dist/chunk-Y36NEYSP.js +255 -0
- package/dist/chunk-Y3UDKEIY.cjs +3 -0
- package/dist/chunk-Y5PAW326.cjs +142 -0
- package/dist/{chunk-2Z4YKJMT.js → chunk-YEQVN7I3.js} +24 -23
- package/dist/chunk-YI6XXQMC.cjs +275 -0
- package/dist/{chunk-OCIKUJ3U.js → chunk-YJDQ3BQZ.js} +9 -8
- package/dist/{chunk-CGX6YCV6.js → chunk-YJR744JB.js} +12 -11
- package/dist/{chunk-7Y22U2ZF.js → chunk-YN2AVSEN.js} +33 -32
- package/dist/chunk-YNJA4HB2.js +307 -0
- package/dist/{chunk-WSL2OVTO.js → chunk-YRLEGHKB.js} +7 -6
- package/dist/{chunk-VDSMO63G.cjs → chunk-YTAX4ICP.cjs} +11 -10
- package/dist/chunk-YU7IOI63.js +2 -0
- package/dist/chunk-YUG4SGR5.js +68 -0
- package/dist/{chunk-VW32EE3I.js → chunk-YVGWCNLQ.js} +10 -9
- package/dist/chunk-Z6SMSENC.js +107 -0
- package/dist/{chunk-3NQ776G6.cjs → chunk-ZAQJBIYI.cjs} +19 -18
- package/dist/chunk-ZGKDMG7N.cjs +3 -0
- package/dist/{chunk-FGJDDSUJ.js → chunk-ZHGVBALA.js} +21 -20
- package/dist/chunk-ZIGUJXZM.js +2 -0
- package/dist/chunk-ZPYGXDFU.js +2 -0
- package/dist/{chunk-XUBFOAT4.js → chunk-ZSD56XUT.js} +17 -16
- package/dist/{chunk-2PABDSNH.cjs → chunk-ZX6JRBPY.cjs} +21 -20
- package/dist/components/accordion.cjs +8 -7
- package/dist/components/accordion.d.cts +1 -41
- package/dist/components/accordion.d.ts +1 -41
- package/dist/components/accordion.js +4 -3
- package/dist/components/ai.cjs +79 -0
- package/dist/components/ai.d.cts +1 -0
- package/dist/components/ai.d.ts +1 -0
- package/dist/components/ai.js +10 -0
- package/dist/components/alert.cjs +14 -0
- package/dist/components/alert.d.cts +1 -0
- package/dist/components/alert.d.ts +1 -0
- package/dist/components/alert.js +5 -0
- package/dist/components/avatar.cjs +21 -0
- package/dist/components/avatar.d.cts +1 -0
- package/dist/components/avatar.d.ts +1 -0
- package/dist/components/avatar.js +4 -0
- package/dist/components/badge.cjs +13 -0
- package/dist/components/badge.d.cts +1 -0
- package/dist/components/badge.d.ts +1 -0
- package/dist/components/badge.js +4 -0
- package/dist/components/bar-chart.cjs +17 -0
- package/dist/components/bar-chart.d.cts +1 -0
- package/dist/components/bar-chart.d.ts +1 -0
- package/dist/components/bar-chart.js +8 -0
- package/dist/components/breadcrumbs.cjs +17 -0
- package/dist/components/breadcrumbs.d.cts +1 -0
- package/dist/components/breadcrumbs.d.ts +1 -0
- package/dist/components/breadcrumbs.js +4 -0
- package/dist/components/button.cjs +18 -0
- package/dist/components/button.d.cts +1 -0
- package/dist/components/button.d.ts +1 -0
- package/dist/components/button.js +5 -0
- package/dist/components/calendar.cjs +6 -4
- package/dist/components/calendar.d.cts +1 -41
- package/dist/components/calendar.d.ts +1 -41
- package/dist/components/calendar.js +5 -3
- package/dist/components/card.cjs +25 -0
- package/dist/components/card.d.cts +1 -0
- package/dist/components/card.d.ts +1 -0
- package/dist/components/card.js +4 -0
- package/dist/components/chart.cjs +84 -0
- package/dist/components/chart.d.cts +1 -0
- package/dist/components/chart.d.ts +1 -0
- package/dist/components/chart.js +7 -0
- package/dist/components/checkbox.cjs +6 -4
- package/dist/components/checkbox.d.cts +1 -27
- package/dist/components/checkbox.d.ts +1 -27
- package/dist/components/checkbox.js +5 -3
- package/dist/components/chip-select.cjs +5 -4
- package/dist/components/chip-select.d.cts +1 -31
- package/dist/components/chip-select.d.ts +1 -31
- package/dist/components/chip-select.js +4 -3
- package/dist/components/clock.cjs +4 -3
- package/dist/components/clock.d.cts +1 -25
- package/dist/components/clock.d.ts +1 -25
- package/dist/components/clock.js +3 -2
- package/dist/components/color-picker.cjs +4 -3
- package/dist/components/color-picker.d.cts +1 -23
- package/dist/components/color-picker.d.ts +1 -23
- package/dist/components/color-picker.js +3 -2
- package/dist/components/command-palette.cjs +8 -7
- package/dist/components/command-palette.d.cts +1 -53
- package/dist/components/command-palette.d.ts +1 -53
- package/dist/components/command-palette.js +6 -5
- package/dist/components/date-picker.cjs +12 -8
- package/dist/components/date-picker.d.cts +1 -40
- package/dist/components/date-picker.d.ts +1 -40
- package/dist/components/date-picker.js +11 -7
- package/dist/components/dialog.cjs +23 -0
- package/dist/components/dialog.d.cts +1 -0
- package/dist/components/dialog.d.ts +1 -0
- package/dist/components/dialog.js +10 -0
- package/dist/components/donut-chart.cjs +21 -0
- package/dist/components/donut-chart.d.cts +1 -0
- package/dist/components/donut-chart.d.ts +1 -0
- package/dist/components/donut-chart.js +8 -0
- package/dist/components/drawer.cjs +7 -6
- package/dist/components/drawer.d.cts +1 -22
- package/dist/components/drawer.d.ts +1 -22
- package/dist/components/drawer.js +6 -5
- package/dist/components/empty-state.cjs +25 -0
- package/dist/components/empty-state.d.cts +1 -0
- package/dist/components/empty-state.d.ts +1 -0
- package/dist/components/empty-state.js +4 -0
- package/dist/components/floating-panel.cjs +5 -4
- package/dist/components/floating-panel.d.cts +1 -25
- package/dist/components/floating-panel.d.ts +1 -25
- package/dist/components/floating-panel.js +4 -3
- package/dist/components/heatmap.cjs +17 -0
- package/dist/components/heatmap.d.cts +1 -0
- package/dist/components/heatmap.d.ts +1 -0
- package/dist/components/heatmap.js +8 -0
- package/dist/components/hold-button.cjs +5 -4
- package/dist/components/hold-button.d.cts +1 -30
- package/dist/components/hold-button.d.ts +1 -30
- package/dist/components/hold-button.js +4 -3
- package/dist/components/knob.cjs +5 -4
- package/dist/components/knob.d.cts +1 -33
- package/dist/components/knob.d.ts +1 -33
- package/dist/components/knob.js +4 -3
- package/dist/components/line-chart.cjs +17 -0
- package/dist/components/line-chart.d.cts +1 -0
- package/dist/components/line-chart.d.ts +1 -0
- package/dist/components/line-chart.js +8 -0
- package/dist/components/magnetic-button.cjs +5 -4
- package/dist/components/magnetic-button.d.cts +1 -23
- package/dist/components/magnetic-button.d.ts +1 -23
- package/dist/components/magnetic-button.js +4 -3
- package/dist/components/mascots.cjs +33 -0
- package/dist/components/mascots.d.cts +1 -0
- package/dist/components/mascots.d.ts +1 -0
- package/dist/components/mascots.js +4 -0
- package/dist/components/menu.cjs +23 -0
- package/dist/components/menu.d.cts +1 -0
- package/dist/components/menu.d.ts +1 -0
- package/dist/components/menu.js +10 -0
- package/dist/components/morph-button.cjs +5 -4
- package/dist/components/morph-button.d.cts +1 -34
- package/dist/components/morph-button.d.ts +1 -34
- package/dist/components/morph-button.js +4 -3
- package/dist/components/morph-dialog.cjs +11 -10
- package/dist/components/morph-dialog.d.cts +1 -30
- package/dist/components/morph-dialog.d.ts +1 -30
- package/dist/components/morph-dialog.js +6 -5
- package/dist/components/number-field.cjs +5 -4
- package/dist/components/number-field.d.cts +1 -32
- package/dist/components/number-field.d.ts +1 -32
- package/dist/components/number-field.js +4 -3
- package/dist/components/pagination.cjs +19 -0
- package/dist/components/pagination.d.cts +1 -0
- package/dist/components/pagination.d.ts +1 -0
- package/dist/components/pagination.js +6 -0
- package/dist/components/pin-input.cjs +6 -4
- package/dist/components/pin-input.d.cts +1 -29
- package/dist/components/pin-input.d.ts +1 -29
- package/dist/components/pin-input.js +5 -3
- package/dist/components/popover.cjs +9 -6
- package/dist/components/popover.d.cts +1 -26
- package/dist/components/popover.d.ts +1 -26
- package/dist/components/popover.js +8 -5
- package/dist/components/progress.cjs +5 -4
- package/dist/components/progress.d.cts +1 -39
- package/dist/components/progress.d.ts +1 -39
- package/dist/components/progress.js +3 -2
- package/dist/components/radial-menu.cjs +6 -5
- package/dist/components/radial-menu.d.cts +1 -31
- package/dist/components/radial-menu.d.ts +1 -31
- package/dist/components/radial-menu.js +5 -4
- package/dist/components/radio-group.cjs +5 -4
- package/dist/components/radio-group.d.cts +1 -34
- package/dist/components/radio-group.d.ts +1 -34
- package/dist/components/radio-group.js +4 -3
- package/dist/components/resizable-panels.cjs +6 -5
- package/dist/components/resizable-panels.d.cts +1 -24
- package/dist/components/resizable-panels.d.ts +1 -24
- package/dist/components/resizable-panels.js +4 -3
- package/dist/components/segmented-control.cjs +6 -4
- package/dist/components/segmented-control.d.cts +1 -34
- package/dist/components/segmented-control.d.ts +1 -34
- package/dist/components/segmented-control.js +5 -3
- package/dist/components/select.cjs +20 -0
- package/dist/components/select.d.cts +1 -0
- package/dist/components/select.d.ts +1 -0
- package/dist/components/select.js +11 -0
- package/dist/components/skeleton.cjs +17 -0
- package/dist/components/skeleton.d.cts +1 -0
- package/dist/components/skeleton.d.ts +1 -0
- package/dist/components/skeleton.js +4 -0
- package/dist/components/slider.cjs +5 -4
- package/dist/components/slider.d.cts +1 -39
- package/dist/components/slider.d.ts +1 -39
- package/dist/components/slider.js +4 -3
- package/dist/components/sortable-list.cjs +5 -4
- package/dist/components/sortable-list.d.cts +1 -24
- package/dist/components/sortable-list.d.ts +1 -24
- package/dist/components/sortable-list.js +4 -3
- package/dist/components/sparkline.cjs +5 -4
- package/dist/components/sparkline.d.cts +1 -28
- package/dist/components/sparkline.d.ts +1 -28
- package/dist/components/sparkline.js +4 -3
- package/dist/components/stat.cjs +23 -0
- package/dist/components/stat.d.cts +1 -0
- package/dist/components/stat.d.ts +1 -0
- package/dist/components/stat.js +6 -0
- package/dist/components/stepper.cjs +14 -0
- package/dist/components/stepper.d.cts +1 -0
- package/dist/components/stepper.d.ts +1 -0
- package/dist/components/stepper.js +5 -0
- package/dist/components/swipe-confirm.cjs +5 -4
- package/dist/components/swipe-confirm.d.cts +1 -18
- package/dist/components/swipe-confirm.d.ts +1 -18
- package/dist/components/swipe-confirm.js +4 -3
- package/dist/components/switch.cjs +6 -4
- package/dist/components/switch.d.cts +1 -29
- package/dist/components/switch.d.ts +1 -29
- package/dist/components/switch.js +5 -3
- package/dist/components/tabs.cjs +9 -8
- package/dist/components/tabs.d.cts +1 -29
- package/dist/components/tabs.d.ts +1 -29
- package/dist/components/tabs.js +4 -3
- package/dist/components/tether.cjs +5 -4
- package/dist/components/tether.d.cts +1 -35
- package/dist/components/tether.d.ts +1 -35
- package/dist/components/tether.js +3 -2
- package/dist/components/text-field.cjs +31 -0
- package/dist/components/text-field.d.cts +1 -0
- package/dist/components/text-field.d.ts +1 -0
- package/dist/components/text-field.js +6 -0
- package/dist/components/theme-switch.cjs +5 -4
- package/dist/components/theme-switch.d.cts +1 -24
- package/dist/components/theme-switch.d.ts +1 -24
- package/dist/components/theme-switch.js +4 -3
- package/dist/components/toaster.cjs +7 -6
- package/dist/components/toaster.d.cts +1 -71
- package/dist/components/toaster.d.ts +1 -71
- package/dist/components/toaster.js +4 -3
- package/dist/components/tooltip.cjs +17 -0
- package/dist/components/tooltip.d.cts +1 -0
- package/dist/components/tooltip.d.ts +1 -0
- package/dist/components/tooltip.js +8 -0
- package/dist/components/wheel-picker.cjs +5 -4
- package/dist/components/wheel-picker.d.cts +1 -27
- package/dist/components/wheel-picker.d.ts +1 -27
- package/dist/components/wheel-picker.js +4 -3
- package/dist/css/accordion.css +1 -1
- package/dist/css/ai-chat.css +2 -0
- package/dist/css/ai.css +2 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/app-shell.css +2 -0
- package/dist/css/auth.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/base.css +1 -1
- package/dist/css/breadcrumbs.css +2 -0
- package/dist/css/button.css +2 -0
- package/dist/css/calendar.css +1 -1
- package/dist/css/card.css +2 -0
- package/dist/css/chart.css +2 -0
- package/dist/css/checkbox.css +1 -1
- package/dist/css/chip-select.css +1 -1
- package/dist/css/clock.css +1 -1
- package/dist/css/color-picker.css +1 -1
- package/dist/css/command-palette.css +1 -1
- package/dist/css/dashboard.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-picker.css +1 -1
- package/dist/css/dialog.css +2 -0
- package/dist/css/drawer.css +1 -1
- package/dist/css/empty-state.css +2 -0
- package/dist/css/floating-panel.css +1 -1
- package/dist/css/forms.css +2 -0
- package/dist/css/hold-button.css +1 -1
- package/dist/css/kanban.css +2 -0
- package/dist/css/knob.css +1 -1
- package/dist/css/magnetic-button.css +1 -1
- package/dist/css/mascots.css +2 -0
- package/dist/css/menu.css +2 -0
- package/dist/css/modals.css +2 -0
- package/dist/css/morph-button.css +1 -1
- package/dist/css/morph-dialog.css +1 -1
- package/dist/css/notifications.css +2 -0
- package/dist/css/number-field.css +1 -1
- package/dist/css/pagination.css +2 -0
- package/dist/css/permissions.css +2 -0
- package/dist/css/pin-input.css +1 -1
- package/dist/css/popover.css +1 -1
- package/dist/css/progress.css +1 -1
- package/dist/css/radial-menu.css +1 -1
- package/dist/css/radio-group.css +1 -1
- package/dist/css/resizable-panels.css +1 -1
- package/dist/css/scheduling.css +2 -0
- package/dist/css/segmented-control.css +1 -1
- package/dist/css/select.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +1 -1
- package/dist/css/sortable-list.css +1 -1
- package/dist/css/sparkline.css +1 -1
- package/dist/css/stepper.css +2 -0
- package/dist/css/swipe-confirm.css +1 -1
- package/dist/css/switch.css +1 -1
- package/dist/css/tabs.css +1 -1
- package/dist/css/template-auth.css +2 -0
- package/dist/css/template-calendar.css +2 -0
- package/dist/css/template-crm.css +2 -0
- package/dist/css/template-dashboard.css +2 -0
- package/dist/css/template-orders.css +2 -0
- package/dist/css/template-settings.css +2 -0
- package/dist/css/template-shared.css +2 -0
- package/dist/css/tether.css +1 -1
- package/dist/css/text-field.css +2 -0
- package/dist/css/theme-switch.css +1 -1
- package/dist/css/toaster.css +1 -1
- package/dist/css/tooltip.css +2 -0
- package/dist/css/wheel-picker.css +1 -1
- package/dist/index.cjs +687 -108
- package/dist/index.d.cts +3141 -36
- package/dist/index.d.ts +3141 -36
- package/dist/index.js +120 -37
- package/dist/styles.css +1 -1
- package/dist/templates/auth.cjs +22 -0
- package/dist/templates/auth.d.cts +1 -0
- package/dist/templates/auth.d.ts +1 -0
- package/dist/templates/auth.js +13 -0
- package/dist/templates/calendar.cjs +40 -0
- package/dist/templates/calendar.d.cts +1 -0
- package/dist/templates/calendar.d.ts +1 -0
- package/dist/templates/calendar.js +31 -0
- package/dist/templates/crm.cjs +43 -0
- package/dist/templates/crm.d.cts +1 -0
- package/dist/templates/crm.d.ts +1 -0
- package/dist/templates/crm.js +34 -0
- package/dist/templates/dashboard.cjs +46 -0
- package/dist/templates/dashboard.d.cts +1 -0
- package/dist/templates/dashboard.d.ts +1 -0
- package/dist/templates/dashboard.js +37 -0
- package/dist/templates/orders.cjs +45 -0
- package/dist/templates/orders.d.cts +1 -0
- package/dist/templates/orders.d.ts +1 -0
- package/dist/templates/orders.js +36 -0
- package/dist/templates/settings.cjs +47 -0
- package/dist/templates/settings.d.cts +1 -0
- package/dist/templates/settings.d.ts +1 -0
- package/dist/templates/settings.js +38 -0
- package/package.json +122 -98
package/dist/index.d.cts
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { MorphButton, MorphButtonProps, MorphButtonVariant, MorphStatus } from './components/morph-button.cjs';
|
|
3
|
-
export { HoldButton, HoldButtonProps, HoldButtonVariant } from './components/hold-button.cjs';
|
|
4
|
-
export { Switch, SwitchProps, SwitchVariant } from './components/switch.cjs';
|
|
5
|
-
export { Theme, ThemeSwitch, ThemeSwitchProps, ThemeSwitchVariant } from './components/theme-switch.cjs';
|
|
6
|
-
export { Checkbox, CheckboxProps, CheckboxVariant, CheckedState } from './components/checkbox.cjs';
|
|
7
|
-
export { SegmentedControl, SegmentedControlProps, SegmentedControlVariant, SegmentedOption } from './components/segmented-control.cjs';
|
|
8
|
-
export { RadioGroup, RadioGroupProps, RadioGroupVariant, RadioOption } from './components/radio-group.cjs';
|
|
9
|
-
export { ChipOption, ChipSelect, ChipSelectProps, ChipSelectVariant } from './components/chip-select.cjs';
|
|
10
|
-
export { Slider, SliderProps, SliderVariant } from './components/slider.cjs';
|
|
11
|
-
export { Knob, KnobProps, KnobVariant } from './components/knob.cjs';
|
|
12
|
-
export { NumberField, NumberFieldProps, NumberFieldVariant } from './components/number-field.cjs';
|
|
13
|
-
export { PinInput, PinInputProps, PinInputVariant, PinStatus } from './components/pin-input.cjs';
|
|
14
|
-
export { Calendar, CalendarProps, CalendarRangeProps, CalendarSingleProps, DateRange } from './components/calendar.cjs';
|
|
15
|
-
export { Popover, PopoverPlacement, PopoverProps, PopoverSide } from './components/popover.cjs';
|
|
16
|
-
export { DatePicker, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps } from './components/date-picker.cjs';
|
|
17
|
-
export { WheelOption, WheelPicker, WheelPickerProps } from './components/wheel-picker.cjs';
|
|
18
|
-
export { ToastAction, ToastData, ToastOptions, ToastType, Toaster, ToasterPosition, ToasterProps, ToasterVariant, toast, useToasts } from './components/toaster.cjs';
|
|
19
|
-
export { Loader, LoaderProps, LoaderVariant, Progress, ProgressProps, ProgressVariant } from './components/progress.cjs';
|
|
20
|
-
export { SwipeConfirm, SwipeConfirmProps } from './components/swipe-confirm.cjs';
|
|
21
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionMultipleProps, AccordionProps, AccordionSingleProps, AccordionTrigger, AccordionTriggerProps, AccordionVariant } from './components/accordion.cjs';
|
|
22
|
-
export { Tabs, TabsContent, TabsContentProps, TabsList, TabsPanels, TabsProps, TabsTrigger, TabsTriggerProps, TabsVariant } from './components/tabs.cjs';
|
|
23
|
-
export { CommandItem, CommandPalette, CommandPaletteProps, fuzzyMatch } from './components/command-palette.cjs';
|
|
24
|
-
export { MorphDialog, MorphDialogClose, MorphDialogContent, MorphDialogContentProps, MorphDialogProps, MorphDialogTitle, MorphDialogTrigger, MorphDialogTriggerProps } from './components/morph-dialog.cjs';
|
|
25
|
-
export { Drawer, DrawerProps } from './components/drawer.cjs';
|
|
26
|
-
export { ResizablePanel, ResizablePanelProps, ResizablePanels, ResizablePanelsProps } from './components/resizable-panels.cjs';
|
|
27
|
-
export { SortableList, SortableListProps, SortableRenderState } from './components/sortable-list.cjs';
|
|
28
|
-
export { Corner, FloatingPanel, FloatingPanelProps } from './components/floating-panel.cjs';
|
|
29
|
-
export { ColorPicker, ColorPickerProps, ColorPickerVariant } from './components/color-picker.cjs';
|
|
30
|
-
export { Clock, ClockProps, ClockVariant } from './components/clock.cjs';
|
|
31
|
-
export { Tether, TetherField, TetherFieldProps, TetherProps, TetherSide } from './components/tether.cjs';
|
|
32
|
-
export { RadialMenu, RadialMenuItem, RadialMenuProps } from './components/radial-menu.cjs';
|
|
33
|
-
export { Sparkline, SparklineProps, SparklineVariant } from './components/sparkline.cjs';
|
|
34
|
-
import 'react';
|
|
1
|
+
import * as React from 'react';
|
|
35
2
|
|
|
36
3
|
/**
|
|
37
4
|
* Spring presets shared by every Seppia component.
|
|
@@ -73,5 +40,3143 @@ declare const springs: {
|
|
|
73
40
|
};
|
|
74
41
|
type SpringName = keyof typeof springs;
|
|
75
42
|
|
|
76
|
-
|
|
77
|
-
|
|
43
|
+
type MagneticButtonVariant = 'magnetic' | 'elastic';
|
|
44
|
+
type ButtonTone = 'ink' | 'accent' | 'outline' | 'ghost';
|
|
45
|
+
interface MagneticButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
46
|
+
/**
|
|
47
|
+
* `magnetic` — the button is pulled toward the cursor; its label travels further (parallax).
|
|
48
|
+
* `elastic` — the surface stretches toward the cursor like a membrane, the label stays crisp.
|
|
49
|
+
*/
|
|
50
|
+
variant?: MagneticButtonVariant;
|
|
51
|
+
tone?: ButtonTone;
|
|
52
|
+
size?: 'sm' | 'md' | 'lg';
|
|
53
|
+
/** 0–1. How strongly the cursor pulls. */
|
|
54
|
+
strength?: number;
|
|
55
|
+
/** Extra distance (px) around the button where the pull starts. */
|
|
56
|
+
radius?: number;
|
|
57
|
+
/** Element rendered before the label. */
|
|
58
|
+
icon?: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
declare const MagneticButton: React.ForwardRefExoticComponent<MagneticButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
61
|
+
|
|
62
|
+
type MorphStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
63
|
+
type MorphButtonVariant = 'collapse' | 'inline' | 'progress';
|
|
64
|
+
interface MorphButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
|
|
65
|
+
/**
|
|
66
|
+
* Runs when clicked. Return a promise and the button follows it:
|
|
67
|
+
* loading while pending, success on resolve, error on reject.
|
|
68
|
+
*/
|
|
69
|
+
onAction?: (event: React.MouseEvent<HTMLButtonElement>) => Promise<unknown> | unknown;
|
|
70
|
+
/** Control the status yourself instead of using `onAction`'s promise. */
|
|
71
|
+
status?: MorphStatus;
|
|
72
|
+
/**
|
|
73
|
+
* `collapse` — the button contracts into a spinner, then blooms into the result.
|
|
74
|
+
* `inline` — the label rewrites itself while the width follows the new text.
|
|
75
|
+
* `progress` — a determinate fill sweeps under the label (pass `progress`).
|
|
76
|
+
*/
|
|
77
|
+
variant?: MorphButtonVariant;
|
|
78
|
+
/** 0–1, used by the `progress` variant while loading. */
|
|
79
|
+
progress?: number;
|
|
80
|
+
loadingLabel?: React.ReactNode;
|
|
81
|
+
successLabel?: React.ReactNode;
|
|
82
|
+
errorLabel?: React.ReactNode;
|
|
83
|
+
/** Return to idle after success/error (ms). `0` keeps the final state. */
|
|
84
|
+
resetAfter?: number;
|
|
85
|
+
tone?: 'ink' | 'accent';
|
|
86
|
+
size?: 'sm' | 'md' | 'lg';
|
|
87
|
+
haptics?: boolean;
|
|
88
|
+
onStatusChange?: (status: MorphStatus) => void;
|
|
89
|
+
}
|
|
90
|
+
declare const MorphButton: React.ForwardRefExoticComponent<MorphButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
91
|
+
|
|
92
|
+
type HoldButtonVariant = 'fill' | 'ring' | 'fuse';
|
|
93
|
+
interface HoldButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
|
|
94
|
+
/** Called once the hold completes. */
|
|
95
|
+
onConfirm?: () => void;
|
|
96
|
+
/** Hold duration in milliseconds. */
|
|
97
|
+
duration?: number;
|
|
98
|
+
/**
|
|
99
|
+
* `fill` — colour floods under the label; the label inverts where it passes.
|
|
100
|
+
* `ring` — a compact icon button whose ring closes around it.
|
|
101
|
+
* `fuse` — a spark burns around the border.
|
|
102
|
+
*/
|
|
103
|
+
variant?: HoldButtonVariant;
|
|
104
|
+
tone?: 'danger' | 'ink' | 'accent';
|
|
105
|
+
size?: 'sm' | 'md' | 'lg';
|
|
106
|
+
/** Label shown after confirming. */
|
|
107
|
+
confirmedLabel?: React.ReactNode;
|
|
108
|
+
/** Icon for the `ring` variant. */
|
|
109
|
+
icon?: React.ReactNode;
|
|
110
|
+
/** Return to the initial state after confirming (ms). `0` keeps it confirmed. */
|
|
111
|
+
resetAfter?: number;
|
|
112
|
+
haptics?: boolean;
|
|
113
|
+
/** Fires with 0–1 while holding. */
|
|
114
|
+
onHoldProgress?: (progress: number) => void;
|
|
115
|
+
}
|
|
116
|
+
declare const HoldButton: React.ForwardRefExoticComponent<HoldButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
117
|
+
|
|
118
|
+
type SwitchVariant = 'toggle' | 'rocker' | 'label';
|
|
119
|
+
interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'value' | 'defaultValue' | 'children'> {
|
|
120
|
+
/** Controlled state. */
|
|
121
|
+
checked?: boolean;
|
|
122
|
+
/** Initial state when uncontrolled. */
|
|
123
|
+
defaultChecked?: boolean;
|
|
124
|
+
/** Called with the next state whenever the user toggles. */
|
|
125
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
126
|
+
/**
|
|
127
|
+
* `toggle` — squishy knob that stretches on press and can be dragged.
|
|
128
|
+
* `rocker` — a 3D rocker paddle that tilts under the finger.
|
|
129
|
+
* `label` — a wider track whose text is pushed along by the knob.
|
|
130
|
+
*/
|
|
131
|
+
variant?: SwitchVariant;
|
|
132
|
+
size?: 'sm' | 'md' | 'lg';
|
|
133
|
+
/** Text for the off / on states (`label` and `rocker` variants). */
|
|
134
|
+
labels?: [off: string, on: string];
|
|
135
|
+
/** Form field name. When set, a hidden input submits `value` while checked. */
|
|
136
|
+
name?: string;
|
|
137
|
+
value?: string;
|
|
138
|
+
/** Vibrate on supported devices when the state changes. */
|
|
139
|
+
haptics?: boolean;
|
|
140
|
+
}
|
|
141
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
142
|
+
|
|
143
|
+
type Theme = 'light' | 'dark' | 'system';
|
|
144
|
+
type ThemeSwitchVariant = 'eclipse' | 'horizon' | 'segmented';
|
|
145
|
+
interface ThemeSwitchProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'defaultValue' | 'onSelect'> {
|
|
146
|
+
value?: Theme;
|
|
147
|
+
defaultValue?: Theme;
|
|
148
|
+
onValueChange?: (theme: Theme) => void;
|
|
149
|
+
/**
|
|
150
|
+
* `eclipse` — icon button; rays retract while a shadow carves the crescent.
|
|
151
|
+
* `horizon` — sun and moon ride a wheel that turns behind the horizon.
|
|
152
|
+
* `segmented` — explicit light / system / dark selector.
|
|
153
|
+
*/
|
|
154
|
+
variant?: ThemeSwitchVariant;
|
|
155
|
+
size?: 'sm' | 'md' | 'lg';
|
|
156
|
+
/** Accessible label for the binary variants. */
|
|
157
|
+
label?: string;
|
|
158
|
+
disabled?: boolean;
|
|
159
|
+
haptics?: boolean;
|
|
160
|
+
}
|
|
161
|
+
declare const ThemeSwitch: React.ForwardRefExoticComponent<ThemeSwitchProps & React.RefAttributes<HTMLElement>>;
|
|
162
|
+
|
|
163
|
+
type CheckedState = boolean | 'indeterminate';
|
|
164
|
+
type CheckboxVariant = 'draw' | 'ink' | 'strike';
|
|
165
|
+
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'defaultChecked' | 'onChange' | 'size' | 'children'> {
|
|
166
|
+
checked?: CheckedState;
|
|
167
|
+
defaultChecked?: CheckedState;
|
|
168
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
169
|
+
/**
|
|
170
|
+
* `draw` — the stroke draws itself and morphs into a dash when indeterminate.
|
|
171
|
+
* `ink` — fill floods outward from the exact point you pressed.
|
|
172
|
+
* `strike` — round, to-do style; the label is struck through.
|
|
173
|
+
*/
|
|
174
|
+
variant?: CheckboxVariant;
|
|
175
|
+
size?: 'sm' | 'md' | 'lg';
|
|
176
|
+
/** Visible label. */
|
|
177
|
+
children?: React.ReactNode;
|
|
178
|
+
/** Secondary text below the label. */
|
|
179
|
+
description?: React.ReactNode;
|
|
180
|
+
haptics?: boolean;
|
|
181
|
+
/** Props for the outer label element. */
|
|
182
|
+
rootProps?: React.LabelHTMLAttributes<HTMLLabelElement>;
|
|
183
|
+
}
|
|
184
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
185
|
+
|
|
186
|
+
interface SegmentedOption<T extends string = string> {
|
|
187
|
+
value: T;
|
|
188
|
+
label?: React.ReactNode;
|
|
189
|
+
icon?: React.ReactNode;
|
|
190
|
+
disabled?: boolean;
|
|
191
|
+
/** Required when the option only has an icon. */
|
|
192
|
+
'aria-label'?: string;
|
|
193
|
+
}
|
|
194
|
+
type SegmentedControlVariant = 'pill' | 'elastic' | 'underline';
|
|
195
|
+
interface SegmentedControlProps<T extends string = string> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
196
|
+
options: ReadonlyArray<SegmentedOption<T> | T>;
|
|
197
|
+
value?: T;
|
|
198
|
+
defaultValue?: T;
|
|
199
|
+
onValueChange?: (value: T) => void;
|
|
200
|
+
/**
|
|
201
|
+
* `pill` — a solid indicator; labels invert exactly where it overlaps them.
|
|
202
|
+
* `elastic` — the leading edge outruns the trailing one, so the indicator stretches in flight.
|
|
203
|
+
* `underline` — a stretching line for tab-like contexts.
|
|
204
|
+
*/
|
|
205
|
+
variant?: SegmentedControlVariant;
|
|
206
|
+
size?: 'sm' | 'md' | 'lg';
|
|
207
|
+
/** Stretch options to fill the container width. */
|
|
208
|
+
fullWidth?: boolean;
|
|
209
|
+
disabled?: boolean;
|
|
210
|
+
haptics?: boolean;
|
|
211
|
+
}
|
|
212
|
+
declare const SegmentedControl: <T extends string = string>(props: SegmentedControlProps<T> & {
|
|
213
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
214
|
+
}) => React.ReactElement;
|
|
215
|
+
|
|
216
|
+
interface RadioOption<T extends string = string> {
|
|
217
|
+
value: T;
|
|
218
|
+
label: React.ReactNode;
|
|
219
|
+
description?: React.ReactNode;
|
|
220
|
+
disabled?: boolean;
|
|
221
|
+
}
|
|
222
|
+
type RadioGroupVariant = 'leap' | 'slide' | 'ring';
|
|
223
|
+
interface RadioGroupProps<T extends string = string> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
224
|
+
options: ReadonlyArray<RadioOption<T>>;
|
|
225
|
+
value?: T;
|
|
226
|
+
defaultValue?: T;
|
|
227
|
+
onValueChange?: (value: T) => void;
|
|
228
|
+
/**
|
|
229
|
+
* `leap` — a single dot jumps along an arc from the old choice to the new one.
|
|
230
|
+
* `slide` — the whole row highlight glides to the selection.
|
|
231
|
+
* `ring` — the ring tightens around the selection with an elastic overshoot.
|
|
232
|
+
*/
|
|
233
|
+
variant?: RadioGroupVariant;
|
|
234
|
+
orientation?: 'vertical' | 'horizontal';
|
|
235
|
+
size?: 'sm' | 'md' | 'lg';
|
|
236
|
+
/** Native input name. Generated when omitted. */
|
|
237
|
+
name?: string;
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
required?: boolean;
|
|
240
|
+
haptics?: boolean;
|
|
241
|
+
}
|
|
242
|
+
declare const RadioGroup: <T extends string = string>(props: RadioGroupProps<T> & {
|
|
243
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
244
|
+
}) => React.ReactElement;
|
|
245
|
+
|
|
246
|
+
interface ChipOption<T extends string = string> {
|
|
247
|
+
value: T;
|
|
248
|
+
label: React.ReactNode;
|
|
249
|
+
icon?: React.ReactNode;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
}
|
|
252
|
+
type ChipSelectVariant = 'check' | 'rank';
|
|
253
|
+
interface ChipSelectProps<T extends string = string> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
254
|
+
options: ReadonlyArray<ChipOption<T> | T>;
|
|
255
|
+
value?: T[];
|
|
256
|
+
defaultValue?: T[];
|
|
257
|
+
onValueChange?: (value: T[]) => void;
|
|
258
|
+
/**
|
|
259
|
+
* `check` — chips grow a check mark; the row reflows around them.
|
|
260
|
+
* `rank` — selection order matters; chips carry their rank and renumber live.
|
|
261
|
+
*/
|
|
262
|
+
variant?: ChipSelectVariant;
|
|
263
|
+
/** Maximum number of selected chips. Extra attempts are refused with a shake. */
|
|
264
|
+
max?: number;
|
|
265
|
+
size?: 'sm' | 'md' | 'lg';
|
|
266
|
+
disabled?: boolean;
|
|
267
|
+
haptics?: boolean;
|
|
268
|
+
}
|
|
269
|
+
declare const ChipSelect: <T extends string = string>(props: ChipSelectProps<T> & {
|
|
270
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
271
|
+
}) => React.ReactElement;
|
|
272
|
+
|
|
273
|
+
type SliderVariant = 'thumb' | 'bar' | 'detent';
|
|
274
|
+
type Range = [number, number];
|
|
275
|
+
interface SliderProps<T extends number | Range = number> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'children'> {
|
|
276
|
+
/** A number, or a `[start, end]` tuple for a range slider. */
|
|
277
|
+
value?: T;
|
|
278
|
+
defaultValue?: T;
|
|
279
|
+
onValueChange?: (value: T) => void;
|
|
280
|
+
/** Fires when the user releases the pointer or changes the value from the keyboard. */
|
|
281
|
+
onValueCommit?: (value: T) => void;
|
|
282
|
+
min?: number;
|
|
283
|
+
max?: number;
|
|
284
|
+
step?: number;
|
|
285
|
+
/**
|
|
286
|
+
* `thumb` — over-drag stretches the track; the value bubble swings with velocity.
|
|
287
|
+
* `bar` — a thick, iOS-style bar dragged relatively; its label inverts under the fill.
|
|
288
|
+
* `detent` — a fader that clicks from step to step.
|
|
289
|
+
*/
|
|
290
|
+
variant?: SliderVariant;
|
|
291
|
+
size?: 'sm' | 'md' | 'lg';
|
|
292
|
+
/** Visible label (bar variant) and accessible name. */
|
|
293
|
+
label?: string;
|
|
294
|
+
/** When to show the value: in a bubble (thumb) or text (bar, detent). */
|
|
295
|
+
showValue?: 'auto' | 'always' | 'never';
|
|
296
|
+
formatValue?: (value: number) => string;
|
|
297
|
+
/** Explicit tick positions for the `detent` variant. */
|
|
298
|
+
marks?: number[];
|
|
299
|
+
disabled?: boolean;
|
|
300
|
+
haptics?: boolean;
|
|
301
|
+
/** Native form field name. */
|
|
302
|
+
name?: string;
|
|
303
|
+
}
|
|
304
|
+
declare const Slider: <T extends number | Range = number>(props: SliderProps<T> & {
|
|
305
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
306
|
+
}) => React.ReactElement;
|
|
307
|
+
|
|
308
|
+
type KnobVariant = 'arc' | 'machined';
|
|
309
|
+
interface KnobProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
310
|
+
value?: number;
|
|
311
|
+
defaultValue?: number;
|
|
312
|
+
onValueChange?: (value: number) => void;
|
|
313
|
+
onValueCommit?: (value: number) => void;
|
|
314
|
+
min?: number;
|
|
315
|
+
max?: number;
|
|
316
|
+
step?: number;
|
|
317
|
+
/**
|
|
318
|
+
* `arc` — a thin dial with a sweeping fill and a centred readout.
|
|
319
|
+
* `machined` — a physical knob with a knurled edge and a lit tick ring.
|
|
320
|
+
*/
|
|
321
|
+
variant?: KnobVariant;
|
|
322
|
+
/** Diameter in pixels. */
|
|
323
|
+
size?: number;
|
|
324
|
+
/** Sweep of the dial in degrees. */
|
|
325
|
+
arc?: number;
|
|
326
|
+
label?: string;
|
|
327
|
+
formatValue?: (value: number) => string;
|
|
328
|
+
/** Number of tick marks (machined variant). */
|
|
329
|
+
ticks?: number;
|
|
330
|
+
/** Pixels of drag for a full sweep. Hold Shift for fine control. */
|
|
331
|
+
sensitivity?: number;
|
|
332
|
+
disabled?: boolean;
|
|
333
|
+
haptics?: boolean;
|
|
334
|
+
}
|
|
335
|
+
declare const Knob: React.ForwardRefExoticComponent<KnobProps & React.RefAttributes<HTMLDivElement>>;
|
|
336
|
+
|
|
337
|
+
type NumberFieldVariant = 'split' | 'scrub';
|
|
338
|
+
interface NumberFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
339
|
+
value?: number;
|
|
340
|
+
defaultValue?: number;
|
|
341
|
+
onValueChange?: (value: number) => void;
|
|
342
|
+
min?: number;
|
|
343
|
+
max?: number;
|
|
344
|
+
step?: number;
|
|
345
|
+
/**
|
|
346
|
+
* `split` — minus / value / plus; hold a button to repeat with acceleration.
|
|
347
|
+
* `scrub` — drag the label sideways to change the value, like a design tool.
|
|
348
|
+
*/
|
|
349
|
+
variant?: NumberFieldVariant;
|
|
350
|
+
label?: string;
|
|
351
|
+
/** Formatting for the rolling display, e.g. `{ style: 'currency', currency: 'EUR' }`. */
|
|
352
|
+
format?: Intl.NumberFormatOptions;
|
|
353
|
+
locale?: string;
|
|
354
|
+
/** Static text before the value, e.g. "$". */
|
|
355
|
+
prefix?: string;
|
|
356
|
+
/** Static text after the value, e.g. "px". */
|
|
357
|
+
suffix?: string;
|
|
358
|
+
size?: 'sm' | 'md' | 'lg';
|
|
359
|
+
disabled?: boolean;
|
|
360
|
+
haptics?: boolean;
|
|
361
|
+
name?: string;
|
|
362
|
+
}
|
|
363
|
+
declare const NumberField: React.ForwardRefExoticComponent<NumberFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
364
|
+
|
|
365
|
+
type PinStatus = 'idle' | 'error' | 'success';
|
|
366
|
+
type PinInputVariant = 'cells' | 'line';
|
|
367
|
+
interface PinInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'type'> {
|
|
368
|
+
length?: number;
|
|
369
|
+
value?: string;
|
|
370
|
+
defaultValue?: string;
|
|
371
|
+
onValueChange?: (value: string) => void;
|
|
372
|
+
/** Called once every cell is filled. */
|
|
373
|
+
onComplete?: (value: string) => void;
|
|
374
|
+
/** `numeric` accepts digits only. */
|
|
375
|
+
type?: 'numeric' | 'alphanumeric';
|
|
376
|
+
/** Show dots instead of characters. */
|
|
377
|
+
mask?: boolean;
|
|
378
|
+
/** Drive feedback from validation: `error` shakes, `success` ripples. */
|
|
379
|
+
status?: PinStatus;
|
|
380
|
+
/**
|
|
381
|
+
* `cells` — framed cells with a caret that glides between them.
|
|
382
|
+
* `line` — minimal underlines that fill as you type.
|
|
383
|
+
*/
|
|
384
|
+
variant?: PinInputVariant;
|
|
385
|
+
size?: 'sm' | 'md' | 'lg';
|
|
386
|
+
haptics?: boolean;
|
|
387
|
+
}
|
|
388
|
+
declare const PinInput: React.ForwardRefExoticComponent<PinInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
389
|
+
|
|
390
|
+
interface DateRange {
|
|
391
|
+
start: Date | null;
|
|
392
|
+
end: Date | null;
|
|
393
|
+
}
|
|
394
|
+
interface CalendarBaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
395
|
+
/** The month in view (controlled). */
|
|
396
|
+
month?: Date;
|
|
397
|
+
defaultMonth?: Date;
|
|
398
|
+
onMonthChange?: (month: Date) => void;
|
|
399
|
+
min?: Date;
|
|
400
|
+
max?: Date;
|
|
401
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
402
|
+
/** 0 = Sunday, 1 = Monday. */
|
|
403
|
+
weekStartsOn?: 0 | 1;
|
|
404
|
+
/** BCP 47 locale for month and weekday names. */
|
|
405
|
+
locale?: string;
|
|
406
|
+
showOutsideDays?: boolean;
|
|
407
|
+
size?: 'sm' | 'md' | 'lg';
|
|
408
|
+
haptics?: boolean;
|
|
409
|
+
/** Override "today" (useful for tests and fixed demos). */
|
|
410
|
+
today?: Date;
|
|
411
|
+
}
|
|
412
|
+
interface CalendarSingleProps extends CalendarBaseProps {
|
|
413
|
+
mode?: 'single';
|
|
414
|
+
value?: Date | null;
|
|
415
|
+
defaultValue?: Date | null;
|
|
416
|
+
onValueChange?: (value: Date | null) => void;
|
|
417
|
+
}
|
|
418
|
+
interface CalendarRangeProps extends CalendarBaseProps {
|
|
419
|
+
mode: 'range';
|
|
420
|
+
value?: DateRange;
|
|
421
|
+
defaultValue?: DateRange;
|
|
422
|
+
onValueChange?: (value: DateRange) => void;
|
|
423
|
+
}
|
|
424
|
+
type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
425
|
+
declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
426
|
+
|
|
427
|
+
type PopoverSide = 'top' | 'bottom' | 'left' | 'right';
|
|
428
|
+
type PopoverPlacement = PopoverSide | `${PopoverSide}-start` | `${PopoverSide}-end`;
|
|
429
|
+
interface PopoverProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content' | 'children'> {
|
|
430
|
+
open?: boolean;
|
|
431
|
+
defaultOpen?: boolean;
|
|
432
|
+
onOpenChange?: (open: boolean) => void;
|
|
433
|
+
/** Popover body. A function receives `close`. */
|
|
434
|
+
content: React.ReactNode | ((close: () => void) => React.ReactNode);
|
|
435
|
+
/** The trigger. Must accept a ref (a DOM element or a component forwarding its ref). */
|
|
436
|
+
children: React.ReactElement;
|
|
437
|
+
placement?: PopoverPlacement;
|
|
438
|
+
/** Distance from the trigger in px. */
|
|
439
|
+
offset?: number;
|
|
440
|
+
/** Trap focus inside while open. */
|
|
441
|
+
modal?: boolean;
|
|
442
|
+
/** Make the popover at least as wide as the trigger. */
|
|
443
|
+
matchWidth?: boolean;
|
|
444
|
+
/** Portal target. Defaults to document.body. */
|
|
445
|
+
container?: HTMLElement | null;
|
|
446
|
+
}
|
|
447
|
+
declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
448
|
+
|
|
449
|
+
interface DatePickerBaseProps {
|
|
450
|
+
placeholder?: string;
|
|
451
|
+
locale?: string;
|
|
452
|
+
/** Intl options for the field text. */
|
|
453
|
+
formatOptions?: Intl.DateTimeFormatOptions;
|
|
454
|
+
min?: Date;
|
|
455
|
+
max?: Date;
|
|
456
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
457
|
+
weekStartsOn?: 0 | 1;
|
|
458
|
+
placement?: PopoverPlacement;
|
|
459
|
+
size?: 'sm' | 'md' | 'lg';
|
|
460
|
+
disabled?: boolean;
|
|
461
|
+
/** Accessible label for the field. */
|
|
462
|
+
'aria-label'?: string;
|
|
463
|
+
className?: string;
|
|
464
|
+
/** Portal target for the calendar popover. */
|
|
465
|
+
container?: HTMLElement | null;
|
|
466
|
+
today?: Date;
|
|
467
|
+
}
|
|
468
|
+
interface DatePickerSingleProps extends DatePickerBaseProps {
|
|
469
|
+
mode?: 'single';
|
|
470
|
+
value?: Date | null;
|
|
471
|
+
defaultValue?: Date | null;
|
|
472
|
+
onValueChange?: (value: Date | null) => void;
|
|
473
|
+
}
|
|
474
|
+
interface DatePickerRangeProps extends DatePickerBaseProps {
|
|
475
|
+
mode: 'range';
|
|
476
|
+
value?: DateRange;
|
|
477
|
+
defaultValue?: DateRange;
|
|
478
|
+
onValueChange?: (value: DateRange) => void;
|
|
479
|
+
}
|
|
480
|
+
type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
|
|
481
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
482
|
+
|
|
483
|
+
interface WheelOption<T extends string = string> {
|
|
484
|
+
value: T;
|
|
485
|
+
label: React.ReactNode;
|
|
486
|
+
disabled?: boolean;
|
|
487
|
+
}
|
|
488
|
+
interface WheelPickerProps<T extends string = string> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
489
|
+
options: ReadonlyArray<WheelOption<T> | T>;
|
|
490
|
+
value?: T;
|
|
491
|
+
defaultValue?: T;
|
|
492
|
+
onValueChange?: (value: T) => void;
|
|
493
|
+
/** Rows visible at once (odd numbers look best). */
|
|
494
|
+
visibleCount?: number;
|
|
495
|
+
/** Row height in px. */
|
|
496
|
+
itemHeight?: number;
|
|
497
|
+
/** Accessible name. */
|
|
498
|
+
label?: string;
|
|
499
|
+
haptics?: boolean;
|
|
500
|
+
disabled?: boolean;
|
|
501
|
+
}
|
|
502
|
+
declare const WheelPicker: <T extends string = string>(props: WheelPickerProps<T> & {
|
|
503
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
504
|
+
}) => React.ReactElement;
|
|
505
|
+
|
|
506
|
+
type ToastType = 'default' | 'success' | 'error' | 'info' | 'loading';
|
|
507
|
+
interface ToastAction {
|
|
508
|
+
label: string;
|
|
509
|
+
onClick: () => void;
|
|
510
|
+
}
|
|
511
|
+
interface ToastOptions {
|
|
512
|
+
id?: string;
|
|
513
|
+
description?: React.ReactNode;
|
|
514
|
+
/** Milliseconds before auto-dismiss. `Infinity` keeps it until dismissed. */
|
|
515
|
+
duration?: number;
|
|
516
|
+
action?: ToastAction;
|
|
517
|
+
icon?: React.ReactNode;
|
|
518
|
+
}
|
|
519
|
+
interface ToastData extends Required<Pick<ToastOptions, 'id'>> {
|
|
520
|
+
title: React.ReactNode;
|
|
521
|
+
description?: React.ReactNode;
|
|
522
|
+
type: ToastType;
|
|
523
|
+
duration?: number;
|
|
524
|
+
action?: ToastAction;
|
|
525
|
+
icon?: React.ReactNode;
|
|
526
|
+
createdAt: number;
|
|
527
|
+
/** Increments whenever content changes, so presenters can react. */
|
|
528
|
+
version: number;
|
|
529
|
+
}
|
|
530
|
+
declare function dismiss(id?: string): void;
|
|
531
|
+
type Msg<R> = React.ReactNode | ((value: R) => React.ReactNode);
|
|
532
|
+
/**
|
|
533
|
+
* Show a notification from anywhere. Render a `<Toaster />` once in your app.
|
|
534
|
+
*
|
|
535
|
+
* toast('Saved')
|
|
536
|
+
* toast.success('Published', { description: 'Live at /launch' })
|
|
537
|
+
* toast.promise(save(), { loading: 'Saving…', success: 'Saved', error: 'Could not save' })
|
|
538
|
+
*/
|
|
539
|
+
declare const toast: ((title: React.ReactNode, options?: ToastOptions) => string) & {
|
|
540
|
+
success: (title: React.ReactNode, options?: ToastOptions) => string;
|
|
541
|
+
error: (title: React.ReactNode, options?: ToastOptions) => string;
|
|
542
|
+
info: (title: React.ReactNode, options?: ToastOptions) => string;
|
|
543
|
+
loading: (title: React.ReactNode, options?: ToastOptions) => string;
|
|
544
|
+
dismiss: typeof dismiss;
|
|
545
|
+
promise<R>(promise: Promise<R>, messages: {
|
|
546
|
+
loading: React.ReactNode;
|
|
547
|
+
success: Msg<R>;
|
|
548
|
+
error: Msg<unknown>;
|
|
549
|
+
}, options?: ToastOptions): Promise<R>;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
type ToasterVariant = 'stack' | 'island';
|
|
553
|
+
type ToasterPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
554
|
+
interface ToasterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
555
|
+
/**
|
|
556
|
+
* `stack` — layered cards; hover to fan them out, swipe to dismiss.
|
|
557
|
+
* `island` — one dark pill that blooms open for each message, then settles.
|
|
558
|
+
*/
|
|
559
|
+
variant?: ToasterVariant;
|
|
560
|
+
position?: ToasterPosition;
|
|
561
|
+
/** Default auto-dismiss duration (ms). */
|
|
562
|
+
duration?: number;
|
|
563
|
+
/** Toasts visible at once in the stack. */
|
|
564
|
+
visibleToasts?: number;
|
|
565
|
+
/** Keyboard shortcut that focuses the notifications (e.g. "alt+t"). */
|
|
566
|
+
hotkey?: string;
|
|
567
|
+
/** Render inside this element instead of the viewport (uses absolute positioning). */
|
|
568
|
+
contained?: boolean;
|
|
569
|
+
}
|
|
570
|
+
declare function useToasts(): ToastData[];
|
|
571
|
+
declare function Toaster({ variant, position, duration, visibleToasts, hotkey, contained, className, ...rest }: ToasterProps): React.JSX.Element;
|
|
572
|
+
|
|
573
|
+
type ProgressVariant = 'bar' | 'ring' | 'segments';
|
|
574
|
+
interface ProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
575
|
+
/** Current value. Omit (or pass `null`) for an indeterminate state. */
|
|
576
|
+
value?: number | null;
|
|
577
|
+
max?: number;
|
|
578
|
+
/**
|
|
579
|
+
* `bar` — a spring-driven bar.
|
|
580
|
+
* `ring` — a circular gauge with a counting readout.
|
|
581
|
+
* `segments` — discrete cells that fill in sequence.
|
|
582
|
+
*/
|
|
583
|
+
variant?: ProgressVariant;
|
|
584
|
+
size?: 'sm' | 'md' | 'lg';
|
|
585
|
+
/** Accessible label. */
|
|
586
|
+
label?: string;
|
|
587
|
+
/** Show the percentage (ring shows it inside). */
|
|
588
|
+
showValue?: boolean;
|
|
589
|
+
/** Number of cells for the `segments` variant. */
|
|
590
|
+
segments?: number;
|
|
591
|
+
tone?: 'accent' | 'ink' | 'positive';
|
|
592
|
+
}
|
|
593
|
+
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
594
|
+
type LoaderVariant = 'forma' | 'orbit' | 'bars';
|
|
595
|
+
interface LoaderProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
596
|
+
/**
|
|
597
|
+
* `forma` — one shape morphing through circle, squircle and diamond.
|
|
598
|
+
* `orbit` — three bodies on staggered orbits.
|
|
599
|
+
* `bars` — an equaliser that breathes.
|
|
600
|
+
*/
|
|
601
|
+
variant?: LoaderVariant;
|
|
602
|
+
/** Size in px. */
|
|
603
|
+
size?: number;
|
|
604
|
+
label?: string;
|
|
605
|
+
}
|
|
606
|
+
declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLSpanElement>>;
|
|
607
|
+
|
|
608
|
+
interface SwipeConfirmProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
609
|
+
label?: string;
|
|
610
|
+
confirmedLabel?: string;
|
|
611
|
+
/** Called when the thumb reaches the end. Return a promise to show a pending state. */
|
|
612
|
+
onConfirm?: () => unknown | Promise<unknown>;
|
|
613
|
+
/** Return to the start after confirming (ms). `0` keeps it confirmed. */
|
|
614
|
+
resetAfter?: number;
|
|
615
|
+
tone?: 'ink' | 'accent' | 'positive';
|
|
616
|
+
size?: 'sm' | 'md' | 'lg';
|
|
617
|
+
disabled?: boolean;
|
|
618
|
+
haptics?: boolean;
|
|
619
|
+
}
|
|
620
|
+
declare const SwipeConfirm: React.ForwardRefExoticComponent<SwipeConfirmProps & React.RefAttributes<HTMLDivElement>>;
|
|
621
|
+
|
|
622
|
+
type AccordionVariant = 'line' | 'detach';
|
|
623
|
+
interface AccordionBaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
|
|
624
|
+
/**
|
|
625
|
+
* `line` — hairline rows; the plus folds into a minus.
|
|
626
|
+
* `detach` — closed rows form one stack; an open row splits away from its neighbours.
|
|
627
|
+
*/
|
|
628
|
+
variant?: AccordionVariant;
|
|
629
|
+
haptics?: boolean;
|
|
630
|
+
}
|
|
631
|
+
interface AccordionSingleProps extends AccordionBaseProps {
|
|
632
|
+
type?: 'single';
|
|
633
|
+
value?: string | null;
|
|
634
|
+
defaultValue?: string | null;
|
|
635
|
+
onValueChange?: (value: string | null) => void;
|
|
636
|
+
/** Allow closing the open item. */
|
|
637
|
+
collapsible?: boolean;
|
|
638
|
+
}
|
|
639
|
+
interface AccordionMultipleProps extends AccordionBaseProps {
|
|
640
|
+
type: 'multiple';
|
|
641
|
+
value?: string[];
|
|
642
|
+
defaultValue?: string[];
|
|
643
|
+
onValueChange?: (value: string[]) => void;
|
|
644
|
+
}
|
|
645
|
+
type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
646
|
+
declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
647
|
+
interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
648
|
+
value: string;
|
|
649
|
+
disabled?: boolean;
|
|
650
|
+
}
|
|
651
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
652
|
+
interface AccordionTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
653
|
+
/** Replace the default plus / chevron icon. */
|
|
654
|
+
icon?: React.ReactNode;
|
|
655
|
+
}
|
|
656
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
657
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
658
|
+
|
|
659
|
+
type TabsVariant = 'underline' | 'pill';
|
|
660
|
+
interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
|
|
661
|
+
value?: string;
|
|
662
|
+
defaultValue?: string;
|
|
663
|
+
onValueChange?: (value: string) => void;
|
|
664
|
+
/**
|
|
665
|
+
* `underline` — a line that stretches between tabs.
|
|
666
|
+
* `pill` — a raised pill; content slides in from the side you moved toward.
|
|
667
|
+
*/
|
|
668
|
+
variant?: TabsVariant;
|
|
669
|
+
haptics?: boolean;
|
|
670
|
+
}
|
|
671
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
672
|
+
declare const TabsList: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
673
|
+
interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
674
|
+
value: string;
|
|
675
|
+
}
|
|
676
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
677
|
+
/** Wraps the panels so their height can spring between tabs. */
|
|
678
|
+
declare const TabsPanels: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
679
|
+
interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
680
|
+
value: string;
|
|
681
|
+
}
|
|
682
|
+
declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
683
|
+
|
|
684
|
+
interface CommandItem {
|
|
685
|
+
id: string;
|
|
686
|
+
label: string;
|
|
687
|
+
group?: string;
|
|
688
|
+
icon?: React.ReactNode;
|
|
689
|
+
description?: string;
|
|
690
|
+
/** Displayed key caps, e.g. ['⌘', 'K']. */
|
|
691
|
+
shortcut?: string[];
|
|
692
|
+
/** Extra words that should match this item. */
|
|
693
|
+
keywords?: string[];
|
|
694
|
+
disabled?: boolean;
|
|
695
|
+
/** Runs when the item is chosen. Return `false` to keep the palette open. */
|
|
696
|
+
onSelect?: () => void | boolean;
|
|
697
|
+
/** Choosing the item opens a nested page with these items. */
|
|
698
|
+
items?: CommandItem[];
|
|
699
|
+
/** Placeholder for the nested page. */
|
|
700
|
+
placeholder?: string;
|
|
701
|
+
}
|
|
702
|
+
interface CommandPaletteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
703
|
+
items: CommandItem[];
|
|
704
|
+
open?: boolean;
|
|
705
|
+
defaultOpen?: boolean;
|
|
706
|
+
onOpenChange?: (open: boolean) => void;
|
|
707
|
+
/** Global shortcut that toggles the palette. `mod` is ⌘ on macOS and Ctrl elsewhere. */
|
|
708
|
+
hotkey?: string | null;
|
|
709
|
+
placeholder?: string;
|
|
710
|
+
emptyMessage?: React.ReactNode;
|
|
711
|
+
/** Render in place (no portal, no backdrop, always open). */
|
|
712
|
+
inline?: boolean;
|
|
713
|
+
/** Called for every chosen item (after its own `onSelect`). */
|
|
714
|
+
onItemSelect?: (item: CommandItem) => void;
|
|
715
|
+
/** Max height of the results list in px. */
|
|
716
|
+
maxHeight?: number;
|
|
717
|
+
/** Portal target. */
|
|
718
|
+
container?: HTMLElement | null;
|
|
719
|
+
/** Show keyboard hints at the bottom. */
|
|
720
|
+
footer?: boolean;
|
|
721
|
+
}
|
|
722
|
+
declare const CommandPalette: React.ForwardRefExoticComponent<CommandPaletteProps & React.RefAttributes<HTMLDivElement>>;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Small fuzzy matcher: ordered subsequence with bonuses for word starts and
|
|
726
|
+
* consecutive runs. Returns null when the query does not match.
|
|
727
|
+
*/
|
|
728
|
+
declare function fuzzyMatch(query: string, text: string): {
|
|
729
|
+
score: number;
|
|
730
|
+
indices: number[];
|
|
731
|
+
} | null;
|
|
732
|
+
|
|
733
|
+
interface MorphDialogProps {
|
|
734
|
+
open?: boolean;
|
|
735
|
+
defaultOpen?: boolean;
|
|
736
|
+
onOpenChange?: (open: boolean) => void;
|
|
737
|
+
children: React.ReactNode;
|
|
738
|
+
/** Portal target. */
|
|
739
|
+
container?: HTMLElement | null;
|
|
740
|
+
}
|
|
741
|
+
/** A dialog that grows out of the element that opened it — and returns into it. */
|
|
742
|
+
declare function MorphDialog({ open: openProp, defaultOpen, onOpenChange, children, container }: MorphDialogProps): React.JSX.Element;
|
|
743
|
+
interface MorphDialogTriggerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
744
|
+
style?: React.CSSProperties;
|
|
745
|
+
}
|
|
746
|
+
declare const MorphDialogTrigger: React.ForwardRefExoticComponent<MorphDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
747
|
+
interface MorphDialogContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style'> {
|
|
748
|
+
style?: React.CSSProperties;
|
|
749
|
+
/** Close when the backdrop is clicked. */
|
|
750
|
+
dismissible?: boolean;
|
|
751
|
+
}
|
|
752
|
+
declare const MorphDialogContent: React.ForwardRefExoticComponent<MorphDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
753
|
+
/** A title that travels between the trigger and the dialog. Use it in both. */
|
|
754
|
+
declare const MorphDialogTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & {
|
|
755
|
+
as?: "h2" | "h3" | "span";
|
|
756
|
+
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
757
|
+
declare const MorphDialogClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
758
|
+
|
|
759
|
+
interface DrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
760
|
+
open?: boolean;
|
|
761
|
+
defaultOpen?: boolean;
|
|
762
|
+
onOpenChange?: (open: boolean) => void;
|
|
763
|
+
/** Element that opens the drawer (cloned with an onClick). */
|
|
764
|
+
trigger?: React.ReactElement;
|
|
765
|
+
/** Heights the sheet rests at, as fractions of the viewport (ascending). */
|
|
766
|
+
snapPoints?: number[];
|
|
767
|
+
/** Index of the snap point to open at. */
|
|
768
|
+
defaultSnap?: number;
|
|
769
|
+
title?: React.ReactNode;
|
|
770
|
+
description?: React.ReactNode;
|
|
771
|
+
/** Portal target. */
|
|
772
|
+
container?: HTMLElement | null;
|
|
773
|
+
onSnapChange?: (index: number) => void;
|
|
774
|
+
}
|
|
775
|
+
declare const Drawer: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
776
|
+
|
|
777
|
+
interface ResizablePanelsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
778
|
+
direction?: 'horizontal' | 'vertical';
|
|
779
|
+
/** Initial sizes in percent; must add up to 100. */
|
|
780
|
+
defaultSizes?: number[];
|
|
781
|
+
/** Minimum size per panel in percent. */
|
|
782
|
+
minSizes?: number[];
|
|
783
|
+
/** Which panels can collapse to zero by dragging past half their minimum. */
|
|
784
|
+
collapsible?: boolean[];
|
|
785
|
+
onSizesChange?: (sizes: number[]) => void;
|
|
786
|
+
/** Show the live percentage readout while dragging. */
|
|
787
|
+
readout?: boolean;
|
|
788
|
+
haptics?: boolean;
|
|
789
|
+
}
|
|
790
|
+
interface ResizablePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
791
|
+
/** Accessible name for the panel, used by the separator. */
|
|
792
|
+
label?: string;
|
|
793
|
+
}
|
|
794
|
+
declare const ResizablePanel: React.ForwardRefExoticComponent<ResizablePanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
795
|
+
declare const ResizablePanels: React.ForwardRefExoticComponent<ResizablePanelsProps & React.RefAttributes<HTMLDivElement>>;
|
|
796
|
+
|
|
797
|
+
interface SortableRenderState {
|
|
798
|
+
/** Spread on the element that should start a drag (when `handle` is true). */
|
|
799
|
+
handleProps: React.HTMLAttributes<HTMLElement>;
|
|
800
|
+
/** True while this item is being dragged with a pointer or lifted with the keyboard. */
|
|
801
|
+
active: boolean;
|
|
802
|
+
index: number;
|
|
803
|
+
}
|
|
804
|
+
interface SortableListProps<T> extends Omit<React.HTMLAttributes<HTMLUListElement>, 'children' | 'onChange'> {
|
|
805
|
+
items: T[];
|
|
806
|
+
onReorder: (items: T[]) => void;
|
|
807
|
+
getKey: (item: T) => string;
|
|
808
|
+
getLabel?: (item: T) => string;
|
|
809
|
+
renderItem: (item: T, state: SortableRenderState) => React.ReactNode;
|
|
810
|
+
/** Only drag from the element that receives `handleProps`. */
|
|
811
|
+
handle?: boolean;
|
|
812
|
+
axis?: 'x' | 'y';
|
|
813
|
+
haptics?: boolean;
|
|
814
|
+
}
|
|
815
|
+
declare function SortableList<T>({ items, onReorder, getKey, getLabel, renderItem, handle, axis, haptics, className, ...rest }: SortableListProps<T>): React.JSX.Element;
|
|
816
|
+
|
|
817
|
+
type Corner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
818
|
+
interface FloatingPanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
819
|
+
title?: React.ReactNode;
|
|
820
|
+
corner?: Corner;
|
|
821
|
+
defaultCorner?: Corner;
|
|
822
|
+
onCornerChange?: (corner: Corner) => void;
|
|
823
|
+
/** Distance from the container edges in px. */
|
|
824
|
+
margin?: number;
|
|
825
|
+
/** Allow collapsing to the title bar (double-click the bar). */
|
|
826
|
+
minimizable?: boolean;
|
|
827
|
+
defaultMinimized?: boolean;
|
|
828
|
+
/** Extra controls rendered in the title bar. */
|
|
829
|
+
actions?: React.ReactNode;
|
|
830
|
+
haptics?: boolean;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* A picture-in-picture panel: drag it anywhere and flick it — it lands in the
|
|
834
|
+
* nearest corner of its positioned parent, carrying your release velocity.
|
|
835
|
+
*/
|
|
836
|
+
declare const FloatingPanel: React.ForwardRefExoticComponent<FloatingPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
837
|
+
|
|
838
|
+
type ColorPickerVariant = 'area' | 'wheel';
|
|
839
|
+
interface ColorPickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
840
|
+
/** Hex colour, e.g. "#ff5b14" (or 8-digit with alpha). */
|
|
841
|
+
value?: string;
|
|
842
|
+
defaultValue?: string;
|
|
843
|
+
onValueChange?: (hex: string) => void;
|
|
844
|
+
/**
|
|
845
|
+
* `area` — saturation/brightness square with hue and alpha rails.
|
|
846
|
+
* `wheel` — hue/saturation disk with a brightness rail.
|
|
847
|
+
*/
|
|
848
|
+
variant?: ColorPickerVariant;
|
|
849
|
+
swatches?: string[];
|
|
850
|
+
/** Show an alpha rail. */
|
|
851
|
+
alpha?: boolean;
|
|
852
|
+
/** Show the native eyedropper when the browser supports it. */
|
|
853
|
+
eyedropper?: boolean;
|
|
854
|
+
}
|
|
855
|
+
declare const ColorPicker: React.ForwardRefExoticComponent<ColorPickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
856
|
+
|
|
857
|
+
type ClockVariant = 'sweep' | 'railway' | 'digital';
|
|
858
|
+
interface ClockProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
859
|
+
/**
|
|
860
|
+
* `sweep` — a continuously gliding second hand.
|
|
861
|
+
* `railway` — stop-to-go: the second hand laps in 58.5 s, waits at twelve, and the minute hand jumps.
|
|
862
|
+
* `digital` — rolling digits.
|
|
863
|
+
*/
|
|
864
|
+
variant?: ClockVariant;
|
|
865
|
+
/** IANA time zone, e.g. "Asia/Tokyo". Defaults to the user's zone. */
|
|
866
|
+
timeZone?: string;
|
|
867
|
+
/** Caption under the face (e.g. a city). */
|
|
868
|
+
label?: string;
|
|
869
|
+
showSeconds?: boolean;
|
|
870
|
+
hour12?: boolean;
|
|
871
|
+
/** Diameter of the analog face in px. */
|
|
872
|
+
size?: number;
|
|
873
|
+
/** Freeze the clock at a given time (useful for screenshots and tests). */
|
|
874
|
+
time?: Date;
|
|
875
|
+
}
|
|
876
|
+
declare const Clock: React.ForwardRefExoticComponent<ClockProps & React.RefAttributes<HTMLDivElement>>;
|
|
877
|
+
|
|
878
|
+
type Anchor = React.RefObject<Element | null> | string;
|
|
879
|
+
type TetherSide = 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
880
|
+
interface TetherFieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
881
|
+
}
|
|
882
|
+
/** A positioned container whose tethers are drawn in its coordinate space. */
|
|
883
|
+
declare const TetherField: React.ForwardRefExoticComponent<TetherFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
884
|
+
interface TetherProps {
|
|
885
|
+
from: Anchor;
|
|
886
|
+
to: Anchor;
|
|
887
|
+
fromSide?: TetherSide;
|
|
888
|
+
toSide?: TetherSide;
|
|
889
|
+
/** Cable length relative to the straight distance (1 = taut). */
|
|
890
|
+
slack?: number;
|
|
891
|
+
/** Simulation segments. */
|
|
892
|
+
segments?: number;
|
|
893
|
+
/** Downward pull in px/frame². */
|
|
894
|
+
gravity?: number;
|
|
895
|
+
/** Push the cable away from the cursor. */
|
|
896
|
+
reactive?: boolean;
|
|
897
|
+
/** Any value; each change sends a pulse travelling from `from` to `to`. */
|
|
898
|
+
signal?: unknown;
|
|
899
|
+
/** Highlight the cable (uses the accent colour). */
|
|
900
|
+
active?: boolean;
|
|
901
|
+
/** Draw jacks at both ends. */
|
|
902
|
+
jacks?: boolean;
|
|
903
|
+
width?: number;
|
|
904
|
+
className?: string;
|
|
905
|
+
}
|
|
906
|
+
/** A physical cable between two elements, simulated with Verlet integration. */
|
|
907
|
+
declare function Tether({ from, to, fromSide, toSide, slack, segments, gravity, reactive, signal, active, jacks, width, className }: TetherProps): React.ReactPortal | null;
|
|
908
|
+
|
|
909
|
+
interface RadialMenuItem {
|
|
910
|
+
id: string;
|
|
911
|
+
label: string;
|
|
912
|
+
icon: React.ReactNode;
|
|
913
|
+
disabled?: boolean;
|
|
914
|
+
onSelect?: () => void;
|
|
915
|
+
}
|
|
916
|
+
interface RadialMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
917
|
+
items: RadialMenuItem[];
|
|
918
|
+
/**
|
|
919
|
+
* How the menu opens on the wrapped area:
|
|
920
|
+
* `contextmenu` (right-click / long-press), `click`, or `press` (long-press with any pointer).
|
|
921
|
+
*/
|
|
922
|
+
trigger?: 'contextmenu' | 'click' | 'press';
|
|
923
|
+
/** Ring radius in px. */
|
|
924
|
+
radius?: number;
|
|
925
|
+
onItemSelect?: (item: RadialMenuItem) => void;
|
|
926
|
+
/** Portal target. */
|
|
927
|
+
container?: HTMLElement | null;
|
|
928
|
+
haptics?: boolean;
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* A marking menu: the direction you move selects, before you even reach the item.
|
|
932
|
+
* Hold and flick to choose; tap to keep it open and click instead.
|
|
933
|
+
*/
|
|
934
|
+
declare const RadialMenu: React.ForwardRefExoticComponent<RadialMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
935
|
+
|
|
936
|
+
type SparklineVariant = 'line' | 'bars';
|
|
937
|
+
interface SparklineProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
938
|
+
data: number[];
|
|
939
|
+
/** Label per point (e.g. dates), shown in the readout and the data table. */
|
|
940
|
+
labels?: string[];
|
|
941
|
+
/**
|
|
942
|
+
* `line` — 2px line over a 10% wash with an end marker.
|
|
943
|
+
* `bars` — columns grown from a square baseline with rounded data ends.
|
|
944
|
+
*/
|
|
945
|
+
variant?: SparklineVariant;
|
|
946
|
+
/** What the series measures; used as the title and the accessible name. */
|
|
947
|
+
label?: string;
|
|
948
|
+
formatValue?: (value: number) => string;
|
|
949
|
+
/** Chart height in px. Width follows the container. */
|
|
950
|
+
height?: number;
|
|
951
|
+
/** Show the headline value (last point, or the scrubbed point). */
|
|
952
|
+
showValue?: boolean;
|
|
953
|
+
/** Show the change from the first to the last point. */
|
|
954
|
+
showDelta?: boolean;
|
|
955
|
+
/** Include zero in the value axis (always true for bars). */
|
|
956
|
+
zeroBased?: boolean;
|
|
957
|
+
}
|
|
958
|
+
declare const Sparkline: React.ForwardRefExoticComponent<SparklineProps & React.RefAttributes<HTMLDivElement>>;
|
|
959
|
+
|
|
960
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'accent';
|
|
961
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
962
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
963
|
+
/**
|
|
964
|
+
* `primary` — ink on paper, the default action.
|
|
965
|
+
* `accent` — the signal colour; use once per view at most.
|
|
966
|
+
* `secondary` — a quiet filled surface.
|
|
967
|
+
* `outline` — hairline border, transparent fill.
|
|
968
|
+
* `ghost` — no chrome until hovered; for toolbars and dense rows.
|
|
969
|
+
* `danger` — destructive actions.
|
|
970
|
+
*/
|
|
971
|
+
variant?: ButtonVariant;
|
|
972
|
+
size?: ButtonSize;
|
|
973
|
+
/** Shows a spinner in place of the leading icon, keeps the width and sets aria-busy. */
|
|
974
|
+
loading?: boolean;
|
|
975
|
+
/** Text announced and shown while loading. Defaults to the children. */
|
|
976
|
+
loadingText?: React.ReactNode;
|
|
977
|
+
/** Leading icon. */
|
|
978
|
+
icon?: React.ReactNode;
|
|
979
|
+
/** Trailing icon. */
|
|
980
|
+
iconEnd?: React.ReactNode;
|
|
981
|
+
/** Stretch to the container width. */
|
|
982
|
+
fullWidth?: boolean;
|
|
983
|
+
}
|
|
984
|
+
/** The everyday button. Presses with a short anticipation; loading never changes its footprint. */
|
|
985
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
986
|
+
interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'iconEnd' | 'children' | 'loadingText'> {
|
|
987
|
+
/** Required: the accessible name. Also shown as a native tooltip unless `title` is set. */
|
|
988
|
+
'aria-label': string;
|
|
989
|
+
children: React.ReactNode;
|
|
990
|
+
}
|
|
991
|
+
/** A square button holding one icon. */
|
|
992
|
+
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
993
|
+
|
|
994
|
+
interface FieldContextValue {
|
|
995
|
+
id: string;
|
|
996
|
+
descriptionId?: string;
|
|
997
|
+
errorId?: string;
|
|
998
|
+
invalid: boolean;
|
|
999
|
+
required?: boolean;
|
|
1000
|
+
disabled?: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
/** Read the ids and state of the closest <Field>, to wire a custom control into it. */
|
|
1003
|
+
declare const useField: () => FieldContextValue | null;
|
|
1004
|
+
interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1005
|
+
label?: React.ReactNode;
|
|
1006
|
+
/** Help text under the label. */
|
|
1007
|
+
description?: React.ReactNode;
|
|
1008
|
+
/** Error message. Its presence marks the control invalid (aria-invalid + aria-describedby). */
|
|
1009
|
+
error?: React.ReactNode;
|
|
1010
|
+
required?: boolean;
|
|
1011
|
+
/** Shows a quiet "Optional" marker next to the label. */
|
|
1012
|
+
optional?: boolean;
|
|
1013
|
+
disabled?: boolean;
|
|
1014
|
+
/** Something aligned to the right of the label, e.g. a "Forgot password?" link. */
|
|
1015
|
+
labelAction?: React.ReactNode;
|
|
1016
|
+
/** Id for the control. Generated when omitted. */
|
|
1017
|
+
htmlFor?: string;
|
|
1018
|
+
children: React.ReactNode;
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Label, description and error around any control. Controls from this library pick up the
|
|
1022
|
+
* ids automatically; for your own, read them with `useField()`.
|
|
1023
|
+
*/
|
|
1024
|
+
declare function Field({ label, description, error, required, optional, disabled, labelAction, htmlFor, className, children, ...rest }: FieldProps): React.JSX.Element;
|
|
1025
|
+
/** Props a control should spread to join the closest Field. */
|
|
1026
|
+
declare function useFieldControlProps(own: {
|
|
1027
|
+
id?: string;
|
|
1028
|
+
'aria-describedby'?: string;
|
|
1029
|
+
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
1030
|
+
required?: boolean;
|
|
1031
|
+
disabled?: boolean;
|
|
1032
|
+
}): {
|
|
1033
|
+
id: string | undefined;
|
|
1034
|
+
'aria-describedby': string | undefined;
|
|
1035
|
+
'aria-invalid': boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
1036
|
+
required: boolean | undefined;
|
|
1037
|
+
disabled: boolean | undefined;
|
|
1038
|
+
};
|
|
1039
|
+
type FieldShorthand = Pick<FieldProps, 'label' | 'description' | 'error' | 'optional' | 'labelAction'>;
|
|
1040
|
+
interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>, FieldShorthand {
|
|
1041
|
+
/** Called with the string value on every change. */
|
|
1042
|
+
onValueChange?: (value: string) => void;
|
|
1043
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1044
|
+
/** Content before the input — an icon or a unit such as "R$". */
|
|
1045
|
+
prefix?: React.ReactNode;
|
|
1046
|
+
/** Content after the input. */
|
|
1047
|
+
suffix?: React.ReactNode;
|
|
1048
|
+
/** Shows a clear button while there is a value. */
|
|
1049
|
+
clearable?: boolean;
|
|
1050
|
+
/** Shows "12 / 80" under the field when `maxLength` is set. */
|
|
1051
|
+
showCount?: boolean;
|
|
1052
|
+
/** Class for the outer wrapper (the Field when label/description/error are given). */
|
|
1053
|
+
wrapperClassName?: string;
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* A text input with label, help, error, adornments, clear and password reveal.
|
|
1057
|
+
* Pass `label`/`error` directly, or place it inside a `<Field>`.
|
|
1058
|
+
*/
|
|
1059
|
+
declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
1060
|
+
interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, FieldShorthand {
|
|
1061
|
+
onValueChange?: (value: string) => void;
|
|
1062
|
+
/** Grow with the content between `minRows` and `maxRows`. */
|
|
1063
|
+
autoResize?: boolean;
|
|
1064
|
+
minRows?: number;
|
|
1065
|
+
maxRows?: number;
|
|
1066
|
+
showCount?: boolean;
|
|
1067
|
+
wrapperClassName?: string;
|
|
1068
|
+
}
|
|
1069
|
+
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
1070
|
+
|
|
1071
|
+
type Side = 'top' | 'bottom' | 'left' | 'right';
|
|
1072
|
+
type Placement = Side | `${Side}-start` | `${Side}-end`;
|
|
1073
|
+
|
|
1074
|
+
/** Animates its own height to follow its content — for steps, tabs and messages that change size. */
|
|
1075
|
+
declare function AutoHeight({ children, className, style }: {
|
|
1076
|
+
children: React.ReactNode;
|
|
1077
|
+
className?: string;
|
|
1078
|
+
style?: React.CSSProperties;
|
|
1079
|
+
}): React.JSX.Element;
|
|
1080
|
+
|
|
1081
|
+
interface SelectOption<V extends string = string> {
|
|
1082
|
+
value: V;
|
|
1083
|
+
label: React.ReactNode;
|
|
1084
|
+
/** Plain text for type-ahead and search when `label` is not a string. */
|
|
1085
|
+
textValue?: string;
|
|
1086
|
+
description?: React.ReactNode;
|
|
1087
|
+
icon?: React.ReactNode;
|
|
1088
|
+
disabled?: boolean;
|
|
1089
|
+
/** Options sharing a group are listed under a heading, in first-seen order. */
|
|
1090
|
+
group?: string;
|
|
1091
|
+
}
|
|
1092
|
+
interface SelectBaseProps<V extends string> extends Pick<FieldProps, 'label' | 'description' | 'error' | 'optional'> {
|
|
1093
|
+
options: ReadonlyArray<SelectOption<V> | V>;
|
|
1094
|
+
placeholder?: React.ReactNode;
|
|
1095
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1096
|
+
disabled?: boolean;
|
|
1097
|
+
required?: boolean;
|
|
1098
|
+
/** Adds a filter input at the top of the list. */
|
|
1099
|
+
searchable?: boolean;
|
|
1100
|
+
searchPlaceholder?: string;
|
|
1101
|
+
/** Shown when search matches nothing. */
|
|
1102
|
+
emptyText?: React.ReactNode;
|
|
1103
|
+
placement?: Placement;
|
|
1104
|
+
/** Form field name; hidden inputs submit the value(s). */
|
|
1105
|
+
name?: string;
|
|
1106
|
+
id?: string;
|
|
1107
|
+
className?: string;
|
|
1108
|
+
style?: React.CSSProperties;
|
|
1109
|
+
/** Portal target. */
|
|
1110
|
+
container?: HTMLElement | null;
|
|
1111
|
+
/** Leading icon inside the trigger. */
|
|
1112
|
+
icon?: React.ReactNode;
|
|
1113
|
+
'aria-label'?: string;
|
|
1114
|
+
'aria-labelledby'?: string;
|
|
1115
|
+
open?: boolean;
|
|
1116
|
+
onOpenChange?: (open: boolean) => void;
|
|
1117
|
+
}
|
|
1118
|
+
interface SelectSingleProps<V extends string = string> extends SelectBaseProps<V> {
|
|
1119
|
+
multiple?: false;
|
|
1120
|
+
value?: V | null;
|
|
1121
|
+
defaultValue?: V | null;
|
|
1122
|
+
onValueChange?: (value: V) => void;
|
|
1123
|
+
/** Custom rendering of the selected value in the trigger. */
|
|
1124
|
+
renderValue?: (option: SelectOption<V>) => React.ReactNode;
|
|
1125
|
+
}
|
|
1126
|
+
interface SelectMultipleProps<V extends string = string> extends SelectBaseProps<V> {
|
|
1127
|
+
multiple: true;
|
|
1128
|
+
value?: V[];
|
|
1129
|
+
defaultValue?: V[];
|
|
1130
|
+
onValueChange?: (value: V[]) => void;
|
|
1131
|
+
renderValue?: (options: SelectOption<V>[]) => React.ReactNode;
|
|
1132
|
+
}
|
|
1133
|
+
type SelectProps<V extends string = string> = SelectSingleProps<V> | SelectMultipleProps<V>;
|
|
1134
|
+
/**
|
|
1135
|
+
* A listbox select with keyboard type-ahead, optional search, groups and multiple selection.
|
|
1136
|
+
* Pass `label` / `error` directly or place it inside a `<Field>`.
|
|
1137
|
+
*/
|
|
1138
|
+
declare function Select<V extends string = string>(props: SelectProps<V>): React.JSX.Element;
|
|
1139
|
+
|
|
1140
|
+
type BadgeTone = 'neutral' | 'accent' | 'positive' | 'negative' | 'warning' | 'info';
|
|
1141
|
+
type BadgeVariant = 'soft' | 'outline' | 'solid';
|
|
1142
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
1143
|
+
tone?: BadgeTone;
|
|
1144
|
+
/** `soft` — tinted wash (default) · `outline` — hairline only · `solid` — filled. */
|
|
1145
|
+
variant?: BadgeVariant;
|
|
1146
|
+
size?: 'sm' | 'md';
|
|
1147
|
+
/** Leading status dot. `pulse` animates it for live states. */
|
|
1148
|
+
dot?: boolean | 'pulse';
|
|
1149
|
+
icon?: React.ReactNode;
|
|
1150
|
+
}
|
|
1151
|
+
/** A compact label for status, counts and categories. Never relies on colour alone: keep the text meaningful. */
|
|
1152
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
1153
|
+
|
|
1154
|
+
interface AvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
1155
|
+
/** Person or entity name. Used for initials, the fallback tone and the accessible name. */
|
|
1156
|
+
name: string;
|
|
1157
|
+
src?: string;
|
|
1158
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
1159
|
+
/** `circle` for people, `square` for organisations and workspaces. */
|
|
1160
|
+
shape?: 'circle' | 'square';
|
|
1161
|
+
/** Presence indicator. */
|
|
1162
|
+
status?: 'online' | 'away' | 'busy' | 'offline';
|
|
1163
|
+
}
|
|
1164
|
+
declare function initialsOf(name: string): string;
|
|
1165
|
+
/** A portrait with an initials fallback in one of six warm tones, and an optional presence dot. */
|
|
1166
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
1167
|
+
interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1168
|
+
/** Show at most this many; the rest collapse into "+N". */
|
|
1169
|
+
max?: number;
|
|
1170
|
+
size?: AvatarProps['size'];
|
|
1171
|
+
children: React.ReactNode;
|
|
1172
|
+
}
|
|
1173
|
+
/** Overlapping avatars that fan out slightly on hover. */
|
|
1174
|
+
declare function AvatarGroup({ max, size, className, children, ...rest }: AvatarGroupProps): React.JSX.Element;
|
|
1175
|
+
|
|
1176
|
+
interface TooltipProps {
|
|
1177
|
+
/** Tooltip text. Keep it short — it is announced as the trigger's description. */
|
|
1178
|
+
content: React.ReactNode;
|
|
1179
|
+
/** Optional keyboard shortcut, shown as keycaps. */
|
|
1180
|
+
shortcut?: string;
|
|
1181
|
+
/** The trigger. Must accept a ref and be focusable. */
|
|
1182
|
+
children: React.ReactElement;
|
|
1183
|
+
placement?: Placement;
|
|
1184
|
+
/** Delay before opening, in ms. Skipped while another tooltip was just open. */
|
|
1185
|
+
delay?: number;
|
|
1186
|
+
disabled?: boolean;
|
|
1187
|
+
container?: HTMLElement | null;
|
|
1188
|
+
className?: string;
|
|
1189
|
+
}
|
|
1190
|
+
/** A small label that appears on hover and keyboard focus. Never put interactive content in it. */
|
|
1191
|
+
declare function Tooltip({ content, shortcut, children, placement, delay, disabled, container, className }: TooltipProps): React.JSX.Element;
|
|
1192
|
+
|
|
1193
|
+
type MenuEntry = {
|
|
1194
|
+
type?: 'item';
|
|
1195
|
+
id: string;
|
|
1196
|
+
label: React.ReactNode;
|
|
1197
|
+
/** Plain text for type-ahead when `label` is not a string. */
|
|
1198
|
+
textValue?: string;
|
|
1199
|
+
icon?: React.ReactNode;
|
|
1200
|
+
/** Shortcut hint, e.g. "⌘ D". Display only — bind the key yourself. */
|
|
1201
|
+
shortcut?: string;
|
|
1202
|
+
description?: React.ReactNode;
|
|
1203
|
+
danger?: boolean;
|
|
1204
|
+
disabled?: boolean;
|
|
1205
|
+
onSelect?: () => void;
|
|
1206
|
+
/** Keep the menu open after selecting. */
|
|
1207
|
+
keepOpen?: boolean;
|
|
1208
|
+
} | {
|
|
1209
|
+
type: 'checkbox';
|
|
1210
|
+
id: string;
|
|
1211
|
+
label: React.ReactNode;
|
|
1212
|
+
textValue?: string;
|
|
1213
|
+
checked: boolean;
|
|
1214
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1215
|
+
disabled?: boolean;
|
|
1216
|
+
icon?: React.ReactNode;
|
|
1217
|
+
} | {
|
|
1218
|
+
type: 'separator';
|
|
1219
|
+
id?: string;
|
|
1220
|
+
} | {
|
|
1221
|
+
type: 'label';
|
|
1222
|
+
id?: string;
|
|
1223
|
+
label: React.ReactNode;
|
|
1224
|
+
};
|
|
1225
|
+
interface MenuProps {
|
|
1226
|
+
items: MenuEntry[];
|
|
1227
|
+
/** The trigger; must accept a ref. Omit when positioning at `anchorPoint` (context menus). */
|
|
1228
|
+
trigger?: React.ReactElement;
|
|
1229
|
+
/** Open at a viewport point instead of next to the trigger. */
|
|
1230
|
+
anchorPoint?: {
|
|
1231
|
+
x: number;
|
|
1232
|
+
y: number;
|
|
1233
|
+
} | null;
|
|
1234
|
+
open?: boolean;
|
|
1235
|
+
defaultOpen?: boolean;
|
|
1236
|
+
onOpenChange?: (open: boolean) => void;
|
|
1237
|
+
placement?: Placement;
|
|
1238
|
+
container?: HTMLElement | null;
|
|
1239
|
+
className?: string;
|
|
1240
|
+
'aria-label'?: string;
|
|
1241
|
+
/** Minimum width in px. */
|
|
1242
|
+
minWidth?: number;
|
|
1243
|
+
}
|
|
1244
|
+
/** A dropdown of actions with keyboard navigation, type-ahead, checkable items and shortcut hints. */
|
|
1245
|
+
declare function Menu({ items, trigger, anchorPoint, open: openProp, defaultOpen, onOpenChange, placement, container, className, minWidth, ...aria }: MenuProps): React.JSX.Element;
|
|
1246
|
+
interface ContextMenuProps extends Omit<MenuProps, 'trigger' | 'anchorPoint' | 'open' | 'defaultOpen' | 'onOpenChange' | 'placement'> {
|
|
1247
|
+
/** The area that opens the menu on right-click or Shift+F10 / the context-menu key. */
|
|
1248
|
+
children: React.ReactElement;
|
|
1249
|
+
disabled?: boolean;
|
|
1250
|
+
}
|
|
1251
|
+
/** Opens a Menu at the pointer on right-click, or at the element on Shift+F10 / the Menu key. */
|
|
1252
|
+
declare function ContextMenu({ children, disabled, ...menu }: ContextMenuProps): React.JSX.Element;
|
|
1253
|
+
|
|
1254
|
+
type DialogSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
1255
|
+
type DialogPlacement = 'center' | 'right';
|
|
1256
|
+
interface DialogProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'children'> {
|
|
1257
|
+
open?: boolean;
|
|
1258
|
+
defaultOpen?: boolean;
|
|
1259
|
+
onOpenChange?: (open: boolean) => void;
|
|
1260
|
+
/** Optional trigger element; it receives aria-haspopup and toggles the dialog. */
|
|
1261
|
+
trigger?: React.ReactElement;
|
|
1262
|
+
title?: React.ReactNode;
|
|
1263
|
+
description?: React.ReactNode;
|
|
1264
|
+
/** Pinned to the bottom, outside the scrolling body. Usually the actions. */
|
|
1265
|
+
footer?: React.ReactNode;
|
|
1266
|
+
size?: DialogSize;
|
|
1267
|
+
/** `center` — modal card · `right` — a full-height sheet for record details and editing. */
|
|
1268
|
+
placement?: DialogPlacement;
|
|
1269
|
+
/** Close on overlay press and Escape. Turn off while a form is submitting. */
|
|
1270
|
+
dismissible?: boolean;
|
|
1271
|
+
/** Hide the × button. */
|
|
1272
|
+
hideClose?: boolean;
|
|
1273
|
+
/** `alertdialog` for confirmations that need a response. */
|
|
1274
|
+
role?: 'dialog' | 'alertdialog';
|
|
1275
|
+
container?: HTMLElement | null;
|
|
1276
|
+
children?: React.ReactNode;
|
|
1277
|
+
}
|
|
1278
|
+
/** Close the surrounding dialog from inside its content. */
|
|
1279
|
+
declare const useDialog: () => {
|
|
1280
|
+
close: () => void;
|
|
1281
|
+
};
|
|
1282
|
+
/** A modal dialog or side sheet with focus trap, scroll lock and a header / body / footer structure. */
|
|
1283
|
+
declare function Dialog({ open: openProp, defaultOpen, onOpenChange, trigger, title, description, footer, size, placement, dismissible, hideClose, role, container, className, style, children, ...rest }: DialogProps): React.JSX.Element;
|
|
1284
|
+
|
|
1285
|
+
interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
1286
|
+
/** 1-based current page. */
|
|
1287
|
+
page?: number;
|
|
1288
|
+
defaultPage?: number;
|
|
1289
|
+
onPageChange?: (page: number) => void;
|
|
1290
|
+
pageCount: number;
|
|
1291
|
+
/** Pages shown on each side of the current one. */
|
|
1292
|
+
siblings?: number;
|
|
1293
|
+
/** `pages` — numbered buttons · `compact` — "Page 3 of 12" with arrows. */
|
|
1294
|
+
variant?: 'pages' | 'compact';
|
|
1295
|
+
size?: 'sm' | 'md';
|
|
1296
|
+
}
|
|
1297
|
+
/** Page numbers with ellipses; the current-page marker slides between pages. */
|
|
1298
|
+
declare function pageRange(page: number, count: number, siblings: number): Array<number | 'gap'>;
|
|
1299
|
+
declare function Pagination({ page: pageProp, defaultPage, onPageChange, pageCount, siblings, variant, size, className, ...rest }: PaginationProps): React.JSX.Element;
|
|
1300
|
+
|
|
1301
|
+
interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
1302
|
+
width?: number | string;
|
|
1303
|
+
height?: number | string;
|
|
1304
|
+
/** `text` lines are rounded and sized to the font; `circle` for avatars. */
|
|
1305
|
+
shape?: 'rect' | 'text' | 'circle';
|
|
1306
|
+
/** Render children instead once loaded. Lets a skeleton and its content share one slot. */
|
|
1307
|
+
loaded?: boolean;
|
|
1308
|
+
}
|
|
1309
|
+
/** A placeholder with a slow, low-contrast sweep. Prefer holding stale data over a skeleton when refetching. */
|
|
1310
|
+
declare function Skeleton({ width, height, shape, loaded, className, style, children, ...rest }: SkeletonProps): React.JSX.Element;
|
|
1311
|
+
/** Several text lines; the last one is shorter, as paragraphs are. */
|
|
1312
|
+
declare function SkeletonText({ lines, className, gap }: {
|
|
1313
|
+
lines?: number;
|
|
1314
|
+
className?: string;
|
|
1315
|
+
gap?: number;
|
|
1316
|
+
}): React.JSX.Element;
|
|
1317
|
+
|
|
1318
|
+
type Pt = [number, number];
|
|
1319
|
+
type Stroke = {
|
|
1320
|
+
line: Pt[];
|
|
1321
|
+
closed?: boolean;
|
|
1322
|
+
} | {
|
|
1323
|
+
ring: [cx: number, cy: number, r: number];
|
|
1324
|
+
} | {
|
|
1325
|
+
disc: [cx: number, cy: number, r: number];
|
|
1326
|
+
};
|
|
1327
|
+
declare const GLYPHS: {
|
|
1328
|
+
inbox: {
|
|
1329
|
+
line: [number, number][];
|
|
1330
|
+
}[];
|
|
1331
|
+
search: ({
|
|
1332
|
+
ring: [number, number, number];
|
|
1333
|
+
line?: undefined;
|
|
1334
|
+
} | {
|
|
1335
|
+
line: [number, number][];
|
|
1336
|
+
ring?: undefined;
|
|
1337
|
+
})[];
|
|
1338
|
+
error: ({
|
|
1339
|
+
line: [number, number][];
|
|
1340
|
+
closed: true;
|
|
1341
|
+
disc?: undefined;
|
|
1342
|
+
} | {
|
|
1343
|
+
line: [number, number][];
|
|
1344
|
+
closed?: undefined;
|
|
1345
|
+
disc?: undefined;
|
|
1346
|
+
} | {
|
|
1347
|
+
disc: [number, number, number];
|
|
1348
|
+
line?: undefined;
|
|
1349
|
+
closed?: undefined;
|
|
1350
|
+
})[];
|
|
1351
|
+
done: ({
|
|
1352
|
+
ring: [number, number, number];
|
|
1353
|
+
line?: undefined;
|
|
1354
|
+
} | {
|
|
1355
|
+
line: [number, number][];
|
|
1356
|
+
ring?: undefined;
|
|
1357
|
+
})[];
|
|
1358
|
+
folder: {
|
|
1359
|
+
line: [number, number][];
|
|
1360
|
+
closed: true;
|
|
1361
|
+
}[];
|
|
1362
|
+
chart: {
|
|
1363
|
+
line: [number, number][];
|
|
1364
|
+
}[];
|
|
1365
|
+
people: ({
|
|
1366
|
+
disc: [number, number, number];
|
|
1367
|
+
line?: undefined;
|
|
1368
|
+
} | {
|
|
1369
|
+
line: [number, number][];
|
|
1370
|
+
disc?: undefined;
|
|
1371
|
+
})[];
|
|
1372
|
+
calendar: ({
|
|
1373
|
+
line: [number, number][];
|
|
1374
|
+
closed: true;
|
|
1375
|
+
disc?: undefined;
|
|
1376
|
+
} | {
|
|
1377
|
+
line: [number, number][];
|
|
1378
|
+
closed?: undefined;
|
|
1379
|
+
disc?: undefined;
|
|
1380
|
+
} | {
|
|
1381
|
+
disc: [number, number, number];
|
|
1382
|
+
line?: undefined;
|
|
1383
|
+
closed?: undefined;
|
|
1384
|
+
})[];
|
|
1385
|
+
lock: ({
|
|
1386
|
+
line: [number, number][];
|
|
1387
|
+
closed: true;
|
|
1388
|
+
} | {
|
|
1389
|
+
line: [number, number][];
|
|
1390
|
+
closed?: undefined;
|
|
1391
|
+
})[];
|
|
1392
|
+
offline: ({
|
|
1393
|
+
line: [number, number][];
|
|
1394
|
+
disc?: undefined;
|
|
1395
|
+
} | {
|
|
1396
|
+
disc: [number, number, number];
|
|
1397
|
+
line?: undefined;
|
|
1398
|
+
})[];
|
|
1399
|
+
};
|
|
1400
|
+
type GlyphName = keyof typeof GLYPHS;
|
|
1401
|
+
interface Dot {
|
|
1402
|
+
x: number;
|
|
1403
|
+
y: number;
|
|
1404
|
+
r: number;
|
|
1405
|
+
/** 0 = field dot, 1 = on the glyph */
|
|
1406
|
+
ink: number;
|
|
1407
|
+
/** Distance from centre, 0..1 — used to stagger the entrance. */
|
|
1408
|
+
delay: number;
|
|
1409
|
+
}
|
|
1410
|
+
/** Rasterise a glyph onto an n×n dot grid in a 0..n coordinate space. */
|
|
1411
|
+
declare function rasterize(strokes: Stroke[], n?: number, key?: string): Dot[];
|
|
1412
|
+
|
|
1413
|
+
interface HalftoneGlyphProps extends React.SVGAttributes<SVGSVGElement> {
|
|
1414
|
+
/** A built-in glyph name, or your own strokes in a unit square. */
|
|
1415
|
+
glyph: GlyphName | Stroke[];
|
|
1416
|
+
/** Rendered size in px. */
|
|
1417
|
+
size?: number;
|
|
1418
|
+
/** Dots per row. */
|
|
1419
|
+
density?: number;
|
|
1420
|
+
/** Dots appear from the centre outward on mount. */
|
|
1421
|
+
animate?: boolean;
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* The Seppia halftone: a glyph rasterised onto a dot grid, like chromatophores on skin.
|
|
1425
|
+
* Monochrome (currentColor) — it takes the colour of its text.
|
|
1426
|
+
*/
|
|
1427
|
+
declare function HalftoneGlyph({ glyph, size, density, animate, className, style, ...rest }: HalftoneGlyphProps): React.JSX.Element;
|
|
1428
|
+
type EmptyStateTone = 'neutral' | 'positive' | 'negative' | 'accent';
|
|
1429
|
+
interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1430
|
+
/** A halftone glyph name, your own node, or `false` for none. */
|
|
1431
|
+
illustration?: GlyphName | React.ReactNode | false;
|
|
1432
|
+
title: React.ReactNode;
|
|
1433
|
+
description?: React.ReactNode;
|
|
1434
|
+
/** Primary and secondary actions. */
|
|
1435
|
+
actions?: React.ReactNode;
|
|
1436
|
+
tone?: EmptyStateTone;
|
|
1437
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1438
|
+
/** Draw a dashed frame around it (for drop zones and blank canvases). */
|
|
1439
|
+
framed?: boolean;
|
|
1440
|
+
}
|
|
1441
|
+
/** Empty, no-results, error and success states with one consistent anatomy. */
|
|
1442
|
+
declare function EmptyState({ illustration, title, description, actions, tone, size, framed, className, ...rest }: EmptyStateProps): React.JSX.Element;
|
|
1443
|
+
|
|
1444
|
+
interface StepItem {
|
|
1445
|
+
id: string;
|
|
1446
|
+
label: React.ReactNode;
|
|
1447
|
+
description?: React.ReactNode;
|
|
1448
|
+
/** Mark a step as failed (e.g. validation on submit). */
|
|
1449
|
+
error?: boolean;
|
|
1450
|
+
}
|
|
1451
|
+
interface StepperProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'onChange'> {
|
|
1452
|
+
steps: StepItem[];
|
|
1453
|
+
/** Index of the current step. Steps before it are complete. */
|
|
1454
|
+
current: number;
|
|
1455
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1456
|
+
/** Let users jump back to completed steps. */
|
|
1457
|
+
onStepClick?: (index: number) => void;
|
|
1458
|
+
size?: 'sm' | 'md';
|
|
1459
|
+
}
|
|
1460
|
+
/** Progress through a sequence. Connectors fill as steps complete; completed steps can be revisited. */
|
|
1461
|
+
declare function Stepper({ steps, current, orientation, onStepClick, size, className, ...rest }: StepperProps): React.JSX.Element;
|
|
1462
|
+
|
|
1463
|
+
type AlertTone = 'info' | 'positive' | 'warning' | 'negative' | 'neutral';
|
|
1464
|
+
interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1465
|
+
tone?: AlertTone;
|
|
1466
|
+
title?: React.ReactNode;
|
|
1467
|
+
children?: React.ReactNode;
|
|
1468
|
+
/** Actions on the right (or below on narrow containers). */
|
|
1469
|
+
action?: React.ReactNode;
|
|
1470
|
+
/** Shows a dismiss button; the alert collapses its space away when dismissed. */
|
|
1471
|
+
onDismiss?: () => void;
|
|
1472
|
+
icon?: React.ReactNode | false;
|
|
1473
|
+
/** `soft` — tinted card · `inline` — left rule only, for dense forms. */
|
|
1474
|
+
variant?: 'soft' | 'inline';
|
|
1475
|
+
}
|
|
1476
|
+
/** A message inside the page flow. Warnings and errors use role="alert"; the rest are polite status. */
|
|
1477
|
+
declare function Alert({ tone, title, children, action, onDismiss, icon, variant, className, ...rest }: AlertProps): React.JSX.Element;
|
|
1478
|
+
|
|
1479
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1480
|
+
/** `raised` — elevated surface with shadow · `flat` — hairline only · `sunken` — recessed panel. */
|
|
1481
|
+
variant?: 'raised' | 'flat' | 'sunken';
|
|
1482
|
+
/** Lift slightly on hover — for cards that are links or buttons. */
|
|
1483
|
+
interactive?: boolean;
|
|
1484
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
1485
|
+
}
|
|
1486
|
+
/** A surface for grouping related content. Compose with CardHeader, CardContent and CardFooter. */
|
|
1487
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
1488
|
+
interface CardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1489
|
+
title?: React.ReactNode;
|
|
1490
|
+
description?: React.ReactNode;
|
|
1491
|
+
/** Right-aligned controls (a menu, a period select). */
|
|
1492
|
+
action?: React.ReactNode;
|
|
1493
|
+
/** Small uppercase label above the title. */
|
|
1494
|
+
eyebrow?: React.ReactNode;
|
|
1495
|
+
}
|
|
1496
|
+
declare function CardHeader({ title, description, action, eyebrow, className, children, ...rest }: CardHeaderProps): React.JSX.Element;
|
|
1497
|
+
declare function CardContent({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
1498
|
+
declare function CardFooter({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
1499
|
+
|
|
1500
|
+
interface BreadcrumbItem {
|
|
1501
|
+
label: React.ReactNode;
|
|
1502
|
+
/** Link target. The last item is the current page and is never a link. */
|
|
1503
|
+
href?: string;
|
|
1504
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
1505
|
+
}
|
|
1506
|
+
interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {
|
|
1507
|
+
items: BreadcrumbItem[];
|
|
1508
|
+
/** Collapse middle items into "…" beyond this count. */
|
|
1509
|
+
maxItems?: number;
|
|
1510
|
+
/** Render links with your router: receives props for an <a>. */
|
|
1511
|
+
renderLink?: (props: {
|
|
1512
|
+
href: string;
|
|
1513
|
+
children: React.ReactNode;
|
|
1514
|
+
className: string;
|
|
1515
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
1516
|
+
}) => React.ReactNode;
|
|
1517
|
+
}
|
|
1518
|
+
/** Where you are in a hierarchy. The last item is marked aria-current="page". */
|
|
1519
|
+
declare function Breadcrumbs({ items, maxItems, renderLink, className, ...rest }: BreadcrumbsProps): React.JSX.Element;
|
|
1520
|
+
/** Keyboard keys, e.g. <Kbd>⌘</Kbd><Kbd>K</Kbd>. */
|
|
1521
|
+
declare function Kbd({ className, ...rest }: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
|
|
1522
|
+
|
|
1523
|
+
/** Width of a container, tracked with ResizeObserver. Height is always explicit for charts. */
|
|
1524
|
+
declare function useChartWidth<T extends HTMLElement = HTMLDivElement>(fallback?: number): readonly [React.RefObject<T | null>, number];
|
|
1525
|
+
/** True once the element has scrolled into view (entrance animations wait for it). */
|
|
1526
|
+
declare function useInView<T extends Element>(ref: React.RefObject<T | null>, enabled?: boolean): boolean;
|
|
1527
|
+
interface TooltipRow {
|
|
1528
|
+
key: string;
|
|
1529
|
+
label: React.ReactNode;
|
|
1530
|
+
value: React.ReactNode;
|
|
1531
|
+
color: string;
|
|
1532
|
+
/** How the series is keyed: a short line for lines, a square for bars/areas. */
|
|
1533
|
+
kind?: 'line' | 'rect' | 'dot' | 'muted';
|
|
1534
|
+
/** De-emphasise (e.g. a comparison series). */
|
|
1535
|
+
muted?: boolean;
|
|
1536
|
+
}
|
|
1537
|
+
interface ChartTooltipProps {
|
|
1538
|
+
open: boolean;
|
|
1539
|
+
/** Anchor in px, relative to the chart container. */
|
|
1540
|
+
x: number;
|
|
1541
|
+
y: number;
|
|
1542
|
+
/** Width of the container, to flip the tooltip near the right edge. */
|
|
1543
|
+
bound: number;
|
|
1544
|
+
title?: React.ReactNode;
|
|
1545
|
+
rows: TooltipRow[];
|
|
1546
|
+
footer?: React.ReactNode;
|
|
1547
|
+
}
|
|
1548
|
+
/** The readout: values lead (strong), series names follow; keyed with short line marks. Glides between points. */
|
|
1549
|
+
declare function ChartTooltip({ open, x, y, bound, title, rows, footer }: ChartTooltipProps): React.JSX.Element;
|
|
1550
|
+
interface LegendItem {
|
|
1551
|
+
key: string;
|
|
1552
|
+
label: React.ReactNode;
|
|
1553
|
+
color: string;
|
|
1554
|
+
kind?: 'line' | 'rect' | 'dot' | 'muted';
|
|
1555
|
+
/** Optional trailing value (e.g. a total or share). */
|
|
1556
|
+
value?: React.ReactNode;
|
|
1557
|
+
}
|
|
1558
|
+
interface ChartLegendProps {
|
|
1559
|
+
items: LegendItem[];
|
|
1560
|
+
/** Keys currently hidden. */
|
|
1561
|
+
hidden?: ReadonlySet<string>;
|
|
1562
|
+
/** Makes items toggle buttons. A series keeps its colour when others are hidden. */
|
|
1563
|
+
onToggle?: (key: string) => void;
|
|
1564
|
+
/** Emphasise one series while hovering or focusing its legend item. */
|
|
1565
|
+
onHighlight?: (key: string | null) => void;
|
|
1566
|
+
className?: string;
|
|
1567
|
+
}
|
|
1568
|
+
declare function ChartLegend({ items, hidden, onToggle, onHighlight, className }: ChartLegendProps): React.JSX.Element;
|
|
1569
|
+
interface ChartDataTableProps {
|
|
1570
|
+
caption: React.ReactNode;
|
|
1571
|
+
columns: Array<{
|
|
1572
|
+
key: string;
|
|
1573
|
+
label: React.ReactNode;
|
|
1574
|
+
numeric?: boolean;
|
|
1575
|
+
}>;
|
|
1576
|
+
rows: Array<Record<string, React.ReactNode>>;
|
|
1577
|
+
/** Render off-screen for assistive tech only. */
|
|
1578
|
+
visuallyHidden?: boolean;
|
|
1579
|
+
className?: string;
|
|
1580
|
+
}
|
|
1581
|
+
/** The table twin of every chart — the WCAG-clean equivalent of the picture. */
|
|
1582
|
+
declare function ChartDataTable({ caption, columns, rows, visuallyHidden, className }: ChartDataTableProps): React.JSX.Element;
|
|
1583
|
+
/** Hidden + highlighted series, shared by legend and plot. */
|
|
1584
|
+
declare function useSeriesState(): {
|
|
1585
|
+
hidden: Set<string>;
|
|
1586
|
+
toggle: (key: string) => void;
|
|
1587
|
+
highlight: string | null;
|
|
1588
|
+
setHighlight: React.Dispatch<React.SetStateAction<string | null>>;
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1591
|
+
type Scale = ((v: number) => number) & {
|
|
1592
|
+
domain: [number, number];
|
|
1593
|
+
range: [number, number];
|
|
1594
|
+
invert: (px: number) => number;
|
|
1595
|
+
};
|
|
1596
|
+
declare function linearScale(domain: [number, number], range: [number, number]): Scale;
|
|
1597
|
+
/** A "nice" step (1, 2, 2.5 or 5 × 10ⁿ) so ticks land on round numbers. */
|
|
1598
|
+
declare function niceStep(span: number, count: number): number;
|
|
1599
|
+
/** Extends [min, max] to round numbers and returns the ticks inside. */
|
|
1600
|
+
declare function niceDomain(min: number, max: number, count?: number): {
|
|
1601
|
+
domain: [number, number];
|
|
1602
|
+
ticks: number[];
|
|
1603
|
+
};
|
|
1604
|
+
/** 0 · 1,250 · 9,999 · 12.9K · 4.2M — full under 10,000, compact above. */
|
|
1605
|
+
declare function formatNumber(v: number): string;
|
|
1606
|
+
/** One consistent style per axis: compact as soon as the axis reaches 10,000. */
|
|
1607
|
+
declare function axisFormatter(ticks: number[]): (v: number) => string;
|
|
1608
|
+
type XValue = number | string | Date;
|
|
1609
|
+
declare const toNumber: (v: XValue) => number;
|
|
1610
|
+
/** Index of the item whose x pixel is nearest to `px`. `xs` must be ascending. */
|
|
1611
|
+
declare function nearestIndex(xs: number[], px: number): number;
|
|
1612
|
+
/** Linear interpolation of a polyline's y at x (polyline sorted by x). Used to morph between datasets. */
|
|
1613
|
+
declare function sampleY(points: Array<[number, number]>, x: number): number;
|
|
1614
|
+
/** SVG path through points. `monotone` keeps the curve from overshooting the data (no fake peaks). */
|
|
1615
|
+
declare function linePath(points: Array<[number, number]>, curve?: 'linear' | 'monotone'): string;
|
|
1616
|
+
/** Closes a line path down to a baseline (or along a lower polyline, for stacked areas). */
|
|
1617
|
+
declare function areaPath(points: Array<[number, number]>, baseline: number | Array<[number, number]>, curve?: 'linear' | 'monotone'): string;
|
|
1618
|
+
/** A bar as a path: 4px rounded data end, square at the baseline. Works for negative values and both orientations. */
|
|
1619
|
+
declare function barPath(x: number, y: number, w: number, h: number, radius: number, end: 'top' | 'bottom' | 'right' | 'left'): string;
|
|
1620
|
+
/**
|
|
1621
|
+
* CSS colour for categorical slot n (1-based). Slots are assigned in order and never cycled:
|
|
1622
|
+
* anything past 8 is drawn in the neutral ink — fold it into "Other" or facet instead.
|
|
1623
|
+
*/
|
|
1624
|
+
declare const seriesColor: (slot: number) => string;
|
|
1625
|
+
|
|
1626
|
+
interface LineSeries {
|
|
1627
|
+
/** Field in each datum. */
|
|
1628
|
+
key: string;
|
|
1629
|
+
label: string;
|
|
1630
|
+
/** Categorical slot 1–8. Defaults to the series' position. Keep it stable across filters. */
|
|
1631
|
+
color?: number;
|
|
1632
|
+
/**
|
|
1633
|
+
* `default` — 2px line in the series colour.
|
|
1634
|
+
* `muted` — thin neutral line behind the others, for a previous period or a benchmark.
|
|
1635
|
+
* `dashed` — for projections and forecasts.
|
|
1636
|
+
*/
|
|
1637
|
+
variant?: 'default' | 'muted' | 'dashed';
|
|
1638
|
+
}
|
|
1639
|
+
interface LineChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1640
|
+
data: Array<Record<string, any>>;
|
|
1641
|
+
/** Field holding the x value — a Date, a timestamp, an ISO date string or a category label. */
|
|
1642
|
+
x: string;
|
|
1643
|
+
series: LineSeries[];
|
|
1644
|
+
/** Plot height in px, axis included. */
|
|
1645
|
+
height?: number;
|
|
1646
|
+
/** Fill a 10% wash under each line. */
|
|
1647
|
+
area?: boolean;
|
|
1648
|
+
/** Stack the areas (implies `area`). */
|
|
1649
|
+
stacked?: boolean;
|
|
1650
|
+
curve?: 'linear' | 'monotone';
|
|
1651
|
+
/** `zero` keeps 0 in view (default for areas); `auto` fits the data; or a fixed [min, max]. */
|
|
1652
|
+
yDomain?: 'auto' | 'zero' | [number, number];
|
|
1653
|
+
formatValue?: (value: number) => string;
|
|
1654
|
+
/** Format an x value for the axis or the tooltip title. */
|
|
1655
|
+
formatX?: (value: XValue, context: 'axis' | 'tooltip') => string;
|
|
1656
|
+
/** Horizontal reference lines (targets, thresholds). */
|
|
1657
|
+
referenceLines?: Array<{
|
|
1658
|
+
y: number;
|
|
1659
|
+
label?: string;
|
|
1660
|
+
}>;
|
|
1661
|
+
/** Legend above the plot. Defaults to on for two or more series. */
|
|
1662
|
+
legend?: boolean;
|
|
1663
|
+
/** Label each line at its end, when the ends don't collide. */
|
|
1664
|
+
endLabels?: boolean;
|
|
1665
|
+
/** Accessible name — what the chart shows. */
|
|
1666
|
+
label: string;
|
|
1667
|
+
/** Show the data as a visible table instead of the plot. */
|
|
1668
|
+
view?: 'chart' | 'table';
|
|
1669
|
+
/** Entrance and update animations. */
|
|
1670
|
+
animated?: boolean;
|
|
1671
|
+
/** Called when the crosshair moves (index into data, or null). Useful for linked readouts. */
|
|
1672
|
+
onActiveChange?: (index: number | null) => void;
|
|
1673
|
+
}
|
|
1674
|
+
/** Line and area chart for time series: crosshair tooltip, keyboard scrubbing, interactive legend and morphing updates. */
|
|
1675
|
+
declare function LineChart({ data, x, series, height, area, stacked, curve, yDomain, formatValue, formatX, referenceLines, legend, endLabels, label, view, animated, onActiveChange, className, ...rest }: LineChartProps): React.JSX.Element;
|
|
1676
|
+
|
|
1677
|
+
interface BarSeries {
|
|
1678
|
+
key: string;
|
|
1679
|
+
label: string;
|
|
1680
|
+
/** Categorical slot 1–8; defaults to the series position. A single series always uses one colour for every bar. */
|
|
1681
|
+
color?: number;
|
|
1682
|
+
}
|
|
1683
|
+
interface BarChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1684
|
+
data: Array<Record<string, any>>;
|
|
1685
|
+
/** Field holding the category label. */
|
|
1686
|
+
category: string;
|
|
1687
|
+
series: BarSeries[];
|
|
1688
|
+
/** `vertical` — columns over categories · `horizontal` — ranked bars, best for long labels. */
|
|
1689
|
+
layout?: 'vertical' | 'horizontal';
|
|
1690
|
+
stacked?: boolean;
|
|
1691
|
+
/** Plot height. Horizontal charts size themselves to their rows when omitted. */
|
|
1692
|
+
height?: number;
|
|
1693
|
+
formatValue?: (value: number) => string;
|
|
1694
|
+
/** Print the value at each bar tip (or the stack total). */
|
|
1695
|
+
showValues?: boolean;
|
|
1696
|
+
legend?: boolean;
|
|
1697
|
+
/** Accessible name. */
|
|
1698
|
+
label: string;
|
|
1699
|
+
view?: 'chart' | 'table';
|
|
1700
|
+
animated?: boolean;
|
|
1701
|
+
/** Emphasise some categories; the rest recede. */
|
|
1702
|
+
emphasize?: (datum: Record<string, any>, index: number) => boolean;
|
|
1703
|
+
onBarClick?: (datum: Record<string, any>, index: number) => void;
|
|
1704
|
+
}
|
|
1705
|
+
/** Grouped or stacked bars, vertical or horizontal, with per-category hover, keyboard reading and animated updates. */
|
|
1706
|
+
declare function BarChart({ data, category, series, layout, stacked, height: heightProp, formatValue, showValues, legend, label, view, animated, emphasize, onBarClick, className, ...rest }: BarChartProps): React.JSX.Element;
|
|
1707
|
+
|
|
1708
|
+
interface PartDatum {
|
|
1709
|
+
key: string;
|
|
1710
|
+
label: string;
|
|
1711
|
+
value: number;
|
|
1712
|
+
/** Categorical slot 1–8; defaults to position. */
|
|
1713
|
+
color?: number;
|
|
1714
|
+
}
|
|
1715
|
+
interface DonutChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1716
|
+
/** Up to six parts read well; fold the tail into "Other". */
|
|
1717
|
+
data: PartDatum[];
|
|
1718
|
+
/** Accessible name. */
|
|
1719
|
+
label: string;
|
|
1720
|
+
formatValue?: (value: number) => string;
|
|
1721
|
+
/** Diameter in px. */
|
|
1722
|
+
size?: number;
|
|
1723
|
+
thickness?: number;
|
|
1724
|
+
/** Text under the centre figure when nothing is hovered. */
|
|
1725
|
+
centerLabel?: React.ReactNode;
|
|
1726
|
+
/** Legend with values and shares beside or below the ring. */
|
|
1727
|
+
legend?: 'side' | 'bottom' | false;
|
|
1728
|
+
view?: 'chart' | 'table';
|
|
1729
|
+
animated?: boolean;
|
|
1730
|
+
}
|
|
1731
|
+
/** Part-to-whole as a ring. Hovering a part (or its legend row) moves its value into the centre. */
|
|
1732
|
+
declare function DonutChart({ data, label, formatValue, size, thickness, centerLabel, legend, view, animated, className, ...rest }: DonutChartProps): React.JSX.Element;
|
|
1733
|
+
interface DistributionBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1734
|
+
data: PartDatum[];
|
|
1735
|
+
label: string;
|
|
1736
|
+
formatValue?: (value: number) => string;
|
|
1737
|
+
/** `tall` — 28px blocks with shares printed inside · `thin` — an 8px meter with no text. */
|
|
1738
|
+
variant?: 'tall' | 'thin';
|
|
1739
|
+
/** Print value instead of share inside blocks. */
|
|
1740
|
+
show?: 'share' | 'value';
|
|
1741
|
+
legend?: boolean;
|
|
1742
|
+
animated?: boolean;
|
|
1743
|
+
}
|
|
1744
|
+
/** One whole, split into parts — the clearest part-to-whole figure for up to six parts. */
|
|
1745
|
+
declare function DistributionBar({ data, label, formatValue, variant, show, legend, animated, className, ...rest }: DistributionBarProps): React.JSX.Element;
|
|
1746
|
+
|
|
1747
|
+
interface HeatmapProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1748
|
+
/** Row labels (e.g. weekdays). */
|
|
1749
|
+
rows: string[];
|
|
1750
|
+
/** Column labels (e.g. hours or weeks). */
|
|
1751
|
+
columns: string[];
|
|
1752
|
+
/** values[row][column]; `null` = no data (drawn as an empty cell, distinct from zero). */
|
|
1753
|
+
values: Array<Array<number | null>>;
|
|
1754
|
+
label: string;
|
|
1755
|
+
formatValue?: (value: number) => string;
|
|
1756
|
+
/** Show every nth column label. Defaults to fitting. */
|
|
1757
|
+
columnLabelEvery?: number;
|
|
1758
|
+
/** Max cell size in px. Cells shrink to fit the width. */
|
|
1759
|
+
cellSize?: number;
|
|
1760
|
+
/** Words at the ends of the scale legend. */
|
|
1761
|
+
scaleLabels?: [low: string, high: string];
|
|
1762
|
+
view?: 'chart' | 'table';
|
|
1763
|
+
animated?: boolean;
|
|
1764
|
+
}
|
|
1765
|
+
/** A grid of values on a single-hue sequential scale, quantised into five steps with a scale legend. */
|
|
1766
|
+
declare function Heatmap({ rows, columns, values, label, formatValue, columnLabelEvery, cellSize, scaleLabels, view, animated, className, ...rest }: HeatmapProps): React.JSX.Element;
|
|
1767
|
+
|
|
1768
|
+
interface AnimatedNumberProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
1769
|
+
value: number;
|
|
1770
|
+
format?: (value: number) => string;
|
|
1771
|
+
/** Seconds. */
|
|
1772
|
+
duration?: number;
|
|
1773
|
+
/** Count up from 0 the first time it mounts. */
|
|
1774
|
+
countOnMount?: boolean;
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* A number that travels to its new value instead of snapping. Writes to the DOM directly —
|
|
1778
|
+
* no re-render per frame. Screen readers get the final value only.
|
|
1779
|
+
*/
|
|
1780
|
+
declare function AnimatedNumber({ value, format, duration, countOnMount, className, ...rest }: AnimatedNumberProps): React.JSX.Element;
|
|
1781
|
+
interface DeltaProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
1782
|
+
/** Change as a fraction: 0.124 = +12.4%. */
|
|
1783
|
+
value: number;
|
|
1784
|
+
/** Which direction is good. Colour = direction × goodness; the arrow and sign always carry it too. */
|
|
1785
|
+
good?: 'up' | 'down' | 'neutral';
|
|
1786
|
+
/** What it compares to, e.g. "vs last week". */
|
|
1787
|
+
context?: React.ReactNode;
|
|
1788
|
+
format?: (fraction: number) => string;
|
|
1789
|
+
}
|
|
1790
|
+
declare function Delta({ value, good, context, format, className, ...rest }: DeltaProps): React.JSX.Element;
|
|
1791
|
+
interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1792
|
+
/** Sentence case, no trailing colon. */
|
|
1793
|
+
label: React.ReactNode;
|
|
1794
|
+
value: number;
|
|
1795
|
+
format?: (value: number) => string;
|
|
1796
|
+
/** Change as a fraction vs the comparison period. */
|
|
1797
|
+
delta?: number;
|
|
1798
|
+
/** Which direction is good. */
|
|
1799
|
+
good?: 'up' | 'down' | 'neutral';
|
|
1800
|
+
deltaContext?: React.ReactNode;
|
|
1801
|
+
/** Up to ~12 points; drawn in a recessive tone with the current point in the accent. */
|
|
1802
|
+
trend?: number[];
|
|
1803
|
+
icon?: React.ReactNode;
|
|
1804
|
+
/** Hold the previous figure at reduced opacity while refreshing. */
|
|
1805
|
+
loading?: boolean;
|
|
1806
|
+
/** `card` — on its own surface · `plain` — for use inside a card or a strip. */
|
|
1807
|
+
variant?: 'card' | 'plain';
|
|
1808
|
+
/** Extra content under the figure (a progress meter, a footnote). */
|
|
1809
|
+
footer?: React.ReactNode;
|
|
1810
|
+
}
|
|
1811
|
+
/** A KPI tile: label, figure, change and trend. The figure animates to new values. */
|
|
1812
|
+
declare function Stat({ label, value, format, delta, good, deltaContext, trend, icon, loading, variant, footer, className, ...rest }: StatProps): React.JSX.Element;
|
|
1813
|
+
|
|
1814
|
+
type ThinkingVariant = 'shimmer' | 'skin' | 'orbit' | 'pulse';
|
|
1815
|
+
interface ThinkingIndicatorProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
1816
|
+
/** While true the indicator is alive; when it turns false it settles into `doneLabel`. */
|
|
1817
|
+
active?: boolean;
|
|
1818
|
+
/**
|
|
1819
|
+
* `shimmer` — light sweeps across the label · `skin` — a 3×3 field of dots ripples like cuttlefish skin ·
|
|
1820
|
+
* `orbit` — two satellites with depth · `pulse` — three dots that squash as they land.
|
|
1821
|
+
*/
|
|
1822
|
+
variant?: ThinkingVariant;
|
|
1823
|
+
label?: React.ReactNode;
|
|
1824
|
+
/** Rotating labels while active, e.g. `['Reading the file', 'Comparing totals']`. Each one morphs into the next. */
|
|
1825
|
+
phrases?: string[];
|
|
1826
|
+
/** Milliseconds between phrases. */
|
|
1827
|
+
phraseInterval?: number;
|
|
1828
|
+
/** Epoch ms the work started. Defaults to when `active` first became true. */
|
|
1829
|
+
startedAt?: number;
|
|
1830
|
+
/** Total time in ms, shown once inactive. Measured automatically when omitted. */
|
|
1831
|
+
duration?: number;
|
|
1832
|
+
/** Show the live elapsed time next to the label. */
|
|
1833
|
+
showElapsed?: boolean;
|
|
1834
|
+
doneLabel?: (ms: number) => React.ReactNode;
|
|
1835
|
+
size?: 'sm' | 'md';
|
|
1836
|
+
}
|
|
1837
|
+
/** A compact "the model is working" signal that turns into "Thought for 12s" when it's done. */
|
|
1838
|
+
declare function ThinkingIndicator({ active, variant, label, phrases, phraseInterval, startedAt, duration, showElapsed, doneLabel, size, className, ...rest }: ThinkingIndicatorProps): React.JSX.Element;
|
|
1839
|
+
|
|
1840
|
+
interface ReasoningStep {
|
|
1841
|
+
id: string;
|
|
1842
|
+
title: React.ReactNode;
|
|
1843
|
+
detail?: React.ReactNode;
|
|
1844
|
+
/** Defaults to `done`, except the last step while streaming, which is `active`. */
|
|
1845
|
+
status?: 'active' | 'done';
|
|
1846
|
+
}
|
|
1847
|
+
interface ReasoningProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1848
|
+
/** True while the model is still reasoning. */
|
|
1849
|
+
streaming: boolean;
|
|
1850
|
+
/** Structured steps — rendered as a thread that grows as steps arrive. */
|
|
1851
|
+
steps?: ReasoningStep[];
|
|
1852
|
+
/** Free-form reasoning (for example a `<StreamingText>`), shown under the steps. */
|
|
1853
|
+
children?: React.ReactNode;
|
|
1854
|
+
open?: boolean;
|
|
1855
|
+
defaultOpen?: boolean;
|
|
1856
|
+
onOpenChange?: (open: boolean) => void;
|
|
1857
|
+
/** Fold the panel away shortly after reasoning ends — unless the reader opened or closed it themselves. */
|
|
1858
|
+
autoCollapse?: boolean;
|
|
1859
|
+
startedAt?: number;
|
|
1860
|
+
/** Total reasoning time in ms (from your backend), shown once done. */
|
|
1861
|
+
duration?: number;
|
|
1862
|
+
label?: React.ReactNode;
|
|
1863
|
+
variant?: ThinkingVariant;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Collapsible reasoning: a live "Thinking" header that settles into "Thought for 12s",
|
|
1867
|
+
* with a peek of the current step while folded and a growing thread of steps when open.
|
|
1868
|
+
*/
|
|
1869
|
+
declare function Reasoning({ streaming, steps, children, open: openProp, defaultOpen, onOpenChange, autoCollapse, startedAt, duration, label, variant, className, ...rest }: ReasoningProps): React.JSX.Element;
|
|
1870
|
+
|
|
1871
|
+
interface StreamingTextProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
1872
|
+
/** The text received so far. Append to it as tokens arrive; replace it to start over. */
|
|
1873
|
+
text: string;
|
|
1874
|
+
/** True while more text may still arrive. */
|
|
1875
|
+
streaming?: boolean;
|
|
1876
|
+
/**
|
|
1877
|
+
* Characters per second at a steady pace. Network chunks are bursty; the reveal smooths them out
|
|
1878
|
+
* and speeds up when it falls behind, so it never lags more than a moment.
|
|
1879
|
+
*/
|
|
1880
|
+
speed?: number;
|
|
1881
|
+
/** Turn smoothing off to show text exactly as it arrives. */
|
|
1882
|
+
smooth?: boolean;
|
|
1883
|
+
/** How fresh words arrive: `fade` · `blur` (focus pull) · `rise` · `none`. */
|
|
1884
|
+
effect?: 'fade' | 'blur' | 'rise' | 'none';
|
|
1885
|
+
/** A caret at the end while streaming. */
|
|
1886
|
+
caret?: boolean;
|
|
1887
|
+
/** Called once the reveal has caught up after `streaming` turned false. */
|
|
1888
|
+
onRevealed?: () => void;
|
|
1889
|
+
as?: 'div' | 'p' | 'span';
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Renders a growing string the way people read: word by word, at an even pace, with new words
|
|
1893
|
+
* arriving softly. Settled text collapses back into plain text nodes, so long answers stay cheap.
|
|
1894
|
+
*/
|
|
1895
|
+
declare function StreamingText({ text, streaming, speed, smooth, effect, caret, onRevealed, as, className, ...rest }: StreamingTextProps): React.JSX.Element;
|
|
1896
|
+
|
|
1897
|
+
type ToolStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
|
|
1898
|
+
interface ToolCallProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'results'> {
|
|
1899
|
+
/** The tool's machine name, e.g. `search_orders`. */
|
|
1900
|
+
name: string;
|
|
1901
|
+
status: ToolStatus;
|
|
1902
|
+
/** A human label, e.g. "Searching orders". Defaults to `name`. */
|
|
1903
|
+
title?: React.ReactNode;
|
|
1904
|
+
/** Arguments the model passed — shown as JSON. */
|
|
1905
|
+
args?: unknown;
|
|
1906
|
+
/** The tool's output: JSON-serialisable data or your own rendering. */
|
|
1907
|
+
result?: unknown;
|
|
1908
|
+
error?: React.ReactNode;
|
|
1909
|
+
startedAt?: number;
|
|
1910
|
+
/** Ms, from your backend. Measured locally when omitted. */
|
|
1911
|
+
duration?: number;
|
|
1912
|
+
icon?: React.ReactNode;
|
|
1913
|
+
open?: boolean;
|
|
1914
|
+
defaultOpen?: boolean;
|
|
1915
|
+
onOpenChange?: (open: boolean) => void;
|
|
1916
|
+
/** With `status="pending"`, show an approval prompt (human in the loop). */
|
|
1917
|
+
onApprove?: () => void;
|
|
1918
|
+
onDeny?: () => void;
|
|
1919
|
+
approveLabel?: React.ReactNode;
|
|
1920
|
+
denyLabel?: React.ReactNode;
|
|
1921
|
+
}
|
|
1922
|
+
/** One tool invocation: a status glyph that morphs as it runs, a live timer, and inspectable arguments and output. */
|
|
1923
|
+
declare function ToolCall({ name, status, title, args, result, error, startedAt, duration, icon, open: openProp, defaultOpen, onOpenChange, onApprove, onDeny, approveLabel, denyLabel, className, ...rest }: ToolCallProps): React.JSX.Element;
|
|
1924
|
+
interface JsonViewProps extends React.HTMLAttributes<HTMLPreElement> {
|
|
1925
|
+
value: unknown;
|
|
1926
|
+
/** Strings longer than this are clipped with an ellipsis. */
|
|
1927
|
+
maxString?: number;
|
|
1928
|
+
}
|
|
1929
|
+
/** Pretty-printed, tinted JSON for tool inputs and outputs. */
|
|
1930
|
+
declare function JsonView({ value, maxString, className, ...rest }: JsonViewProps): React.JSX.Element;
|
|
1931
|
+
|
|
1932
|
+
type AgentStepStatus = 'queued' | 'running' | 'waiting' | 'done' | 'error' | 'skipped';
|
|
1933
|
+
interface AgentStep {
|
|
1934
|
+
id: string;
|
|
1935
|
+
title: React.ReactNode;
|
|
1936
|
+
status: AgentStepStatus;
|
|
1937
|
+
/** A line under the title — what the step found, or why it failed. */
|
|
1938
|
+
detail?: React.ReactNode;
|
|
1939
|
+
/** The tool it used, shown as a mono tag. */
|
|
1940
|
+
tool?: string;
|
|
1941
|
+
startedAt?: number;
|
|
1942
|
+
finishedAt?: number;
|
|
1943
|
+
/** Nested work. Folded once the parent is done. */
|
|
1944
|
+
steps?: AgentStep[];
|
|
1945
|
+
}
|
|
1946
|
+
type AgentRunStatus = 'running' | 'paused' | 'done' | 'error' | 'cancelled';
|
|
1947
|
+
interface AgentRunProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1948
|
+
title: React.ReactNode;
|
|
1949
|
+
steps: AgentStep[];
|
|
1950
|
+
/** Derived from the steps when omitted. */
|
|
1951
|
+
status?: AgentRunStatus;
|
|
1952
|
+
startedAt?: number;
|
|
1953
|
+
finishedAt?: number;
|
|
1954
|
+
onCancel?: () => void;
|
|
1955
|
+
onRetry?: (step: AgentStep) => void;
|
|
1956
|
+
/** Extra controls in the header (pause, open logs…). */
|
|
1957
|
+
actions?: React.ReactNode;
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* A live timeline for an agent working through a task: a segmented progress bar, steps that
|
|
1961
|
+
* light up as they start, live timers, nested sub-steps and retry for failures.
|
|
1962
|
+
*/
|
|
1963
|
+
declare function AgentRun({ title, steps, status: statusProp, startedAt, finishedAt, onCancel, onRetry, actions, className, ...rest }: AgentRunProps): React.JSX.Element;
|
|
1964
|
+
|
|
1965
|
+
interface ModelOption {
|
|
1966
|
+
id: string;
|
|
1967
|
+
name: string;
|
|
1968
|
+
/** Shown as a quiet prefix, e.g. the provider or family. */
|
|
1969
|
+
provider?: string;
|
|
1970
|
+
description?: React.ReactNode;
|
|
1971
|
+
/** 1–5. */
|
|
1972
|
+
speed?: number;
|
|
1973
|
+
/** 1–5. */
|
|
1974
|
+
intelligence?: number;
|
|
1975
|
+
/** Context window in tokens. */
|
|
1976
|
+
context?: number;
|
|
1977
|
+
badge?: string;
|
|
1978
|
+
icon?: React.ReactNode;
|
|
1979
|
+
disabled?: boolean;
|
|
1980
|
+
/** Why it's disabled — shown in place of the description. */
|
|
1981
|
+
reason?: React.ReactNode;
|
|
1982
|
+
group?: string;
|
|
1983
|
+
}
|
|
1984
|
+
interface ModelSelectorProps {
|
|
1985
|
+
models: ModelOption[];
|
|
1986
|
+
value?: string;
|
|
1987
|
+
defaultValue?: string;
|
|
1988
|
+
onValueChange?: (id: string) => void;
|
|
1989
|
+
size?: 'sm' | 'md';
|
|
1990
|
+
placement?: Placement;
|
|
1991
|
+
container?: HTMLElement | null;
|
|
1992
|
+
disabled?: boolean;
|
|
1993
|
+
className?: string;
|
|
1994
|
+
'aria-label'?: string;
|
|
1995
|
+
}
|
|
1996
|
+
/** Picks a model, with speed and capability meters, context size and badges. Keyboard and type-ahead friendly. */
|
|
1997
|
+
declare function ModelSelector({ models, value, defaultValue, onValueChange, size, placement, container, disabled, className, 'aria-label': ariaLabel }: ModelSelectorProps): React.JSX.Element;
|
|
1998
|
+
|
|
1999
|
+
interface PromptAttachment {
|
|
2000
|
+
id: string;
|
|
2001
|
+
name: string;
|
|
2002
|
+
size?: number;
|
|
2003
|
+
type?: string;
|
|
2004
|
+
/** The local file, when it came from this input. */
|
|
2005
|
+
file?: File;
|
|
2006
|
+
/** A preview or remote URL. Images without one get a local object URL. */
|
|
2007
|
+
url?: string;
|
|
2008
|
+
/** Set by your upload code. */
|
|
2009
|
+
status?: 'uploading' | 'ready' | 'error';
|
|
2010
|
+
/** 0–1 while uploading. */
|
|
2011
|
+
progress?: number;
|
|
2012
|
+
}
|
|
2013
|
+
interface PromptSuggestion {
|
|
2014
|
+
id: string;
|
|
2015
|
+
label: React.ReactNode;
|
|
2016
|
+
/** Text placed in the input. Defaults to `label` when it's a string. */
|
|
2017
|
+
prompt?: string;
|
|
2018
|
+
}
|
|
2019
|
+
interface PromptInputProps extends Omit<React.HTMLAttributes<HTMLFormElement>, 'onSubmit' | 'defaultValue' | 'placeholder'> {
|
|
2020
|
+
value?: string;
|
|
2021
|
+
defaultValue?: string;
|
|
2022
|
+
onValueChange?: (value: string) => void;
|
|
2023
|
+
/** Enter sends, Shift+Enter adds a line. An uncontrolled input clears itself after sending. */
|
|
2024
|
+
onSubmit?: (value: string, attachments: PromptAttachment[]) => void;
|
|
2025
|
+
/** `submitted` — waiting for the first token · `streaming` — the send button becomes Stop. */
|
|
2026
|
+
status?: 'idle' | 'submitted' | 'streaming';
|
|
2027
|
+
onStop?: () => void;
|
|
2028
|
+
/** One placeholder, or several that take turns while the input is empty. */
|
|
2029
|
+
placeholder?: string | string[];
|
|
2030
|
+
disabled?: boolean;
|
|
2031
|
+
minRows?: number;
|
|
2032
|
+
maxRows?: number;
|
|
2033
|
+
maxLength?: number;
|
|
2034
|
+
attachments?: PromptAttachment[];
|
|
2035
|
+
defaultAttachments?: PromptAttachment[];
|
|
2036
|
+
onAttachmentsChange?: (attachments: PromptAttachment[]) => void;
|
|
2037
|
+
/** Enables the attach button, paste and drop. Same syntax as `<input accept>`; `true` accepts anything. */
|
|
2038
|
+
accept?: string | boolean;
|
|
2039
|
+
suggestions?: PromptSuggestion[];
|
|
2040
|
+
/** Send a suggestion straight away instead of placing it in the input. */
|
|
2041
|
+
submitOnSuggestion?: boolean;
|
|
2042
|
+
/** Controls at the left of the footer — a model selector, tool toggles. */
|
|
2043
|
+
toolbar?: React.ReactNode;
|
|
2044
|
+
autoFocus?: boolean;
|
|
2045
|
+
'aria-label'?: string;
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* A composer for chat and agent apps: grows with its content, sends on Enter, turns into Stop while
|
|
2049
|
+
* a response streams, and takes files by picker, paste or drop. Uploading is yours — attachments
|
|
2050
|
+
* carry a `status` and `progress` you control.
|
|
2051
|
+
*/
|
|
2052
|
+
declare function PromptInput({ value, defaultValue, onValueChange, onSubmit, status, onStop, placeholder, disabled, minRows, maxRows, maxLength, attachments: attachmentsProp, defaultAttachments, onAttachmentsChange, accept, suggestions, submitOnSuggestion, toolbar, autoFocus, 'aria-label': ariaLabel, className, ...rest }: PromptInputProps): React.JSX.Element;
|
|
2053
|
+
|
|
2054
|
+
interface ChatMessageProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
2055
|
+
/** `user` messages sit in bubbles on the right; `assistant` messages read as plain prose. */
|
|
2056
|
+
from: 'user' | 'assistant' | 'system';
|
|
2057
|
+
avatar?: React.ReactNode;
|
|
2058
|
+
name?: React.ReactNode;
|
|
2059
|
+
time?: React.ReactNode;
|
|
2060
|
+
/** Shown under the message on hover and focus — usually `<MessageActions>`. */
|
|
2061
|
+
actions?: React.ReactNode;
|
|
2062
|
+
/** `sending` dims a user message; `error` offers `onRetry`. */
|
|
2063
|
+
status?: 'sending' | 'error';
|
|
2064
|
+
onRetry?: () => void;
|
|
2065
|
+
/** Animate in on mount. Turn off when rendering history. */
|
|
2066
|
+
animateIn?: boolean;
|
|
2067
|
+
}
|
|
2068
|
+
declare const ChatMessage: React.ForwardRefExoticComponent<ChatMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
2069
|
+
interface MessageActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2070
|
+
/** Text for the copy button. Omit to hide it. */
|
|
2071
|
+
copyText?: string;
|
|
2072
|
+
onCopy?: () => void;
|
|
2073
|
+
onRegenerate?: () => void;
|
|
2074
|
+
feedback?: 'up' | 'down' | null;
|
|
2075
|
+
onFeedback?: (value: 'up' | 'down' | null) => void;
|
|
2076
|
+
}
|
|
2077
|
+
/** Copy, regenerate and thumbs — each with its own small moment of feedback. */
|
|
2078
|
+
declare function MessageActions({ copyText, onCopy, onRegenerate, feedback, onFeedback, className, children, ...rest }: MessageActionsProps): React.JSX.Element;
|
|
2079
|
+
interface ChatThreadProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2080
|
+
/** Follow new content while the reader is at the bottom. Scrolling up pauses it. */
|
|
2081
|
+
stickToBottom?: boolean;
|
|
2082
|
+
/** Label of the pill that appears when new content arrives off-screen. */
|
|
2083
|
+
jumpLabel?: React.ReactNode;
|
|
2084
|
+
/** Shown when there are no children. */
|
|
2085
|
+
empty?: React.ReactNode;
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* A scrolling conversation that sticks to the latest message while you're there, lets go when
|
|
2089
|
+
* you scroll up to read, and offers a way back when something new arrives.
|
|
2090
|
+
*/
|
|
2091
|
+
declare const ChatThread: React.ForwardRefExoticComponent<ChatThreadProps & React.RefAttributes<HTMLDivElement>>;
|
|
2092
|
+
|
|
2093
|
+
interface ContextSegment {
|
|
2094
|
+
label: string;
|
|
2095
|
+
/** Tokens. */
|
|
2096
|
+
value: number;
|
|
2097
|
+
}
|
|
2098
|
+
interface ContextMeterProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
2099
|
+
/** Tokens used. Ignored when `segments` is given (their sum is used). */
|
|
2100
|
+
used?: number;
|
|
2101
|
+
/** The model's context window in tokens. */
|
|
2102
|
+
limit: number;
|
|
2103
|
+
/** Break usage down — system prompt, conversation, files… Each gets its own arc and legend row. */
|
|
2104
|
+
segments?: ContextSegment[];
|
|
2105
|
+
/** Ring diameter in px. */
|
|
2106
|
+
size?: number;
|
|
2107
|
+
/** Show the "64K / 200K" text next to the ring. */
|
|
2108
|
+
showLabel?: boolean;
|
|
2109
|
+
/** Fractions where the ring turns to warning and critical. */
|
|
2110
|
+
thresholds?: [warn: number, critical: number];
|
|
2111
|
+
}
|
|
2112
|
+
/** How full the context window is — a ring that warms as it fills, with an optional breakdown. */
|
|
2113
|
+
declare function ContextMeter({ used: usedProp, limit, segments, size, showLabel, thresholds, className, ...rest }: ContextMeterProps): React.JSX.Element;
|
|
2114
|
+
|
|
2115
|
+
interface GenerationPreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
2116
|
+
/** A partial or final image. While `progress < 1` it resolves out of the dot field. */
|
|
2117
|
+
src?: string;
|
|
2118
|
+
/** Describe the image for people who can't see it. */
|
|
2119
|
+
alt: string;
|
|
2120
|
+
status: 'queued' | 'generating' | 'done' | 'error';
|
|
2121
|
+
/** 0–1. Omit for an indeterminate field. */
|
|
2122
|
+
progress?: number;
|
|
2123
|
+
/** Width ÷ height. */
|
|
2124
|
+
aspectRatio?: number;
|
|
2125
|
+
/** Small caption over the field, e.g. "Rendering · step 18 of 30". */
|
|
2126
|
+
caption?: React.ReactNode;
|
|
2127
|
+
onRetry?: () => void;
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* A generation in progress: a living halftone field that resolves into the image as it arrives,
|
|
2131
|
+
* then hands over to a crisp `<img>`. Feed it your partial previews and progress events.
|
|
2132
|
+
*/
|
|
2133
|
+
declare function GenerationPreview({ src, alt, status, progress, aspectRatio, caption, onRetry, className, style, ...rest }: GenerationPreviewProps): React.JSX.Element;
|
|
2134
|
+
|
|
2135
|
+
interface ActivityPillProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
2136
|
+
/** What's happening now. Each new phase morphs in; the pill's width follows. Use a string key-able phase. */
|
|
2137
|
+
phase: string;
|
|
2138
|
+
/** Extra detail after the phase, e.g. "12 sources". */
|
|
2139
|
+
detail?: React.ReactNode;
|
|
2140
|
+
/** 0–1 for a determinate ring, omit for an indeterminate one. */
|
|
2141
|
+
progress?: number;
|
|
2142
|
+
tone?: 'neutral' | 'positive' | 'negative';
|
|
2143
|
+
/** Finished: the ring closes into a check (positive) or a mark (negative). */
|
|
2144
|
+
done?: boolean;
|
|
2145
|
+
icon?: React.ReactNode;
|
|
2146
|
+
}
|
|
2147
|
+
/** A compact, morphing status for long-running work — "Searching · 12 sources" → "Writing" → "Done". */
|
|
2148
|
+
declare function ActivityPill({ phase, detail, progress, tone, done, icon, className, ...rest }: ActivityPillProps): React.JSX.Element;
|
|
2149
|
+
|
|
2150
|
+
/** `4s`, `1m 12s`, `1h 03m`. Durations are in milliseconds. */
|
|
2151
|
+
declare function formatDuration(ms: number): string;
|
|
2152
|
+
/** `0:07`, `1:12` — a clock for live timers. */
|
|
2153
|
+
declare function formatClock(ms: number): string;
|
|
2154
|
+
|
|
2155
|
+
/** One vocabulary for every mascot, mapped to what an assistant is doing. */
|
|
2156
|
+
type MascotState = 'idle' | 'listening' | 'thinking' | 'speaking' | 'success' | 'error' | 'sleeping';
|
|
2157
|
+
declare const MASCOT_STATES: readonly MascotState[];
|
|
2158
|
+
interface MascotProps {
|
|
2159
|
+
state?: MascotState;
|
|
2160
|
+
/** Pixel size of the square the mascot occupies. */
|
|
2161
|
+
size?: number;
|
|
2162
|
+
/** Eyes follow the pointer. */
|
|
2163
|
+
track?: boolean;
|
|
2164
|
+
/** 0–1 voice or output level, for `speaking` (e.g. from an AnalyserNode). Animates on its own when omitted. */
|
|
2165
|
+
level?: number;
|
|
2166
|
+
/** Accessible name. The current state is appended. */
|
|
2167
|
+
label?: string;
|
|
2168
|
+
className?: string;
|
|
2169
|
+
style?: React.CSSProperties;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* **Bit** — a 16×16 pixel creature that moves in honest, stepped frames.
|
|
2174
|
+
* Antenna light for attention, pixel dots while thinking, a chattering mouth while speaking.
|
|
2175
|
+
*/
|
|
2176
|
+
declare function PixelMascot({ state, size, track, level, label, className, style }: MascotProps): React.JSX.Element;
|
|
2177
|
+
|
|
2178
|
+
/**
|
|
2179
|
+
* **Lumen** — a minimal orb with a single expressive eye. It leans toward you when listening,
|
|
2180
|
+
* traces an orbit while thinking, and its halo breathes with the voice `level` when speaking.
|
|
2181
|
+
*/
|
|
2182
|
+
declare function OrbMascot({ state, size, track, level, label, className, style }: MascotProps): React.JSX.Element;
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* **Moss** — a soft, living blob. Its outline never quite holds still; it leans in to listen,
|
|
2186
|
+
* shivers at errors, squashes and stretches for joy and melts a little when it sleeps.
|
|
2187
|
+
*/
|
|
2188
|
+
declare function BlobMascot({ state, size, track, level, label, className, style }: MascotProps): React.JSX.Element;
|
|
2189
|
+
|
|
2190
|
+
/**
|
|
2191
|
+
* **Quill** — a figure drawn with a pen. It draws itself in, then redraws its face for every state,
|
|
2192
|
+
* the nib visible as it writes: rings of sound when listening, a looping thought, a tick for success.
|
|
2193
|
+
*/
|
|
2194
|
+
declare function LineMascot({ state, size, track, level, label, className, style }: MascotProps): React.JSX.Element;
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* **Murmur** — a murmuration of points holding a face. It ripples outward to listen, swirls its edge
|
|
2198
|
+
* while thinking, pulses with your voice level, bursts and regathers on success and sinks to sleep.
|
|
2199
|
+
*/
|
|
2200
|
+
declare function ParticleMascot({ state, size, track, level, label, className, style }: MascotProps): React.JSX.Element;
|
|
2201
|
+
|
|
2202
|
+
type SortDirection = 'asc' | 'desc';
|
|
2203
|
+
interface SortState {
|
|
2204
|
+
id: string;
|
|
2205
|
+
direction: SortDirection;
|
|
2206
|
+
}
|
|
2207
|
+
interface DataTableColumn<T> {
|
|
2208
|
+
id: string;
|
|
2209
|
+
header: React.ReactNode;
|
|
2210
|
+
/** The value used for sorting, search, filters, editing and CSV. A field name or a function. */
|
|
2211
|
+
accessor?: keyof T | ((row: T) => unknown);
|
|
2212
|
+
/** Custom cell rendering. Receives the row and the accessor value. */
|
|
2213
|
+
cell?: (row: T, value: unknown) => React.ReactNode;
|
|
2214
|
+
align?: 'left' | 'right' | 'center';
|
|
2215
|
+
width?: number | string;
|
|
2216
|
+
sortable?: boolean;
|
|
2217
|
+
/** Include this column in the search box. Defaults to true when the column has an accessor. */
|
|
2218
|
+
searchable?: boolean;
|
|
2219
|
+
/** Faceted filter in the toolbar. Options are derived from the data when omitted. */
|
|
2220
|
+
filter?: {
|
|
2221
|
+
label?: string;
|
|
2222
|
+
options?: Array<{
|
|
2223
|
+
value: string;
|
|
2224
|
+
label: string;
|
|
2225
|
+
}>;
|
|
2226
|
+
};
|
|
2227
|
+
/** Can be hidden from the View menu. Default true. */
|
|
2228
|
+
hideable?: boolean;
|
|
2229
|
+
defaultHidden?: boolean;
|
|
2230
|
+
/** Inline editing: double-click, Enter or F2 on the cell. */
|
|
2231
|
+
editable?: {
|
|
2232
|
+
type?: 'text' | 'number' | 'select';
|
|
2233
|
+
options?: Array<string | {
|
|
2234
|
+
value: string;
|
|
2235
|
+
label: string;
|
|
2236
|
+
}>;
|
|
2237
|
+
/** Return a message to reject the value. */
|
|
2238
|
+
validate?: (value: string, row: T) => string | null | undefined;
|
|
2239
|
+
};
|
|
2240
|
+
}
|
|
2241
|
+
interface DataTableQuery {
|
|
2242
|
+
page: number;
|
|
2243
|
+
pageSize: number;
|
|
2244
|
+
sort: SortState | null;
|
|
2245
|
+
search: string;
|
|
2246
|
+
filters: Record<string, string[]>;
|
|
2247
|
+
}
|
|
2248
|
+
interface DataTableProps<T> {
|
|
2249
|
+
data: T[];
|
|
2250
|
+
columns: Array<DataTableColumn<T>>;
|
|
2251
|
+
getRowId: (row: T) => string;
|
|
2252
|
+
/** Accessible name of the table. */
|
|
2253
|
+
label: string;
|
|
2254
|
+
/**
|
|
2255
|
+
* `client` — sorts, filters and paginates `data` itself.
|
|
2256
|
+
* `server` — renders `data` as the current page; listen to `onQueryChange` and pass `rowCount`.
|
|
2257
|
+
*/
|
|
2258
|
+
mode?: 'client' | 'server';
|
|
2259
|
+
/** Total rows across pages (server mode). */
|
|
2260
|
+
rowCount?: number;
|
|
2261
|
+
onQueryChange?: (query: DataTableQuery) => void;
|
|
2262
|
+
/** Hold the current rows at reduced opacity while new ones load. With no rows yet, shows skeleton rows. */
|
|
2263
|
+
loading?: boolean;
|
|
2264
|
+
selectable?: boolean;
|
|
2265
|
+
selection?: string[];
|
|
2266
|
+
defaultSelection?: string[];
|
|
2267
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
2268
|
+
/** Actions shown in the floating bar while rows are selected. */
|
|
2269
|
+
bulkActions?: (ids: string[], clear: () => void) => React.ReactNode;
|
|
2270
|
+
/** Row menu (… button and right-click). */
|
|
2271
|
+
rowActions?: (row: T) => MenuEntry[];
|
|
2272
|
+
onRowClick?: (row: T) => void;
|
|
2273
|
+
/** Persist an inline edit. Throw or reject to keep the editor open with the error message. */
|
|
2274
|
+
onCellEdit?: (rowId: string, columnId: string, value: string, row: T) => void | Promise<void>;
|
|
2275
|
+
initialSort?: SortState | null;
|
|
2276
|
+
pageSizes?: number[];
|
|
2277
|
+
defaultPageSize?: number;
|
|
2278
|
+
searchPlaceholder?: string;
|
|
2279
|
+
/** Extra controls on the right of the toolbar. */
|
|
2280
|
+
toolbar?: React.ReactNode;
|
|
2281
|
+
/** Adds an "Export CSV" action for the filtered rows and visible columns. */
|
|
2282
|
+
exportFilename?: string;
|
|
2283
|
+
/** Shown when there is no data at all (not when filters hide everything). */
|
|
2284
|
+
emptyState?: React.ReactNode;
|
|
2285
|
+
defaultDensity?: 'comfortable' | 'compact';
|
|
2286
|
+
/** Scroll the body with a sticky header beyond this height. */
|
|
2287
|
+
maxHeight?: number | string;
|
|
2288
|
+
className?: string;
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* A complete data table: search, faceted filters, sorting, pagination, multi-select with a bulk bar,
|
|
2292
|
+
* inline editing, row menus, column visibility, density and CSV export. Client- or server-driven.
|
|
2293
|
+
*/
|
|
2294
|
+
declare function DataTable<T>(props: DataTableProps<T>): React.JSX.Element;
|
|
2295
|
+
|
|
2296
|
+
/**
|
|
2297
|
+
* What your handler returns. Return nothing on success; return `{ error }` (optionally with the
|
|
2298
|
+
* offending `field`) to show a message. Thrown errors are shown as a form-level message.
|
|
2299
|
+
*/
|
|
2300
|
+
type AuthResult = void | undefined | {
|
|
2301
|
+
error: string;
|
|
2302
|
+
field?: string;
|
|
2303
|
+
};
|
|
2304
|
+
type Handler<V> = (values: V) => AuthResult | Promise<AuthResult>;
|
|
2305
|
+
interface AuthProvider {
|
|
2306
|
+
id: string;
|
|
2307
|
+
label: string;
|
|
2308
|
+
icon?: React.ReactNode;
|
|
2309
|
+
/** Start the provider's flow (usually a redirect). */
|
|
2310
|
+
onSelect: () => void | Promise<void>;
|
|
2311
|
+
}
|
|
2312
|
+
/** A countdown that restarts on demand — for "Resend code in 0:42". */
|
|
2313
|
+
declare function useCooldown(seconds: number): {
|
|
2314
|
+
left: number;
|
|
2315
|
+
start: () => void;
|
|
2316
|
+
ready: boolean;
|
|
2317
|
+
};
|
|
2318
|
+
interface AuthCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
2319
|
+
/** Your logo or product mark. */
|
|
2320
|
+
logo?: React.ReactNode;
|
|
2321
|
+
title: React.ReactNode;
|
|
2322
|
+
description?: React.ReactNode;
|
|
2323
|
+
/** Below the card body, e.g. "No account? Sign up". */
|
|
2324
|
+
footer?: React.ReactNode;
|
|
2325
|
+
children: React.ReactNode;
|
|
2326
|
+
}
|
|
2327
|
+
/** The frame every auth step shares: mark, heading, form, footer. */
|
|
2328
|
+
declare function AuthCard({ logo, title, description, footer, children, className, ...rest }: AuthCardProps): React.JSX.Element;
|
|
2329
|
+
/** Provider buttons ("Continue with …"). Each shows its own pending state. */
|
|
2330
|
+
declare function ProviderButtons({ providers, disabled }: {
|
|
2331
|
+
providers: AuthProvider[];
|
|
2332
|
+
disabled?: boolean;
|
|
2333
|
+
}): React.JSX.Element;
|
|
2334
|
+
interface SignInValues {
|
|
2335
|
+
email: string;
|
|
2336
|
+
password: string;
|
|
2337
|
+
remember: boolean;
|
|
2338
|
+
}
|
|
2339
|
+
interface SignInFormProps {
|
|
2340
|
+
onSubmit: Handler<SignInValues>;
|
|
2341
|
+
providers?: AuthProvider[];
|
|
2342
|
+
/** Shows "Forgot password?" next to the password label. */
|
|
2343
|
+
onForgotPassword?: () => void;
|
|
2344
|
+
/** Show the "Keep me signed in" checkbox. */
|
|
2345
|
+
rememberMe?: boolean;
|
|
2346
|
+
defaultEmail?: string;
|
|
2347
|
+
submitLabel?: string;
|
|
2348
|
+
className?: string;
|
|
2349
|
+
}
|
|
2350
|
+
/** Email + password with provider sign-in, client validation and server errors mapped to fields. */
|
|
2351
|
+
declare function SignInForm({ onSubmit, providers, onForgotPassword, rememberMe, defaultEmail, submitLabel, className }: SignInFormProps): React.JSX.Element;
|
|
2352
|
+
interface PasswordStrength {
|
|
2353
|
+
/** 0 (too weak) – 4 (strong). */
|
|
2354
|
+
score: 0 | 1 | 2 | 3 | 4;
|
|
2355
|
+
label: 'Too weak' | 'Weak' | 'Fair' | 'Good' | 'Strong';
|
|
2356
|
+
/** The single most useful next step, if any. */
|
|
2357
|
+
hint: string | null;
|
|
2358
|
+
}
|
|
2359
|
+
/** A local, dependency-free estimate. It does not replace server-side checks against breached-password lists. */
|
|
2360
|
+
declare function estimatePasswordStrength(password: string, context?: string[]): PasswordStrength;
|
|
2361
|
+
/** A four-segment meter with a label and the next suggestion. */
|
|
2362
|
+
declare function PasswordMeter({ password, context }: {
|
|
2363
|
+
password: string;
|
|
2364
|
+
context?: string[];
|
|
2365
|
+
}): React.JSX.Element;
|
|
2366
|
+
interface SignUpValues {
|
|
2367
|
+
name: string;
|
|
2368
|
+
email: string;
|
|
2369
|
+
password: string;
|
|
2370
|
+
company?: string;
|
|
2371
|
+
acceptedTerms: boolean;
|
|
2372
|
+
}
|
|
2373
|
+
interface SignUpFormProps {
|
|
2374
|
+
onSubmit: Handler<SignUpValues>;
|
|
2375
|
+
providers?: AuthProvider[];
|
|
2376
|
+
/** Ask for a company / workspace name too. */
|
|
2377
|
+
askCompany?: boolean;
|
|
2378
|
+
/** Label for the terms checkbox; when given, acceptance is required. */
|
|
2379
|
+
terms?: React.ReactNode;
|
|
2380
|
+
/** Minimum strength score accepted (0–4). Default 2. */
|
|
2381
|
+
minStrength?: number;
|
|
2382
|
+
submitLabel?: string;
|
|
2383
|
+
className?: string;
|
|
2384
|
+
}
|
|
2385
|
+
declare function SignUpForm({ onSubmit, providers, askCompany, terms, minStrength, submitLabel, className }: SignUpFormProps): React.JSX.Element;
|
|
2386
|
+
interface ForgotPasswordFormProps {
|
|
2387
|
+
/** Send the reset link. For privacy, show the same confirmation whether or not the account exists. */
|
|
2388
|
+
onSubmit: Handler<{
|
|
2389
|
+
email: string;
|
|
2390
|
+
}>;
|
|
2391
|
+
onResend?: Handler<{
|
|
2392
|
+
email: string;
|
|
2393
|
+
}>;
|
|
2394
|
+
onBack?: () => void;
|
|
2395
|
+
defaultEmail?: string;
|
|
2396
|
+
/** Seconds before "Resend" is available again. */
|
|
2397
|
+
cooldown?: number;
|
|
2398
|
+
className?: string;
|
|
2399
|
+
}
|
|
2400
|
+
declare function ForgotPasswordForm({ onSubmit, onResend, onBack, defaultEmail, cooldown, className }: ForgotPasswordFormProps): React.JSX.Element;
|
|
2401
|
+
interface VerifyCodeFormProps {
|
|
2402
|
+
/** Check the code. Return `{ error }` to reject it. */
|
|
2403
|
+
onVerify: Handler<{
|
|
2404
|
+
code: string;
|
|
2405
|
+
}>;
|
|
2406
|
+
onResend?: () => void | Promise<void>;
|
|
2407
|
+
/** Where the code was sent, shown masked: "a•••@company.com". */
|
|
2408
|
+
destination?: string;
|
|
2409
|
+
length?: number;
|
|
2410
|
+
cooldown?: number;
|
|
2411
|
+
className?: string;
|
|
2412
|
+
}
|
|
2413
|
+
declare function maskDestination(d: string): string;
|
|
2414
|
+
/** One-time code entry: auto-submits when complete, shakes on a wrong code, resends with a cooldown. */
|
|
2415
|
+
declare function VerifyCodeForm({ onVerify, onResend, destination, length, cooldown, className }: VerifyCodeFormProps): React.JSX.Element;
|
|
2416
|
+
|
|
2417
|
+
interface OpenProps {
|
|
2418
|
+
open?: boolean;
|
|
2419
|
+
defaultOpen?: boolean;
|
|
2420
|
+
onOpenChange?: (open: boolean) => void;
|
|
2421
|
+
/** Element that opens the dialog. */
|
|
2422
|
+
trigger?: React.ReactElement;
|
|
2423
|
+
container?: HTMLElement | null;
|
|
2424
|
+
}
|
|
2425
|
+
interface ConfirmDialogProps extends OpenProps {
|
|
2426
|
+
title: React.ReactNode;
|
|
2427
|
+
description?: React.ReactNode;
|
|
2428
|
+
/** What will happen, listed under the description. */
|
|
2429
|
+
details?: React.ReactNode;
|
|
2430
|
+
confirmLabel?: string;
|
|
2431
|
+
cancelLabel?: string;
|
|
2432
|
+
tone?: 'default' | 'danger';
|
|
2433
|
+
/** Ask the user to type this text (e.g. the project name) before confirming. */
|
|
2434
|
+
requireText?: string;
|
|
2435
|
+
/** Throw or reject to keep the dialog open and show the message. */
|
|
2436
|
+
onConfirm: () => void | Promise<void>;
|
|
2437
|
+
}
|
|
2438
|
+
/** A confirmation that needs a deliberate answer. Stays open, with the error, if the action fails. */
|
|
2439
|
+
declare function ConfirmDialog({ title, description, details, confirmLabel, cancelLabel, tone, requireText, onConfirm, open: openProp, defaultOpen, onOpenChange, trigger, container }: ConfirmDialogProps): React.JSX.Element;
|
|
2440
|
+
type FormDialogResult = void | undefined | {
|
|
2441
|
+
error: string;
|
|
2442
|
+
field?: string;
|
|
2443
|
+
};
|
|
2444
|
+
interface FormDialogProps extends OpenProps {
|
|
2445
|
+
title: React.ReactNode;
|
|
2446
|
+
description?: React.ReactNode;
|
|
2447
|
+
/** Your fields. Give inputs a `name`; the values arrive as FormData. */
|
|
2448
|
+
children: React.ReactNode;
|
|
2449
|
+
/** Return `{ error, field? }` or throw to keep the dialog open with the message. */
|
|
2450
|
+
onSubmit: (data: FormData) => FormDialogResult | Promise<FormDialogResult>;
|
|
2451
|
+
submitLabel?: string;
|
|
2452
|
+
cancelLabel?: string;
|
|
2453
|
+
size?: DialogSize;
|
|
2454
|
+
placement?: DialogPlacement;
|
|
2455
|
+
/** Ask before discarding edits when closing. Default true. */
|
|
2456
|
+
guardChanges?: boolean;
|
|
2457
|
+
/** Extra footer content on the left (e.g. a delete action). */
|
|
2458
|
+
footerStart?: React.ReactNode;
|
|
2459
|
+
}
|
|
2460
|
+
/** A dialog around a form: ⌘/Ctrl+Enter submits, edits are protected from accidental dismissal, errors map to fields. */
|
|
2461
|
+
declare function FormDialog({ title, description, children, onSubmit, submitLabel, cancelLabel, size, placement, guardChanges, footerStart, open: openProp, defaultOpen, onOpenChange, trigger, container, }: FormDialogProps): React.JSX.Element;
|
|
2462
|
+
interface WizardStep {
|
|
2463
|
+
id: string;
|
|
2464
|
+
title: string;
|
|
2465
|
+
description?: string;
|
|
2466
|
+
content: React.ReactNode;
|
|
2467
|
+
/** Return true to continue, or a message to stay on the step. May be async. */
|
|
2468
|
+
validate?: () => true | string | Promise<true | string>;
|
|
2469
|
+
}
|
|
2470
|
+
interface WizardDialogProps extends OpenProps {
|
|
2471
|
+
title: React.ReactNode;
|
|
2472
|
+
steps: WizardStep[];
|
|
2473
|
+
/** Runs after the last step validates. Throw to stay open with the message. */
|
|
2474
|
+
onFinish: () => void | Promise<void>;
|
|
2475
|
+
finishLabel?: string;
|
|
2476
|
+
size?: DialogSize;
|
|
2477
|
+
}
|
|
2478
|
+
/** A multi-step flow in one dialog: progress at the top, directional transitions, per-step validation. */
|
|
2479
|
+
declare function WizardDialog({ title, steps, onFinish, finishLabel, size, open: openProp, defaultOpen, onOpenChange, trigger, container }: WizardDialogProps): React.JSX.Element;
|
|
2480
|
+
|
|
2481
|
+
interface ShellState {
|
|
2482
|
+
collapsed: boolean;
|
|
2483
|
+
setCollapsed: (v: boolean) => void;
|
|
2484
|
+
/** The shell is narrower than `compactBelow`: the sidebar becomes an overlay. */
|
|
2485
|
+
compact: boolean;
|
|
2486
|
+
navOpen: boolean;
|
|
2487
|
+
setNavOpen: (v: boolean) => void;
|
|
2488
|
+
}
|
|
2489
|
+
/** Read and control the surrounding AppShell (collapse, mobile navigation). */
|
|
2490
|
+
declare const useAppShell: () => ShellState;
|
|
2491
|
+
interface AppShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2492
|
+
sidebar: React.ReactNode;
|
|
2493
|
+
topbar?: React.ReactNode;
|
|
2494
|
+
children: React.ReactNode;
|
|
2495
|
+
collapsed?: boolean;
|
|
2496
|
+
defaultCollapsed?: boolean;
|
|
2497
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
2498
|
+
/** Below this container width the sidebar turns into an overlay. Default 860. */
|
|
2499
|
+
compactBelow?: number;
|
|
2500
|
+
/** Toggle the sidebar with ⌘/Ctrl + B. Default true. */
|
|
2501
|
+
shortcut?: boolean;
|
|
2502
|
+
}
|
|
2503
|
+
/**
|
|
2504
|
+
* The frame of an application: a collapsible sidebar, a top bar and a scrolling main area.
|
|
2505
|
+
* It adapts to its own width (not the viewport), so it also works inside panels and previews.
|
|
2506
|
+
*/
|
|
2507
|
+
declare function AppShell({ sidebar, topbar, children, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, compactBelow, shortcut, className, ...rest }: AppShellProps): React.JSX.Element;
|
|
2508
|
+
interface NavItem {
|
|
2509
|
+
id: string;
|
|
2510
|
+
label: string;
|
|
2511
|
+
icon?: React.ReactNode;
|
|
2512
|
+
href?: string;
|
|
2513
|
+
/** A count or status at the end of the row. */
|
|
2514
|
+
badge?: React.ReactNode;
|
|
2515
|
+
/** One level of nesting. */
|
|
2516
|
+
children?: NavItem[];
|
|
2517
|
+
}
|
|
2518
|
+
interface NavSection {
|
|
2519
|
+
id: string;
|
|
2520
|
+
label?: string;
|
|
2521
|
+
items: NavItem[];
|
|
2522
|
+
}
|
|
2523
|
+
interface SidebarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
2524
|
+
sections: NavSection[];
|
|
2525
|
+
activeId?: string;
|
|
2526
|
+
onNavigate?: (item: NavItem, event: React.MouseEvent) => void;
|
|
2527
|
+
/** Top slot — usually a WorkspaceSwitcher. */
|
|
2528
|
+
header?: React.ReactNode;
|
|
2529
|
+
/** Bottom slot — usually the signed-in user. */
|
|
2530
|
+
footer?: React.ReactNode;
|
|
2531
|
+
/** Render links with your router. */
|
|
2532
|
+
renderLink?: (props: {
|
|
2533
|
+
href: string;
|
|
2534
|
+
className: string;
|
|
2535
|
+
children: React.ReactNode;
|
|
2536
|
+
onClick: (e: React.MouseEvent) => void;
|
|
2537
|
+
'aria-current'?: 'page';
|
|
2538
|
+
}) => React.ReactNode;
|
|
2539
|
+
}
|
|
2540
|
+
declare function Sidebar({ sections, activeId, onNavigate, header, footer, renderLink, className, ...rest }: SidebarProps): React.JSX.Element;
|
|
2541
|
+
interface Workspace {
|
|
2542
|
+
id: string;
|
|
2543
|
+
name: string;
|
|
2544
|
+
/** A plan or a secondary line. */
|
|
2545
|
+
meta?: string;
|
|
2546
|
+
logo?: string;
|
|
2547
|
+
}
|
|
2548
|
+
declare function WorkspaceSwitcher({ workspaces, activeId, onSelect, onCreate }: {
|
|
2549
|
+
workspaces: Workspace[];
|
|
2550
|
+
activeId: string;
|
|
2551
|
+
onSelect: (id: string) => void;
|
|
2552
|
+
onCreate?: () => void;
|
|
2553
|
+
}): React.JSX.Element | null;
|
|
2554
|
+
interface UserMenuProps {
|
|
2555
|
+
name: string;
|
|
2556
|
+
email?: string;
|
|
2557
|
+
avatar?: string;
|
|
2558
|
+
items: MenuEntry[];
|
|
2559
|
+
/** `row` for sidebar footers, `avatar` for top bars. */
|
|
2560
|
+
variant?: 'row' | 'avatar';
|
|
2561
|
+
}
|
|
2562
|
+
declare function UserMenu({ name, email, avatar, items, variant }: UserMenuProps): React.JSX.Element;
|
|
2563
|
+
interface TopbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
2564
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
2565
|
+
/** Opens your search / command palette. Shows a ⌘K hint. */
|
|
2566
|
+
onSearch?: () => void;
|
|
2567
|
+
searchPlaceholder?: string;
|
|
2568
|
+
/** Right-aligned controls (notifications, help, user menu). */
|
|
2569
|
+
actions?: React.ReactNode;
|
|
2570
|
+
}
|
|
2571
|
+
declare function Topbar({ breadcrumbs, onSearch, searchPlaceholder, actions, className, children, ...rest }: TopbarProps): React.JSX.Element;
|
|
2572
|
+
interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
2573
|
+
title: React.ReactNode;
|
|
2574
|
+
description?: React.ReactNode;
|
|
2575
|
+
actions?: React.ReactNode;
|
|
2576
|
+
/** Small text above the title (a section name, a record id). */
|
|
2577
|
+
eyebrow?: React.ReactNode;
|
|
2578
|
+
}
|
|
2579
|
+
declare function PageHeader({ title, description, actions, eyebrow, className, children, ...rest }: PageHeaderProps): React.JSX.Element;
|
|
2580
|
+
|
|
2581
|
+
interface KanbanColumn {
|
|
2582
|
+
id: string;
|
|
2583
|
+
title: string;
|
|
2584
|
+
/** Work-in-progress limit; the count turns to a warning above it. */
|
|
2585
|
+
limit?: number;
|
|
2586
|
+
/** Categorical slot 1–8 for the column's dot. */
|
|
2587
|
+
color?: number;
|
|
2588
|
+
}
|
|
2589
|
+
interface KanbanItem {
|
|
2590
|
+
id: string;
|
|
2591
|
+
columnId: string;
|
|
2592
|
+
}
|
|
2593
|
+
interface KanbanBoardProps<T extends KanbanItem> {
|
|
2594
|
+
columns: KanbanColumn[];
|
|
2595
|
+
/** All cards. Order within a column follows array order. */
|
|
2596
|
+
items: T[];
|
|
2597
|
+
renderCard: (item: T, state: {
|
|
2598
|
+
dragging: boolean;
|
|
2599
|
+
overlay: boolean;
|
|
2600
|
+
}) => React.ReactNode;
|
|
2601
|
+
/** Persist a move. `index` is the position in the destination column. */
|
|
2602
|
+
onMove: (itemId: string, toColumnId: string, index: number) => void;
|
|
2603
|
+
/** Shows "Add card" at the bottom of each column. */
|
|
2604
|
+
onAdd?: (columnId: string) => void;
|
|
2605
|
+
/** A click (no drag) or Enter on a card — usually opens its details. Space still picks it up. */
|
|
2606
|
+
onItemClick?: (item: T) => void;
|
|
2607
|
+
/** Short text for screen-reader announcements. */
|
|
2608
|
+
getItemLabel: (item: T) => string;
|
|
2609
|
+
className?: string;
|
|
2610
|
+
'aria-label'?: string;
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2613
|
+
* A board of columns and cards. Drag with a pointer, or with the keyboard: Space to pick up,
|
|
2614
|
+
* arrows to move, Space to drop, Escape to cancel. Moves are announced to screen readers.
|
|
2615
|
+
*/
|
|
2616
|
+
declare function KanbanBoard<T extends KanbanItem>({ columns, items, renderCard, onMove, onAdd, onItemClick, getItemLabel, className, ...rest }: KanbanBoardProps<T>): React.JSX.Element;
|
|
2617
|
+
|
|
2618
|
+
/** "now", "5m", "3h", "Mon", "Oct 4" — compact relative time for lists. */
|
|
2619
|
+
declare function formatRelative(date: Date, now?: Date): string;
|
|
2620
|
+
/** "Today", "Yesterday", or a date — the heading for a group of items. */
|
|
2621
|
+
declare function dayLabel(date: Date, now?: Date): string;
|
|
2622
|
+
interface NotificationItem {
|
|
2623
|
+
id: string;
|
|
2624
|
+
title: React.ReactNode;
|
|
2625
|
+
body?: React.ReactNode;
|
|
2626
|
+
time: Date;
|
|
2627
|
+
read?: boolean;
|
|
2628
|
+
actor?: {
|
|
2629
|
+
name: string;
|
|
2630
|
+
avatar?: string;
|
|
2631
|
+
};
|
|
2632
|
+
/** Used by the "Mentions" tab when kind === 'mention'. */
|
|
2633
|
+
kind?: string;
|
|
2634
|
+
}
|
|
2635
|
+
interface NotificationCenterProps {
|
|
2636
|
+
notifications: NotificationItem[];
|
|
2637
|
+
onMarkRead: (ids: string[]) => void;
|
|
2638
|
+
onArchive?: (id: string) => void;
|
|
2639
|
+
onItemClick?: (item: NotificationItem) => void;
|
|
2640
|
+
/** Footer link, e.g. to a full notifications page. */
|
|
2641
|
+
footer?: React.ReactNode;
|
|
2642
|
+
placement?: 'bottom-end' | 'bottom-start' | 'bottom';
|
|
2643
|
+
container?: HTMLElement | null;
|
|
2644
|
+
}
|
|
2645
|
+
/** A bell with an unread count that opens an inbox: tabs, day groups, mark read, archive. */
|
|
2646
|
+
declare function NotificationCenter({ notifications, onMarkRead, onArchive, onItemClick, footer, placement, container }: NotificationCenterProps): React.JSX.Element;
|
|
2647
|
+
interface ActivityEvent {
|
|
2648
|
+
id: string;
|
|
2649
|
+
actor: {
|
|
2650
|
+
name: string;
|
|
2651
|
+
avatar?: string;
|
|
2652
|
+
};
|
|
2653
|
+
/** The verb phrase: "moved", "commented on", "closed". */
|
|
2654
|
+
action: React.ReactNode;
|
|
2655
|
+
/** What it happened to. */
|
|
2656
|
+
target?: React.ReactNode;
|
|
2657
|
+
time: Date;
|
|
2658
|
+
/** A quote, a diff or an attachment shown under the line. */
|
|
2659
|
+
detail?: React.ReactNode;
|
|
2660
|
+
/** Replaces the avatar with a small system icon. */
|
|
2661
|
+
icon?: React.ReactNode;
|
|
2662
|
+
}
|
|
2663
|
+
interface ActivityFeedProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2664
|
+
/** Newest first. */
|
|
2665
|
+
events: ActivityEvent[];
|
|
2666
|
+
/** Events waiting to be shown (e.g. arrived while the user was reading). */
|
|
2667
|
+
pending?: number;
|
|
2668
|
+
onShowPending?: () => void;
|
|
2669
|
+
groupByDay?: boolean;
|
|
2670
|
+
}
|
|
2671
|
+
/** A vertical timeline of who did what. New arrivals wait behind a "show" pill instead of shifting the list. */
|
|
2672
|
+
declare function ActivityFeed({ events, pending, onShowPending, groupByDay: grouped, className, ...rest }: ActivityFeedProps): React.JSX.Element;
|
|
2673
|
+
|
|
2674
|
+
/** Monday-based start of the week containing `d`. */
|
|
2675
|
+
declare const startOfWeek: (d: Date, weekStartsOn?: number) => Date;
|
|
2676
|
+
interface CalendarEvent {
|
|
2677
|
+
id: string;
|
|
2678
|
+
title: string;
|
|
2679
|
+
start: Date;
|
|
2680
|
+
end: Date;
|
|
2681
|
+
/** Categorical slot 1–8. */
|
|
2682
|
+
color?: number;
|
|
2683
|
+
/** A second line (location, attendees). */
|
|
2684
|
+
meta?: string;
|
|
2685
|
+
/** Prevent moving/resizing this event. */
|
|
2686
|
+
locked?: boolean;
|
|
2687
|
+
}
|
|
2688
|
+
interface WeekViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
2689
|
+
events: CalendarEvent[];
|
|
2690
|
+
/** Any date in the week to show. */
|
|
2691
|
+
date: Date;
|
|
2692
|
+
/** 5 for a working week, 7 for a full week. */
|
|
2693
|
+
days?: 5 | 7;
|
|
2694
|
+
startHour?: number;
|
|
2695
|
+
endHour?: number;
|
|
2696
|
+
/** Pixel height of one hour. */
|
|
2697
|
+
hourHeight?: number;
|
|
2698
|
+
/** Snap step in minutes for creating, moving and resizing. */
|
|
2699
|
+
step?: number;
|
|
2700
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
2701
|
+
/** Click on an empty slot — usually opens a "new event" form at that time. */
|
|
2702
|
+
onSlotClick?: (start: Date) => void;
|
|
2703
|
+
/** Persist a move or resize. Without it, events are read-only. */
|
|
2704
|
+
onEventChange?: (id: string, start: Date, end: Date) => void;
|
|
2705
|
+
/** Override "now" (for tests and screenshots). */
|
|
2706
|
+
now?: Date;
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* A week of days on a time grid: overlapping events share the width, drag to move, pull the bottom
|
|
2710
|
+
* edge to resize (snapped), click empty time to create. Alt + arrows move a focused event.
|
|
2711
|
+
*/
|
|
2712
|
+
declare function WeekView({ events, date, days, startHour, endHour, hourHeight, step, onEventClick, onSlotClick, onEventChange, now: nowProp, className, ...rest }: WeekViewProps): React.JSX.Element;
|
|
2713
|
+
interface TimelineTask {
|
|
2714
|
+
id: string;
|
|
2715
|
+
label: string;
|
|
2716
|
+
start: Date;
|
|
2717
|
+
end: Date;
|
|
2718
|
+
/** 0–1 completion, drawn as a fill inside the bar. */
|
|
2719
|
+
progress?: number;
|
|
2720
|
+
/** Categorical slot 1–8. */
|
|
2721
|
+
color?: number;
|
|
2722
|
+
/** Rows sharing a group are listed under a heading. */
|
|
2723
|
+
group?: string;
|
|
2724
|
+
/** Draw as a diamond at `start`. */
|
|
2725
|
+
milestone?: boolean;
|
|
2726
|
+
/** Short text at the end of the bar (an owner, a status). */
|
|
2727
|
+
note?: string;
|
|
2728
|
+
}
|
|
2729
|
+
interface TimelineProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2730
|
+
tasks: TimelineTask[];
|
|
2731
|
+
/** Visible range. Defaults to the tasks' range with a little padding. */
|
|
2732
|
+
from?: Date;
|
|
2733
|
+
to?: Date;
|
|
2734
|
+
/** Width of one day in px. */
|
|
2735
|
+
dayWidth?: number;
|
|
2736
|
+
rowHeight?: number;
|
|
2737
|
+
labelWidth?: number;
|
|
2738
|
+
onTaskClick?: (task: TimelineTask) => void;
|
|
2739
|
+
now?: Date;
|
|
2740
|
+
}
|
|
2741
|
+
/** A project timeline: grouped rows, bars with progress, milestones, weekends shaded and a "today" line. */
|
|
2742
|
+
declare function Timeline({ tasks, from, to, dayWidth, rowHeight, labelWidth, onTaskClick, now: nowProp, className, ...rest }: TimelineProps): React.JSX.Element;
|
|
2743
|
+
|
|
2744
|
+
interface Permission {
|
|
2745
|
+
id: string;
|
|
2746
|
+
label: string;
|
|
2747
|
+
description?: string;
|
|
2748
|
+
}
|
|
2749
|
+
interface PermissionGroup {
|
|
2750
|
+
id: string;
|
|
2751
|
+
label: string;
|
|
2752
|
+
permissions: Permission[];
|
|
2753
|
+
}
|
|
2754
|
+
interface Role {
|
|
2755
|
+
id: string;
|
|
2756
|
+
name: string;
|
|
2757
|
+
description?: string;
|
|
2758
|
+
/** Can't be edited (e.g. Owner always has everything). */
|
|
2759
|
+
locked?: boolean;
|
|
2760
|
+
}
|
|
2761
|
+
type Grants = Record<string, string[]>;
|
|
2762
|
+
interface PermissionMatrixProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
2763
|
+
groups: PermissionGroup[];
|
|
2764
|
+
roles: Role[];
|
|
2765
|
+
/** Saved grants: roleId → permission ids. */
|
|
2766
|
+
value: Grants;
|
|
2767
|
+
/** Persist the draft. Throw to keep the changes pending with an error. */
|
|
2768
|
+
onSave: (next: Grants) => void | Promise<void>;
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* Roles × permissions. Edits stay as a draft — changed cells are marked — until saved from the bar
|
|
2772
|
+
* that slides in with the number of changes. Group rows toggle a whole resource per role.
|
|
2773
|
+
*/
|
|
2774
|
+
declare function PermissionMatrix({ groups, roles, value, onSave, className, ...rest }: PermissionMatrixProps): React.JSX.Element;
|
|
2775
|
+
|
|
2776
|
+
interface LineItem {
|
|
2777
|
+
id: string;
|
|
2778
|
+
description: string;
|
|
2779
|
+
quantity: number;
|
|
2780
|
+
unitPrice: number;
|
|
2781
|
+
/** Fraction, e.g. 0.2 for 20%. */
|
|
2782
|
+
taxRate: number;
|
|
2783
|
+
}
|
|
2784
|
+
interface LineItemsEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
2785
|
+
items: LineItem[];
|
|
2786
|
+
onChange: (items: LineItem[]) => void;
|
|
2787
|
+
/** ISO 4217 code. */
|
|
2788
|
+
currency?: string;
|
|
2789
|
+
locale?: string;
|
|
2790
|
+
taxRates?: Array<{
|
|
2791
|
+
value: number;
|
|
2792
|
+
label: string;
|
|
2793
|
+
}>;
|
|
2794
|
+
readOnly?: boolean;
|
|
2795
|
+
/** Ids for new rows. Defaults to a random id. */
|
|
2796
|
+
createId?: () => string;
|
|
2797
|
+
}
|
|
2798
|
+
declare function computeTotals(items: LineItem[]): {
|
|
2799
|
+
subtotal: number;
|
|
2800
|
+
taxes: [number, number][];
|
|
2801
|
+
tax: number;
|
|
2802
|
+
total: number;
|
|
2803
|
+
};
|
|
2804
|
+
/**
|
|
2805
|
+
* Editable invoice / order lines: add, remove, edit quantity, price and tax; totals per tax rate
|
|
2806
|
+
* update as you type. Enter in the last row's description adds a new row.
|
|
2807
|
+
*/
|
|
2808
|
+
declare function LineItemsEditor({ items, onChange, currency, locale, taxRates, readOnly, createId, className, ...rest }: LineItemsEditorProps): React.JSX.Element;
|
|
2809
|
+
interface UploadContext {
|
|
2810
|
+
/** Report progress 0–1. */
|
|
2811
|
+
onProgress: (fraction: number) => void;
|
|
2812
|
+
/** Aborted when the user cancels or removes the file. */
|
|
2813
|
+
signal: AbortSignal;
|
|
2814
|
+
}
|
|
2815
|
+
interface FileDropzoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
2816
|
+
/** Upload one file. Report progress through the context; throw to mark it failed. */
|
|
2817
|
+
onUpload: (file: File, ctx: UploadContext) => Promise<void>;
|
|
2818
|
+
/** Called after a file finished or was removed. */
|
|
2819
|
+
onFilesChange?: (files: Array<{
|
|
2820
|
+
id: string;
|
|
2821
|
+
file: File;
|
|
2822
|
+
status: UploadStatus;
|
|
2823
|
+
}>) => void;
|
|
2824
|
+
/** Same syntax as the input's `accept` attribute: "image/*,.pdf". */
|
|
2825
|
+
accept?: string;
|
|
2826
|
+
/** Bytes. */
|
|
2827
|
+
maxSize?: number;
|
|
2828
|
+
multiple?: boolean;
|
|
2829
|
+
/** Max number of files kept in the list. */
|
|
2830
|
+
maxFiles?: number;
|
|
2831
|
+
hint?: React.ReactNode;
|
|
2832
|
+
disabled?: boolean;
|
|
2833
|
+
}
|
|
2834
|
+
type UploadStatus = 'uploading' | 'done' | 'error' | 'rejected';
|
|
2835
|
+
/** Drop or pick files; each uploads through your handler with real progress, cancel and retry. */
|
|
2836
|
+
declare function FileDropzone({ onUpload, onFilesChange, accept, maxSize, multiple, maxFiles, hint, disabled, className, ...rest }: FileDropzoneProps): React.JSX.Element;
|
|
2837
|
+
|
|
2838
|
+
interface StatGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2839
|
+
stats: Array<StatProps & {
|
|
2840
|
+
id: string;
|
|
2841
|
+
}>;
|
|
2842
|
+
/** Hold figures at reduced opacity while a new period loads. */
|
|
2843
|
+
loading?: boolean;
|
|
2844
|
+
}
|
|
2845
|
+
/** A strip of KPIs on one surface, separated by hairlines. Wraps into a grid on narrow containers. */
|
|
2846
|
+
declare function StatGroup({ stats, loading, className, ...rest }: StatGroupProps): React.JSX.Element;
|
|
2847
|
+
interface ChecklistTask {
|
|
2848
|
+
id: string;
|
|
2849
|
+
title: string;
|
|
2850
|
+
description?: string;
|
|
2851
|
+
done: boolean;
|
|
2852
|
+
/** The action that completes the task (opens a page, a dialog…). */
|
|
2853
|
+
action?: {
|
|
2854
|
+
label: string;
|
|
2855
|
+
onClick: () => void;
|
|
2856
|
+
};
|
|
2857
|
+
}
|
|
2858
|
+
interface OnboardingChecklistProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
2859
|
+
title?: React.ReactNode;
|
|
2860
|
+
tasks: ChecklistTask[];
|
|
2861
|
+
/** Hide the checklist (e.g. "Dismiss" once done). */
|
|
2862
|
+
onDismiss?: () => void;
|
|
2863
|
+
}
|
|
2864
|
+
/** Getting-started tasks with a progress ring. The next open task is expanded; finished ones collapse. */
|
|
2865
|
+
declare function OnboardingChecklist({ title, tasks, onDismiss, className, ...rest }: OnboardingChecklistProps): React.JSX.Element;
|
|
2866
|
+
|
|
2867
|
+
type AssistantPart = {
|
|
2868
|
+
type: 'text';
|
|
2869
|
+
text: string;
|
|
2870
|
+
} | {
|
|
2871
|
+
type: 'reasoning';
|
|
2872
|
+
text?: string;
|
|
2873
|
+
steps?: ReasoningStep[];
|
|
2874
|
+
startedAt?: number;
|
|
2875
|
+
duration?: number;
|
|
2876
|
+
done?: boolean;
|
|
2877
|
+
} | {
|
|
2878
|
+
type: 'tool';
|
|
2879
|
+
id: string;
|
|
2880
|
+
name: string;
|
|
2881
|
+
title?: React.ReactNode;
|
|
2882
|
+
status: ToolStatus;
|
|
2883
|
+
args?: unknown;
|
|
2884
|
+
result?: unknown;
|
|
2885
|
+
error?: React.ReactNode;
|
|
2886
|
+
startedAt?: number;
|
|
2887
|
+
duration?: number;
|
|
2888
|
+
};
|
|
2889
|
+
interface AssistantMessage {
|
|
2890
|
+
id: string;
|
|
2891
|
+
role: 'user' | 'assistant';
|
|
2892
|
+
/** Plain text. For assistant messages, `parts` lets you interleave reasoning, tool calls and text. */
|
|
2893
|
+
text?: string;
|
|
2894
|
+
parts?: AssistantPart[];
|
|
2895
|
+
attachments?: PromptAttachment[];
|
|
2896
|
+
/** `streaming` while tokens arrive. */
|
|
2897
|
+
status?: 'streaming' | 'done' | 'error';
|
|
2898
|
+
feedback?: 'up' | 'down' | null;
|
|
2899
|
+
time?: React.ReactNode;
|
|
2900
|
+
}
|
|
2901
|
+
interface AssistantChatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSubmit'> {
|
|
2902
|
+
messages: AssistantMessage[];
|
|
2903
|
+
/** `submitted` — waiting for the first token · `streaming` — a response is arriving. */
|
|
2904
|
+
status?: 'idle' | 'submitted' | 'streaming';
|
|
2905
|
+
onSend?: (text: string, attachments: PromptAttachment[]) => void;
|
|
2906
|
+
onStop?: () => void;
|
|
2907
|
+
onRegenerate?: (messageId: string) => void;
|
|
2908
|
+
onFeedback?: (messageId: string, value: 'up' | 'down' | null) => void;
|
|
2909
|
+
/** Approve or deny a tool call that is `pending`. */
|
|
2910
|
+
onToolDecision?: (messageId: string, toolId: string, approved: boolean) => void;
|
|
2911
|
+
models?: ModelOption[];
|
|
2912
|
+
model?: string;
|
|
2913
|
+
onModelChange?: (id: string) => void;
|
|
2914
|
+
suggestions?: PromptSuggestion[];
|
|
2915
|
+
/** Tokens used and the model's window — shown as a meter by the composer. */
|
|
2916
|
+
context?: {
|
|
2917
|
+
used: number;
|
|
2918
|
+
limit: number;
|
|
2919
|
+
};
|
|
2920
|
+
assistantName?: React.ReactNode;
|
|
2921
|
+
/** A static avatar, or a function of the assistant's state — pass a mascot and it reacts. */
|
|
2922
|
+
avatar?: React.ReactNode | ((state: MascotState) => React.ReactNode);
|
|
2923
|
+
/** Shown above the composer when there are no messages. */
|
|
2924
|
+
empty?: React.ReactNode;
|
|
2925
|
+
placeholder?: string | string[];
|
|
2926
|
+
/** Enable attachments (same syntax as `<input accept>`, or `true`). */
|
|
2927
|
+
accept?: string | boolean;
|
|
2928
|
+
header?: React.ReactNode;
|
|
2929
|
+
}
|
|
2930
|
+
/**
|
|
2931
|
+
* A complete assistant conversation: thread with stick-to-bottom, reasoning, tool calls and
|
|
2932
|
+
* streamed answers, message actions and a composer with model choice and context usage.
|
|
2933
|
+
* It renders state you own — wire `onSend` to your API and stream into `messages`.
|
|
2934
|
+
*/
|
|
2935
|
+
declare function AssistantChat({ messages, status, onSend, onStop, onRegenerate, onFeedback, onToolDecision, models, model, onModelChange, suggestions, context, assistantName, avatar, empty, placeholder, accept, header, className, ...rest }: AssistantChatProps): React.JSX.Element;
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* Shared by every application template. Pass `chrome` to wrap the page in a full AppShell,
|
|
2939
|
+
* or leave it out to drop the page into your own layout.
|
|
2940
|
+
*/
|
|
2941
|
+
interface TemplateChrome {
|
|
2942
|
+
nav: NavSection[];
|
|
2943
|
+
activeNav: string;
|
|
2944
|
+
onNavigate?: (item: NavItem) => void;
|
|
2945
|
+
workspaces: Workspace[];
|
|
2946
|
+
activeWorkspace: string;
|
|
2947
|
+
onWorkspaceChange?: (id: string) => void;
|
|
2948
|
+
user: {
|
|
2949
|
+
name: string;
|
|
2950
|
+
email?: string;
|
|
2951
|
+
avatar?: string;
|
|
2952
|
+
menu: MenuEntry[];
|
|
2953
|
+
};
|
|
2954
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
2955
|
+
onSearch?: () => void;
|
|
2956
|
+
notifications?: {
|
|
2957
|
+
items: NotificationItem[];
|
|
2958
|
+
onMarkRead: (ids: string[]) => void;
|
|
2959
|
+
onArchive?: (id: string) => void;
|
|
2960
|
+
};
|
|
2961
|
+
topbarActions?: React.ReactNode;
|
|
2962
|
+
defaultCollapsed?: boolean;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
interface DashboardOrder {
|
|
2966
|
+
id: string;
|
|
2967
|
+
customer: string;
|
|
2968
|
+
amount: number;
|
|
2969
|
+
status: 'Paid' | 'Pending' | 'Refunded' | 'Failed';
|
|
2970
|
+
date: Date;
|
|
2971
|
+
}
|
|
2972
|
+
interface DashboardTemplateProps {
|
|
2973
|
+
chrome?: TemplateChrome;
|
|
2974
|
+
title?: string;
|
|
2975
|
+
description?: string;
|
|
2976
|
+
/** Period options for the filter row; every widget below is expected to follow it. */
|
|
2977
|
+
periods?: Array<{
|
|
2978
|
+
value: string;
|
|
2979
|
+
label: string;
|
|
2980
|
+
}>;
|
|
2981
|
+
period: string;
|
|
2982
|
+
onPeriodChange: (period: string) => void;
|
|
2983
|
+
/** True while data for a new period loads: figures and charts hold at reduced opacity. */
|
|
2984
|
+
loading?: boolean;
|
|
2985
|
+
kpis: Array<StatProps & {
|
|
2986
|
+
id: string;
|
|
2987
|
+
}>;
|
|
2988
|
+
trend: {
|
|
2989
|
+
data: Array<Record<string, any>>;
|
|
2990
|
+
x: string;
|
|
2991
|
+
series: LineSeries[];
|
|
2992
|
+
label: string;
|
|
2993
|
+
formatValue?: (v: number) => string;
|
|
2994
|
+
};
|
|
2995
|
+
breakdown: {
|
|
2996
|
+
data: Array<Record<string, any>>;
|
|
2997
|
+
category: string;
|
|
2998
|
+
series: BarSeries[];
|
|
2999
|
+
label: string;
|
|
3000
|
+
formatValue?: (v: number) => string;
|
|
3001
|
+
};
|
|
3002
|
+
mix: {
|
|
3003
|
+
data: PartDatum[];
|
|
3004
|
+
label: string;
|
|
3005
|
+
formatValue?: (v: number) => string;
|
|
3006
|
+
};
|
|
3007
|
+
activity: {
|
|
3008
|
+
rows: string[];
|
|
3009
|
+
columns: string[];
|
|
3010
|
+
values: Array<Array<number | null>>;
|
|
3011
|
+
label: string;
|
|
3012
|
+
};
|
|
3013
|
+
orders: DashboardOrder[];
|
|
3014
|
+
onOrderClick?: (order: DashboardOrder) => void;
|
|
3015
|
+
events: ActivityEvent[];
|
|
3016
|
+
actions?: React.ReactNode;
|
|
3017
|
+
currency?: string;
|
|
3018
|
+
}
|
|
3019
|
+
/** An analytics overview: one filter row scoping KPIs, a trend, a breakdown, a mix, activity and recent orders. */
|
|
3020
|
+
declare function DashboardTemplate({ chrome, title, description, periods, period, onPeriodChange, loading, kpis, trend, breakdown, mix, activity, orders, onOrderClick, events, actions, currency, }: DashboardTemplateProps): React.JSX.Element;
|
|
3021
|
+
|
|
3022
|
+
type AuthMode = 'sign-in' | 'sign-up' | 'forgot' | 'verify';
|
|
3023
|
+
interface AuthTemplateProps {
|
|
3024
|
+
mode: AuthMode;
|
|
3025
|
+
onModeChange: (mode: AuthMode) => void;
|
|
3026
|
+
/** Your mark, shown above the form. */
|
|
3027
|
+
logo?: React.ReactNode;
|
|
3028
|
+
productName?: string;
|
|
3029
|
+
/** The panel beside the form. Defaults to a quiet pattern with the quote. */
|
|
3030
|
+
aside?: React.ReactNode;
|
|
3031
|
+
quote?: {
|
|
3032
|
+
text: string;
|
|
3033
|
+
author: string;
|
|
3034
|
+
role?: string;
|
|
3035
|
+
};
|
|
3036
|
+
providers?: AuthProvider[];
|
|
3037
|
+
onSignIn: (values: SignInValues) => AuthResult | Promise<AuthResult>;
|
|
3038
|
+
onSignUp: (values: SignUpValues) => AuthResult | Promise<AuthResult>;
|
|
3039
|
+
onForgotPassword: (values: {
|
|
3040
|
+
email: string;
|
|
3041
|
+
}) => AuthResult | Promise<AuthResult>;
|
|
3042
|
+
/** Second factor. Rendered when `mode` is "verify". */
|
|
3043
|
+
onVerify?: (values: {
|
|
3044
|
+
code: string;
|
|
3045
|
+
}) => AuthResult | Promise<AuthResult>;
|
|
3046
|
+
onResendCode?: () => void | Promise<void>;
|
|
3047
|
+
/** Where the second-factor code was sent. */
|
|
3048
|
+
verifyDestination?: string;
|
|
3049
|
+
terms?: React.ReactNode;
|
|
3050
|
+
className?: string;
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* A complete authentication screen: sign in, sign up, password reset and a second factor, with the
|
|
3054
|
+
* steps sliding between each other. Every action calls your handler — nothing is faked.
|
|
3055
|
+
*/
|
|
3056
|
+
declare function AuthTemplate({ mode, onModeChange, logo, productName, aside, quote, providers, onSignIn, onSignUp, onForgotPassword, onVerify, onResendCode, verifyDestination, terms, className }: AuthTemplateProps): React.JSX.Element;
|
|
3057
|
+
|
|
3058
|
+
interface Deal {
|
|
3059
|
+
id: string;
|
|
3060
|
+
/** Pipeline stage = Kanban column id. */
|
|
3061
|
+
stage: string;
|
|
3062
|
+
title: string;
|
|
3063
|
+
company: string;
|
|
3064
|
+
value: number;
|
|
3065
|
+
owner: string;
|
|
3066
|
+
/** 0–1. */
|
|
3067
|
+
probability: number;
|
|
3068
|
+
closeDate: Date;
|
|
3069
|
+
tags?: string[];
|
|
3070
|
+
}
|
|
3071
|
+
interface CrmTemplateProps {
|
|
3072
|
+
chrome?: TemplateChrome;
|
|
3073
|
+
stages: KanbanColumn[];
|
|
3074
|
+
deals: Deal[];
|
|
3075
|
+
/** Persist a stage change (from the board) — index is the position in the new stage. */
|
|
3076
|
+
onMoveDeal: (id: string, stage: string, index: number) => void;
|
|
3077
|
+
onCreateDeal?: (stage?: string) => void;
|
|
3078
|
+
/** Activity for the deal open in the side sheet. */
|
|
3079
|
+
activityFor?: (deal: Deal) => ActivityEvent[];
|
|
3080
|
+
onDealAction?: (deal: Deal, action: 'edit' | 'won' | 'lost') => void;
|
|
3081
|
+
currency?: string;
|
|
3082
|
+
view?: 'board' | 'table';
|
|
3083
|
+
onViewChange?: (view: 'board' | 'table') => void;
|
|
3084
|
+
}
|
|
3085
|
+
/** A sales pipeline: board and table views of the same deals, a weighted forecast and a deal sheet. */
|
|
3086
|
+
declare function CrmTemplate({ chrome, stages, deals, onMoveDeal, onCreateDeal, activityFor, onDealAction, currency, view: viewProp, onViewChange }: CrmTemplateProps): React.JSX.Element;
|
|
3087
|
+
|
|
3088
|
+
interface Member {
|
|
3089
|
+
id: string;
|
|
3090
|
+
name: string;
|
|
3091
|
+
email: string;
|
|
3092
|
+
role: string;
|
|
3093
|
+
status: 'Active' | 'Invited';
|
|
3094
|
+
lastActive?: Date;
|
|
3095
|
+
}
|
|
3096
|
+
interface SettingsProfile {
|
|
3097
|
+
name: string;
|
|
3098
|
+
email: string;
|
|
3099
|
+
title?: string;
|
|
3100
|
+
timezone: string;
|
|
3101
|
+
}
|
|
3102
|
+
interface SettingsTemplateProps {
|
|
3103
|
+
chrome?: TemplateChrome;
|
|
3104
|
+
section?: SettingsSection;
|
|
3105
|
+
onSectionChange?: (section: SettingsSection) => void;
|
|
3106
|
+
profile: SettingsProfile;
|
|
3107
|
+
onSaveProfile: (profile: SettingsProfile) => void | Promise<void>;
|
|
3108
|
+
timezones: string[];
|
|
3109
|
+
notifications: Array<{
|
|
3110
|
+
id: string;
|
|
3111
|
+
label: string;
|
|
3112
|
+
description?: string;
|
|
3113
|
+
enabled: boolean;
|
|
3114
|
+
}>;
|
|
3115
|
+
onToggleNotification: (id: string, enabled: boolean) => void;
|
|
3116
|
+
members: Member[];
|
|
3117
|
+
roles: Role[];
|
|
3118
|
+
onInvite: (email: string, role: string) => void | Promise<void>;
|
|
3119
|
+
onChangeRole: (memberId: string, role: string) => void | Promise<void>;
|
|
3120
|
+
onRemoveMember: (memberId: string) => void | Promise<void>;
|
|
3121
|
+
permissionGroups: PermissionGroup[];
|
|
3122
|
+
grants: Grants;
|
|
3123
|
+
onSaveGrants: (grants: Grants) => void | Promise<void>;
|
|
3124
|
+
workspaceName: string;
|
|
3125
|
+
onDeleteWorkspace: () => void | Promise<void>;
|
|
3126
|
+
}
|
|
3127
|
+
type SettingsSection = 'profile' | 'notifications' | 'members' | 'roles' | 'danger';
|
|
3128
|
+
/** Account and workspace settings: profile, notifications, members, roles and a guarded danger zone. */
|
|
3129
|
+
declare function SettingsTemplate(props: SettingsTemplateProps): React.JSX.Element;
|
|
3130
|
+
|
|
3131
|
+
interface CalendarSource {
|
|
3132
|
+
id: string;
|
|
3133
|
+
name: string;
|
|
3134
|
+
/** Categorical slot 1–8. */
|
|
3135
|
+
color: number;
|
|
3136
|
+
}
|
|
3137
|
+
interface AgendaEvent extends CalendarEvent {
|
|
3138
|
+
calendarId: string;
|
|
3139
|
+
}
|
|
3140
|
+
interface CalendarTemplateProps {
|
|
3141
|
+
chrome?: TemplateChrome;
|
|
3142
|
+
calendars: CalendarSource[];
|
|
3143
|
+
events: AgendaEvent[];
|
|
3144
|
+
onCreateEvent: (event: Omit<AgendaEvent, 'id' | 'color'>) => void | Promise<void>;
|
|
3145
|
+
onUpdateEvent: (id: string, start: Date, end: Date) => void;
|
|
3146
|
+
onDeleteEvent: (id: string) => void | Promise<void>;
|
|
3147
|
+
/** The week in view. */
|
|
3148
|
+
date: Date;
|
|
3149
|
+
onDateChange: (date: Date) => void;
|
|
3150
|
+
days?: 5 | 7;
|
|
3151
|
+
now?: Date;
|
|
3152
|
+
}
|
|
3153
|
+
/** A scheduling workspace: mini month, calendars you can toggle, upcoming list and an editable week. */
|
|
3154
|
+
declare function CalendarTemplate({ chrome, calendars, events, onCreateEvent, onUpdateEvent, onDeleteEvent, date, onDateChange, days, now }: CalendarTemplateProps): React.JSX.Element;
|
|
3155
|
+
|
|
3156
|
+
type OrderStatus = 'Draft' | 'Confirmed' | 'Packed' | 'Shipped' | 'Delivered' | 'Cancelled';
|
|
3157
|
+
interface Order {
|
|
3158
|
+
id: string;
|
|
3159
|
+
customer: string;
|
|
3160
|
+
email: string;
|
|
3161
|
+
status: OrderStatus;
|
|
3162
|
+
createdAt: Date;
|
|
3163
|
+
items: LineItem[];
|
|
3164
|
+
channel: string;
|
|
3165
|
+
}
|
|
3166
|
+
interface OrdersTemplateProps {
|
|
3167
|
+
chrome?: TemplateChrome;
|
|
3168
|
+
orders: Order[];
|
|
3169
|
+
onUpdateItems: (orderId: string, items: LineItem[]) => void;
|
|
3170
|
+
/** Advance an order to its next status. */
|
|
3171
|
+
onAdvance: (orderId: string, next: OrderStatus) => void | Promise<void>;
|
|
3172
|
+
onCancel: (orderId: string) => void | Promise<void>;
|
|
3173
|
+
onBulkAdvance?: (ids: string[]) => void | Promise<void>;
|
|
3174
|
+
historyFor?: (order: Order) => ActivityEvent[];
|
|
3175
|
+
onCreateOrder?: () => void;
|
|
3176
|
+
currency?: string;
|
|
3177
|
+
}
|
|
3178
|
+
/** Order management: KPIs, a filterable orders table, and an order sheet with fulfilment steps and editable lines. */
|
|
3179
|
+
declare function OrdersTemplate({ chrome, orders, onUpdateItems, onAdvance, onCancel, onBulkAdvance, historyFor, onCreateOrder, currency }: OrdersTemplateProps): React.JSX.Element;
|
|
3180
|
+
|
|
3181
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityFeed, ActivityPill, AgentRun, Alert, AnimatedNumber, AppShell, AssistantChat, AuthCard, AuthTemplate, AutoHeight, Avatar, AvatarGroup, Badge, BarChart, BlobMascot, Breadcrumbs, Button, Calendar, CalendarTemplate, Card, CardContent, CardFooter, CardHeader, ChartDataTable, ChartLegend, ChartTooltip, ChatMessage, ChatThread, Checkbox, ChipSelect, Clock, ColorPicker, CommandPalette, ConfirmDialog, ContextMenu, ContextMeter, CrmTemplate, DashboardTemplate, DataTable, DatePicker, Delta, Dialog, DistributionBar, DonutChart, Drawer, EmptyState, Field, FileDropzone, FloatingPanel, ForgotPasswordForm, FormDialog, GLYPHS, GenerationPreview, HalftoneGlyph, Heatmap, HoldButton, IconButton, JsonView, KanbanBoard, Kbd, Knob, LineChart, LineItemsEditor, LineMascot, Loader, MASCOT_STATES, MagneticButton, Menu, MessageActions, ModelSelector, MorphButton, MorphDialog, MorphDialogClose, MorphDialogContent, MorphDialogTitle, MorphDialogTrigger, NotificationCenter, NumberField, OnboardingChecklist, OrbMascot, OrdersTemplate, PageHeader, Pagination, ParticleMascot, PasswordMeter, PermissionMatrix, PinInput, PixelMascot, Popover, Progress, PromptInput, ProviderButtons, RadialMenu, RadioGroup, Reasoning, ResizablePanel, ResizablePanels, SegmentedControl, Select, SettingsTemplate, Sidebar, SignInForm, SignUpForm, Skeleton, SkeletonText, Slider, SortableList, Sparkline, Stat, StatGroup, Stepper, StreamingText, SwipeConfirm, Switch, Tabs, TabsContent, TabsList, TabsPanels, TabsTrigger, Tether, TetherField, TextArea, TextField, ThemeSwitch, ThinkingIndicator, Timeline, Toaster, ToolCall, Tooltip, Topbar, UserMenu, VerifyCodeForm, WeekView, WheelPicker, WizardDialog, WorkspaceSwitcher, areaPath, axisFormatter, barPath, computeTotals, dayLabel, estimatePasswordStrength, formatClock, formatDuration, formatNumber, formatRelative, fuzzyMatch, initialsOf, linePath, linearScale, maskDestination, nearestIndex, niceDomain, niceStep, pageRange, rasterize, sampleY, seriesColor, springs, startOfWeek, toNumber, toast, useAppShell, useChartWidth, useCooldown, useDialog, useField, useFieldControlProps, useInView, useSeriesState, useToasts };
|
|
3182
|
+
export type { AccordionItemProps, AccordionMultipleProps, AccordionProps, AccordionSingleProps, AccordionTriggerProps, AccordionVariant, ActivityEvent, ActivityFeedProps, ActivityPillProps, AgendaEvent, AgentRunProps, AgentRunStatus, AgentStep, AgentStepStatus, AlertProps, AlertTone, AnimatedNumberProps, AppShellProps, AssistantChatProps, AssistantMessage, AssistantPart, AuthCardProps, AuthMode, AuthProvider, AuthResult, AuthTemplateProps, AvatarGroupProps, AvatarProps, BadgeProps, BadgeTone, BadgeVariant, BarChartProps, BarSeries, BreadcrumbItem, BreadcrumbsProps, ButtonProps, ButtonSize, ButtonTone, ButtonVariant, CalendarEvent, CalendarProps, CalendarRangeProps, CalendarSingleProps, CalendarSource, CalendarTemplateProps, CardHeaderProps, CardProps, ChartDataTableProps, ChartLegendProps, ChartTooltipProps, ChatMessageProps, ChatThreadProps, CheckboxProps, CheckboxVariant, CheckedState, ChecklistTask, ChipOption, ChipSelectProps, ChipSelectVariant, ClockProps, ClockVariant, ColorPickerProps, ColorPickerVariant, CommandItem, CommandPaletteProps, ConfirmDialogProps, ContextMenuProps, ContextMeterProps, ContextSegment, Corner, CrmTemplateProps, DashboardOrder, DashboardTemplateProps, DataTableColumn, DataTableProps, DataTableQuery, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps, DateRange, Deal, DeltaProps, DialogPlacement, DialogProps, DialogSize, DistributionBarProps, DonutChartProps, DrawerProps, EmptyStateProps, EmptyStateTone, FieldProps, FileDropzoneProps, FloatingPanelProps, ForgotPasswordFormProps, FormDialogProps, FormDialogResult, GenerationPreviewProps, GlyphName, Grants, HalftoneGlyphProps, HeatmapProps, HoldButtonProps, HoldButtonVariant, IconButtonProps, JsonViewProps, KanbanBoardProps, KanbanColumn, KanbanItem, KnobProps, KnobVariant, LegendItem, LineChartProps, LineItem, LineItemsEditorProps, LineSeries, LoaderProps, LoaderVariant, MagneticButtonProps, MagneticButtonVariant, MascotProps, MascotState, Member, MenuEntry, MenuProps, MessageActionsProps, ModelOption, ModelSelectorProps, MorphButtonProps, MorphButtonVariant, MorphDialogContentProps, MorphDialogProps, MorphDialogTriggerProps, MorphStatus, NavItem, NavSection, NotificationCenterProps, NotificationItem, NumberFieldProps, NumberFieldVariant, OnboardingChecklistProps, Order, OrderStatus, OrdersTemplateProps, PageHeaderProps, PaginationProps, PartDatum, PasswordStrength, Permission, PermissionGroup, PermissionMatrixProps, PinInputProps, PinInputVariant, PinStatus, Placement, PopoverPlacement, PopoverProps, PopoverSide, ProgressProps, ProgressVariant, PromptAttachment, PromptInputProps, PromptSuggestion, RadialMenuItem, RadialMenuProps, RadioGroupProps, RadioGroupVariant, RadioOption, ReasoningProps, ReasoningStep, ResizablePanelProps, ResizablePanelsProps, Role, Scale, SegmentedControlProps, SegmentedControlVariant, SegmentedOption, SelectMultipleProps, SelectOption, SelectProps, SelectSingleProps, SettingsProfile, SettingsSection, SettingsTemplateProps, SidebarProps, SignInFormProps, SignInValues, SignUpFormProps, SignUpValues, SkeletonProps, SliderProps, SliderVariant, SortDirection, SortState, SortableListProps, SortableRenderState, SparklineProps, SparklineVariant, SpringName, StatGroupProps, StatProps, StepItem, StepperProps, StreamingTextProps, Stroke, SwipeConfirmProps, SwitchProps, SwitchVariant, TabsContentProps, TabsProps, TabsTriggerProps, TabsVariant, TemplateChrome, TetherFieldProps, TetherProps, TetherSide, TextAreaProps, TextFieldProps, Theme, ThemeSwitchProps, ThemeSwitchVariant, ThinkingIndicatorProps, ThinkingVariant, TimelineProps, TimelineTask, ToastAction, ToastData, ToastOptions, ToastType, ToasterPosition, ToasterProps, ToasterVariant, ToolCallProps, ToolStatus, TooltipProps, TooltipRow, TopbarProps, UploadContext, UploadStatus, UserMenuProps, VerifyCodeFormProps, WeekViewProps, WheelOption, WheelPickerProps, WizardDialogProps, WizardStep, Workspace, XValue };
|