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
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { mergeRefs, useIsoLayoutEffect } from './chunk-4C7VKLTU.js';
|
|
3
|
+
import { useMotionPreset } from './chunk-VDQ3DWO4.js';
|
|
4
|
+
import { cx } from './chunk-K6X6O42N.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { motion, AnimatePresence } from 'motion/react';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var FieldContext = React.createContext(null);
|
|
10
|
+
var useField = () => React.useContext(FieldContext);
|
|
11
|
+
function Field({ label, description, error, required, optional, disabled, labelAction, htmlFor, className, children, ...rest }) {
|
|
12
|
+
const auto = React.useId();
|
|
13
|
+
const id = htmlFor ?? `sp-field-${auto}`;
|
|
14
|
+
const descriptionId = description ? `${id}-desc` : void 0;
|
|
15
|
+
const errorId = error ? `${id}-err` : void 0;
|
|
16
|
+
const { reduced } = useMotionPreset();
|
|
17
|
+
return /* @__PURE__ */ jsx(FieldContext.Provider, { value: { id, descriptionId, errorId, invalid: !!error, required, disabled }, children: /* @__PURE__ */ jsxs("div", { ...rest, className: cx("sp-field", className), "data-invalid": error ? "" : void 0, "data-disabled": disabled || void 0, children: [
|
|
18
|
+
(label || labelAction) && /* @__PURE__ */ jsxs("div", { className: "sp-field__head", children: [
|
|
19
|
+
label && /* @__PURE__ */ jsxs("label", { className: "sp-field__label", htmlFor: id, children: [
|
|
20
|
+
label,
|
|
21
|
+
required && /* @__PURE__ */ jsx("span", { className: "sp-field__required", "aria-hidden": true, children: "*" }),
|
|
22
|
+
optional && !required && /* @__PURE__ */ jsx("span", { className: "sp-field__optional", children: "Optional" })
|
|
23
|
+
] }),
|
|
24
|
+
labelAction && /* @__PURE__ */ jsx("span", { className: "sp-field__action", children: labelAction })
|
|
25
|
+
] }),
|
|
26
|
+
description && /* @__PURE__ */ jsx("p", { className: "sp-field__description", id: descriptionId, children: description }),
|
|
27
|
+
children,
|
|
28
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: error && /* @__PURE__ */ jsx(
|
|
29
|
+
motion.div,
|
|
30
|
+
{
|
|
31
|
+
className: "sp-field__error-wrap",
|
|
32
|
+
initial: reduced ? false : { height: 0, opacity: 0 },
|
|
33
|
+
animate: { height: "auto", opacity: 1 },
|
|
34
|
+
exit: reduced ? void 0 : { height: 0, opacity: 0 },
|
|
35
|
+
transition: { type: "spring", visualDuration: 0.24, bounce: 0 },
|
|
36
|
+
children: /* @__PURE__ */ jsxs("p", { className: "sp-field__error", id: errorId, role: "alert", children: [
|
|
37
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", width: "12", height: "12", "aria-hidden": true, fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M8 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 3.25a.75.75 0 0 0-.75.75v3a.75.75 0 0 0 1.5 0v-3A.75.75 0 0 0 8 4.75Zm0 6.75a.85.85 0 1 0 0-1.7.85.85 0 0 0 0 1.7Z" }) }),
|
|
38
|
+
error
|
|
39
|
+
] })
|
|
40
|
+
},
|
|
41
|
+
"error"
|
|
42
|
+
) })
|
|
43
|
+
] }) });
|
|
44
|
+
}
|
|
45
|
+
function useFieldControlProps(own) {
|
|
46
|
+
const field = useField();
|
|
47
|
+
const describedBy = [own["aria-describedby"], field?.descriptionId, field?.errorId].filter(Boolean).join(" ") || void 0;
|
|
48
|
+
return {
|
|
49
|
+
id: own.id ?? field?.id,
|
|
50
|
+
"aria-describedby": describedBy,
|
|
51
|
+
"aria-invalid": own["aria-invalid"] ?? (field?.invalid || void 0),
|
|
52
|
+
required: own.required ?? field?.required,
|
|
53
|
+
disabled: own.disabled ?? field?.disabled
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var TextField = React.forwardRef(function TextField2({ label, description, error, optional, labelAction, wrapperClassName, ...rest }, ref) {
|
|
57
|
+
if (label || description || error || labelAction) {
|
|
58
|
+
return /* @__PURE__ */ jsx(Field, { label, description, error, optional, required: rest.required, disabled: rest.disabled, labelAction, htmlFor: rest.id, className: wrapperClassName, children: /* @__PURE__ */ jsx(TextInput, { ...rest, ref, errorKey: typeof error === "string" ? error : error ? "error" : "" }) });
|
|
59
|
+
}
|
|
60
|
+
return /* @__PURE__ */ jsx(TextInput, { ...rest, ref, className: cx(rest.className, wrapperClassName) });
|
|
61
|
+
});
|
|
62
|
+
var TextInput = React.forwardRef(function TextInput2({ onValueChange, onChange, size = "md", prefix, suffix, clearable, showCount, type = "text", className, style, errorKey, value, defaultValue, maxLength, ...rest }, ref) {
|
|
63
|
+
const control = useFieldControlProps(rest);
|
|
64
|
+
const inputRef = React.useRef(null);
|
|
65
|
+
const [reveal, setReveal] = React.useState(false);
|
|
66
|
+
const controlled = value !== void 0;
|
|
67
|
+
const [inner, setInner] = React.useState(String(defaultValue ?? ""));
|
|
68
|
+
const current = controlled ? String(value ?? "") : inner;
|
|
69
|
+
const isPassword = type === "password";
|
|
70
|
+
const boxRef = React.useRef(null);
|
|
71
|
+
const { reduced } = useMotionPreset();
|
|
72
|
+
const prevError = React.useRef(errorKey);
|
|
73
|
+
React.useEffect(() => {
|
|
74
|
+
if (errorKey && errorKey !== prevError.current && !reduced) {
|
|
75
|
+
boxRef.current?.animate?.(
|
|
76
|
+
[{ transform: "translateX(0)" }, { transform: "translateX(-3px)" }, { transform: "translateX(3px)" }, { transform: "translateX(-2px)" }, { transform: "translateX(0)" }],
|
|
77
|
+
{ duration: 280, easing: "cubic-bezier(0.22, 1, 0.36, 1)" }
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
prevError.current = errorKey;
|
|
81
|
+
}, [errorKey, reduced]);
|
|
82
|
+
const handleChange = (event) => {
|
|
83
|
+
if (!controlled) setInner(event.target.value);
|
|
84
|
+
onChange?.(event);
|
|
85
|
+
onValueChange?.(event.target.value);
|
|
86
|
+
};
|
|
87
|
+
const clear = () => {
|
|
88
|
+
const el = inputRef.current;
|
|
89
|
+
if (!el) return;
|
|
90
|
+
const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
91
|
+
setter?.call(el, "");
|
|
92
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
93
|
+
el.focus();
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ jsxs("div", { className: "sp-textfield-wrap", children: [
|
|
96
|
+
/* @__PURE__ */ jsxs(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: cx("sp-textfield", className),
|
|
100
|
+
style,
|
|
101
|
+
"data-size": size,
|
|
102
|
+
"data-invalid": control["aria-invalid"] ? "" : void 0,
|
|
103
|
+
"data-disabled": control.disabled || void 0,
|
|
104
|
+
ref: boxRef,
|
|
105
|
+
onPointerDown: (e) => {
|
|
106
|
+
if (e.target === e.currentTarget) {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
inputRef.current?.focus();
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
children: [
|
|
112
|
+
prefix && /* @__PURE__ */ jsx("span", { className: "sp-textfield__adorn", "data-side": "start", children: prefix }),
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
"input",
|
|
115
|
+
{
|
|
116
|
+
...rest,
|
|
117
|
+
...control,
|
|
118
|
+
ref: mergeRefs(inputRef, ref),
|
|
119
|
+
type: isPassword && reveal ? "text" : type,
|
|
120
|
+
value: controlled ? value : void 0,
|
|
121
|
+
defaultValue: controlled ? void 0 : defaultValue,
|
|
122
|
+
maxLength,
|
|
123
|
+
onChange: handleChange,
|
|
124
|
+
className: "sp-textfield__input"
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
clearable && current && !control.disabled && /* @__PURE__ */ jsx("button", { type: "button", className: "sp-reset-button sp-textfield__btn", "aria-label": "Clear", onClick: clear, tabIndex: -1, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": true, fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", children: /* @__PURE__ */ jsx("path", { d: "M5 5l6 6M11 5l-6 6" }) }) }),
|
|
128
|
+
isPassword && /* @__PURE__ */ jsx(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
className: "sp-reset-button sp-textfield__btn",
|
|
133
|
+
"aria-label": reveal ? "Hide password" : "Show password",
|
|
134
|
+
"aria-pressed": reveal,
|
|
135
|
+
onClick: () => {
|
|
136
|
+
setReveal((r) => !r);
|
|
137
|
+
inputRef.current?.focus();
|
|
138
|
+
},
|
|
139
|
+
children: /* @__PURE__ */ jsx(EyeIcon, { open: !reveal })
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
suffix && /* @__PURE__ */ jsx("span", { className: "sp-textfield__adorn", "data-side": "end", children: suffix })
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
showCount && maxLength ? /* @__PURE__ */ jsxs("div", { className: "sp-textfield__count", "aria-live": "polite", "data-full": current.length >= maxLength || void 0, children: [
|
|
147
|
+
current.length,
|
|
148
|
+
" / ",
|
|
149
|
+
maxLength
|
|
150
|
+
] }) : null
|
|
151
|
+
] });
|
|
152
|
+
});
|
|
153
|
+
function EyeIcon({ open }) {
|
|
154
|
+
const { reduced } = useMotionPreset();
|
|
155
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": true, fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
156
|
+
/* @__PURE__ */ jsx("path", { d: "M1.5 8s2.4-4.5 6.5-4.5S14.5 8 14.5 8 12.1 12.5 8 12.5 1.5 8 1.5 8Z" }),
|
|
157
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "2" }),
|
|
158
|
+
/* @__PURE__ */ jsx(motion.path, { d: "M2.5 2.5l11 11", initial: false, animate: { pathLength: open ? 0 : 1, opacity: open ? 0 : 1 }, transition: reduced ? { duration: 0 } : { duration: 0.18 } })
|
|
159
|
+
] });
|
|
160
|
+
}
|
|
161
|
+
var TextArea = React.forwardRef(function TextArea2({ label, description, error, optional, labelAction, wrapperClassName, ...rest }, ref) {
|
|
162
|
+
if (label || description || error || labelAction) {
|
|
163
|
+
return /* @__PURE__ */ jsx(Field, { label, description, error, optional, required: rest.required, disabled: rest.disabled, labelAction, htmlFor: rest.id, className: wrapperClassName, children: /* @__PURE__ */ jsx(TextAreaInput, { ...rest, ref }) });
|
|
164
|
+
}
|
|
165
|
+
return /* @__PURE__ */ jsx(TextAreaInput, { ...rest, ref });
|
|
166
|
+
});
|
|
167
|
+
var TextAreaInput = React.forwardRef(function TextAreaInput2({ onValueChange, onChange, autoResize = true, minRows = 3, maxRows = 10, showCount, className, value, defaultValue, maxLength, ...rest }, ref) {
|
|
168
|
+
const control = useFieldControlProps(rest);
|
|
169
|
+
const elRef = React.useRef(null);
|
|
170
|
+
const controlled = value !== void 0;
|
|
171
|
+
const [inner, setInner] = React.useState(String(defaultValue ?? ""));
|
|
172
|
+
const current = controlled ? String(value ?? "") : inner;
|
|
173
|
+
const resize = React.useCallback(() => {
|
|
174
|
+
const el = elRef.current;
|
|
175
|
+
if (!el || !autoResize) return;
|
|
176
|
+
const cs = getComputedStyle(el);
|
|
177
|
+
const line = parseFloat(cs.lineHeight) || 20;
|
|
178
|
+
const pad = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom) + parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);
|
|
179
|
+
el.style.height = "auto";
|
|
180
|
+
const h = Math.min(Math.max(el.scrollHeight, line * minRows + pad), line * maxRows + pad);
|
|
181
|
+
el.style.height = `${h}px`;
|
|
182
|
+
el.style.overflowY = el.scrollHeight > h ? "auto" : "hidden";
|
|
183
|
+
}, [autoResize, minRows, maxRows]);
|
|
184
|
+
useIsoLayoutEffect(resize, [current, resize]);
|
|
185
|
+
return /* @__PURE__ */ jsxs("div", { className: "sp-textfield-wrap", children: [
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
"textarea",
|
|
188
|
+
{
|
|
189
|
+
...rest,
|
|
190
|
+
...control,
|
|
191
|
+
ref: mergeRefs(elRef, ref),
|
|
192
|
+
rows: minRows,
|
|
193
|
+
value: controlled ? value : void 0,
|
|
194
|
+
defaultValue: controlled ? void 0 : defaultValue,
|
|
195
|
+
maxLength,
|
|
196
|
+
onChange: (e) => {
|
|
197
|
+
if (!controlled) setInner(e.target.value);
|
|
198
|
+
onChange?.(e);
|
|
199
|
+
onValueChange?.(e.target.value);
|
|
200
|
+
},
|
|
201
|
+
"data-invalid": control["aria-invalid"] ? "" : void 0,
|
|
202
|
+
className: cx("sp-textarea", className)
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
showCount && maxLength ? /* @__PURE__ */ jsxs("div", { className: "sp-textfield__count", "aria-live": "polite", "data-full": current.length >= maxLength || void 0, children: [
|
|
206
|
+
current.length,
|
|
207
|
+
" / ",
|
|
208
|
+
maxLength
|
|
209
|
+
] }) : null
|
|
210
|
+
] });
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
export { Field, TextArea, TextField, useField, useFieldControlProps };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { clamp } from './chunk-344MRWFO.js';
|
|
3
|
-
import { useMotionPreset
|
|
3
|
+
import { useMotionPreset } from './chunk-VDQ3DWO4.js';
|
|
4
|
+
import { cx } from './chunk-K6X6O42N.js';
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { useMotionValue, animate, useMotionValueEvent, useTransform, motion } from 'motion/react';
|
|
6
7
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
@@ -33,7 +34,7 @@ var Progress = React.forwardRef(function Progress2({ value = null, max = 100, va
|
|
|
33
34
|
"aria-valuenow": indeterminate ? void 0 : value,
|
|
34
35
|
"aria-valuetext": indeterminate ? "Loading" : `${Math.round(target * 100)}%`,
|
|
35
36
|
"aria-busy": indeterminate || void 0,
|
|
36
|
-
className: cx("
|
|
37
|
+
className: cx("sp-progress", className),
|
|
37
38
|
"data-variant": variant,
|
|
38
39
|
"data-size": size,
|
|
39
40
|
"data-tone": tone,
|
|
@@ -41,25 +42,25 @@ var Progress = React.forwardRef(function Progress2({ value = null, max = 100, va
|
|
|
41
42
|
"data-complete": target >= 1 || void 0,
|
|
42
43
|
children: [
|
|
43
44
|
variant === "bar" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
-
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "
|
|
45
|
-
label && /* @__PURE__ */ jsx("span", { className: "
|
|
46
|
-
showValue && !indeterminate && /* @__PURE__ */ jsx("span", { className: "
|
|
45
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "sp-progress__meta", children: [
|
|
46
|
+
label && /* @__PURE__ */ jsx("span", { className: "sp-progress__label", children: label }),
|
|
47
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx("span", { className: "sp-progress__value", children: percent })
|
|
47
48
|
] }),
|
|
48
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: "sp-progress__track", children: indeterminate ? /* @__PURE__ */ jsx("span", { className: "sp-progress__comet" }) : /* @__PURE__ */ jsx(motion.span, { className: "sp-progress__fill", style: { width } }) })
|
|
49
50
|
] }),
|
|
50
|
-
variant === "ring" && /* @__PURE__ */ jsxs("div", { className: "
|
|
51
|
+
variant === "ring" && /* @__PURE__ */ jsxs("div", { className: "sp-progress__ring", children: [
|
|
51
52
|
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 40 40", "aria-hidden": true, children: [
|
|
52
|
-
/* @__PURE__ */ jsx("circle", { className: "
|
|
53
|
-
indeterminate ? /* @__PURE__ */ jsx("circle", { className: "
|
|
53
|
+
/* @__PURE__ */ jsx("circle", { className: "sp-progress__ring-track", cx: "20", cy: "20", r: "17" }),
|
|
54
|
+
indeterminate ? /* @__PURE__ */ jsx("circle", { className: "sp-progress__ring-spin", cx: "20", cy: "20", r: "17", pathLength: "100" }) : /* @__PURE__ */ jsx(motion.circle, { className: "sp-progress__ring-fill", cx: "20", cy: "20", r: "17", style: { pathLength: p, opacity: ringOpacity } })
|
|
54
55
|
] }),
|
|
55
|
-
showValue && !indeterminate && /* @__PURE__ */ jsx("span", { className: "
|
|
56
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx("span", { className: "sp-progress__ring-value", children: percent })
|
|
56
57
|
] }),
|
|
57
58
|
variant === "segments" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
-
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "
|
|
59
|
-
label && /* @__PURE__ */ jsx("span", { className: "
|
|
60
|
-
showValue && !indeterminate && /* @__PURE__ */ jsx("span", { className: "
|
|
59
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "sp-progress__meta", children: [
|
|
60
|
+
label && /* @__PURE__ */ jsx("span", { className: "sp-progress__label", children: label }),
|
|
61
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx("span", { className: "sp-progress__value", children: percent })
|
|
61
62
|
] }),
|
|
62
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: "sp-progress__cells", children: Array.from({ length: segments }, (_, i) => /* @__PURE__ */ jsx(Cell, { i, n: segments, p, indeterminate }, i)) })
|
|
63
64
|
] })
|
|
64
65
|
]
|
|
65
66
|
}
|
|
@@ -67,7 +68,7 @@ var Progress = React.forwardRef(function Progress2({ value = null, max = 100, va
|
|
|
67
68
|
});
|
|
68
69
|
function Cell({ i, n, p, indeterminate }) {
|
|
69
70
|
const fill = useTransform(p, (v) => clamp(v * n - i, 0, 1));
|
|
70
|
-
return /* @__PURE__ */ jsx("span", { className: "
|
|
71
|
+
return /* @__PURE__ */ jsx("span", { className: "sp-progress__cell", style: indeterminate ? { animationDelay: `${i / n * 1.1}s` } : void 0, children: !indeterminate && /* @__PURE__ */ jsx(motion.span, { className: "sp-progress__cell-fill", style: { scaleX: fill } }) });
|
|
71
72
|
}
|
|
72
73
|
var Loader = React.forwardRef(function Loader2({ variant = "forma", size = 24, label = "Loading", className, style, ...rest }, ref) {
|
|
73
74
|
return /* @__PURE__ */ jsxs(
|
|
@@ -77,13 +78,13 @@ var Loader = React.forwardRef(function Loader2({ variant = "forma", size = 24, l
|
|
|
77
78
|
ref,
|
|
78
79
|
role: "status",
|
|
79
80
|
"aria-label": label,
|
|
80
|
-
className: cx("
|
|
81
|
+
className: cx("sp-loader", className),
|
|
81
82
|
"data-variant": variant,
|
|
82
|
-
style: { ...style, ["--
|
|
83
|
+
style: { ...style, ["--sp-loader-size"]: `${size}px` },
|
|
83
84
|
children: [
|
|
84
|
-
variant === "forma" && /* @__PURE__ */ jsx("span", { className: "
|
|
85
|
-
variant === "orbit" && [0, 1, 2].map((i) => /* @__PURE__ */ jsx("span", { className: "
|
|
86
|
-
variant === "bars" && [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx("span", { className: "
|
|
85
|
+
variant === "forma" && /* @__PURE__ */ jsx("span", { className: "sp-loader__shape" }),
|
|
86
|
+
variant === "orbit" && [0, 1, 2].map((i) => /* @__PURE__ */ jsx("span", { className: "sp-loader__body", style: { animationDelay: `${i * -0.16}s` } }, i)),
|
|
87
|
+
variant === "bars" && [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx("span", { className: "sp-loader__bar", style: { animationDelay: `${[0, -0.36, -0.18, -0.54][i]}s` } }, i))
|
|
87
88
|
]
|
|
88
89
|
}
|
|
89
90
|
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMotionPreset } from './chunk-VDQ3DWO4.js';
|
|
3
|
+
import { cx } from './chunk-K6X6O42N.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var ICONS = {
|
|
9
|
+
info: "M8 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 5.25a.75.75 0 0 0-.75.75v3.25a.75.75 0 0 0 1.5 0V7.5A.75.75 0 0 0 8 6.75Zm0-2.5a.85.85 0 1 0 0 1.7.85.85 0 0 0 0-1.7Z",
|
|
10
|
+
neutral: "M8 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 5.25a.75.75 0 0 0-.75.75v3.25a.75.75 0 0 0 1.5 0V7.5A.75.75 0 0 0 8 6.75Zm0-2.5a.85.85 0 1 0 0 1.7.85.85 0 0 0 0-1.7Z",
|
|
11
|
+
positive: "M8 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm2.97 4.22a.75.75 0 0 0-1.06 0L7.2 8.43 6.09 7.32a.75.75 0 1 0-1.06 1.06l1.64 1.64c.29.3.77.3 1.06 0l3.24-3.24a.75.75 0 0 0 0-1.06Z",
|
|
12
|
+
warning: "M6.7 2.3a1.5 1.5 0 0 1 2.6 0l5.47 9.48A1.5 1.5 0 0 1 13.47 14H2.53a1.5 1.5 0 0 1-1.3-2.22L6.7 2.3ZM8 5.5a.75.75 0 0 0-.75.75v2.5a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8 5.5Zm0 5.1a.85.85 0 1 0 0 1.7.85.85 0 0 0 0-1.7Z",
|
|
13
|
+
negative: "M8 1.5a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13ZM5.97 5.97a.75.75 0 0 0 0 1.06L6.94 8l-.97.97a.75.75 0 1 0 1.06 1.06l.97-.97.97.97a.75.75 0 1 0 1.06-1.06L9.06 8l.97-.97a.75.75 0 0 0-1.06-1.06L8 6.94l-.97-.97a.75.75 0 0 0-1.06 0Z"
|
|
14
|
+
};
|
|
15
|
+
function Alert({ tone = "info", title, children, action, onDismiss, icon, variant = "soft", className, ...rest }) {
|
|
16
|
+
const [visible, setVisible] = React.useState(true);
|
|
17
|
+
const { reduced } = useMotionPreset();
|
|
18
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, onExitComplete: onDismiss, children: visible && /* @__PURE__ */ jsx(
|
|
19
|
+
motion.div,
|
|
20
|
+
{
|
|
21
|
+
initial: false,
|
|
22
|
+
exit: reduced ? { opacity: 0 } : { opacity: 0, height: 0, marginTop: 0, marginBottom: 0 },
|
|
23
|
+
transition: { type: "spring", visualDuration: 0.28, bounce: 0 },
|
|
24
|
+
style: { overflow: "hidden" },
|
|
25
|
+
children: /* @__PURE__ */ jsxs("div", { ...rest, role: tone === "negative" || tone === "warning" ? "alert" : "status", className: cx("sp-alert", className), "data-tone": tone, "data-variant": variant, children: [
|
|
26
|
+
icon !== false && /* @__PURE__ */ jsx("span", { className: "sp-alert__icon", "aria-hidden": true, children: icon ?? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", width: "16", height: "16", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: ICONS[tone] }) }) }),
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "sp-alert__body", children: [
|
|
28
|
+
title && /* @__PURE__ */ jsx("p", { className: "sp-alert__title", children: title }),
|
|
29
|
+
children && /* @__PURE__ */ jsx("div", { className: "sp-alert__text", children })
|
|
30
|
+
] }),
|
|
31
|
+
action && /* @__PURE__ */ jsx("div", { className: "sp-alert__action", children: action }),
|
|
32
|
+
onDismiss && /* @__PURE__ */ jsx("button", { type: "button", className: "sp-reset-button sp-alert__close", "aria-label": "Dismiss", onClick: () => setVisible(false), children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": true, fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", children: /* @__PURE__ */ jsx("path", { d: "M4.5 4.5l7 7M11.5 4.5l-7 7" }) }) })
|
|
33
|
+
] })
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { Alert };
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { PermissionMatrix } from './chunk-RZUCUWKB.js';
|
|
3
|
+
import { FormDialog, ConfirmDialog } from './chunk-4GLMIQUX.js';
|
|
4
|
+
import { TemplateFrame } from './chunk-5A46EAUE.js';
|
|
5
|
+
import { PageHeader } from './chunk-Y36NEYSP.js';
|
|
6
|
+
import { DataTable } from './chunk-ECJ6AOAB.js';
|
|
7
|
+
import { Switch } from './chunk-2MX7EYXA.js';
|
|
8
|
+
import { Select } from './chunk-X47PLMHL.js';
|
|
9
|
+
import { TextField } from './chunk-A2QD7OLJ.js';
|
|
10
|
+
import { Button } from './chunk-PDP4YT3H.js';
|
|
11
|
+
import { Card, CardHeader } from './chunk-PT736HBJ.js';
|
|
12
|
+
import { Avatar } from './chunk-FVVH37UH.js';
|
|
13
|
+
import { Badge } from './chunk-W7OZ3DOL.js';
|
|
14
|
+
import { useMotionPreset } from './chunk-VDQ3DWO4.js';
|
|
15
|
+
import { cx } from './chunk-K6X6O42N.js';
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import { motion, AnimatePresence } from 'motion/react';
|
|
18
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
var SECTIONS = [
|
|
21
|
+
{ id: "profile", label: "Profile", description: "How you appear to your team." },
|
|
22
|
+
{ id: "notifications", label: "Notifications", description: "What we email you about." },
|
|
23
|
+
{ id: "members", label: "Members", description: "People in this workspace." },
|
|
24
|
+
{ id: "roles", label: "Roles & permissions", description: "What each role can do." },
|
|
25
|
+
{ id: "danger", label: "Danger zone", description: "Irreversible actions." }
|
|
26
|
+
];
|
|
27
|
+
function SettingsTemplate(props) {
|
|
28
|
+
const { chrome, section: sectionProp, onSectionChange } = props;
|
|
29
|
+
const [inner, setInner] = React.useState("profile");
|
|
30
|
+
const section = sectionProp ?? inner;
|
|
31
|
+
const go = (s) => onSectionChange ? onSectionChange(s) : setInner(s);
|
|
32
|
+
const { reduced } = useMotionPreset();
|
|
33
|
+
const id = React.useId();
|
|
34
|
+
const current = SECTIONS.find((s) => s.id === section);
|
|
35
|
+
return /* @__PURE__ */ jsx(TemplateFrame, { chrome, children: /* @__PURE__ */ jsxs("div", { className: cx("sp-tpl", "sp-tpl-settings"), children: [
|
|
36
|
+
/* @__PURE__ */ jsx(PageHeader, { title: "Settings", description: "Manage your account and this workspace." }),
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "sp-tpl-settings__layout", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("nav", { className: "sp-tpl-settings__nav", "aria-label": "Settings sections", children: SECTIONS.map((s) => /* @__PURE__ */ jsxs("button", { type: "button", className: "sp-reset-button sp-tpl-settings__link", "aria-current": section === s.id ? "page" : void 0, "data-danger": s.id === "danger" || void 0, onClick: () => go(s.id), children: [
|
|
39
|
+
section === s.id && /* @__PURE__ */ jsx(motion.span, { layoutId: `${id}-sel`, className: "sp-tpl-settings__sel", transition: { type: "spring", stiffness: 520, damping: 40 } }),
|
|
40
|
+
s.label
|
|
41
|
+
] }, s.id)) }),
|
|
42
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsxs(
|
|
43
|
+
motion.section,
|
|
44
|
+
{
|
|
45
|
+
className: "sp-tpl-settings__panel",
|
|
46
|
+
"aria-labelledby": `${id}-${section}`,
|
|
47
|
+
initial: reduced ? { opacity: 0 } : { opacity: 0, y: 8 },
|
|
48
|
+
animate: { opacity: 1, y: 0 },
|
|
49
|
+
exit: reduced ? { opacity: 0 } : { opacity: 0, y: -4 },
|
|
50
|
+
transition: { duration: 0.18 },
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("header", { className: "sp-tpl-settings__head", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("h2", { id: `${id}-${section}`, className: "sp-tpl__h2", children: current.label }),
|
|
54
|
+
/* @__PURE__ */ jsx("p", { children: current.description })
|
|
55
|
+
] }),
|
|
56
|
+
section === "profile" && /* @__PURE__ */ jsx(ProfileSection, { ...props }),
|
|
57
|
+
section === "notifications" && /* @__PURE__ */ jsx(NotificationsSection, { ...props }),
|
|
58
|
+
section === "members" && /* @__PURE__ */ jsx(MembersSection, { ...props }),
|
|
59
|
+
section === "roles" && /* @__PURE__ */ jsx(PermissionMatrix, { roles: props.roles, groups: props.permissionGroups, value: props.grants, onSave: props.onSaveGrants }),
|
|
60
|
+
section === "danger" && /* @__PURE__ */ jsx(DangerSection, { ...props })
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
section
|
|
64
|
+
) })
|
|
65
|
+
] })
|
|
66
|
+
] }) });
|
|
67
|
+
}
|
|
68
|
+
function ProfileSection({ profile, onSaveProfile, timezones }) {
|
|
69
|
+
const [draft, setDraft] = React.useState(profile);
|
|
70
|
+
const [saving, setSaving] = React.useState(false);
|
|
71
|
+
const [saved, setSaved] = React.useState(false);
|
|
72
|
+
const [error, setError] = React.useState(null);
|
|
73
|
+
React.useEffect(() => setDraft(profile), [profile]);
|
|
74
|
+
const dirty = JSON.stringify(draft) !== JSON.stringify(profile);
|
|
75
|
+
const emailError = draft.email && !/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(draft.email) ? "Enter a valid email address." : void 0;
|
|
76
|
+
return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
|
|
77
|
+
"form",
|
|
78
|
+
{
|
|
79
|
+
className: "sp-tpl-settings__form",
|
|
80
|
+
onSubmit: async (e) => {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
if (emailError || !draft.name.trim()) return;
|
|
83
|
+
setSaving(true);
|
|
84
|
+
setError(null);
|
|
85
|
+
try {
|
|
86
|
+
await onSaveProfile(draft);
|
|
87
|
+
setSaved(true);
|
|
88
|
+
setTimeout(() => setSaved(false), 2200);
|
|
89
|
+
} catch (err) {
|
|
90
|
+
setError(err instanceof Error ? err.message : "Could not save.");
|
|
91
|
+
} finally {
|
|
92
|
+
setSaving(false);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ jsxs("div", { className: "sp-tpl-settings__avatar", children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Avatar, { name: draft.name || "?", size: 56 }),
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
99
|
+
/* @__PURE__ */ jsx("b", { children: draft.name || "Your name" }),
|
|
100
|
+
/* @__PURE__ */ jsx("span", { children: draft.title || "Add a title" })
|
|
101
|
+
] })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsxs("div", { className: "sp-tpl-settings__grid", children: [
|
|
104
|
+
/* @__PURE__ */ jsx(TextField, { label: "Full name", name: "name", value: draft.name, onValueChange: (v) => setDraft({ ...draft, name: v }), required: true, error: !draft.name.trim() ? "Your name can\u2019t be empty." : void 0, autoComplete: "name" }),
|
|
105
|
+
/* @__PURE__ */ jsx(TextField, { label: "Email", name: "email", type: "email", value: draft.email, onValueChange: (v) => setDraft({ ...draft, email: v }), error: emailError, autoComplete: "email" }),
|
|
106
|
+
/* @__PURE__ */ jsx(TextField, { label: "Title", name: "title", optional: true, value: draft.title ?? "", onValueChange: (v) => setDraft({ ...draft, title: v }) }),
|
|
107
|
+
/* @__PURE__ */ jsx(Select, { label: "Time zone", options: timezones, value: draft.timezone, onValueChange: (v) => setDraft({ ...draft, timezone: v }), searchable: true })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "sp-tpl-settings__actions", children: [
|
|
110
|
+
error && /* @__PURE__ */ jsx("span", { className: "sp-field__error", children: error }),
|
|
111
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: saved && /* @__PURE__ */ jsx(motion.span, { className: "sp-tpl-settings__saved", initial: { opacity: 0, x: 6 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0 }, role: "status", children: "Saved" }) }),
|
|
112
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", disabled: !dirty || saving, onClick: () => setDraft(profile), children: "Reset" }),
|
|
113
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", disabled: !dirty || !!emailError, loading: saving, children: "Save profile" })
|
|
114
|
+
] })
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
) });
|
|
118
|
+
}
|
|
119
|
+
function NotificationsSection({ notifications, onToggleNotification }) {
|
|
120
|
+
return /* @__PURE__ */ jsx(Card, { padding: "none", children: /* @__PURE__ */ jsx("ul", { className: "sp-tpl-settings__list", children: notifications.map((n) => /* @__PURE__ */ jsxs("li", { children: [
|
|
121
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: `notif-${n.id}`, children: [
|
|
122
|
+
/* @__PURE__ */ jsx("b", { children: n.label }),
|
|
123
|
+
n.description && /* @__PURE__ */ jsx("span", { children: n.description })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsx(Switch, { id: `notif-${n.id}`, checked: n.enabled, onCheckedChange: (c) => onToggleNotification(n.id, c) })
|
|
126
|
+
] }, n.id)) }) });
|
|
127
|
+
}
|
|
128
|
+
function MembersSection({ members, roles, onInvite, onChangeRole, onRemoveMember }) {
|
|
129
|
+
const [inviting, setInviting] = React.useState(false);
|
|
130
|
+
const [removing, setRemoving] = React.useState(null);
|
|
131
|
+
const roleOptions = roles.filter((r) => !r.locked).map((r) => r.name);
|
|
132
|
+
const rel = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
133
|
+
const columns = [
|
|
134
|
+
{ id: "name", header: "Member", accessor: "name", sortable: true, cell: (m) => /* @__PURE__ */ jsxs("span", { className: "sp-tpl__person", children: [
|
|
135
|
+
/* @__PURE__ */ jsx(Avatar, { name: m.name, size: 26 }),
|
|
136
|
+
/* @__PURE__ */ jsxs("span", { className: "sp-tpl__stack", children: [
|
|
137
|
+
/* @__PURE__ */ jsx("b", { children: m.name }),
|
|
138
|
+
/* @__PURE__ */ jsx("small", { children: m.email })
|
|
139
|
+
] })
|
|
140
|
+
] }) },
|
|
141
|
+
{ id: "role", header: "Role", accessor: "role", filter: {}, editable: { type: "select", options: roleOptions } },
|
|
142
|
+
{ id: "status", header: "Status", accessor: "status", filter: {}, cell: (m) => /* @__PURE__ */ jsx(Badge, { tone: m.status === "Active" ? "positive" : "info", dot: true, children: m.status }) },
|
|
143
|
+
{ id: "last", header: "Last active", accessor: (m) => m.lastActive, sortable: true, cell: (m) => m.lastActive ? rel.format(-Math.max(0, Math.round((Date.now() - m.lastActive.getTime()) / 864e5)), "day") : "\u2014" }
|
|
144
|
+
];
|
|
145
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
DataTable,
|
|
148
|
+
{
|
|
149
|
+
label: "Members",
|
|
150
|
+
data: members,
|
|
151
|
+
columns,
|
|
152
|
+
getRowId: (m) => m.id,
|
|
153
|
+
onCellEdit: (id, _col, value) => onChangeRole(id, value),
|
|
154
|
+
rowActions: (m) => [{ id: "remove", label: "Remove from workspace", danger: true, onSelect: () => setRemoving(m) }],
|
|
155
|
+
toolbar: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "accent", onClick: () => setInviting(true), children: "Invite people" }),
|
|
156
|
+
defaultDensity: "compact"
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ jsxs(
|
|
160
|
+
FormDialog,
|
|
161
|
+
{
|
|
162
|
+
open: inviting,
|
|
163
|
+
onOpenChange: setInviting,
|
|
164
|
+
title: "Invite people",
|
|
165
|
+
description: "They\u2019ll get an email with a link to join.",
|
|
166
|
+
submitLabel: "Send invite",
|
|
167
|
+
onSubmit: async (data) => {
|
|
168
|
+
const email = String(data.get("email") ?? "").trim();
|
|
169
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(email)) return { error: "Enter a valid email address.", field: "email" };
|
|
170
|
+
if (members.some((m) => m.email.toLowerCase() === email.toLowerCase())) return { error: `${email} is already a member.`, field: "email" };
|
|
171
|
+
await onInvite(email, String(data.get("role") ?? roleOptions[0]));
|
|
172
|
+
},
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsx(TextField, { label: "Email address", name: "email", type: "email", placeholder: "name@company.com", required: true, "data-autofocus": "" }),
|
|
175
|
+
/* @__PURE__ */ jsx(Select, { label: "Role", name: "role", options: roleOptions, defaultValue: roleOptions[roleOptions.length - 1] })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ jsx(
|
|
180
|
+
ConfirmDialog,
|
|
181
|
+
{
|
|
182
|
+
open: !!removing,
|
|
183
|
+
onOpenChange: (o) => !o && setRemoving(null),
|
|
184
|
+
tone: "danger",
|
|
185
|
+
title: `Remove ${removing?.name ?? ""}?`,
|
|
186
|
+
description: "They lose access immediately. Their work stays in the workspace.",
|
|
187
|
+
confirmLabel: "Remove",
|
|
188
|
+
onConfirm: async () => {
|
|
189
|
+
if (removing) await onRemoveMember(removing.id);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
function DangerSection({ workspaceName, onDeleteWorkspace }) {
|
|
196
|
+
return /* @__PURE__ */ jsx(Card, { variant: "flat", className: "sp-tpl-settings__danger", children: /* @__PURE__ */ jsx(
|
|
197
|
+
CardHeader,
|
|
198
|
+
{
|
|
199
|
+
title: "Delete this workspace",
|
|
200
|
+
description: "Removes every project, file and member. Billing stops at the end of the period. This can\u2019t be undone.",
|
|
201
|
+
action: /* @__PURE__ */ jsx(
|
|
202
|
+
ConfirmDialog,
|
|
203
|
+
{
|
|
204
|
+
tone: "danger",
|
|
205
|
+
title: `Delete ${workspaceName}?`,
|
|
206
|
+
description: "Everything in it is deleted permanently.",
|
|
207
|
+
details: /* @__PURE__ */ jsxs("ul", { children: [
|
|
208
|
+
/* @__PURE__ */ jsx("li", { children: "All projects, files and comments" }),
|
|
209
|
+
/* @__PURE__ */ jsx("li", { children: "Member access and invitations" }),
|
|
210
|
+
/* @__PURE__ */ jsx("li", { children: "Integrations and API keys" })
|
|
211
|
+
] }),
|
|
212
|
+
requireText: workspaceName,
|
|
213
|
+
confirmLabel: "Delete workspace",
|
|
214
|
+
onConfirm: onDeleteWorkspace,
|
|
215
|
+
trigger: /* @__PURE__ */ jsx(Button, { variant: "danger", children: "Delete workspace" })
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
) });
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export { SettingsTemplate };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useMounted } from './chunk-
|
|
2
|
+
import { useMounted } from './chunk-4C7VKLTU.js';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function resolveTheme(anchor) {
|
|
7
|
-
const el = anchor?.closest("[data-theme],[data-
|
|
7
|
+
const el = anchor?.closest("[data-theme],[data-sp-theme],.dark,.light");
|
|
8
8
|
if (!el) return void 0;
|
|
9
|
-
const attr = el.getAttribute("data-
|
|
9
|
+
const attr = el.getAttribute("data-sp-theme") ?? el.getAttribute("data-theme");
|
|
10
10
|
if (attr === "dark" || attr === "light") return attr;
|
|
11
11
|
if (el.classList.contains("dark")) return "dark";
|
|
12
12
|
if (el.classList.contains("light")) return "light";
|
|
@@ -18,7 +18,7 @@ function Portal({ children, container, anchor, className }) {
|
|
|
18
18
|
const target = container ?? document.body;
|
|
19
19
|
const theme = resolveTheme(anchor);
|
|
20
20
|
return createPortal(
|
|
21
|
-
/* @__PURE__ */ jsx("div", { className: className ? `
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: className ? `sp-portal ${className}` : "sp-portal", "data-sp-theme": theme, children }),
|
|
22
22
|
target
|
|
23
23
|
);
|
|
24
24
|
}
|