@chaibuilder/sdk 4.0.0-beta.4 → 4.0.0-beta.40
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 +72 -50
- package/dist/{2SSKDMRQ-CopJgtZb.cjs → 2SSKDMRQ-D-2rSLsq.cjs} +1 -1
- package/dist/{2SSKDMRQ-Difo_1pg.js → 2SSKDMRQ-DKit4bEt.js} +3 -3
- package/dist/{AP7HFJJL-BPuPBqj4.js → AP7HFJJL-BWruCozs.js} +1 -1
- package/dist/{AP7HFJJL-DYxDgaOs.cjs → AP7HFJJL-CAE2yHEv.cjs} +1 -1
- package/dist/{IconPicker-C0oycHbs.cjs → IconPicker-BCYCPK5M.cjs} +1 -1
- package/dist/{IconPicker-B2-oriq2.js → IconPicker-BOBnjfJc.js} +2 -2
- package/dist/STRINGS-BExFecZW.js +8 -0
- package/dist/STRINGS-FNnfjF5H.cjs +1 -0
- package/dist/{WDYDFRGG-DbejaRPK.cjs → WDYDFRGG-BNve1FlV.cjs} +1 -1
- package/dist/{WDYDFRGG-KK8pkcW1.js → WDYDFRGG-Bv40IVPG.js} +4 -4
- package/dist/{actions-registery-y_ENc8zj.js → actions-registery-CMKfEXxX.js} +3397 -3202
- package/dist/actions-registery-CqhNZFV3.cjs +481 -0
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.ts +0 -158
- package/dist/actions.js +3 -3
- package/dist/{active-in-another-tab-Cu_ASKtx.cjs → active-in-another-tab-BPBvEwmD.cjs} +1 -1
- package/dist/{active-in-another-tab-DkR2HWI4.js → active-in-another-tab-C334yD2g.js} +5 -5
- package/dist/{add-new-language-page-BXuwluuU.cjs → add-new-language-page-BVME8b7v.cjs} +1 -1
- package/dist/{add-new-language-page-CBY0RR6q.js → add-new-language-page-DVL-HkWR.js} +4 -4
- package/dist/{add-new-page-C_PzKby8.cjs → add-new-page-BPysPck8.cjs} +1 -1
- package/dist/add-new-page-BQOsHkVl.js +31 -0
- package/dist/{ai-panel-content-rRmJdH7L.cjs → ai-panel-content-BsElc0Ke.cjs} +1 -1
- package/dist/{ai-panel-content--YM01Aly.js → ai-panel-content-BwX0YBGD.js} +6 -6
- package/dist/ai-panel-default-lang-BqhAu1iN.cjs +3 -0
- package/dist/ai-panel-default-lang-CYZuwSQn.js +317 -0
- package/dist/ai-panel-other-lang-CL83Mwha.js +132 -0
- package/dist/ai-panel-other-lang-CivH2s8Q.cjs +1 -0
- package/dist/{ai-prompt-input-N9PcYCFa.cjs → ai-prompt-input-BuP52voq.cjs} +1 -1
- package/dist/{ai-prompt-input-DueQYNf-.js → ai-prompt-input-C37B_jlE.js} +30 -34
- package/dist/{ai-translation-prompt-IAdWMNZb.cjs → ai-translation-prompt-CgZKlkF_.cjs} +1 -1
- package/dist/{ai-translation-prompt-B36F3d7K.js → ai-translation-prompt-V5PBEZRn.js} +2 -2
- package/dist/apply-binding-BuwI_Uf5.cjs +41 -0
- package/dist/apply-binding-RQRSIe56.js +942 -0
- package/dist/change-password-modal-AQU_GLqq.js +137 -0
- package/dist/change-password-modal-Chufk3yU.cjs +1 -0
- package/dist/{code-display-DloSPyPr.cjs → code-display-BR-gij5j.cjs} +1 -1
- package/dist/{code-display-Ck81Id9K.js → code-display-DdWcOQ_i.js} +1 -1
- package/dist/code-editor-D-fpas30.js +57 -0
- package/dist/code-editor-gqdLU-rU.cjs +1 -0
- package/dist/{continue-editing-in-this-client-DmGFLHXw.cjs → continue-editing-in-this-client-BNEnV0hi.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-Dm9cCj7K.js → continue-editing-in-this-client-Dx3f64SH.js} +3 -3
- package/dist/core-czmLeR0h.cjs +1 -0
- package/dist/core-nSRy3D7z.js +54 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +285 -103
- package/dist/core.js +71 -42
- package/dist/{css-import-modal-Rh1QAVxo.cjs → css-import-modal-B2NoLsdZ.cjs} +1 -1
- package/dist/{css-import-modal-9P_0uNa4.js → css-import-modal-c_6VH1js.js} +8 -8
- package/dist/default-theme-options-DN-3gIjM.cjs +22 -0
- package/dist/default-theme-options-saBIkWGT.js +248 -0
- package/dist/delete-page-B1R1w8O5.js +84 -0
- package/dist/delete-page-DbQDbCyB.cjs +1 -0
- package/dist/{design-token-usage-MNYsFlPG.js → design-token-usage-11kPk5n1.js} +26 -26
- package/dist/{design-token-usage-CXglXgcJ.cjs → design-token-usage-BBLfxzzo.cjs} +1 -1
- package/dist/digital-asset-manager-B0h5rUVQ.cjs +1 -0
- package/dist/{digital-asset-manager-CqCWBO0s.js → digital-asset-manager-BbEQ8cPb.js} +6 -6
- package/dist/{duplicate-page-BknLfqr0.js → duplicate-page-BY_Pcqbb.js} +7 -7
- package/dist/{duplicate-page-DzZByALW.cjs → duplicate-page-BaAzKbiX.cjs} +1 -1
- package/dist/{dynamic-page-selector-WA007Sni.cjs → dynamic-page-selector-DzH_gCQ4.cjs} +1 -1
- package/dist/{dynamic-page-selector-DoW7OyUB.js → dynamic-page-selector-bsaLGZkO.js} +16 -16
- package/dist/fonts/bungee/Bungee-Regular.woff2 +0 -0
- package/dist/fonts/dm_sans/dm-sans-variable.woff2 +0 -0
- package/dist/fonts/geist/Geist-VariableFont_wght.ttf +0 -0
- package/dist/fonts/geist/Geist-VariableFont_wght.woff2 +0 -0
- package/dist/fonts/geist/geist-variable.woff2 +0 -0
- package/dist/fonts/geist-mono/GeistMono-VariableFont_wght.woff2 +0 -0
- package/dist/fonts/inter/inter-latin.woff2 +0 -0
- package/dist/fonts/inter/inter-variable.woff2 +1449 -0
- package/dist/fonts/lato/lato-variable.woff2 +0 -0
- package/dist/fonts/lavishly_yours/lavishly-yours.woff2 +11 -0
- package/dist/fonts/merriweather/merriweather-variable.woff2 +11 -0
- package/dist/fonts/montserrat/montserrat-variable.woff2 +0 -0
- package/dist/fonts/nunito_sans/nunito-sans-variable.woff2 +11 -0
- package/dist/fonts/open_sans/open-sans-variable.woff2 +0 -0
- package/dist/fonts/oswald/oswald-variable.woff2 +0 -0
- package/dist/fonts/playfair_display/playfair-display-variable.woff2 +11 -0
- package/dist/fonts/poppins/poppins-variable.woff2 +0 -0
- package/dist/fonts/raleway/raleway-variable.woff2 +0 -0
- package/dist/fonts/roboto/roboto-variable.woff2 +11 -0
- package/dist/fonts/source_sans_3/source-sans-3-variable.woff2 +11 -0
- package/dist/fonts/ubuntu/ubuntu-variable.woff2 +0 -0
- package/dist/fonts-B3UYxuJI.js +25 -0
- package/dist/fonts-D5fTqvSS.cjs +1 -0
- package/dist/{get-chai-builder-tailwind-config-BFePCEIS.cjs → get-chai-builder-tailwind-config-7CxFxEYL.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BXf_xLHk.js → get-chai-builder-tailwind-config-DC4sDOYK.js} +5 -5
- package/dist/get-chai-builder-theme-C_qofMh_.cjs +1 -0
- package/dist/{get-chai-builder-theme-DDVRJQ6Z.js → get-chai-builder-theme-CyOkIlte.js} +1 -1
- package/dist/{image-compression-DsZ1oqpb.js → image-compression-DPFITwOL.js} +2 -2
- package/dist/image-compression-UaU7Bwqe.cjs +1 -0
- package/dist/{image-editor-CqwaVxO2.cjs → image-editor-Cfn290vp.cjs} +1 -1
- package/dist/{image-editor-CQnNtak2.js → image-editor-CyGqVNvX.js} +1 -1
- package/dist/index-BpVxZOd-.js +5082 -0
- package/dist/index-CQf0jL1k.cjs +5 -0
- package/dist/{index-rAcNbjk_.js → index-DpeytsiB.js} +6145 -6091
- package/dist/index-P-2SvZA9.cjs +160 -0
- package/dist/{json-diff-viewer-CLuUHiPU.cjs → json-diff-viewer-BBERGXdt.cjs} +7 -7
- package/dist/{json-diff-viewer-CMvGUvJ2.js → json-diff-viewer-C-bpInzt.js} +87 -85
- package/dist/{lang-panel-CnwTb05j.js → lang-panel-4Q_PTmKm.js} +26 -26
- package/dist/lang-panel-uI149Beq.cjs +1 -0
- package/dist/library-blocks/bento/agency-showcase/agency-showcase.html +175 -0
- package/dist/library-blocks/bento/agency-showcase/agency-showcase.webp +0 -0
- package/dist/library-blocks/bento/creative-portfolio/creative-portfolio.html +116 -0
- package/dist/library-blocks/bento/creative-portfolio/creative-portfolio.webp +0 -0
- package/dist/library-blocks/bento/product-features/product-features.html +159 -0
- package/dist/library-blocks/bento/product-features/product-features.webp +0 -0
- package/dist/library-blocks/bento/saas-dashboard/saas-dashboard.html +182 -0
- package/dist/library-blocks/bento/saas-dashboard/saas-dashboard.webp +0 -0
- package/dist/library-blocks/bento/startup-metrics/startup-metrics.html +170 -0
- package/dist/library-blocks/bento/startup-metrics/startup-metrics.webp +0 -0
- package/dist/library-blocks/blocks-list.json +149 -0
- package/dist/library-blocks/feature/agency-services/agency-services.html +194 -0
- package/dist/library-blocks/feature/agency-services/agency-services.webp +0 -0
- package/dist/library-blocks/feature/consulting-firm/consulting-firm.html +219 -0
- package/dist/library-blocks/feature/consulting-firm/consulting-firm.webp +0 -0
- package/dist/library-blocks/feature/design-studio/design-studio.html +190 -0
- package/dist/library-blocks/feature/design-studio/design-studio.webp +0 -0
- package/dist/library-blocks/feature/freelancer-toolkit/freelancer-toolkit.html +195 -0
- package/dist/library-blocks/feature/freelancer-toolkit/freelancer-toolkit.webp +0 -0
- package/dist/library-blocks/feature/marketing-agency/marketing-agency.html +212 -0
- package/dist/library-blocks/feature/marketing-agency/marketing-agency.webp +0 -0
- package/dist/library-blocks/footer/creative-agency/creative-agency.html +64 -0
- package/dist/library-blocks/footer/creative-agency/creative-agency.webp +0 -0
- package/dist/library-blocks/footer/minimal-portfolio/minimal-portfolio.html +106 -0
- package/dist/library-blocks/footer/minimal-portfolio/minimal-portfolio.webp +0 -0
- package/dist/library-blocks/footer/saas-startup/saas-startup.html +117 -0
- package/dist/library-blocks/footer/saas-startup/saas-startup.webp +0 -0
- package/dist/library-blocks/hero/creative-agency/creative-agency.html +117 -0
- package/dist/library-blocks/hero/creative-agency/creative-agency.webp +0 -0
- package/dist/library-blocks/hero/developer-focused/developer-focused.html +124 -0
- package/dist/library-blocks/hero/developer-focused/developer-focused.webp +0 -0
- package/dist/library-blocks/hero/minimal-saas/minimal-saas.html +98 -0
- package/dist/library-blocks/hero/minimal-saas/minimal-saas.webp +0 -0
- package/dist/library-blocks/hero/portfolio-showcase/portfolio-showcase.html +148 -0
- package/dist/library-blocks/hero/portfolio-showcase/portfolio-showcase.webp +0 -0
- package/dist/library-blocks/hero/startup-landing/startup-landing.html +130 -0
- package/dist/library-blocks/hero/startup-landing/startup-landing.webp +0 -0
- package/dist/library-blocks/navbar/creative-agency/creative-agency.html +139 -0
- package/dist/library-blocks/navbar/creative-agency/creative-agency.webp +0 -0
- package/dist/library-blocks/navbar/minimal-portfolio/minimal-portfolio.html +164 -0
- package/dist/library-blocks/navbar/minimal-portfolio/minimal-portfolio.webp +0 -0
- package/dist/library-blocks/navbar/saas-startup/saas-startup.html +129 -0
- package/dist/library-blocks/navbar/saas-startup/saas-startup.webp +0 -0
- package/dist/manage-design-tokens-B_-TrQgu.cjs +1 -0
- package/dist/manage-design-tokens-CHpHE-dx.js +446 -0
- package/dist/manage-design-tokens-modal-Bug5H8PT.cjs +1 -0
- package/dist/manage-design-tokens-modal-DO_tHkgp.js +161 -0
- package/dist/{mark-as-template-CpWEBJGd.cjs → mark-as-template-BEnMYTql.cjs} +1 -1
- package/dist/{mark-as-template-DBLshWb5.js → mark-as-template-Ca3QLzX4.js} +11 -11
- package/dist/{nested-path-selector-content-6OBJ8LG8.js → nested-path-selector-content-5gECLoRV.js} +2 -2
- package/dist/{nested-path-selector-content-C2sD9dkq.cjs → nested-path-selector-content-BHPOfftZ.cjs} +1 -1
- package/dist/{no-language-page-content-CzENgtnu.js → no-language-page-content-Bb3nUSLv.js} +9 -9
- package/dist/{no-language-page-content-BvPDdccK.cjs → no-language-page-content-CKxggLC_.cjs} +1 -1
- package/dist/{no-language-page-dialog-CbYI2cVg.js → no-language-page-dialog-BEVRCAhM.js} +2 -2
- package/dist/{no-language-page-dialog-CgW4yJBC.cjs → no-language-page-dialog-DMb5Z5on.cjs} +1 -1
- package/dist/page-creator-C_95U8kn.cjs +1 -0
- package/dist/{page-creator-Cc83uQqw.js → page-creator-DQRFXhNj.js} +143 -143
- package/dist/{page-lock-BJUkyxdh.js → page-lock-Be5wPHz5.js} +2 -2
- package/dist/{page-lock-CT7SmQqp.cjs → page-lock-DKWt66MX.cjs} +1 -1
- package/dist/page-locked-dialog-CWyZol0i.cjs +1 -0
- package/dist/{page-locked-dialog-DsEbWRed.js → page-locked-dialog-CkXpQUpO.js} +22 -22
- package/dist/page-manager-new-2gYNPR6y.js +408 -0
- package/dist/page-manager-new-Bt7rBO1J.cjs +1 -0
- package/dist/{page-manager-search-and-filter-zq-LfhQ1.js → page-manager-search-and-filter-BotSCoAo.js} +30 -29
- package/dist/{page-manager-search-and-filter-Bfm0j1gg.cjs → page-manager-search-and-filter-Dkwl089C.cjs} +1 -1
- package/dist/{page-revisions-content-D38G2tJM.js → page-revisions-content-OigWteYc.js} +133 -122
- package/dist/page-revisions-content-bQ32feXp.cjs +1 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +330 -96
- package/dist/pages.js +23 -19
- package/dist/{publish-pages-content-CS7f41Ac.js → publish-pages-content-2RcG3Ptp.js} +39 -39
- package/dist/publish-pages-content-Dtkal6ue.cjs +1 -0
- package/dist/{register-chai-top-bar-ESJHs5s-.js → register-chai-top-bar-D6GjnauV.js} +87 -87
- package/dist/register-chai-top-bar-DyW9GPzV.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +20 -18
- package/dist/render.js +133 -132
- package/dist/{rte-widget-modal-BKNx2wln.cjs → rte-widget-modal-CHxO3TQR.cjs} +1 -1
- package/dist/{rte-widget-modal-D6Zik0Ta.js → rte-widget-modal-DmQk0Lfj.js} +10 -10
- package/dist/runtime-client.cjs +1 -0
- package/dist/runtime-client.d.ts +158 -0
- package/dist/runtime-client.js +32 -0
- package/dist/runtime.cjs +11 -1
- package/dist/runtime.d.ts +153 -270
- package/dist/runtime.js +107 -71
- package/dist/save-to-lib-BSsuvkZS.cjs +1 -0
- package/dist/{save-to-lib-WwOzbgiF.js → save-to-lib-CVqlFkRK.js} +153 -147
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-BOgnQRLF.cjs → selected-block-display-Cr7R1ojV.cjs} +1 -1
- package/dist/{selected-block-display-B1SG_UXw.js → selected-block-display-DngI-pF1.js} +12 -12
- package/dist/seo-panel-BMYdzcoJ.cjs +2 -0
- package/dist/{seo-panel-BkOgRoWd.js → seo-panel-CHkFLI5b.js} +27 -27
- package/dist/{shared-json-ld-uka9TOgA.js → shared-json-ld-BzjOUN-P.js} +88 -88
- package/dist/shared-json-ld-ClIZw1aA.cjs +1 -0
- package/dist/{slug-input-DHLmUNrH.js → slug-input-07EKw9U5.js} +8 -8
- package/dist/{slug-input-Cyd6NR6J.cjs → slug-input-DHVDl_Dv.cjs} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.d.ts +45 -0
- package/dist/supabase-actions.js +380 -275
- package/dist/take-over-request-BLdOZhUs.cjs +1 -0
- package/dist/{take-over-request-Ca0X-qyf.js → take-over-request-zqtItFSK.js} +13 -13
- package/dist/{translation-warning-modal-pSZVKcNW.cjs → translation-warning-modal-BxV_8mCE.cjs} +1 -1
- package/dist/{translation-warning-modal-DrpFeI83.js → translation-warning-modal-DnSd7lOJ.js} +9 -9
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +756 -0
- package/dist/types.js +1 -0
- package/dist/{unmark-as-template-DF1Ms4VN.cjs → unmark-as-template-C4UkGyOP.cjs} +1 -1
- package/dist/{unmark-as-template-BMqgelv-.js → unmark-as-template-DIKZYr01.js} +11 -11
- package/dist/unpublish-page-CK0sAZcB.js +28 -0
- package/dist/{unpublish-page-Bsq2yEqQ.cjs → unpublish-page-DFXLzJbc.cjs} +1 -1
- package/dist/unpublished-partials-modal-BAr1SkEG.cjs +1 -0
- package/dist/unpublished-partials-modal-CDaOvXgp.js +52 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +6 -6
- package/dist/utils.js +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +360 -351
- package/dist/{web-preview-D6h1L2nV.js → web-preview-CRSjh2he.js} +2 -2
- package/dist/{web-preview-kres0aG7.cjs → web-preview-DA7_F3vv.cjs} +1 -1
- package/package.json +34 -35
- package/dist/actions-registery-JdxhXhT6.cjs +0 -418
- package/dist/add-new-page-DJLJFLAd.js +0 -31
- package/dist/ai-panel-default-lang-BZl0tPYo.js +0 -341
- package/dist/ai-panel-default-lang-D2zhXvKP.cjs +0 -3
- package/dist/ai-panel-other-lang-Bfjk2CYZ.js +0 -162
- package/dist/ai-panel-other-lang-Y4bEKHoG.cjs +0 -1
- package/dist/apply-binding-BvWfJCSZ.js +0 -841
- package/dist/apply-binding-IsUf6UWJ.cjs +0 -1
- package/dist/code-editor-Bb7JumZy.js +0 -51
- package/dist/code-editor-DQB8lAOk.cjs +0 -1
- package/dist/core-Dr7QYemB.js +0 -56
- package/dist/core-Y0lXLwkq.cjs +0 -1
- package/dist/delete-design-token-BG8yHcS5.cjs +0 -1
- package/dist/delete-design-token-COvR4G1S.js +0 -40
- package/dist/delete-page-CNucxe4P.js +0 -71
- package/dist/delete-page-DAvEjHwF.cjs +0 -1
- package/dist/digital-asset-manager-CB5MRBcW.cjs +0 -1
- package/dist/fonts/GeistMonoVF.woff +0 -0
- package/dist/fonts/GeistVF.woff +0 -0
- package/dist/fonts-B-Xt29pe.cjs +0 -1
- package/dist/fonts-DRly3Wzd.js +0 -78
- package/dist/get-chai-builder-theme-BApShjRz.cjs +0 -1
- package/dist/image-compression-DZ9WMmyn.cjs +0 -1
- package/dist/index-B-rSiAp_.cjs +0 -1
- package/dist/index-C0-pgg_p.cjs +0 -5
- package/dist/index-C99FhuF1.cjs +0 -160
- package/dist/index-Dno42B0a.js +0 -4734
- package/dist/index-Dxfyt4d4.js +0 -39
- package/dist/lang-panel-fDCYm5Jm.cjs +0 -1
- package/dist/manage-design-tokens-BsSZE9Vs.js +0 -241
- package/dist/manage-design-tokens-BvH5KTJX.cjs +0 -1
- package/dist/page-creator-g8GqgcKH.cjs +0 -1
- package/dist/page-locked-dialog-Co5b9XIZ.cjs +0 -1
- package/dist/page-manager-new-5rFP5DyQ.js +0 -395
- package/dist/page-manager-new-BOkJImo2.cjs +0 -1
- package/dist/page-revisions-content-ag-MHBGr.cjs +0 -1
- package/dist/plugin-BGlQf0iy.cjs +0 -22
- package/dist/plugin-C-ht41UZ.js +0 -245
- package/dist/publish-pages-content-BiX-GMLw.cjs +0 -1
- package/dist/register-chai-top-bar-BqwKw4uy.cjs +0 -1
- package/dist/save-to-lib-ffjCZYJ5.cjs +0 -1
- package/dist/seo-panel-FjS1UF_y.cjs +0 -2
- package/dist/shared-json-ld-yJkXjENy.cjs +0 -1
- package/dist/take-over-request-CmpJVe9T.cjs +0 -1
- package/dist/theme-panel-footer-BUXIu252.js +0 -26
- package/dist/theme-panel-footer-CKO9YYwZ.cjs +0 -1
- package/dist/unpublish-page-BJ0Bsvt2.js +0 -28
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<header chai-name="Minimal Portfolio Navbar" class="w-full bg-background">
|
|
2
|
+
<div chai-name="Navbar Container" class="mx-auto flex h-16 max-w-7xl items-center justify-between px-6 lg:px-8">
|
|
3
|
+
<a href="#" chai-name="Logo" class="flex items-center gap-2">
|
|
4
|
+
<div class="flex h-8 w-8 items-center justify-center rounded-full border border-border">
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="14"
|
|
8
|
+
height="14"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
stroke-width="1.5"
|
|
13
|
+
stroke-linecap="round"
|
|
14
|
+
stroke-linejoin="round"
|
|
15
|
+
class="text-foreground">
|
|
16
|
+
<polygon
|
|
17
|
+
points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
|
|
18
|
+
</svg>
|
|
19
|
+
</div>
|
|
20
|
+
<span class="text-sm font-semibold text-foreground">Alex Morgan</span>
|
|
21
|
+
</a>
|
|
22
|
+
|
|
23
|
+
<nav chai-name="Desktop Navigation" class="hidden items-center gap-1 sm:flex">
|
|
24
|
+
<a
|
|
25
|
+
href="#"
|
|
26
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
27
|
+
>Projects</a
|
|
28
|
+
>
|
|
29
|
+
<a
|
|
30
|
+
href="#"
|
|
31
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
32
|
+
>About</a
|
|
33
|
+
>
|
|
34
|
+
<a
|
|
35
|
+
href="#"
|
|
36
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
37
|
+
>Resume</a
|
|
38
|
+
>
|
|
39
|
+
</nav>
|
|
40
|
+
|
|
41
|
+
<div chai-name="Desktop Actions" class="hidden items-center gap-4 sm:flex">
|
|
42
|
+
<div class="flex items-center gap-3 border-l border-border pl-4">
|
|
43
|
+
<a
|
|
44
|
+
href="#"
|
|
45
|
+
class="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
46
|
+
aria-label="GitHub Profile">
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
48
|
+
<path
|
|
49
|
+
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
|
|
50
|
+
</svg>
|
|
51
|
+
</a>
|
|
52
|
+
<a
|
|
53
|
+
href="#"
|
|
54
|
+
class="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
55
|
+
aria-label="Twitter Profile">
|
|
56
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor">
|
|
57
|
+
<path
|
|
58
|
+
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
|
|
59
|
+
</svg>
|
|
60
|
+
</a>
|
|
61
|
+
</div>
|
|
62
|
+
<a
|
|
63
|
+
href="#"
|
|
64
|
+
class="inline-flex h-9 items-center gap-2 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90">
|
|
65
|
+
<svg
|
|
66
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
67
|
+
width="14"
|
|
68
|
+
height="14"
|
|
69
|
+
viewBox="0 0 24 24"
|
|
70
|
+
fill="none"
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
stroke-width="2"
|
|
73
|
+
stroke-linecap="round"
|
|
74
|
+
stroke-linejoin="round">
|
|
75
|
+
<rect width="20" height="16" x="2" y="4" rx="2" />
|
|
76
|
+
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
|
|
77
|
+
</svg>
|
|
78
|
+
Contact
|
|
79
|
+
</a>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<details chai-name="Mobile Menu" class="relative sm:hidden">
|
|
83
|
+
<summary
|
|
84
|
+
class="flex h-10 w-10 cursor-pointer list-none items-center justify-center rounded-md border border-input bg-background transition-colors hover:bg-accent">
|
|
85
|
+
<svg
|
|
86
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
87
|
+
width="18"
|
|
88
|
+
height="18"
|
|
89
|
+
viewBox="0 0 24 24"
|
|
90
|
+
fill="none"
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
stroke-width="2"
|
|
93
|
+
stroke-linecap="round"
|
|
94
|
+
stroke-linejoin="round"
|
|
95
|
+
class="text-foreground">
|
|
96
|
+
<line x1="4" x2="20" y1="12" y2="12" />
|
|
97
|
+
<line x1="4" x2="20" y1="6" y2="6" />
|
|
98
|
+
<line x1="4" x2="20" y1="18" y2="18" />
|
|
99
|
+
</svg>
|
|
100
|
+
</summary>
|
|
101
|
+
<div
|
|
102
|
+
chai-name="Mobile Dropdown"
|
|
103
|
+
class="absolute right-0 top-12 w-56 rounded-md border border-border bg-card p-4 shadow-lg">
|
|
104
|
+
<nav class="flex flex-col gap-1">
|
|
105
|
+
<a
|
|
106
|
+
href="#"
|
|
107
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
108
|
+
>Projects</a
|
|
109
|
+
>
|
|
110
|
+
<a
|
|
111
|
+
href="#"
|
|
112
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
113
|
+
>About</a
|
|
114
|
+
>
|
|
115
|
+
<a
|
|
116
|
+
href="#"
|
|
117
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
118
|
+
>Resume</a
|
|
119
|
+
>
|
|
120
|
+
</nav>
|
|
121
|
+
<div class="mt-3 flex flex-col gap-2 border-t border-border pt-3">
|
|
122
|
+
<div class="flex items-center gap-3 px-3 py-2">
|
|
123
|
+
<a
|
|
124
|
+
href="#"
|
|
125
|
+
class="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
126
|
+
aria-label="GitHub Profile">
|
|
127
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
128
|
+
<path
|
|
129
|
+
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
|
|
130
|
+
</svg>
|
|
131
|
+
</a>
|
|
132
|
+
<a
|
|
133
|
+
href="#"
|
|
134
|
+
class="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
135
|
+
aria-label="Twitter Profile">
|
|
136
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="currentColor">
|
|
137
|
+
<path
|
|
138
|
+
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
|
|
139
|
+
</svg>
|
|
140
|
+
</a>
|
|
141
|
+
</div>
|
|
142
|
+
<a
|
|
143
|
+
href="#"
|
|
144
|
+
class="flex h-10 items-center justify-center gap-2 rounded-md bg-primary text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90">
|
|
145
|
+
<svg
|
|
146
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
147
|
+
width="14"
|
|
148
|
+
height="14"
|
|
149
|
+
viewBox="0 0 24 24"
|
|
150
|
+
fill="none"
|
|
151
|
+
stroke="currentColor"
|
|
152
|
+
stroke-width="2"
|
|
153
|
+
stroke-linecap="round"
|
|
154
|
+
stroke-linejoin="round">
|
|
155
|
+
<rect width="20" height="16" x="2" y="4" rx="2" />
|
|
156
|
+
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
|
|
157
|
+
</svg>
|
|
158
|
+
Contact
|
|
159
|
+
</a>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</details>
|
|
163
|
+
</div>
|
|
164
|
+
</header>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<header
|
|
2
|
+
chai-name="SaaS Startup Navbar"
|
|
3
|
+
class="sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur-md">
|
|
4
|
+
<div chai-name="Navbar Container" class="mx-auto flex h-16 max-w-7xl items-center justify-between px-6 lg:px-8">
|
|
5
|
+
<div chai-name="Logo" class="flex items-center gap-2">
|
|
6
|
+
<div class="flex h-8 w-8 items-center justify-center rounded-md bg-primary">
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width="18"
|
|
10
|
+
height="18"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
fill="none"
|
|
13
|
+
stroke="currentColor"
|
|
14
|
+
stroke-width="2"
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
stroke-linejoin="round"
|
|
17
|
+
class="text-primary-foreground">
|
|
18
|
+
<path d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" />
|
|
19
|
+
</svg>
|
|
20
|
+
</div>
|
|
21
|
+
<span class="text-lg font-bold tracking-tight text-foreground">Launchpad</span>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<nav chai-name="Desktop Navigation" class="hidden items-center gap-1 md:flex">
|
|
25
|
+
<a
|
|
26
|
+
href="#"
|
|
27
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
28
|
+
>Product</a
|
|
29
|
+
>
|
|
30
|
+
<a
|
|
31
|
+
href="#"
|
|
32
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
33
|
+
>Features</a
|
|
34
|
+
>
|
|
35
|
+
<a
|
|
36
|
+
href="#"
|
|
37
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
38
|
+
>Pricing</a
|
|
39
|
+
>
|
|
40
|
+
<a
|
|
41
|
+
href="#"
|
|
42
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
43
|
+
>Docs</a
|
|
44
|
+
>
|
|
45
|
+
<a
|
|
46
|
+
href="#"
|
|
47
|
+
class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
48
|
+
>Blog</a
|
|
49
|
+
>
|
|
50
|
+
</nav>
|
|
51
|
+
|
|
52
|
+
<div chai-name="Desktop Actions" class="hidden items-center gap-3 md:flex">
|
|
53
|
+
<a
|
|
54
|
+
href="#"
|
|
55
|
+
class="inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground">
|
|
56
|
+
Sign In
|
|
57
|
+
</a>
|
|
58
|
+
<a
|
|
59
|
+
href="#"
|
|
60
|
+
class="inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90">
|
|
61
|
+
Get Started
|
|
62
|
+
</a>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<details chai-name="Mobile Menu" class="relative md:hidden">
|
|
66
|
+
<summary
|
|
67
|
+
class="flex h-10 w-10 cursor-pointer list-none items-center justify-center rounded-md border border-input bg-background transition-colors hover:bg-accent hover:text-accent-foreground">
|
|
68
|
+
<svg
|
|
69
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
70
|
+
width="20"
|
|
71
|
+
height="20"
|
|
72
|
+
viewBox="0 0 24 24"
|
|
73
|
+
fill="none"
|
|
74
|
+
stroke="currentColor"
|
|
75
|
+
stroke-width="2"
|
|
76
|
+
stroke-linecap="round"
|
|
77
|
+
stroke-linejoin="round"
|
|
78
|
+
class="text-foreground">
|
|
79
|
+
<line x1="4" x2="20" y1="12" y2="12" />
|
|
80
|
+
<line x1="4" x2="20" y1="6" y2="6" />
|
|
81
|
+
<line x1="4" x2="20" y1="18" y2="18" />
|
|
82
|
+
</svg>
|
|
83
|
+
</summary>
|
|
84
|
+
<div
|
|
85
|
+
chai-name="Mobile Dropdown"
|
|
86
|
+
class="absolute right-0 top-12 w-64 rounded-md border border-border bg-card p-4 shadow-lg">
|
|
87
|
+
<nav class="flex flex-col gap-1">
|
|
88
|
+
<a
|
|
89
|
+
href="#"
|
|
90
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
91
|
+
>Product</a
|
|
92
|
+
>
|
|
93
|
+
<a
|
|
94
|
+
href="#"
|
|
95
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
96
|
+
>Features</a
|
|
97
|
+
>
|
|
98
|
+
<a
|
|
99
|
+
href="#"
|
|
100
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
101
|
+
>Pricing</a
|
|
102
|
+
>
|
|
103
|
+
<a
|
|
104
|
+
href="#"
|
|
105
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
106
|
+
>Docs</a
|
|
107
|
+
>
|
|
108
|
+
<a
|
|
109
|
+
href="#"
|
|
110
|
+
class="rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
|
|
111
|
+
>Blog</a
|
|
112
|
+
>
|
|
113
|
+
</nav>
|
|
114
|
+
<div class="mt-4 flex flex-col gap-2 border-t border-border pt-4">
|
|
115
|
+
<a
|
|
116
|
+
href="#"
|
|
117
|
+
class="inline-flex h-10 items-center justify-center rounded-md border border-input bg-background text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground">
|
|
118
|
+
Sign In
|
|
119
|
+
</a>
|
|
120
|
+
<a
|
|
121
|
+
href="#"
|
|
122
|
+
class="inline-flex h-10 items-center justify-center rounded-md bg-primary text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90">
|
|
123
|
+
Get Started
|
|
124
|
+
</a>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</details>
|
|
128
|
+
</div>
|
|
129
|
+
</header>
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index-P-2SvZA9.cjs"),g=require("./register-chai-top-bar-DyW9GPzV.cjs"),oe=require("./STRINGS-FNnfjF5H.cjs"),j=require("@radix-ui/react-icons"),le=require("jotai"),ce=require("nanoid"),i=require("react"),de=require("react-i18next"),p=require("sonner"),ue=require("tailwind-merge"),L=o=>{const m=o.trim();return m.length===0||m.length>25?!1:/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(m)},me=(o,m,t,a=!1,x)=>{const h=o.trim();return h.length===0?"":h.length>25?t("Token name must be 25 characters or less"):/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(h)?Object.entries(m).find(([k,C])=>C.name===h&&(!a||k!==x))?t("Token name already exists"):"":t("Only alphanumeric characters and hyphens allowed")},xe=o=>o.replace(/\s+/g,"-"),he=i.lazy(()=>Promise.resolve().then(()=>require("./design-token-usage-BBLfxzzo.cjs"))),_=({tokenId:o,token:m,isDisabled:t,isSelected:a,isArchived:x=!1,onSelect:h,onEdit:y,onUnarchive:N})=>e.jsxs("div",{onClick:()=>h(o),className:`group relative flex cursor-pointer items-center justify-between overflow-hidden rounded border p-2 transition-all duration-150 ${x?"border-muted bg-muted/30 opacity-60":a?"border-primary bg-primary/10":"hover:bg-muted/90"}`,children:[e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[e.jsx("div",{className:`text-xs font-semibold ${x?"text-muted-foreground":""}`,children:m.name}),e.jsx("div",{className:`w-full max-w-52 truncate text-[10px] font-light ${x?"text-muted-foreground":""}`,children:m.value})]}),e.jsxs("div",{className:"absolute right-1 top-1 flex flex-shrink-0 items-center opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[!x&&e.jsxs(e.Fragment,{children:[e.jsx(i.Suspense,{fallback:null,children:e.jsx(he,{tokenId:o,tokenName:m.name,children:e.jsx(g.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",children:e.jsx(j.EyeOpenIcon,{className:"h-3 w-3"})})})}),e.jsx(g.Button,{variant:"ghost",size:"sm",onClick:k=>{k.stopPropagation(),y(o)},disabled:t,className:"h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",children:e.jsx(j.Pencil1Icon,{className:"h-3 w-3"})})]}),x&&e.jsx(g.Button,{variant:"ghost",size:"sm",onClick:k=>{k.stopPropagation(),N==null||N(o)},disabled:t,className:"h-6 w-6 rounded-full p-0 hover:bg-primary/10 hover:text-primary",children:e.jsx(j.EyeOpenIcon,{className:"h-3 w-3"})})]})]}),fe=({onActiveTokenChange:o,onDirtyStateChange:m})=>{const{t}=de.useTranslation(),[a,x]=le.useAtom(c.chaiDesignTokensAtom),h=c.useIncrementActionsCount(),{saveDesignTokens:y,debouncedSaveDesignTokens:N}=c.useSaveWebsiteData(),k=c.useBuilderProp("pageId",""),C=c.useBuilderProp("siteWideUsage",{}),[f,B]=i.useState("view"),[v,R]=i.useState(null),[b,W]=i.useState(null),[l,A]=i.useState(""),[d,S]=i.useState(""),[D,I]=i.useState(""),[O,H]=i.useState(""),[K,q]=i.useState(!1),z=i.useRef(null),[E,M]=i.useState({isOpen:!1,tokenId:null,tokenName:"",pageCount:0,partialCount:0}),P=i.useRef(null),X=i.useCallback(s=>{if(!C)return{pageCount:0,partialCount:0};let n=0,r=0;return Object.entries(C).forEach(([u,T])=>{if(u===k||!(T!=null&&T.designTokens))return;Object.keys(T.designTokens).some(ie=>ie===s)&&(T.isPartial?r++:n++)}),{pageCount:n,partialCount:r}},[C,k]),F=i.useMemo(()=>Object.entries(a).filter(([,s])=>s.name.toLowerCase().includes(O.toLowerCase())||s.value.toLowerCase().includes(O.toLowerCase())),[a,O]);i.useEffect(()=>{if(!m)return;const s=f==="add"&&(l&&l.trim().length>0||d&&d.trim().length>0);m(s)},[f,l,d,m]),i.useEffect(()=>{if(o)if(f==="edit"||f==="add")o(l&&d?{name:l,value:d,id:v||void 0}:null);else if(f==="view"&&b&&a[b]){const s=a[b];o({name:s.name,value:s.value,id:b})}else o(null)},[f,l,d,v,b,a,o]);const J=()=>{if(!l.trim()||!d.trim()){p.toast.error(t("Please fill in both token name and classes"));return}if(!L(l)){p.toast.error(t("Invalid design token name format"));return}if(Object.entries(a).find(([n,r])=>r.name===l.trim()&&n!==v)){p.toast.error(t("Token already exists"));return}v&&Y(l,d)},w=i.useCallback(()=>{R(null),A(""),S(""),I(""),q(!1),B("view")},[]),Y=i.useCallback((s,n)=>{!v||f!=="edit"||!s.trim()||!n.trim()||!L(s)||Object.entries(a).find(([u,T])=>T.name===s.trim()&&u!==v)||(q(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{const u={...a,[v]:{name:s.trim(),value:n.trim()}};x(u),h(),N(),q(!1),p.toast.success(t("Token updated successfully")),w()},10))},[v,f,a,x,h,N,t,w]),U=()=>{if(!l.trim()||!d.trim()){p.toast.error(t("Please fill in both token name and classes"));return}if(!L(l)){p.toast.error(t("Invalid design token name format"));return}if(Object.values(a).find(u=>u.name===l.trim())){p.toast.error(t("Token already exists"));return}const n=`${oe.DESIGN_TOKEN_PREFIX}${ce.nanoid(12)}`,r={...a,[n]:{name:l.trim(),value:d.trim()}};x(r),h(),y(),p.toast.success(t("Token added successfully")),w()},$=s=>{const n=a[s];if(!n)return;const{pageCount:r,partialCount:u}=X(s);M({isOpen:!0,tokenId:s,tokenName:n.name,pageCount:r,partialCount:u}),P.current=s},ee=()=>{const s=P.current;if(!s)return;const n={...a,[s]:{...a[s],archived:!0}};x(n),h(),y(),p.toast.success(t("Token archived successfully")),M({isOpen:!1,tokenId:null,tokenName:"",pageCount:0,partialCount:0}),P.current=null},G=s=>{const n={...a,[s]:{name:a[s].name,value:a[s].value}};x(n),h(),p.toast.success(t("Token unarchived successfully"))},Z=s=>{const n=a[s];n&&(R(s),A(n.name),S(n.value),I(""),B("edit"))},V=()=>{R(null),A(""),S(""),I(""),B("add")},se=s=>{const n=xe(s);A(n);const r=me(n,a,t,f==="edit",v||void 0);I(r)},Q=s=>{S(s)},te=s=>{const n=c.orderClassesByBreakpoint(c.removeDuplicateClasses(ue.twMerge(d,s)));Q(n)},ne=s=>{const n=d.split(" ").filter(r=>r!==s).join(" ");Q(n)},re=()=>{const s=f==="edit",n=t(s?"Edit Design Token":"Add Design Token"),r=t(s?"Update design token":"Create a reusable design token");return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-md border border-border/50 bg-muted p-1.5",children:[e.jsx(g.Button,{variant:"ghost",size:"sm",onClick:w,className:"h-6 w-6 rounded-full p-0 hover:bg-muted",children:e.jsx(j.ArrowLeftIcon,{className:"h-3 w-3"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xs font-semibold text-foreground",children:n}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:r})]}),s&&K&&e.jsx("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:e.jsx("div",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-primary"})})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c.Label,{htmlFor:"token-name",className:"text-xs font-medium",children:t("Token Name")}),e.jsx(g.Input,{id:"token-name",placeholder:"Button-Primary",value:l,onChange:u=>se(u.target.value),className:"h-7 text-xs"}),D?e.jsx("span",{className:"text-[10px] text-destructive",children:D}):e.jsx("span",{className:"text-[10px] font-light text-muted-foreground",children:t("Button-Primary, Card-Header, Text-Large etc.")})]}),e.jsx(c.ManualClasses,{from:"designToken",classFromProps:d,onAddNew:te,onRemove:ne,showDesignTokenSuggestions:!1}),e.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2 pt-3",children:[e.jsx(g.Button,{variant:"outline",onClick:w,className:"h-7 text-xs",children:t("Cancel")}),s?e.jsx(g.Button,{onClick:J,disabled:!l.trim()||!d.trim()||!!D,className:"h-7 text-xs",children:t("Save Token")}):e.jsx(g.Button,{onClick:U,disabled:!l.trim()||!d.trim()||!!D,className:"h-7 text-xs",children:t("Add Token")})]})]})]})},ae=()=>{const s=F.filter(([,r])=>!r.archived),n=F.filter(([,r])=>r.archived);return e.jsxs(e.Fragment,{children:[Object.entries(a).length>0&&e.jsxs("div",{className:"flex items-center justify-between gap-x-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(j.MagnifyingGlassIcon,{className:"absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),e.jsx(g.Input,{placeholder:t("Search tokens"),value:O,onChange:r=>H(r.target.value),className:"h-6 pl-7 text-xs"})]}),e.jsxs(g.Button,{variant:"outline",onClick:V,size:"sm",className:"h-6 border-primary text-xs text-primary hover:bg-primary/10 hover:text-primary",children:[e.jsx(j.PlusIcon,{className:"h-3 w-3"}),t("Add")]})]}),e.jsx("div",{className:"no-scrollbar flex flex-1 flex-col overflow-hidden pt-2",children:e.jsx(c.ScrollArea,{className:"flex h-full flex-1 items-center justify-center",children:e.jsxs("div",{className:"space-y-1",children:[Object.entries(a).length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-muted bg-muted/20 py-8",children:[e.jsx("div",{className:"mb-2 text-3xl",children:e.jsx(j.TokensIcon,{className:"h-12 w-12 text-muted-foreground"})}),e.jsx("p",{className:"mb-1 text-sm font-medium text-foreground",children:t("No design tokens yet")}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:t("Create reusable design tokens to streamline your styling")}),e.jsxs(g.Button,{variant:"default",onClick:V,size:"sm",className:"mt-4 h-7 text-xs leading-tight",children:[e.jsx(j.PlusIcon,{className:"mr-1 h-3 w-3"}),t("Add first design token")]})]}):F.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-muted bg-muted/20 py-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx(j.MagnifyingGlassIcon,{className:"h-10 w-10 text-muted-foreground"})}),e.jsx("p",{className:"mb-1 text-sm font-medium text-foreground",children:t("No tokens found")}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:t("No design tokens match your search")})]}):e.jsxs(e.Fragment,{children:[s.length>0&&e.jsx("div",{className:"space-y-1",children:s.map(([r,u])=>e.jsx(_,{token:u,tokenId:r,isSelected:b===r,isArchived:!1,onSelect:W,onEdit:Z,onArchive:$,onUnarchive:G,isDisabled:!1},r))}),n.length>0&&e.jsxs("div",{className:"mt-4 space-y-1",children:[e.jsx("div",{className:"px-2 py-1 text-[10px] font-semibold text-muted-foreground",children:t("Archived")}),n.map(([r,u])=>e.jsx(_,{token:u,tokenId:r,isSelected:b===r,isArchived:!0,onSelect:W,onEdit:Z,onArchive:$,onUnarchive:G,isDisabled:!1},r))]})]}),e.jsx("div",{className:"h-44"})]})})})]})};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex h-full w-full flex-col",children:f==="view"?ae():re()}),e.jsx(c.AlertDialog,{open:E.isOpen,onOpenChange:s=>{s||(M({isOpen:!1,tokenId:null,tokenName:"",pageCount:0,partialCount:0}),P.current=null)},children:e.jsxs(c.AlertDialogContent,{children:[e.jsx(c.AlertDialogTitle,{children:t("Archive Design Token")}),e.jsxs(c.AlertDialogDescription,{className:"space-y-3",children:[e.jsxs("p",{children:[t("This token is used on")," ",e.jsx("span",{className:"font-semibold",children:E.pageCount})," ",t("pages"),E.partialCount>0&&e.jsxs(e.Fragment,{children:[" ",t("and")," ",e.jsx("span",{className:"font-semibold",children:E.partialCount})," ",t("partials")]}),"."]}),e.jsx("p",{className:"text-sm text-destructive",children:t("Archiving this token will remove the styling for those blocks.")}),e.jsx("p",{children:t("Do you wish to continue?")})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(c.AlertDialogCancel,{children:t("Cancel")}),e.jsx(c.AlertDialogAction,{onClick:ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:t("Archive")})]})]})})]})};exports.default=fe;
|