seppia 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +116 -2
- 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-2AS3PZ62.js +222 -0
- package/dist/chunk-2DW7PF2P.cjs +116 -0
- package/dist/chunk-2HMUVVUR.cjs +45 -0
- package/dist/chunk-2IBDXUBG.js +2 -0
- package/dist/chunk-2L7GUYB2.js +152 -0
- package/dist/chunk-2MX7EYXA.js +187 -0
- package/dist/chunk-2UB2HKMF.cjs +131 -0
- package/dist/chunk-2YB44UOW.js +2 -0
- package/dist/chunk-32OCNZWB.js +2 -0
- package/dist/chunk-344MRWFO.js +25 -0
- package/dist/chunk-3A2LHCPV.cjs +30 -0
- package/dist/chunk-3BC4NA2C.cjs +126 -0
- package/dist/chunk-3ENS37RT.cjs +373 -0
- package/dist/chunk-3FLWYYDS.js +161 -0
- package/dist/chunk-3GGOAJIG.cjs +176 -0
- package/dist/chunk-3HME5VXL.cjs +3 -0
- package/dist/chunk-3S3MBTXC.cjs +3 -0
- package/dist/chunk-3WWOK2IV.cjs +104 -0
- package/dist/chunk-3YOPOWUB.js +191 -0
- package/dist/chunk-3Z5M2WVW.cjs +3 -0
- package/dist/chunk-43N5QL6C.cjs +3 -0
- package/dist/chunk-4C7VKLTU.js +47 -0
- package/dist/chunk-4GLMIQUX.js +275 -0
- package/dist/chunk-4MTRY6D2.js +288 -0
- package/dist/chunk-4Q6LY3TN.cjs +259 -0
- package/dist/chunk-4STGAE4T.js +2 -0
- package/dist/chunk-4YXWES4C.cjs +81 -0
- package/dist/chunk-54SA4YJ7.js +217 -0
- package/dist/chunk-5A46EAUE.js +42 -0
- package/dist/chunk-5CKY3233.js +2 -0
- package/dist/chunk-5IGY4W4T.cjs +131 -0
- package/dist/chunk-5KNKWEIE.cjs +564 -0
- package/dist/chunk-5OOVB2S5.cjs +244 -0
- package/dist/chunk-64WDKM52.js +191 -0
- package/dist/chunk-6CZIXWOU.js +2 -0
- package/dist/chunk-6HPGI7VU.js +183 -0
- package/dist/chunk-6HZLPZ5A.js +146 -0
- package/dist/chunk-6IH2PZO5.js +122 -0
- package/dist/chunk-6JZYZDCV.cjs +245 -0
- package/dist/chunk-6K3RXUKZ.cjs +239 -0
- package/dist/chunk-6MJYJC3V.cjs +3 -0
- package/dist/chunk-6OA3BX3U.cjs +394 -0
- package/dist/chunk-6PE3ZGPD.cjs +239 -0
- package/dist/chunk-6QQPGNNK.js +2 -0
- package/dist/chunk-6W3OO6DK.cjs +159 -0
- 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-AEQ6DMPS.js +93 -0
- package/dist/chunk-APFW2I3Q.js +38 -0
- package/dist/chunk-AXWQJPZL.js +222 -0
- package/dist/chunk-B3D6KWG3.cjs +11 -0
- package/dist/chunk-B5Z4XIIF.js +26 -0
- package/dist/chunk-BQUUTWTZ.cjs +129 -0
- package/dist/chunk-BRHXMXA7.cjs +3 -0
- package/dist/chunk-CIMKUKAG.cjs +3 -0
- package/dist/chunk-CM7W446Z.cjs +410 -0
- package/dist/chunk-CQZU4EHR.cjs +263 -0
- package/dist/chunk-DKTUKZ5A.cjs +326 -0
- package/dist/chunk-DLS6YGNX.cjs +217 -0
- 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-EAQYTXY7.js +127 -0
- 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-FLLU5FAE.js +121 -0
- package/dist/chunk-FO7ZZP52.cjs +186 -0
- package/dist/chunk-FVVH37UH.js +57 -0
- package/dist/chunk-FXCVPRHV.cjs +52 -0
- package/dist/chunk-FXQKHROS.cjs +3 -0
- package/dist/chunk-G5UZZ2XG.cjs +52 -0
- package/dist/chunk-GASIBRAJ.js +650 -0
- package/dist/chunk-GHC7MKBR.cjs +31 -0
- package/dist/chunk-GK7BIWGS.cjs +149 -0
- package/dist/chunk-GROWBVU5.cjs +140 -0
- package/dist/chunk-GSF7YUXO.js +117 -0
- package/dist/chunk-GTU6TD5Q.cjs +197 -0
- 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-HWHAD4OZ.js +109 -0
- package/dist/chunk-I2QUKJX7.cjs +197 -0
- package/dist/chunk-I2RCFWV3.cjs +174 -0
- package/dist/chunk-I3GJQHNE.cjs +144 -0
- package/dist/chunk-I3HEEAHX.cjs +28 -0
- 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-IT27FHWR.cjs +131 -0
- 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-JUMI5UBA.cjs +143 -0
- package/dist/chunk-JXPOKP66.js +2 -0
- package/dist/chunk-JZUEW7WR.js +2 -0
- package/dist/chunk-K2CVKVIF.js +175 -0
- package/dist/chunk-K6MCWJ35.cjs +180 -0
- package/dist/chunk-K6X6O42N.js +9 -0
- package/dist/chunk-KA24K3XP.js +193 -0
- package/dist/chunk-KEISLNT6.cjs +3 -0
- package/dist/chunk-KLJ4DMH2.cjs +262 -0
- package/dist/chunk-KO5DJXD4.js +2 -0
- package/dist/chunk-KPG24YFL.js +30 -0
- package/dist/chunk-KVDIEAWQ.cjs +3 -0
- package/dist/chunk-KVFBDLSA.cjs +215 -0
- 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-LD3DXOQ7.js +92 -0
- package/dist/chunk-LRI6V2NK.cjs +117 -0
- package/dist/chunk-LVE2WXGB.js +109 -0
- package/dist/chunk-M4U2IWVW.js +54 -0
- package/dist/chunk-MCK6WCG2.cjs +168 -0
- package/dist/chunk-MCQYUABH.cjs +154 -0
- package/dist/chunk-MFFNV55T.cjs +223 -0
- package/dist/chunk-MGUOCT7T.cjs +1047 -0
- package/dist/chunk-MHIFGXVD.cjs +213 -0
- 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-MYTU26NE.js +158 -0
- package/dist/chunk-N4KGLSBT.cjs +85 -0
- package/dist/chunk-N64ZJPCO.cjs +3 -0
- package/dist/chunk-NGKH2EEJ.cjs +326 -0
- package/dist/chunk-NIT46ZG7.cjs +352 -0
- package/dist/chunk-NJEGW6SX.js +386 -0
- package/dist/chunk-NJYCQEIR.js +182 -0
- 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-OLWS65QZ.cjs +276 -0
- 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-POKS6BSL.cjs +166 -0
- package/dist/chunk-PSMIDELA.js +254 -0
- package/dist/chunk-PT736HBJ.js +27 -0
- package/dist/chunk-PWKKLWBX.js +144 -0
- 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-QHFMQWSO.cjs +139 -0
- 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-RZNIXIJU.js +132 -0
- 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-SS6DGMZY.cjs +204 -0
- 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-TLP4LLIX.cjs +157 -0
- 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-UGDDUI2N.js +131 -0
- package/dist/chunk-UORTZAPR.js +2 -0
- package/dist/chunk-UTYMDSOE.cjs +3 -0
- package/dist/chunk-UWQGY3GT.cjs +60 -0
- package/dist/chunk-UZS7VXCA.js +237 -0
- package/dist/chunk-VACQZKYM.cjs +44 -0
- package/dist/chunk-VDQ3DWO4.js +28 -0
- package/dist/chunk-VKYDWRL2.cjs +3 -0
- package/dist/chunk-VRFYJ4BN.js +80 -0
- package/dist/chunk-W3VOEVRS.cjs +74 -0
- package/dist/chunk-W7OZ3DOL.js +14 -0
- package/dist/chunk-WG4KHU2E.cjs +149 -0
- package/dist/chunk-WHM3QKTO.js +1012 -0
- package/dist/chunk-WINVYCMX.js +380 -0
- package/dist/chunk-WPTNMFHO.cjs +310 -0
- 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-XQMLBUHW.js +175 -0
- 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-YEQVN7I3.js +330 -0
- package/dist/chunk-YI6XXQMC.cjs +275 -0
- package/dist/chunk-YJDQ3BQZ.js +118 -0
- package/dist/chunk-YJR744JB.js +131 -0
- package/dist/chunk-YN2AVSEN.js +371 -0
- package/dist/chunk-YNJA4HB2.js +307 -0
- package/dist/chunk-YRLEGHKB.js +137 -0
- package/dist/chunk-YTAX4ICP.cjs +154 -0
- package/dist/chunk-YU7IOI63.js +2 -0
- package/dist/chunk-YUG4SGR5.js +68 -0
- package/dist/chunk-YVGWCNLQ.js +154 -0
- package/dist/chunk-Z6SMSENC.js +107 -0
- package/dist/chunk-ZAQJBIYI.cjs +205 -0
- package/dist/chunk-ZGKDMG7N.cjs +3 -0
- package/dist/chunk-ZHGVBALA.js +304 -0
- package/dist/chunk-ZIGUJXZM.js +2 -0
- package/dist/chunk-ZPYGXDFU.js +2 -0
- package/dist/chunk-ZSD56XUT.js +240 -0
- package/dist/chunk-ZX6JRBPY.cjs +209 -0
- package/dist/components/accordion.cjs +27 -0
- package/dist/components/accordion.d.cts +1 -0
- package/dist/components/accordion.d.ts +1 -0
- package/dist/components/accordion.js +6 -0
- 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 +16 -0
- package/dist/components/calendar.d.cts +1 -0
- package/dist/components/calendar.d.ts +1 -0
- package/dist/components/calendar.js +7 -0
- 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 +16 -0
- package/dist/components/checkbox.d.cts +1 -0
- package/dist/components/checkbox.d.ts +1 -0
- package/dist/components/checkbox.js +7 -0
- package/dist/components/chip-select.cjs +15 -0
- package/dist/components/chip-select.d.cts +1 -0
- package/dist/components/chip-select.d.ts +1 -0
- package/dist/components/chip-select.js +6 -0
- package/dist/components/clock.cjs +13 -0
- package/dist/components/clock.d.cts +1 -0
- package/dist/components/clock.d.ts +1 -0
- package/dist/components/clock.js +4 -0
- package/dist/components/color-picker.cjs +15 -0
- package/dist/components/color-picker.d.cts +1 -0
- package/dist/components/color-picker.d.ts +1 -0
- package/dist/components/color-picker.js +6 -0
- package/dist/components/command-palette.cjs +21 -0
- package/dist/components/command-palette.d.cts +1 -0
- package/dist/components/command-palette.d.ts +1 -0
- package/dist/components/command-palette.js +8 -0
- package/dist/components/date-picker.cjs +22 -0
- package/dist/components/date-picker.d.cts +1 -0
- package/dist/components/date-picker.d.ts +1 -0
- package/dist/components/date-picker.js +13 -0
- 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 +17 -0
- package/dist/components/drawer.d.cts +1 -0
- package/dist/components/drawer.d.ts +1 -0
- package/dist/components/drawer.js +8 -0
- 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 +14 -0
- package/dist/components/floating-panel.d.cts +1 -0
- package/dist/components/floating-panel.d.ts +1 -0
- package/dist/components/floating-panel.js +5 -0
- 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 +14 -0
- package/dist/components/hold-button.d.cts +1 -0
- package/dist/components/hold-button.d.ts +1 -0
- package/dist/components/hold-button.js +5 -0
- package/dist/components/knob.cjs +16 -0
- package/dist/components/knob.d.cts +1 -0
- package/dist/components/knob.d.ts +1 -0
- package/dist/components/knob.js +7 -0
- 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 +14 -0
- package/dist/components/magnetic-button.d.cts +1 -0
- package/dist/components/magnetic-button.d.ts +1 -0
- package/dist/components/magnetic-button.js +5 -0
- 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 +14 -0
- package/dist/components/morph-button.d.cts +1 -0
- package/dist/components/morph-button.d.ts +1 -0
- package/dist/components/morph-button.js +5 -0
- package/dist/components/morph-dialog.cjs +33 -0
- package/dist/components/morph-dialog.d.cts +1 -0
- package/dist/components/morph-dialog.d.ts +1 -0
- package/dist/components/morph-dialog.js +8 -0
- package/dist/components/number-field.cjs +16 -0
- package/dist/components/number-field.d.cts +1 -0
- package/dist/components/number-field.d.ts +1 -0
- package/dist/components/number-field.js +7 -0
- 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 +16 -0
- package/dist/components/pin-input.d.cts +1 -0
- package/dist/components/pin-input.d.ts +1 -0
- package/dist/components/pin-input.js +7 -0
- package/dist/components/popover.cjs +19 -0
- package/dist/components/popover.d.cts +1 -0
- package/dist/components/popover.d.ts +1 -0
- package/dist/components/popover.js +10 -0
- package/dist/components/progress.cjs +18 -0
- package/dist/components/progress.d.cts +1 -0
- package/dist/components/progress.d.ts +1 -0
- package/dist/components/progress.js +5 -0
- package/dist/components/radial-menu.cjs +15 -0
- package/dist/components/radial-menu.d.cts +1 -0
- package/dist/components/radial-menu.d.ts +1 -0
- package/dist/components/radial-menu.js +6 -0
- package/dist/components/radio-group.cjs +15 -0
- package/dist/components/radio-group.d.cts +1 -0
- package/dist/components/radio-group.d.ts +1 -0
- package/dist/components/radio-group.js +6 -0
- package/dist/components/resizable-panels.cjs +19 -0
- package/dist/components/resizable-panels.d.cts +1 -0
- package/dist/components/resizable-panels.d.ts +1 -0
- package/dist/components/resizable-panels.js +6 -0
- package/dist/components/segmented-control.cjs +16 -0
- package/dist/components/segmented-control.d.cts +1 -0
- package/dist/components/segmented-control.d.ts +1 -0
- package/dist/components/segmented-control.js +7 -0
- 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 +16 -0
- package/dist/components/slider.d.cts +1 -0
- package/dist/components/slider.d.ts +1 -0
- package/dist/components/slider.js +7 -0
- package/dist/components/sortable-list.cjs +14 -0
- package/dist/components/sortable-list.d.cts +1 -0
- package/dist/components/sortable-list.d.ts +1 -0
- package/dist/components/sortable-list.js +5 -0
- package/dist/components/sparkline.cjs +15 -0
- package/dist/components/sparkline.d.cts +1 -0
- package/dist/components/sparkline.d.ts +1 -0
- package/dist/components/sparkline.js +6 -0
- 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 +14 -0
- package/dist/components/swipe-confirm.d.cts +1 -0
- package/dist/components/swipe-confirm.d.ts +1 -0
- package/dist/components/swipe-confirm.js +5 -0
- package/dist/components/switch.cjs +17 -0
- package/dist/components/switch.d.cts +1 -0
- package/dist/components/switch.d.ts +1 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/tabs.cjs +31 -0
- package/dist/components/tabs.d.cts +1 -0
- package/dist/components/tabs.d.ts +1 -0
- package/dist/components/tabs.js +6 -0
- package/dist/components/tether.cjs +17 -0
- package/dist/components/tether.d.cts +1 -0
- package/dist/components/tether.d.ts +1 -0
- package/dist/components/tether.js +4 -0
- 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 +15 -0
- package/dist/components/theme-switch.d.cts +1 -0
- package/dist/components/theme-switch.d.ts +1 -0
- package/dist/components/theme-switch.js +6 -0
- package/dist/components/toaster.cjs +22 -0
- package/dist/components/toaster.d.cts +1 -0
- package/dist/components/toaster.d.ts +1 -0
- package/dist/components/toaster.js +5 -0
- 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 +16 -0
- package/dist/components/wheel-picker.d.cts +1 -0
- package/dist/components/wheel-picker.d.ts +1 -0
- package/dist/components/wheel-picker.js +7 -0
- package/dist/css/accordion.css +2 -0
- 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 +2 -0
- package/dist/css/breadcrumbs.css +2 -0
- package/dist/css/button.css +2 -0
- package/dist/css/calendar.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/chart.css +2 -0
- package/dist/css/checkbox.css +2 -0
- package/dist/css/chip-select.css +2 -0
- package/dist/css/clock.css +2 -0
- package/dist/css/color-picker.css +2 -0
- package/dist/css/command-palette.css +2 -0
- package/dist/css/dashboard.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-picker.css +2 -0
- package/dist/css/dialog.css +2 -0
- package/dist/css/drawer.css +2 -0
- package/dist/css/empty-state.css +2 -0
- package/dist/css/floating-panel.css +2 -0
- package/dist/css/forms.css +2 -0
- package/dist/css/hold-button.css +2 -0
- package/dist/css/kanban.css +2 -0
- package/dist/css/knob.css +2 -0
- package/dist/css/magnetic-button.css +2 -0
- 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 +2 -0
- package/dist/css/morph-dialog.css +2 -0
- package/dist/css/notifications.css +2 -0
- package/dist/css/number-field.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/permissions.css +2 -0
- package/dist/css/pin-input.css +2 -0
- package/dist/css/popover.css +2 -0
- package/dist/css/progress.css +2 -0
- package/dist/css/radial-menu.css +2 -0
- package/dist/css/radio-group.css +2 -0
- package/dist/css/resizable-panels.css +2 -0
- package/dist/css/scheduling.css +2 -0
- package/dist/css/segmented-control.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +2 -0
- package/dist/css/sortable-list.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/stepper.css +2 -0
- package/dist/css/swipe-confirm.css +2 -0
- package/dist/css/switch.css +2 -0
- package/dist/css/tabs.css +2 -0
- 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 +2 -0
- package/dist/css/text-field.css +2 -0
- package/dist/css/theme-switch.css +2 -0
- package/dist/css/toaster.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/wheel-picker.css +2 -0
- package/dist/index.cjs +828 -0
- package/dist/index.d.cts +3182 -0
- package/dist/index.d.ts +3182 -0
- package/dist/index.js +123 -0
- package/dist/styles.css +2 -0
- 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 +120 -4
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunk3BC4NA2C_cjs = require('./chunk-3BC4NA2C.cjs');
|
|
5
|
+
var chunkL5JDNZS3_cjs = require('./chunk-L5JDNZS3.cjs');
|
|
6
|
+
var chunkVACQZKYM_cjs = require('./chunk-VACQZKYM.cjs');
|
|
7
|
+
var chunkNYRO7BWG_cjs = require('./chunk-NYRO7BWG.cjs');
|
|
8
|
+
var chunk5KNKWEIE_cjs = require('./chunk-5KNKWEIE.cjs');
|
|
9
|
+
var chunkZX6JRBPY_cjs = require('./chunk-ZX6JRBPY.cjs');
|
|
10
|
+
var chunkNGKH2EEJ_cjs = require('./chunk-NGKH2EEJ.cjs');
|
|
11
|
+
var chunk6PE3ZGPD_cjs = require('./chunk-6PE3ZGPD.cjs');
|
|
12
|
+
var chunkN4KGLSBT_cjs = require('./chunk-N4KGLSBT.cjs');
|
|
13
|
+
var chunkFXCVPRHV_cjs = require('./chunk-FXCVPRHV.cjs');
|
|
14
|
+
var chunk4YXWES4C_cjs = require('./chunk-4YXWES4C.cjs');
|
|
15
|
+
var chunkDQQLYUXT_cjs = require('./chunk-DQQLYUXT.cjs');
|
|
16
|
+
var chunkGHC7MKBR_cjs = require('./chunk-GHC7MKBR.cjs');
|
|
17
|
+
var chunkB3D6KWG3_cjs = require('./chunk-B3D6KWG3.cjs');
|
|
18
|
+
var React = require('react');
|
|
19
|
+
var react = require('motion/react');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopNamespace(e) {
|
|
23
|
+
if (e && e.__esModule) return e;
|
|
24
|
+
var n = Object.create(null);
|
|
25
|
+
if (e) {
|
|
26
|
+
Object.keys(e).forEach(function (k) {
|
|
27
|
+
if (k !== 'default') {
|
|
28
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return e[k]; }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
n.default = e;
|
|
37
|
+
return Object.freeze(n);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
41
|
+
|
|
42
|
+
var SECTIONS = [
|
|
43
|
+
{ id: "profile", label: "Profile", description: "How you appear to your team." },
|
|
44
|
+
{ id: "notifications", label: "Notifications", description: "What we email you about." },
|
|
45
|
+
{ id: "members", label: "Members", description: "People in this workspace." },
|
|
46
|
+
{ id: "roles", label: "Roles & permissions", description: "What each role can do." },
|
|
47
|
+
{ id: "danger", label: "Danger zone", description: "Irreversible actions." }
|
|
48
|
+
];
|
|
49
|
+
function SettingsTemplate(props) {
|
|
50
|
+
const { chrome, section: sectionProp, onSectionChange } = props;
|
|
51
|
+
const [inner, setInner] = React__namespace.useState("profile");
|
|
52
|
+
const section = sectionProp ?? inner;
|
|
53
|
+
const go = (s) => onSectionChange ? onSectionChange(s) : setInner(s);
|
|
54
|
+
const { reduced } = chunkGHC7MKBR_cjs.useMotionPreset();
|
|
55
|
+
const id = React__namespace.useId();
|
|
56
|
+
const current = SECTIONS.find((s) => s.id === section);
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVACQZKYM_cjs.TemplateFrame, { chrome, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkB3D6KWG3_cjs.cx("sp-tpl", "sp-tpl-settings"), children: [
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkNYRO7BWG_cjs.PageHeader, { title: "Settings", description: "Manage your account and this workspace." }),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sp-tpl-settings__layout", children: [
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx("nav", { className: "sp-tpl-settings__nav", "aria-label": "Settings sections", children: SECTIONS.map((s) => /* @__PURE__ */ jsxRuntime.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: [
|
|
61
|
+
section === s.id && /* @__PURE__ */ jsxRuntime.jsx(react.motion.span, { layoutId: `${id}-sel`, className: "sp-tpl-settings__sel", transition: { type: "spring", stiffness: 520, damping: 40 } }),
|
|
62
|
+
s.label
|
|
63
|
+
] }, s.id)) }),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
65
|
+
react.motion.section,
|
|
66
|
+
{
|
|
67
|
+
className: "sp-tpl-settings__panel",
|
|
68
|
+
"aria-labelledby": `${id}-${section}`,
|
|
69
|
+
initial: reduced ? { opacity: 0 } : { opacity: 0, y: 8 },
|
|
70
|
+
animate: { opacity: 1, y: 0 },
|
|
71
|
+
exit: reduced ? { opacity: 0 } : { opacity: 0, y: -4 },
|
|
72
|
+
transition: { duration: 0.18 },
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "sp-tpl-settings__head", children: [
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { id: `${id}-${section}`, className: "sp-tpl__h2", children: current.label }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: current.description })
|
|
77
|
+
] }),
|
|
78
|
+
section === "profile" && /* @__PURE__ */ jsxRuntime.jsx(ProfileSection, { ...props }),
|
|
79
|
+
section === "notifications" && /* @__PURE__ */ jsxRuntime.jsx(NotificationsSection, { ...props }),
|
|
80
|
+
section === "members" && /* @__PURE__ */ jsxRuntime.jsx(MembersSection, { ...props }),
|
|
81
|
+
section === "roles" && /* @__PURE__ */ jsxRuntime.jsx(chunk3BC4NA2C_cjs.PermissionMatrix, { roles: props.roles, groups: props.permissionGroups, value: props.grants, onSave: props.onSaveGrants }),
|
|
82
|
+
section === "danger" && /* @__PURE__ */ jsxRuntime.jsx(DangerSection, { ...props })
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
section
|
|
86
|
+
) })
|
|
87
|
+
] })
|
|
88
|
+
] }) });
|
|
89
|
+
}
|
|
90
|
+
function ProfileSection({ profile, onSaveProfile, timezones }) {
|
|
91
|
+
const [draft, setDraft] = React__namespace.useState(profile);
|
|
92
|
+
const [saving, setSaving] = React__namespace.useState(false);
|
|
93
|
+
const [saved, setSaved] = React__namespace.useState(false);
|
|
94
|
+
const [error, setError] = React__namespace.useState(null);
|
|
95
|
+
React__namespace.useEffect(() => setDraft(profile), [profile]);
|
|
96
|
+
const dirty = JSON.stringify(draft) !== JSON.stringify(profile);
|
|
97
|
+
const emailError = draft.email && !/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(draft.email) ? "Enter a valid email address." : void 0;
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkFXCVPRHV_cjs.Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
99
|
+
"form",
|
|
100
|
+
{
|
|
101
|
+
className: "sp-tpl-settings__form",
|
|
102
|
+
onSubmit: async (e) => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
if (emailError || !draft.name.trim()) return;
|
|
105
|
+
setSaving(true);
|
|
106
|
+
setError(null);
|
|
107
|
+
try {
|
|
108
|
+
await onSaveProfile(draft);
|
|
109
|
+
setSaved(true);
|
|
110
|
+
setTimeout(() => setSaved(false), 2200);
|
|
111
|
+
} catch (err) {
|
|
112
|
+
setError(err instanceof Error ? err.message : "Could not save.");
|
|
113
|
+
} finally {
|
|
114
|
+
setSaving(false);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sp-tpl-settings__avatar", children: [
|
|
119
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk4YXWES4C_cjs.Avatar, { name: draft.name || "?", size: 56 }),
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: draft.name || "Your name" }),
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: draft.title || "Add a title" })
|
|
123
|
+
] })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sp-tpl-settings__grid", children: [
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6PE3ZGPD_cjs.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" }),
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6PE3ZGPD_cjs.TextField, { label: "Email", name: "email", type: "email", value: draft.email, onValueChange: (v) => setDraft({ ...draft, email: v }), error: emailError, autoComplete: "email" }),
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6PE3ZGPD_cjs.TextField, { label: "Title", name: "title", optional: true, value: draft.title ?? "", onValueChange: (v) => setDraft({ ...draft, title: v }) }),
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkNGKH2EEJ_cjs.Select, { label: "Time zone", options: timezones, value: draft.timezone, onValueChange: (v) => setDraft({ ...draft, timezone: v }), searchable: true })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sp-tpl-settings__actions", children: [
|
|
132
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sp-field__error", children: error }),
|
|
133
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: saved && /* @__PURE__ */ jsxRuntime.jsx(react.motion.span, { className: "sp-tpl-settings__saved", initial: { opacity: 0, x: 6 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0 }, role: "status", children: "Saved" }) }),
|
|
134
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkN4KGLSBT_cjs.Button, { variant: "secondary", disabled: !dirty || saving, onClick: () => setDraft(profile), children: "Reset" }),
|
|
135
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkN4KGLSBT_cjs.Button, { type: "submit", disabled: !dirty || !!emailError, loading: saving, children: "Save profile" })
|
|
136
|
+
] })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
) });
|
|
140
|
+
}
|
|
141
|
+
function NotificationsSection({ notifications, onToggleNotification }) {
|
|
142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkFXCVPRHV_cjs.Card, { padding: "none", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "sp-tpl-settings__list", children: notifications.map((n) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: `notif-${n.id}`, children: [
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: n.label }),
|
|
145
|
+
n.description && /* @__PURE__ */ jsxRuntime.jsx("span", { children: n.description })
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZX6JRBPY_cjs.Switch, { id: `notif-${n.id}`, checked: n.enabled, onCheckedChange: (c) => onToggleNotification(n.id, c) })
|
|
148
|
+
] }, n.id)) }) });
|
|
149
|
+
}
|
|
150
|
+
function MembersSection({ members, roles, onInvite, onChangeRole, onRemoveMember }) {
|
|
151
|
+
const [inviting, setInviting] = React__namespace.useState(false);
|
|
152
|
+
const [removing, setRemoving] = React__namespace.useState(null);
|
|
153
|
+
const roleOptions = roles.filter((r) => !r.locked).map((r) => r.name);
|
|
154
|
+
const rel = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
155
|
+
const columns = [
|
|
156
|
+
{ id: "name", header: "Member", accessor: "name", sortable: true, cell: (m) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sp-tpl__person", children: [
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk4YXWES4C_cjs.Avatar, { name: m.name, size: 26 }),
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sp-tpl__stack", children: [
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: m.name }),
|
|
160
|
+
/* @__PURE__ */ jsxRuntime.jsx("small", { children: m.email })
|
|
161
|
+
] })
|
|
162
|
+
] }) },
|
|
163
|
+
{ id: "role", header: "Role", accessor: "role", filter: {}, editable: { type: "select", options: roleOptions } },
|
|
164
|
+
{ id: "status", header: "Status", accessor: "status", filter: {}, cell: (m) => /* @__PURE__ */ jsxRuntime.jsx(chunkDQQLYUXT_cjs.Badge, { tone: m.status === "Active" ? "positive" : "info", dot: true, children: m.status }) },
|
|
165
|
+
{ 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" }
|
|
166
|
+
];
|
|
167
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
168
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
169
|
+
chunk5KNKWEIE_cjs.DataTable,
|
|
170
|
+
{
|
|
171
|
+
label: "Members",
|
|
172
|
+
data: members,
|
|
173
|
+
columns,
|
|
174
|
+
getRowId: (m) => m.id,
|
|
175
|
+
onCellEdit: (id, _col, value) => onChangeRole(id, value),
|
|
176
|
+
rowActions: (m) => [{ id: "remove", label: "Remove from workspace", danger: true, onSelect: () => setRemoving(m) }],
|
|
177
|
+
toolbar: /* @__PURE__ */ jsxRuntime.jsx(chunkN4KGLSBT_cjs.Button, { size: "sm", variant: "accent", onClick: () => setInviting(true), children: "Invite people" }),
|
|
178
|
+
defaultDensity: "compact"
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
182
|
+
chunkL5JDNZS3_cjs.FormDialog,
|
|
183
|
+
{
|
|
184
|
+
open: inviting,
|
|
185
|
+
onOpenChange: setInviting,
|
|
186
|
+
title: "Invite people",
|
|
187
|
+
description: "They\u2019ll get an email with a link to join.",
|
|
188
|
+
submitLabel: "Send invite",
|
|
189
|
+
onSubmit: async (data) => {
|
|
190
|
+
const email = String(data.get("email") ?? "").trim();
|
|
191
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(email)) return { error: "Enter a valid email address.", field: "email" };
|
|
192
|
+
if (members.some((m) => m.email.toLowerCase() === email.toLowerCase())) return { error: `${email} is already a member.`, field: "email" };
|
|
193
|
+
await onInvite(email, String(data.get("role") ?? roleOptions[0]));
|
|
194
|
+
},
|
|
195
|
+
children: [
|
|
196
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk6PE3ZGPD_cjs.TextField, { label: "Email address", name: "email", type: "email", placeholder: "name@company.com", required: true, "data-autofocus": "" }),
|
|
197
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkNGKH2EEJ_cjs.Select, { label: "Role", name: "role", options: roleOptions, defaultValue: roleOptions[roleOptions.length - 1] })
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
202
|
+
chunkL5JDNZS3_cjs.ConfirmDialog,
|
|
203
|
+
{
|
|
204
|
+
open: !!removing,
|
|
205
|
+
onOpenChange: (o) => !o && setRemoving(null),
|
|
206
|
+
tone: "danger",
|
|
207
|
+
title: `Remove ${removing?.name ?? ""}?`,
|
|
208
|
+
description: "They lose access immediately. Their work stays in the workspace.",
|
|
209
|
+
confirmLabel: "Remove",
|
|
210
|
+
onConfirm: async () => {
|
|
211
|
+
if (removing) await onRemoveMember(removing.id);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] });
|
|
216
|
+
}
|
|
217
|
+
function DangerSection({ workspaceName, onDeleteWorkspace }) {
|
|
218
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkFXCVPRHV_cjs.Card, { variant: "flat", className: "sp-tpl-settings__danger", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
+
chunkFXCVPRHV_cjs.CardHeader,
|
|
220
|
+
{
|
|
221
|
+
title: "Delete this workspace",
|
|
222
|
+
description: "Removes every project, file and member. Billing stops at the end of the period. This can\u2019t be undone.",
|
|
223
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
224
|
+
chunkL5JDNZS3_cjs.ConfirmDialog,
|
|
225
|
+
{
|
|
226
|
+
tone: "danger",
|
|
227
|
+
title: `Delete ${workspaceName}?`,
|
|
228
|
+
description: "Everything in it is deleted permanently.",
|
|
229
|
+
details: /* @__PURE__ */ jsxRuntime.jsxs("ul", { children: [
|
|
230
|
+
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "All projects, files and comments" }),
|
|
231
|
+
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "Member access and invitations" }),
|
|
232
|
+
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "Integrations and API keys" })
|
|
233
|
+
] }),
|
|
234
|
+
requireText: workspaceName,
|
|
235
|
+
confirmLabel: "Delete workspace",
|
|
236
|
+
onConfirm: onDeleteWorkspace,
|
|
237
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(chunkN4KGLSBT_cjs.Button, { variant: "danger", children: "Delete workspace" })
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
) });
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
exports.SettingsTemplate = SettingsTemplate;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clamp, rubberband } from './chunk-344MRWFO.js';
|
|
3
|
+
import { useControllableState } from './chunk-KPG24YFL.js';
|
|
4
|
+
import { haptic } from './chunk-4C7VKLTU.js';
|
|
5
|
+
import { useMotionPreset } from './chunk-VDQ3DWO4.js';
|
|
6
|
+
import { cx } from './chunk-K6X6O42N.js';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { useMotionValue, animate, useMotionValueEvent, useTransform, motion } from 'motion/react';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var SETTLE = { type: "spring", stiffness: 320, damping: 34 };
|
|
12
|
+
var ANGLE = 20;
|
|
13
|
+
function normalize(options) {
|
|
14
|
+
return options.map((o) => typeof o === "string" ? { value: o, label: o } : o);
|
|
15
|
+
}
|
|
16
|
+
function WheelPickerImpl({ options: raw, value: valueProp, defaultValue, onValueChange, visibleCount = 5, itemHeight = 36, label, haptics = true, disabled, className, style, ...rest }, ref) {
|
|
17
|
+
const options = React.useMemo(() => normalize(raw), [raw]);
|
|
18
|
+
const [value, setValue] = useControllableState({ value: valueProp, defaultValue: defaultValue ?? options[0]?.value, onChange: onValueChange });
|
|
19
|
+
const { t, reduced } = useMotionPreset();
|
|
20
|
+
const index = Math.max(0, options.findIndex((o) => o.value === value));
|
|
21
|
+
const y = useMotionValue(-index * itemHeight);
|
|
22
|
+
const drag = React.useRef(null);
|
|
23
|
+
const [dragging, setDragging] = React.useState(false);
|
|
24
|
+
const local = React.useRef(null);
|
|
25
|
+
const id = React.useId();
|
|
26
|
+
const maxY = 0;
|
|
27
|
+
const minY = -(options.length - 1) * itemHeight;
|
|
28
|
+
const radius = itemHeight / (2 * Math.tan(ANGLE * Math.PI / 360));
|
|
29
|
+
const nearestEnabled = (i) => {
|
|
30
|
+
i = clamp(i, 0, options.length - 1);
|
|
31
|
+
if (!options[i]?.disabled) return i;
|
|
32
|
+
for (let d = 1; d < options.length; d++) {
|
|
33
|
+
if (options[i + d] && !options[i + d].disabled) return i + d;
|
|
34
|
+
if (options[i - d] && !options[i - d].disabled) return i - d;
|
|
35
|
+
}
|
|
36
|
+
return i;
|
|
37
|
+
};
|
|
38
|
+
const settleTo = (i, velocity = 0) => {
|
|
39
|
+
const target = nearestEnabled(i);
|
|
40
|
+
animate(y, -target * itemHeight, reduced ? { duration: 0 } : { ...SETTLE, velocity });
|
|
41
|
+
if (options[target] && options[target].value !== value) setValue(options[target].value);
|
|
42
|
+
};
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
if (drag.current) return;
|
|
45
|
+
const target = -index * itemHeight;
|
|
46
|
+
if (Math.abs(y.get() - target) > 0.5) animate(y, target, t(SETTLE));
|
|
47
|
+
}, [index, itemHeight]);
|
|
48
|
+
const lastRow = React.useRef(index);
|
|
49
|
+
useMotionValueEvent(y, "change", (v) => {
|
|
50
|
+
const row = Math.round(-v / itemHeight);
|
|
51
|
+
if (row !== lastRow.current) {
|
|
52
|
+
lastRow.current = row;
|
|
53
|
+
if (haptics && (drag.current || dragging)) haptic(2);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const onPointerDown = (event) => {
|
|
57
|
+
if (disabled || event.button !== 0) return;
|
|
58
|
+
y.stop();
|
|
59
|
+
drag.current = { y0: event.clientY, start: y.get(), samples: [{ t: performance.now(), y: event.clientY }] };
|
|
60
|
+
setDragging(true);
|
|
61
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
62
|
+
};
|
|
63
|
+
const onPointerMove = (event) => {
|
|
64
|
+
const d = drag.current;
|
|
65
|
+
if (!d) return;
|
|
66
|
+
const raw2 = d.start + (event.clientY - d.y0);
|
|
67
|
+
const v = raw2 > maxY ? maxY + rubberband(raw2 - maxY, itemHeight * 3) : raw2 < minY ? minY + rubberband(raw2 - minY, itemHeight * 3) : raw2;
|
|
68
|
+
y.set(v);
|
|
69
|
+
d.samples.push({ t: performance.now(), y: event.clientY });
|
|
70
|
+
if (d.samples.length > 6) d.samples.shift();
|
|
71
|
+
};
|
|
72
|
+
const onPointerUp = (event) => {
|
|
73
|
+
const d = drag.current;
|
|
74
|
+
if (!d) return;
|
|
75
|
+
drag.current = null;
|
|
76
|
+
setDragging(false);
|
|
77
|
+
const first = d.samples[0];
|
|
78
|
+
const last = d.samples[d.samples.length - 1];
|
|
79
|
+
const dt = Math.max(1, last.t - first.t);
|
|
80
|
+
const velocity = (last.y - first.y) / dt * 1e3;
|
|
81
|
+
const moved = Math.abs(event.clientY - d.y0) > 4;
|
|
82
|
+
if (!moved) {
|
|
83
|
+
const rect = local.current.getBoundingClientRect();
|
|
84
|
+
const offset = Math.round((event.clientY - (rect.top + rect.height / 2)) / itemHeight);
|
|
85
|
+
settleTo(Math.round(-y.get() / itemHeight) + offset);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const projected = clamp(y.get() + velocity * 0.22, minY, maxY);
|
|
89
|
+
settleTo(Math.round(-projected / itemHeight), velocity);
|
|
90
|
+
};
|
|
91
|
+
React.useEffect(() => {
|
|
92
|
+
const el = local.current;
|
|
93
|
+
if (!el || disabled) return;
|
|
94
|
+
let acc = 0;
|
|
95
|
+
let timer;
|
|
96
|
+
const onWheel = (event) => {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
acc += event.deltaY;
|
|
99
|
+
const rows = Math.trunc(acc / 40);
|
|
100
|
+
if (rows !== 0) {
|
|
101
|
+
acc -= rows * 40;
|
|
102
|
+
const current = Math.round(-y.get() / itemHeight);
|
|
103
|
+
settleTo(current + rows);
|
|
104
|
+
}
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
timer = setTimeout(() => acc = 0, 120);
|
|
107
|
+
};
|
|
108
|
+
el.addEventListener("wheel", onWheel, { passive: false });
|
|
109
|
+
return () => el.removeEventListener("wheel", onWheel);
|
|
110
|
+
});
|
|
111
|
+
const onKeyDown = (event) => {
|
|
112
|
+
rest.onKeyDown?.(event);
|
|
113
|
+
const page = Math.max(1, Math.floor(visibleCount / 2));
|
|
114
|
+
const map = { ArrowDown: 1, ArrowUp: -1, PageDown: page, PageUp: -page };
|
|
115
|
+
if (event.key in map) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
settleTo(index + map[event.key]);
|
|
118
|
+
} else if (event.key === "Home") {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
settleTo(0);
|
|
121
|
+
} else if (event.key === "End") {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
settleTo(options.length - 1);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const height = visibleCount * itemHeight;
|
|
127
|
+
return /* @__PURE__ */ jsxs(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
...rest,
|
|
131
|
+
ref: (el) => {
|
|
132
|
+
local.current = el;
|
|
133
|
+
if (typeof ref === "function") ref(el);
|
|
134
|
+
else if (ref) ref.current = el;
|
|
135
|
+
},
|
|
136
|
+
role: "listbox",
|
|
137
|
+
tabIndex: disabled ? -1 : 0,
|
|
138
|
+
"aria-label": label,
|
|
139
|
+
"aria-activedescendant": `${id}-${index}`,
|
|
140
|
+
"aria-disabled": disabled || void 0,
|
|
141
|
+
className: cx("sp-wheel", className),
|
|
142
|
+
"data-dragging": dragging || void 0,
|
|
143
|
+
style: { ...style, height, ["--sp-wheel-row"]: `${itemHeight}px` },
|
|
144
|
+
onPointerDown,
|
|
145
|
+
onPointerMove,
|
|
146
|
+
onPointerUp,
|
|
147
|
+
onPointerCancel: onPointerUp,
|
|
148
|
+
onKeyDown,
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx("div", { className: "sp-wheel__band", "aria-hidden": true }),
|
|
151
|
+
/* @__PURE__ */ jsx("div", { className: "sp-wheel__drum", children: options.map((option, i) => /* @__PURE__ */ jsx(WheelItem, { id: `${id}-${i}`, i, y, h: itemHeight, radius, visible: visibleCount, selected: i === index, option }, option.value)) })
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function WheelItem({
|
|
157
|
+
id,
|
|
158
|
+
i,
|
|
159
|
+
y,
|
|
160
|
+
h,
|
|
161
|
+
radius,
|
|
162
|
+
visible,
|
|
163
|
+
selected,
|
|
164
|
+
option
|
|
165
|
+
}) {
|
|
166
|
+
const offset = useTransform(y, (v) => (i * h + v) / h);
|
|
167
|
+
const transform = useTransform(offset, (o) => `translateY(-50%) rotateX(${-o * ANGLE}deg) translateZ(${radius}px)`);
|
|
168
|
+
const half = visible / 2;
|
|
169
|
+
const opacity = useTransform(offset, (o) => {
|
|
170
|
+
const d = Math.abs(o);
|
|
171
|
+
if (d * ANGLE >= 90 || d > half + 0.5) return 0;
|
|
172
|
+
if (d > half - 0.5) return 0.6 * (half + 0.5 - d);
|
|
173
|
+
return d < 1 ? 1 - d * 0.25 : 0.75 - Math.min(1, d - 1) * 0.15;
|
|
174
|
+
});
|
|
175
|
+
return /* @__PURE__ */ jsx(
|
|
176
|
+
motion.div,
|
|
177
|
+
{
|
|
178
|
+
id,
|
|
179
|
+
role: "option",
|
|
180
|
+
"aria-selected": selected,
|
|
181
|
+
"aria-disabled": option.disabled || void 0,
|
|
182
|
+
className: "sp-wheel__item",
|
|
183
|
+
"data-selected": selected || void 0,
|
|
184
|
+
style: { transform, opacity, height: h },
|
|
185
|
+
children: option.label
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
var WheelPicker = React.forwardRef(WheelPickerImpl);
|
|
190
|
+
|
|
191
|
+
export { WheelPicker };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { haptic, useIsoLayoutEffect, mergeRefs } 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 { useMotionValue, useTransform, animate, motion, AnimatePresence } from 'motion/react';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var WIDTH = { type: "spring", stiffness: 380, damping: 30 };
|
|
10
|
+
var SWAP = { type: "spring", stiffness: 520, damping: 34 };
|
|
11
|
+
var MorphButton = React.forwardRef(function MorphButton2({
|
|
12
|
+
onAction,
|
|
13
|
+
status: statusProp,
|
|
14
|
+
variant = "collapse",
|
|
15
|
+
progress = 0,
|
|
16
|
+
children,
|
|
17
|
+
loadingLabel = "Working",
|
|
18
|
+
successLabel = "Done",
|
|
19
|
+
errorLabel = "Try again",
|
|
20
|
+
resetAfter = 1800,
|
|
21
|
+
tone = "ink",
|
|
22
|
+
size = "md",
|
|
23
|
+
haptics = true,
|
|
24
|
+
onStatusChange,
|
|
25
|
+
className,
|
|
26
|
+
disabled,
|
|
27
|
+
...rest
|
|
28
|
+
}, ref) {
|
|
29
|
+
const [internal, setInternal] = React.useState("idle");
|
|
30
|
+
const status = statusProp ?? internal;
|
|
31
|
+
const { t, reduced } = useMotionPreset();
|
|
32
|
+
const local = React.useRef(null);
|
|
33
|
+
const measureRef = React.useRef(null);
|
|
34
|
+
const width = useMotionValue("auto");
|
|
35
|
+
const fill = useMotionValue(0);
|
|
36
|
+
const fillScale = useTransform(fill, (v) => v);
|
|
37
|
+
const timer = React.useRef(void 0);
|
|
38
|
+
const mounted = React.useRef(true);
|
|
39
|
+
React.useEffect(() => () => {
|
|
40
|
+
mounted.current = false;
|
|
41
|
+
clearTimeout(timer.current);
|
|
42
|
+
}, []);
|
|
43
|
+
const prev = React.useRef(status);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
if (prev.current === status) return;
|
|
46
|
+
prev.current = status;
|
|
47
|
+
onStatusChange?.(status);
|
|
48
|
+
if (haptics && status === "success") haptic([6, 40, 10]);
|
|
49
|
+
if (haptics && status === "error") haptic([20, 30, 20]);
|
|
50
|
+
if (status === "error" && local.current && !reduced) {
|
|
51
|
+
animate(local.current, { x: [0, -7, 6, -4, 3, 0] }, { duration: 0.42, ease: "easeOut" });
|
|
52
|
+
}
|
|
53
|
+
if ((status === "success" || status === "error") && statusProp === void 0 && resetAfter > 0) {
|
|
54
|
+
clearTimeout(timer.current);
|
|
55
|
+
timer.current = setTimeout(() => mounted.current && setInternal("idle"), resetAfter);
|
|
56
|
+
}
|
|
57
|
+
}, [status]);
|
|
58
|
+
useIsoLayoutEffect(() => {
|
|
59
|
+
const el = local.current;
|
|
60
|
+
const measure = measureRef.current;
|
|
61
|
+
if (!el || !measure) return;
|
|
62
|
+
if (variant !== "collapse") {
|
|
63
|
+
width.set("auto");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const natural = measure.offsetWidth;
|
|
67
|
+
const circle = el.offsetHeight;
|
|
68
|
+
const target = status === "loading" ? circle : status === "idle" ? natural : Math.max(circle, natural * 0.86);
|
|
69
|
+
if (width.get() === "auto") {
|
|
70
|
+
width.set(target);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
animate(width, target, t(status === "loading" ? { type: "spring", stiffness: 420, damping: 32 } : { type: "spring", stiffness: 300, damping: 19 }));
|
|
74
|
+
}, [status, variant, size, children, successLabel, errorLabel]);
|
|
75
|
+
React.useEffect(() => {
|
|
76
|
+
if (variant !== "progress") return;
|
|
77
|
+
const target = status === "loading" ? progress : status === "success" ? 1 : 0;
|
|
78
|
+
animate(fill, target, t(status === "idle" ? { duration: 0.2 } : { type: "spring", stiffness: 120, damping: 22 }));
|
|
79
|
+
}, [progress, status, variant]);
|
|
80
|
+
const handleClick = async (event) => {
|
|
81
|
+
if (status === "loading" || disabled) return;
|
|
82
|
+
const result = onAction?.(event);
|
|
83
|
+
if (statusProp !== void 0 || !(result instanceof Promise || result && typeof result.then === "function")) return;
|
|
84
|
+
clearTimeout(timer.current);
|
|
85
|
+
setInternal("loading");
|
|
86
|
+
try {
|
|
87
|
+
await result;
|
|
88
|
+
if (mounted.current) setInternal("success");
|
|
89
|
+
} catch {
|
|
90
|
+
if (mounted.current) setInternal("error");
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const label = status === "loading" ? loadingLabel : status === "success" ? successLabel : status === "error" ? errorLabel : children;
|
|
94
|
+
const percent = Math.round(Math.min(1, Math.max(0, progress)) * 100);
|
|
95
|
+
return /* @__PURE__ */ jsxs(
|
|
96
|
+
motion.button,
|
|
97
|
+
{
|
|
98
|
+
...rest,
|
|
99
|
+
ref: mergeRefs(local, ref),
|
|
100
|
+
type: rest.type ?? "button",
|
|
101
|
+
layout: variant === "inline" ? true : void 0,
|
|
102
|
+
transition: t(WIDTH),
|
|
103
|
+
style: { ...rest.style, width: variant === "collapse" ? width : void 0, borderRadius: 999 },
|
|
104
|
+
className: cx("sp-reset-button sp-morph", className),
|
|
105
|
+
"data-variant": variant,
|
|
106
|
+
"data-status": status,
|
|
107
|
+
"data-tone": tone,
|
|
108
|
+
"data-size": size,
|
|
109
|
+
disabled,
|
|
110
|
+
"aria-disabled": status === "loading" || void 0,
|
|
111
|
+
"aria-busy": status === "loading" || void 0,
|
|
112
|
+
whileTap: reduced || status === "loading" ? void 0 : { scale: 0.96 },
|
|
113
|
+
onClick: handleClick,
|
|
114
|
+
children: [
|
|
115
|
+
variant === "collapse" && /* @__PURE__ */ jsx("span", { ref: measureRef, className: "sp-morph__measure", "aria-hidden": true, children }),
|
|
116
|
+
variant === "progress" && /* @__PURE__ */ jsx(motion.span, { className: "sp-morph__fill", "aria-hidden": true, style: { scaleX: fillScale } }),
|
|
117
|
+
/* @__PURE__ */ jsx("span", { className: "sp-morph__stage", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsxs(
|
|
118
|
+
motion.span,
|
|
119
|
+
{
|
|
120
|
+
className: "sp-morph__content",
|
|
121
|
+
layout: variant === "inline" ? "position" : void 0,
|
|
122
|
+
initial: { opacity: 0, y: variant === "collapse" ? 0 : 14, scale: variant === "collapse" ? 0.6 : 1, filter: "blur(3px)" },
|
|
123
|
+
animate: { opacity: 1, y: 0, scale: 1, filter: "blur(0px)" },
|
|
124
|
+
exit: { opacity: 0, y: variant === "collapse" ? 0 : -14, scale: variant === "collapse" ? 0.6 : 1, filter: "blur(3px)" },
|
|
125
|
+
transition: t({ ...SWAP, filter: { duration: 0.18, ease: "easeOut" } }),
|
|
126
|
+
children: [
|
|
127
|
+
status === "loading" && /* @__PURE__ */ jsx(Spinner, {}),
|
|
128
|
+
status === "success" && /* @__PURE__ */ jsx(Glyph, { kind: "success" }),
|
|
129
|
+
status === "error" && /* @__PURE__ */ jsx(Glyph, { kind: "error" }),
|
|
130
|
+
!(variant === "collapse" && status === "loading") && /* @__PURE__ */ jsxs("span", { className: "sp-morph__label", children: [
|
|
131
|
+
label,
|
|
132
|
+
variant === "progress" && status === "loading" && /* @__PURE__ */ jsxs("span", { className: "sp-morph__percent", children: [
|
|
133
|
+
" ",
|
|
134
|
+
percent,
|
|
135
|
+
"%"
|
|
136
|
+
] })
|
|
137
|
+
] })
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
status
|
|
141
|
+
) }) }),
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: "sp-sr-only", "aria-live": "polite", children: status === "idle" ? "" : typeof label === "string" ? label : status })
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
function Spinner() {
|
|
148
|
+
return /* @__PURE__ */ jsxs("svg", { className: "sp-morph__spinner", viewBox: "0 0 20 20", "aria-hidden": true, children: [
|
|
149
|
+
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "7.5", fill: "none", stroke: "currentColor", strokeOpacity: "0.22", strokeWidth: "2" }),
|
|
150
|
+
/* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "7.5", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeDasharray: "14 33.1" })
|
|
151
|
+
] });
|
|
152
|
+
}
|
|
153
|
+
function Glyph({ kind }) {
|
|
154
|
+
const { t } = useMotionPreset();
|
|
155
|
+
return /* @__PURE__ */ jsx("svg", { className: "sp-morph__glyph", viewBox: "0 0 20 20", "aria-hidden": true, children: kind === "success" ? /* @__PURE__ */ jsx(
|
|
156
|
+
motion.path,
|
|
157
|
+
{
|
|
158
|
+
d: "M5 10.4 L8.4 13.6 L15 6.6",
|
|
159
|
+
fill: "none",
|
|
160
|
+
stroke: "currentColor",
|
|
161
|
+
strokeWidth: "2.2",
|
|
162
|
+
strokeLinecap: "round",
|
|
163
|
+
strokeLinejoin: "round",
|
|
164
|
+
initial: { pathLength: 0 },
|
|
165
|
+
animate: { pathLength: 1 },
|
|
166
|
+
transition: t({ type: "spring", stiffness: 200, damping: 22, delay: 0.1 })
|
|
167
|
+
}
|
|
168
|
+
) : /* @__PURE__ */ jsx(
|
|
169
|
+
motion.path,
|
|
170
|
+
{
|
|
171
|
+
d: "M6 6 L14 14 M14 6 L6 14",
|
|
172
|
+
fill: "none",
|
|
173
|
+
stroke: "currentColor",
|
|
174
|
+
strokeWidth: "2.2",
|
|
175
|
+
strokeLinecap: "round",
|
|
176
|
+
initial: { pathLength: 0 },
|
|
177
|
+
animate: { pathLength: 1 },
|
|
178
|
+
transition: t({ type: "spring", stiffness: 220, damping: 24, delay: 0.08 })
|
|
179
|
+
}
|
|
180
|
+
) });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { MorphButton };
|