@psnext/design-system 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -30
- package/dist/Header.cjs +890 -0
- package/dist/Header.cjs.map +1 -0
- package/dist/Header.js +798 -0
- package/dist/Header.js.map +1 -0
- package/dist/Icon.cjs +1969 -0
- package/dist/Icon.cjs.map +1 -0
- package/dist/Icon.js +1956 -0
- package/dist/Icon.js.map +1 -0
- package/dist/{ThemeProvider.cjs → Logo.cjs} +2 -1075
- package/dist/Logo.cjs.map +1 -0
- package/dist/{ThemeProvider.js → Logo.js} +4 -704
- package/dist/Logo.js.map +1 -0
- package/dist/Sidebar.cjs +562 -0
- package/dist/Sidebar.cjs.map +1 -0
- package/dist/Sidebar.js +416 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/{utils.cjs → chunk.cjs} +0 -39
- package/dist/cn.cjs +15 -0
- package/dist/cn.cjs.map +1 -0
- package/dist/cn.js +10 -0
- package/dist/cn.js.map +1 -0
- package/dist/index.cjs +413 -346
- package/dist/index.d.cts +12 -1996
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +12 -1996
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -5
- package/dist/index10.d.cts +38 -0
- package/dist/index10.d.cts.map +1 -0
- package/dist/index10.d.ts +38 -0
- package/dist/index10.d.ts.map +1 -0
- package/dist/index11.d.cts +30 -0
- package/dist/index11.d.cts.map +1 -0
- package/dist/index11.d.ts +30 -0
- package/dist/index11.d.ts.map +1 -0
- package/dist/index12.d.cts +75 -0
- package/dist/index12.d.cts.map +1 -0
- package/dist/index12.d.ts +75 -0
- package/dist/index12.d.ts.map +1 -0
- package/dist/index13.d.cts +57 -0
- package/dist/index13.d.cts.map +1 -0
- package/dist/index13.d.ts +57 -0
- package/dist/index13.d.ts.map +1 -0
- package/dist/index14.d.cts +98 -0
- package/dist/index14.d.cts.map +1 -0
- package/dist/index14.d.ts +98 -0
- package/dist/index14.d.ts.map +1 -0
- package/dist/index15.d.cts +29 -0
- package/dist/index15.d.cts.map +1 -0
- package/dist/index15.d.ts +29 -0
- package/dist/index15.d.ts.map +1 -0
- package/dist/index16.d.cts +38 -0
- package/dist/index16.d.cts.map +1 -0
- package/dist/index16.d.ts +38 -0
- package/dist/index16.d.ts.map +1 -0
- package/dist/index17.d.cts +19 -0
- package/dist/index17.d.cts.map +1 -0
- package/dist/index17.d.ts +19 -0
- package/dist/index17.d.ts.map +1 -0
- package/dist/index18.d.cts +73 -0
- package/dist/index18.d.cts.map +1 -0
- package/dist/index18.d.ts +73 -0
- package/dist/index18.d.ts.map +1 -0
- package/dist/index19.d.cts +66 -0
- package/dist/index19.d.cts.map +1 -0
- package/dist/index19.d.ts +66 -0
- package/dist/index19.d.ts.map +1 -0
- package/dist/index2.d.cts +44 -4
- package/dist/index2.d.cts.map +1 -0
- package/dist/index2.d.ts +44 -4
- package/dist/index2.d.ts.map +1 -0
- package/dist/index20.d.cts +96 -0
- package/dist/index20.d.cts.map +1 -0
- package/dist/index20.d.ts +96 -0
- package/dist/index20.d.ts.map +1 -0
- package/dist/index21.d.cts +34 -0
- package/dist/index21.d.cts.map +1 -0
- package/dist/index21.d.ts +34 -0
- package/dist/index21.d.ts.map +1 -0
- package/dist/index22.d.cts +62 -0
- package/dist/index22.d.cts.map +1 -0
- package/dist/index22.d.ts +62 -0
- package/dist/index22.d.ts.map +1 -0
- package/dist/index23.d.cts +99 -0
- package/dist/index23.d.cts.map +1 -0
- package/dist/index23.d.ts +99 -0
- package/dist/index23.d.ts.map +1 -0
- package/dist/index24.d.cts +49 -0
- package/dist/index24.d.cts.map +1 -0
- package/dist/index24.d.ts +49 -0
- package/dist/index24.d.ts.map +1 -0
- package/dist/index25.d.cts +17 -0
- package/dist/index25.d.cts.map +1 -0
- package/dist/index25.d.ts +17 -0
- package/dist/index25.d.ts.map +1 -0
- package/dist/index26.d.cts +80 -0
- package/dist/index26.d.cts.map +1 -0
- package/dist/index26.d.ts +80 -0
- package/dist/index26.d.ts.map +1 -0
- package/dist/index27.d.cts +71 -0
- package/dist/index27.d.cts.map +1 -0
- package/dist/index27.d.ts +71 -0
- package/dist/index27.d.ts.map +1 -0
- package/dist/index28.d.cts +37 -0
- package/dist/index28.d.cts.map +1 -0
- package/dist/index28.d.ts +37 -0
- package/dist/index28.d.ts.map +1 -0
- package/dist/index29.d.cts +25 -0
- package/dist/index29.d.cts.map +1 -0
- package/dist/index29.d.ts +25 -0
- package/dist/index29.d.ts.map +1 -0
- package/dist/index3.d.cts +62 -0
- package/dist/index3.d.cts.map +1 -0
- package/dist/index3.d.ts +62 -0
- package/dist/index3.d.ts.map +1 -0
- package/dist/index30.d.cts +59 -0
- package/dist/index30.d.cts.map +1 -0
- package/dist/index30.d.ts +59 -0
- package/dist/index30.d.ts.map +1 -0
- package/dist/index31.d.cts +40 -0
- package/dist/index31.d.cts.map +1 -0
- package/dist/index31.d.ts +40 -0
- package/dist/index31.d.ts.map +1 -0
- package/dist/index32.d.cts +23 -0
- package/dist/index32.d.cts.map +1 -0
- package/dist/index32.d.ts +23 -0
- package/dist/index32.d.ts.map +1 -0
- package/dist/index33.d.cts +55 -0
- package/dist/index33.d.cts.map +1 -0
- package/dist/index33.d.ts +55 -0
- package/dist/index33.d.ts.map +1 -0
- package/dist/index34.d.cts +43 -0
- package/dist/index34.d.cts.map +1 -0
- package/dist/index34.d.ts +43 -0
- package/dist/index34.d.ts.map +1 -0
- package/dist/index35.d.cts +77 -0
- package/dist/index35.d.cts.map +1 -0
- package/dist/index35.d.ts +77 -0
- package/dist/index35.d.ts.map +1 -0
- package/dist/index36.d.cts +19 -0
- package/dist/index36.d.cts.map +1 -0
- package/dist/index36.d.ts +19 -0
- package/dist/index36.d.ts.map +1 -0
- package/dist/index37.d.cts +29 -0
- package/dist/index37.d.cts.map +1 -0
- package/dist/index37.d.ts +29 -0
- package/dist/index37.d.ts.map +1 -0
- package/dist/index38.d.cts +20 -0
- package/dist/index38.d.cts.map +1 -0
- package/dist/index38.d.ts +20 -0
- package/dist/index38.d.ts.map +1 -0
- package/dist/index39.d.cts +105 -0
- package/dist/index39.d.cts.map +1 -0
- package/dist/index39.d.ts +105 -0
- package/dist/index39.d.ts.map +1 -0
- package/dist/index4.d.cts +11 -0
- package/dist/index4.d.cts.map +1 -0
- package/dist/index4.d.ts +11 -0
- package/dist/index4.d.ts.map +1 -0
- package/dist/index40.d.cts +22 -0
- package/dist/index40.d.cts.map +1 -0
- package/dist/index40.d.ts +22 -0
- package/dist/index40.d.ts.map +1 -0
- package/dist/index41.d.cts +56 -0
- package/dist/index41.d.cts.map +1 -0
- package/dist/index41.d.ts +56 -0
- package/dist/index41.d.ts.map +1 -0
- package/dist/index42.d.cts +45 -0
- package/dist/index42.d.cts.map +1 -0
- package/dist/index42.d.ts +45 -0
- package/dist/index42.d.ts.map +1 -0
- package/dist/index43.d.cts +96 -0
- package/dist/index43.d.cts.map +1 -0
- package/dist/index43.d.ts +96 -0
- package/dist/index43.d.ts.map +1 -0
- package/dist/index44.d.cts +48 -0
- package/dist/index44.d.cts.map +1 -0
- package/dist/index44.d.ts +48 -0
- package/dist/index44.d.ts.map +1 -0
- package/dist/index45.d.cts +28 -0
- package/dist/index45.d.cts.map +1 -0
- package/dist/index45.d.ts +28 -0
- package/dist/index45.d.ts.map +1 -0
- package/dist/index46.d.cts +41 -0
- package/dist/index46.d.cts.map +1 -0
- package/dist/index46.d.ts +41 -0
- package/dist/index46.d.ts.map +1 -0
- package/dist/index47.d.cts +25 -0
- package/dist/index47.d.cts.map +1 -0
- package/dist/index47.d.ts +25 -0
- package/dist/index47.d.ts.map +1 -0
- package/dist/index48.d.cts +21 -0
- package/dist/index48.d.cts.map +1 -0
- package/dist/index48.d.ts +21 -0
- package/dist/index48.d.ts.map +1 -0
- package/dist/index49.d.cts +69 -0
- package/dist/index49.d.cts.map +1 -0
- package/dist/index49.d.ts +69 -0
- package/dist/index49.d.ts.map +1 -0
- package/dist/index5.d.cts +45 -0
- package/dist/index5.d.cts.map +1 -0
- package/dist/index5.d.ts +45 -0
- package/dist/index5.d.ts.map +1 -0
- package/dist/index50.d.cts +63 -0
- package/dist/index50.d.cts.map +1 -0
- package/dist/index50.d.ts +63 -0
- package/dist/index50.d.ts.map +1 -0
- package/dist/index51.d.cts +31 -0
- package/dist/index51.d.cts.map +1 -0
- package/dist/index51.d.ts +31 -0
- package/dist/index51.d.ts.map +1 -0
- package/dist/index52.d.cts +209 -0
- package/dist/index52.d.cts.map +1 -0
- package/dist/index52.d.ts +209 -0
- package/dist/index52.d.ts.map +1 -0
- package/dist/index53.d.cts +26 -0
- package/dist/index53.d.cts.map +1 -0
- package/dist/index53.d.ts +26 -0
- package/dist/index53.d.ts.map +1 -0
- package/dist/index54.d.cts +28 -0
- package/dist/index54.d.cts.map +1 -0
- package/dist/index54.d.ts +28 -0
- package/dist/index54.d.ts.map +1 -0
- package/dist/index55.d.cts +25 -0
- package/dist/index55.d.cts.map +1 -0
- package/dist/index55.d.ts +25 -0
- package/dist/index55.d.ts.map +1 -0
- package/dist/index56.d.cts +12 -0
- package/dist/index56.d.cts.map +1 -0
- package/dist/index56.d.ts +12 -0
- package/dist/index56.d.ts.map +1 -0
- package/dist/index57.d.cts +50 -0
- package/dist/index57.d.cts.map +1 -0
- package/dist/index57.d.ts +50 -0
- package/dist/index57.d.ts.map +1 -0
- package/dist/index58.d.cts +51 -0
- package/dist/index58.d.cts.map +1 -0
- package/dist/index58.d.ts +51 -0
- package/dist/index58.d.ts.map +1 -0
- package/dist/index59.d.cts +58 -0
- package/dist/index59.d.cts.map +1 -0
- package/dist/index59.d.ts +58 -0
- package/dist/index59.d.ts.map +1 -0
- package/dist/index6.d.cts +26 -0
- package/dist/index6.d.cts.map +1 -0
- package/dist/index6.d.ts +26 -0
- package/dist/index6.d.ts.map +1 -0
- package/dist/index60.d.cts +45 -0
- package/dist/index60.d.cts.map +1 -0
- package/dist/index60.d.ts +45 -0
- package/dist/index60.d.ts.map +1 -0
- package/dist/index61.d.cts +21 -0
- package/dist/index61.d.cts.map +1 -0
- package/dist/index61.d.ts +21 -0
- package/dist/index61.d.ts.map +1 -0
- package/dist/index62.d.cts +45 -0
- package/dist/index62.d.cts.map +1 -0
- package/dist/index62.d.ts +45 -0
- package/dist/index62.d.ts.map +1 -0
- package/dist/index63.d.cts +23 -0
- package/dist/index63.d.cts.map +1 -0
- package/dist/index63.d.ts +23 -0
- package/dist/index63.d.ts.map +1 -0
- package/dist/index64.d.cts +48 -0
- package/dist/index64.d.cts.map +1 -0
- package/dist/index64.d.ts +48 -0
- package/dist/index64.d.ts.map +1 -0
- package/dist/index65.d.cts +25 -0
- package/dist/index65.d.cts.map +1 -0
- package/dist/index65.d.ts +25 -0
- package/dist/index65.d.ts.map +1 -0
- package/dist/index66.d.cts +19 -0
- package/dist/index66.d.cts.map +1 -0
- package/dist/index66.d.ts +19 -0
- package/dist/index66.d.ts.map +1 -0
- package/dist/index67.d.cts +37 -0
- package/dist/index67.d.cts.map +1 -0
- package/dist/index67.d.ts +37 -0
- package/dist/index67.d.ts.map +1 -0
- package/dist/index68.d.cts +36 -0
- package/dist/index68.d.cts.map +1 -0
- package/dist/index68.d.ts +36 -0
- package/dist/index68.d.ts.map +1 -0
- package/dist/index69.d.cts +69 -0
- package/dist/index69.d.ts +69 -0
- package/dist/index7.d.cts +46 -0
- package/dist/index7.d.cts.map +1 -0
- package/dist/index7.d.ts +46 -0
- package/dist/index7.d.ts.map +1 -0
- package/dist/index70.d.cts +242 -0
- package/dist/index70.d.cts.map +1 -0
- package/dist/index70.d.ts +242 -0
- package/dist/index70.d.ts.map +1 -0
- package/dist/index8.d.cts +26 -0
- package/dist/index8.d.cts.map +1 -0
- package/dist/index8.d.ts +26 -0
- package/dist/index8.d.ts.map +1 -0
- package/dist/index9.d.cts +20 -0
- package/dist/index9.d.cts.map +1 -0
- package/dist/index9.d.ts +20 -0
- package/dist/index9.d.ts.map +1 -0
- package/dist/layouts/Container/index.cjs +39 -0
- package/dist/layouts/Container/index.cjs.map +1 -0
- package/dist/layouts/Container/index.d.cts +2 -0
- package/dist/layouts/Container/index.d.ts +2 -0
- package/dist/layouts/Container/index.js +38 -0
- package/dist/layouts/Container/index.js.map +1 -0
- package/dist/layouts/PageBackground/index.cjs +22 -0
- package/dist/layouts/PageBackground/index.cjs.map +1 -0
- package/dist/layouts/PageBackground/index.d.cts +2 -0
- package/dist/layouts/PageBackground/index.d.ts +2 -0
- package/dist/layouts/PageBackground/index.js +21 -0
- package/dist/layouts/PageBackground/index.js.map +1 -0
- package/dist/{Stack.cjs → layouts/Stack/index.cjs} +7 -15
- package/dist/layouts/Stack/index.cjs.map +1 -0
- package/dist/layouts/Stack/index.d.cts +2 -0
- package/dist/layouts/Stack/index.d.ts +2 -0
- package/dist/{Stack.js → layouts/Stack/index.js} +4 -3
- package/dist/layouts/Stack/index.js.map +1 -0
- package/dist/layouts/TwoColumn/index.cjs +51 -0
- package/dist/layouts/TwoColumn/index.cjs.map +1 -0
- package/dist/layouts/TwoColumn/index.d.cts +2 -0
- package/dist/layouts/TwoColumn/index.d.ts +2 -0
- package/dist/layouts/TwoColumn/index.js +48 -0
- package/dist/layouts/TwoColumn/index.js.map +1 -0
- package/dist/layouts/index.cjs +13 -100
- package/dist/layouts/index.d.cts +5 -76
- package/dist/layouts/index.d.ts +5 -76
- package/dist/layouts/index.js +4 -91
- package/dist/patterns/DataTable/index.cjs +114 -0
- package/dist/patterns/DataTable/index.cjs.map +1 -0
- package/dist/patterns/DataTable/index.d.cts +43 -0
- package/dist/patterns/DataTable/index.d.cts.map +1 -0
- package/dist/patterns/DataTable/index.d.ts +43 -0
- package/dist/patterns/DataTable/index.d.ts.map +1 -0
- package/dist/patterns/DataTable/index.js +110 -0
- package/dist/patterns/DataTable/index.js.map +1 -0
- package/dist/patterns/Footer/index.cjs +76 -0
- package/dist/patterns/Footer/index.cjs.map +1 -0
- package/dist/patterns/Footer/index.d.cts +54 -0
- package/dist/patterns/Footer/index.d.cts.map +1 -0
- package/dist/patterns/Footer/index.d.ts +54 -0
- package/dist/patterns/Footer/index.d.ts.map +1 -0
- package/dist/patterns/Footer/index.js +70 -0
- package/dist/patterns/Footer/index.js.map +1 -0
- package/dist/patterns/Header/index.cjs +17 -0
- package/dist/patterns/Header/index.d.cts +2 -0
- package/dist/patterns/Header/index.d.ts +2 -0
- package/dist/patterns/Header/index.js +2 -0
- package/dist/patterns/MediaObject/index.cjs +108 -0
- package/dist/patterns/MediaObject/index.cjs.map +1 -0
- package/dist/patterns/MediaObject/index.d.cts +71 -0
- package/dist/patterns/MediaObject/index.d.cts.map +1 -0
- package/dist/patterns/MediaObject/index.d.ts +71 -0
- package/dist/patterns/MediaObject/index.d.ts.map +1 -0
- package/dist/patterns/MediaObject/index.js +99 -0
- package/dist/patterns/MediaObject/index.js.map +1 -0
- package/dist/patterns/SectionCard/index.cjs +35 -0
- package/dist/patterns/SectionCard/index.cjs.map +1 -0
- package/dist/patterns/SectionCard/index.d.cts +21 -0
- package/dist/patterns/SectionCard/index.d.cts.map +1 -0
- package/dist/patterns/SectionCard/index.d.ts +21 -0
- package/dist/patterns/SectionCard/index.d.ts.map +1 -0
- package/dist/patterns/SectionCard/index.js +34 -0
- package/dist/patterns/SectionCard/index.js.map +1 -0
- package/dist/patterns/SectionHeading/index.cjs +44 -0
- package/dist/patterns/SectionHeading/index.cjs.map +1 -0
- package/dist/patterns/SectionHeading/index.d.cts +37 -0
- package/dist/patterns/SectionHeading/index.d.cts.map +1 -0
- package/dist/patterns/SectionHeading/index.d.ts +37 -0
- package/dist/patterns/SectionHeading/index.d.ts.map +1 -0
- package/dist/patterns/SectionHeading/index.js +43 -0
- package/dist/patterns/SectionHeading/index.js.map +1 -0
- package/dist/patterns/index.cjs +40 -1124
- package/dist/patterns/index.d.cts +7 -410
- package/dist/patterns/index.d.ts +7 -410
- package/dist/patterns/index.js +6 -1088
- package/dist/primitives/Accordion/index.cjs +54 -0
- package/dist/primitives/Accordion/index.cjs.map +1 -0
- package/dist/primitives/Accordion/index.d.cts +2 -0
- package/dist/primitives/Accordion/index.d.ts +2 -0
- package/dist/primitives/Accordion/index.js +50 -0
- package/dist/primitives/Accordion/index.js.map +1 -0
- package/dist/primitives/Alert/index.cjs +61 -0
- package/dist/primitives/Alert/index.cjs.map +1 -0
- package/dist/primitives/Alert/index.d.cts +2 -0
- package/dist/primitives/Alert/index.d.ts +2 -0
- package/dist/primitives/Alert/index.js +57 -0
- package/dist/primitives/Alert/index.js.map +1 -0
- package/dist/primitives/AlertDialog/index.cjs +102 -0
- package/dist/primitives/AlertDialog/index.cjs.map +1 -0
- package/dist/primitives/AlertDialog/index.d.cts +2 -0
- package/dist/primitives/AlertDialog/index.d.ts +2 -0
- package/dist/primitives/AlertDialog/index.js +90 -0
- package/dist/primitives/AlertDialog/index.js.map +1 -0
- package/dist/primitives/AspectRatio/index.cjs +15 -0
- package/dist/primitives/AspectRatio/index.cjs.map +1 -0
- package/dist/primitives/AspectRatio/index.d.cts +2 -0
- package/dist/primitives/AspectRatio/index.d.ts +2 -0
- package/dist/primitives/AspectRatio/index.js +14 -0
- package/dist/primitives/AspectRatio/index.js.map +1 -0
- package/dist/primitives/Avatar/index.cjs +64 -0
- package/dist/primitives/Avatar/index.cjs.map +1 -0
- package/dist/primitives/Avatar/index.d.cts +2 -0
- package/dist/primitives/Avatar/index.d.ts +2 -0
- package/dist/primitives/Avatar/index.js +58 -0
- package/dist/primitives/Avatar/index.js.map +1 -0
- package/dist/primitives/Badge/index.cjs +44 -0
- package/dist/primitives/Badge/index.cjs.map +1 -0
- package/dist/primitives/Badge/index.d.cts +2 -0
- package/dist/primitives/Badge/index.d.ts +2 -0
- package/dist/primitives/Badge/index.js +43 -0
- package/dist/primitives/Badge/index.js.map +1 -0
- package/dist/primitives/Breadcrumb/index.cjs +82 -0
- package/dist/primitives/Breadcrumb/index.cjs.map +1 -0
- package/dist/primitives/Breadcrumb/index.d.cts +2 -0
- package/dist/primitives/Breadcrumb/index.d.ts +2 -0
- package/dist/primitives/Breadcrumb/index.js +75 -0
- package/dist/primitives/Breadcrumb/index.js.map +1 -0
- package/dist/primitives/Button/index.cjs +61 -0
- package/dist/primitives/Button/index.cjs.map +1 -0
- package/dist/primitives/Button/index.d.cts +2 -0
- package/dist/primitives/Button/index.d.ts +2 -0
- package/dist/primitives/Button/index.js +60 -0
- package/dist/primitives/Button/index.js.map +1 -0
- package/dist/primitives/ButtonGroup/index.cjs +46 -0
- package/dist/primitives/ButtonGroup/index.cjs.map +1 -0
- package/dist/primitives/ButtonGroup/index.d.cts +2 -0
- package/dist/primitives/ButtonGroup/index.d.ts +2 -0
- package/dist/primitives/ButtonGroup/index.js +43 -0
- package/dist/primitives/ButtonGroup/index.js.map +1 -0
- package/dist/primitives/Calendar/index.cjs +112 -0
- package/dist/primitives/Calendar/index.cjs.map +1 -0
- package/dist/primitives/Calendar/index.d.cts +2 -0
- package/dist/primitives/Calendar/index.d.ts +2 -0
- package/dist/primitives/Calendar/index.js +108 -0
- package/dist/primitives/Calendar/index.js.map +1 -0
- package/dist/primitives/Card/index.cjs +128 -0
- package/dist/primitives/Card/index.cjs.map +1 -0
- package/dist/primitives/Card/index.d.cts +2 -0
- package/dist/primitives/Card/index.d.ts +2 -0
- package/dist/primitives/Card/index.js +121 -0
- package/dist/primitives/Card/index.js.map +1 -0
- package/dist/primitives/Carousel/index.cjs +146 -0
- package/dist/primitives/Carousel/index.cjs.map +1 -0
- package/dist/primitives/Carousel/index.d.cts +2 -0
- package/dist/primitives/Carousel/index.d.ts +2 -0
- package/dist/primitives/Carousel/index.js +138 -0
- package/dist/primitives/Carousel/index.js.map +1 -0
- package/dist/primitives/Chart/index.cjs +162 -0
- package/dist/primitives/Chart/index.cjs.map +1 -0
- package/dist/primitives/Chart/index.d.cts +2 -0
- package/dist/primitives/Chart/index.d.ts +2 -0
- package/dist/primitives/Chart/index.js +153 -0
- package/dist/primitives/Chart/index.js.map +1 -0
- package/dist/primitives/Checkbox/index.cjs +53 -0
- package/dist/primitives/Checkbox/index.cjs.map +1 -0
- package/dist/primitives/Checkbox/index.d.cts +2 -0
- package/dist/primitives/Checkbox/index.d.ts +2 -0
- package/dist/primitives/Checkbox/index.js +51 -0
- package/dist/primitives/Checkbox/index.js.map +1 -0
- package/dist/primitives/CheckboxTree/index.cjs +106 -0
- package/dist/primitives/CheckboxTree/index.cjs.map +1 -0
- package/dist/primitives/CheckboxTree/index.d.cts +2 -0
- package/dist/primitives/CheckboxTree/index.d.ts +2 -0
- package/dist/primitives/CheckboxTree/index.js +103 -0
- package/dist/primitives/CheckboxTree/index.js.map +1 -0
- package/dist/primitives/Collapsible/index.cjs +31 -0
- package/dist/primitives/Collapsible/index.cjs.map +1 -0
- package/dist/primitives/Collapsible/index.d.cts +2 -0
- package/dist/primitives/Collapsible/index.d.ts +2 -0
- package/dist/primitives/Collapsible/index.js +28 -0
- package/dist/primitives/Collapsible/index.js.map +1 -0
- package/dist/primitives/Command/index.cjs +104 -0
- package/dist/primitives/Command/index.cjs.map +1 -0
- package/dist/primitives/Command/index.d.cts +2 -0
- package/dist/primitives/Command/index.d.ts +2 -0
- package/dist/primitives/Command/index.js +95 -0
- package/dist/primitives/Command/index.js.map +1 -0
- package/dist/primitives/ContextMenu/index.cjs +152 -0
- package/dist/primitives/ContextMenu/index.cjs.map +1 -0
- package/dist/primitives/ContextMenu/index.d.cts +2 -0
- package/dist/primitives/ContextMenu/index.d.ts +2 -0
- package/dist/primitives/ContextMenu/index.js +137 -0
- package/dist/primitives/ContextMenu/index.js.map +1 -0
- package/dist/primitives/Credits/index.cjs +39 -0
- package/dist/primitives/Credits/index.cjs.map +1 -0
- package/dist/primitives/Credits/index.d.cts +2 -0
- package/dist/primitives/Credits/index.d.ts +2 -0
- package/dist/primitives/Credits/index.js +38 -0
- package/dist/primitives/Credits/index.js.map +1 -0
- package/dist/primitives/Dialog/index.cjs +121 -0
- package/dist/primitives/Dialog/index.cjs.map +1 -0
- package/dist/primitives/Dialog/index.d.cts +2 -0
- package/dist/primitives/Dialog/index.d.ts +2 -0
- package/dist/primitives/Dialog/index.js +111 -0
- package/dist/primitives/Dialog/index.js.map +1 -0
- package/dist/primitives/Drawer/index.cjs +98 -0
- package/dist/primitives/Drawer/index.cjs.map +1 -0
- package/dist/primitives/Drawer/index.d.cts +2 -0
- package/dist/primitives/Drawer/index.d.ts +2 -0
- package/dist/primitives/Drawer/index.js +88 -0
- package/dist/primitives/Drawer/index.js.map +1 -0
- package/dist/primitives/DropdownMenu/index.cjs +153 -0
- package/dist/primitives/DropdownMenu/index.cjs.map +1 -0
- package/dist/primitives/DropdownMenu/index.d.cts +2 -0
- package/dist/primitives/DropdownMenu/index.d.ts +2 -0
- package/dist/primitives/DropdownMenu/index.js +138 -0
- package/dist/primitives/DropdownMenu/index.js.map +1 -0
- package/dist/primitives/Empty/index.cjs +84 -0
- package/dist/primitives/Empty/index.cjs.map +1 -0
- package/dist/primitives/Empty/index.d.cts +2 -0
- package/dist/primitives/Empty/index.d.ts +2 -0
- package/dist/primitives/Empty/index.js +77 -0
- package/dist/primitives/Empty/index.js.map +1 -0
- package/dist/primitives/Field/index.cjs +139 -0
- package/dist/primitives/Field/index.cjs.map +1 -0
- package/dist/primitives/Field/index.d.cts +2 -0
- package/dist/primitives/Field/index.d.ts +2 -0
- package/dist/primitives/Field/index.js +129 -0
- package/dist/primitives/Field/index.js.map +1 -0
- package/dist/primitives/Form/index.cjs +104 -0
- package/dist/primitives/Form/index.cjs.map +1 -0
- package/dist/primitives/Form/index.d.cts +2 -0
- package/dist/primitives/Form/index.d.ts +2 -0
- package/dist/primitives/Form/index.js +94 -0
- package/dist/primitives/Form/index.js.map +1 -0
- package/dist/primitives/Heading/index.cjs +53 -0
- package/dist/primitives/Heading/index.cjs.map +1 -0
- package/dist/primitives/Heading/index.d.cts +2 -0
- package/dist/primitives/Heading/index.d.ts +2 -0
- package/dist/primitives/Heading/index.js +52 -0
- package/dist/primitives/Heading/index.js.map +1 -0
- package/dist/primitives/HoverCard/index.cjs +38 -0
- package/dist/primitives/HoverCard/index.cjs.map +1 -0
- package/dist/primitives/HoverCard/index.d.cts +2 -0
- package/dist/primitives/HoverCard/index.d.ts +2 -0
- package/dist/primitives/HoverCard/index.js +35 -0
- package/dist/primitives/HoverCard/index.js.map +1 -0
- package/dist/primitives/Icon/index.cjs +4 -0
- package/dist/primitives/Icon/index.d.cts +2 -0
- package/dist/primitives/Icon/index.d.ts +2 -0
- package/dist/primitives/Icon/index.js +2 -0
- package/dist/primitives/InfoBanner/index.cjs +79 -0
- package/dist/primitives/InfoBanner/index.cjs.map +1 -0
- package/dist/primitives/InfoBanner/index.d.cts +2 -0
- package/dist/primitives/InfoBanner/index.d.ts +2 -0
- package/dist/primitives/InfoBanner/index.js +78 -0
- package/dist/primitives/InfoBanner/index.js.map +1 -0
- package/dist/primitives/Input/index.cjs +39 -0
- package/dist/primitives/Input/index.cjs.map +1 -0
- package/dist/primitives/Input/index.d.cts +2 -0
- package/dist/primitives/Input/index.d.ts +2 -0
- package/dist/primitives/Input/index.js +38 -0
- package/dist/primitives/Input/index.js.map +1 -0
- package/dist/primitives/InputGroup/index.cjs +91 -0
- package/dist/primitives/InputGroup/index.cjs.map +1 -0
- package/dist/primitives/InputGroup/index.d.cts +2 -0
- package/dist/primitives/InputGroup/index.d.ts +2 -0
- package/dist/primitives/InputGroup/index.js +85 -0
- package/dist/primitives/InputGroup/index.js.map +1 -0
- package/dist/primitives/InputOtp/index.cjs +80 -0
- package/dist/primitives/InputOtp/index.cjs.map +1 -0
- package/dist/primitives/InputOtp/index.d.cts +2 -0
- package/dist/primitives/InputOtp/index.d.ts +2 -0
- package/dist/primitives/InputOtp/index.js +74 -0
- package/dist/primitives/InputOtp/index.js.map +1 -0
- package/dist/primitives/Item/index.cjs +137 -0
- package/dist/primitives/Item/index.cjs.map +1 -0
- package/dist/primitives/Item/index.d.cts +2 -0
- package/dist/primitives/Item/index.d.ts +2 -0
- package/dist/primitives/Item/index.js +127 -0
- package/dist/primitives/Item/index.js.map +1 -0
- package/dist/primitives/Kbd/index.cjs +25 -0
- package/dist/primitives/Kbd/index.cjs.map +1 -0
- package/dist/primitives/Kbd/index.d.cts +2 -0
- package/dist/primitives/Kbd/index.d.ts +2 -0
- package/dist/primitives/Kbd/index.js +23 -0
- package/dist/primitives/Kbd/index.js.map +1 -0
- package/dist/primitives/Label/index.cjs +18 -0
- package/dist/primitives/Label/index.cjs.map +1 -0
- package/dist/primitives/Label/index.d.cts +2 -0
- package/dist/primitives/Label/index.d.ts +2 -0
- package/dist/primitives/Label/index.js +17 -0
- package/dist/primitives/Label/index.js.map +1 -0
- package/dist/primitives/Link/index.cjs +38 -0
- package/dist/primitives/Link/index.cjs.map +1 -0
- package/dist/primitives/Link/index.d.cts +2 -0
- package/dist/primitives/Link/index.d.ts +2 -0
- package/dist/primitives/Link/index.js +37 -0
- package/dist/primitives/Link/index.js.map +1 -0
- package/dist/primitives/Logo/index.cjs +3 -0
- package/dist/primitives/Logo/index.d.cts +2 -0
- package/dist/primitives/Logo/index.d.ts +2 -0
- package/dist/primitives/Logo/index.js +2 -0
- package/dist/primitives/Menubar/index.cjs +165 -0
- package/dist/primitives/Menubar/index.cjs.map +1 -0
- package/dist/primitives/Menubar/index.d.cts +2 -0
- package/dist/primitives/Menubar/index.d.ts +2 -0
- package/dist/primitives/Menubar/index.js +149 -0
- package/dist/primitives/Menubar/index.js.map +1 -0
- package/dist/primitives/NativeSelect/index.cjs +40 -0
- package/dist/primitives/NativeSelect/index.cjs.map +1 -0
- package/dist/primitives/NativeSelect/index.d.cts +2 -0
- package/dist/primitives/NativeSelect/index.d.ts +2 -0
- package/dist/primitives/NativeSelect/index.js +39 -0
- package/dist/primitives/NativeSelect/index.js.map +1 -0
- package/dist/primitives/NavRail/index.cjs +195 -0
- package/dist/primitives/NavRail/index.cjs.map +1 -0
- package/dist/primitives/NavRail/index.d.cts +2 -0
- package/dist/primitives/NavRail/index.d.ts +2 -0
- package/dist/primitives/NavRail/index.js +185 -0
- package/dist/primitives/NavRail/index.js.map +1 -0
- package/dist/primitives/NavigationMenu/index.cjs +98 -0
- package/dist/primitives/NavigationMenu/index.cjs.map +1 -0
- package/dist/primitives/NavigationMenu/index.d.cts +2 -0
- package/dist/primitives/NavigationMenu/index.d.ts +2 -0
- package/dist/primitives/NavigationMenu/index.js +89 -0
- package/dist/primitives/NavigationMenu/index.js.map +1 -0
- package/dist/primitives/Pagination/index.cjs +93 -0
- package/dist/primitives/Pagination/index.cjs.map +1 -0
- package/dist/primitives/Pagination/index.d.cts +2 -0
- package/dist/primitives/Pagination/index.d.ts +2 -0
- package/dist/primitives/Pagination/index.js +86 -0
- package/dist/primitives/Pagination/index.js.map +1 -0
- package/dist/primitives/Popover/index.cjs +70 -0
- package/dist/primitives/Popover/index.cjs.map +1 -0
- package/dist/primitives/Popover/index.d.cts +2 -0
- package/dist/primitives/Popover/index.d.ts +2 -0
- package/dist/primitives/Popover/index.js +63 -0
- package/dist/primitives/Popover/index.js.map +1 -0
- package/dist/primitives/Progress/index.cjs +44 -0
- package/dist/primitives/Progress/index.cjs.map +1 -0
- package/dist/primitives/Progress/index.d.cts +2 -0
- package/dist/primitives/Progress/index.d.ts +2 -0
- package/dist/primitives/Progress/index.js +43 -0
- package/dist/primitives/Progress/index.js.map +1 -0
- package/dist/primitives/RadioGroup/index.cjs +65 -0
- package/dist/primitives/RadioGroup/index.cjs.map +1 -0
- package/dist/primitives/RadioGroup/index.d.cts +2 -0
- package/dist/primitives/RadioGroup/index.d.ts +2 -0
- package/dist/primitives/RadioGroup/index.js +62 -0
- package/dist/primitives/RadioGroup/index.js.map +1 -0
- package/dist/primitives/Resizable/index.cjs +41 -0
- package/dist/primitives/Resizable/index.cjs.map +1 -0
- package/dist/primitives/Resizable/index.d.cts +2 -0
- package/dist/primitives/Resizable/index.d.ts +2 -0
- package/dist/primitives/Resizable/index.js +36 -0
- package/dist/primitives/Resizable/index.js.map +1 -0
- package/dist/primitives/ScrollArea/index.cjs +40 -0
- package/dist/primitives/ScrollArea/index.cjs.map +1 -0
- package/dist/primitives/ScrollArea/index.d.cts +2 -0
- package/dist/primitives/ScrollArea/index.d.ts +2 -0
- package/dist/primitives/ScrollArea/index.js +38 -0
- package/dist/primitives/ScrollArea/index.js.map +1 -0
- package/dist/primitives/Select/index.cjs +126 -0
- package/dist/primitives/Select/index.cjs.map +1 -0
- package/dist/primitives/Select/index.d.cts +2 -0
- package/dist/primitives/Select/index.d.ts +2 -0
- package/dist/primitives/Select/index.js +116 -0
- package/dist/primitives/Select/index.js.map +1 -0
- package/dist/primitives/Separator/index.cjs +25 -0
- package/dist/primitives/Separator/index.cjs.map +1 -0
- package/dist/primitives/Separator/index.d.cts +2 -0
- package/dist/primitives/Separator/index.d.ts +2 -0
- package/dist/primitives/Separator/index.js +24 -0
- package/dist/primitives/Separator/index.js.map +1 -0
- package/dist/primitives/Sheet/index.cjs +107 -0
- package/dist/primitives/Sheet/index.cjs.map +1 -0
- package/dist/primitives/Sheet/index.d.cts +2 -0
- package/dist/primitives/Sheet/index.d.ts +2 -0
- package/dist/primitives/Sheet/index.js +99 -0
- package/dist/primitives/Sheet/index.js.map +1 -0
- package/dist/primitives/Sidebar/index.cjs +26 -0
- package/dist/primitives/Sidebar/index.d.cts +2 -0
- package/dist/primitives/Sidebar/index.d.ts +2 -0
- package/dist/primitives/Sidebar/index.js +2 -0
- package/dist/primitives/Skeleton/index.cjs +43 -0
- package/dist/primitives/Skeleton/index.cjs.map +1 -0
- package/dist/primitives/Skeleton/index.d.cts +2 -0
- package/dist/primitives/Skeleton/index.d.ts +2 -0
- package/dist/primitives/Skeleton/index.js +39 -0
- package/dist/primitives/Skeleton/index.js.map +1 -0
- package/dist/primitives/Slider/index.cjs +46 -0
- package/dist/primitives/Slider/index.cjs.map +1 -0
- package/dist/primitives/Slider/index.d.cts +2 -0
- package/dist/primitives/Slider/index.d.ts +2 -0
- package/dist/primitives/Slider/index.js +43 -0
- package/dist/primitives/Slider/index.js.map +1 -0
- package/dist/primitives/Sonner/index.cjs +42 -0
- package/dist/primitives/Sonner/index.cjs.map +1 -0
- package/dist/primitives/Sonner/index.d.cts +2 -0
- package/dist/primitives/Sonner/index.d.ts +2 -0
- package/dist/primitives/Sonner/index.js +41 -0
- package/dist/primitives/Sonner/index.js.map +1 -0
- package/dist/primitives/Spinner/index.cjs +19 -0
- package/dist/primitives/Spinner/index.cjs.map +1 -0
- package/dist/primitives/Spinner/index.d.cts +2 -0
- package/dist/primitives/Spinner/index.d.ts +2 -0
- package/dist/primitives/Spinner/index.js +18 -0
- package/dist/primitives/Spinner/index.js.map +1 -0
- package/dist/primitives/Switch/index.cjs +71 -0
- package/dist/primitives/Switch/index.cjs.map +1 -0
- package/dist/primitives/Switch/index.d.cts +2 -0
- package/dist/primitives/Switch/index.d.ts +2 -0
- package/dist/primitives/Switch/index.js +68 -0
- package/dist/primitives/Switch/index.js.map +1 -0
- package/dist/primitives/Table/index.cjs +84 -0
- package/dist/primitives/Table/index.cjs.map +1 -0
- package/dist/primitives/Table/index.d.cts +2 -0
- package/dist/primitives/Table/index.d.ts +2 -0
- package/dist/primitives/Table/index.js +76 -0
- package/dist/primitives/Table/index.js.map +1 -0
- package/dist/primitives/Tabs/index.cjs +267 -0
- package/dist/primitives/Tabs/index.cjs.map +1 -0
- package/dist/primitives/Tabs/index.d.cts +2 -0
- package/dist/primitives/Tabs/index.d.ts +2 -0
- package/dist/primitives/Tabs/index.js +258 -0
- package/dist/primitives/Tabs/index.js.map +1 -0
- package/dist/primitives/Text/index.cjs +64 -0
- package/dist/primitives/Text/index.cjs.map +1 -0
- package/dist/primitives/Text/index.d.cts +2 -0
- package/dist/primitives/Text/index.d.ts +2 -0
- package/dist/primitives/Text/index.js +63 -0
- package/dist/primitives/Text/index.js.map +1 -0
- package/dist/primitives/Textarea/index.cjs +24 -0
- package/dist/primitives/Textarea/index.cjs.map +1 -0
- package/dist/primitives/Textarea/index.d.cts +2 -0
- package/dist/primitives/Textarea/index.d.ts +2 -0
- package/dist/primitives/Textarea/index.js +23 -0
- package/dist/primitives/Textarea/index.js.map +1 -0
- package/dist/primitives/ThemeProvider/index.cjs +93 -0
- package/dist/primitives/ThemeProvider/index.cjs.map +1 -0
- package/dist/primitives/ThemeProvider/index.d.cts +2 -0
- package/dist/primitives/ThemeProvider/index.d.ts +2 -0
- package/dist/primitives/ThemeProvider/index.js +88 -0
- package/dist/primitives/ThemeProvider/index.js.map +1 -0
- package/dist/primitives/Toggle/index.cjs +59 -0
- package/dist/primitives/Toggle/index.cjs.map +1 -0
- package/dist/primitives/Toggle/index.d.cts +2 -0
- package/dist/primitives/Toggle/index.d.ts +2 -0
- package/dist/primitives/Toggle/index.js +58 -0
- package/dist/primitives/Toggle/index.js.map +1 -0
- package/dist/primitives/ToggleGroup/index.cjs +65 -0
- package/dist/primitives/ToggleGroup/index.cjs.map +1 -0
- package/dist/primitives/ToggleGroup/index.d.cts +2 -0
- package/dist/primitives/ToggleGroup/index.d.ts +2 -0
- package/dist/primitives/ToggleGroup/index.js +61 -0
- package/dist/primitives/ToggleGroup/index.js.map +1 -0
- package/dist/primitives/Tooltip/index.cjs +47 -0
- package/dist/primitives/Tooltip/index.cjs.map +1 -0
- package/dist/primitives/Tooltip/index.d.cts +2 -0
- package/dist/primitives/Tooltip/index.d.ts +2 -0
- package/dist/primitives/Tooltip/index.js +43 -0
- package/dist/primitives/Tooltip/index.js.map +1 -0
- package/dist/primitives/index.cjs +398 -335
- package/dist/primitives/index.d.cts +65 -3
- package/dist/primitives/index.d.ts +65 -3
- package/dist/primitives/index.js +65 -3
- package/dist/styles/base.css +70 -0
- package/dist/styles/semantic.css +62 -2
- package/dist/styles/theme.css +12 -0
- package/package.json +21 -2
- package/dist/Stack.cjs.map +0 -1
- package/dist/Stack.js.map +0 -1
- package/dist/ThemeProvider.cjs.map +0 -1
- package/dist/ThemeProvider.d.cts +0 -85
- package/dist/ThemeProvider.d.cts.map +0 -1
- package/dist/ThemeProvider.d.ts +0 -85
- package/dist/ThemeProvider.d.ts.map +0 -1
- package/dist/ThemeProvider.js.map +0 -1
- package/dist/layouts/index.cjs.map +0 -1
- package/dist/layouts/index.d.cts.map +0 -1
- package/dist/layouts/index.d.ts.map +0 -1
- package/dist/layouts/index.js.map +0 -1
- package/dist/patterns/index.cjs.map +0 -1
- package/dist/patterns/index.d.cts.map +0 -1
- package/dist/patterns/index.d.ts.map +0 -1
- package/dist/patterns/index.js.map +0 -1
- package/dist/primitives.cjs +0 -6979
- package/dist/primitives.cjs.map +0 -1
- package/dist/primitives.js +0 -5357
- package/dist/primitives.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js +0 -27
- package/dist/utils.js.map +0 -1
package/dist/patterns/index.cjs
CHANGED
|
@@ -1,1125 +1,41 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
43
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.TableCell, { children: (0, _tanstack_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
44
|
-
}, row.id)) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.TableRow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.TableCell, {
|
|
45
|
-
colSpan: columns.length,
|
|
46
|
-
className: "h-24 text-center text-muted-foreground",
|
|
47
|
-
children: "No results."
|
|
48
|
-
}) }) })]
|
|
49
|
-
})
|
|
50
|
-
}), enablePagination ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
51
|
-
className: "flex items-center justify-between gap-4",
|
|
52
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
53
|
-
className: "text-sm text-muted-foreground",
|
|
54
|
-
"data-slot": "data-table-selection",
|
|
55
|
-
children: [
|
|
56
|
-
table.getFilteredSelectedRowModel().rows.length,
|
|
57
|
-
" of",
|
|
58
|
-
" ",
|
|
59
|
-
table.getFilteredRowModel().rows.length,
|
|
60
|
-
" row(s) selected."
|
|
61
|
-
]
|
|
62
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
63
|
-
className: "flex items-center gap-2",
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
66
|
-
className: "text-sm text-muted-foreground",
|
|
67
|
-
children: [
|
|
68
|
-
"Page ",
|
|
69
|
-
table.getState().pagination.pageIndex + 1,
|
|
70
|
-
" of ",
|
|
71
|
-
table.getPageCount() || 1
|
|
72
|
-
]
|
|
73
|
-
}),
|
|
74
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Button, {
|
|
75
|
-
variant: "outline",
|
|
76
|
-
size: "sm",
|
|
77
|
-
onClick: () => table.previousPage(),
|
|
78
|
-
disabled: !table.getCanPreviousPage(),
|
|
79
|
-
children: "Previous"
|
|
80
|
-
}),
|
|
81
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Button, {
|
|
82
|
-
variant: "outline",
|
|
83
|
-
size: "sm",
|
|
84
|
-
onClick: () => table.nextPage(),
|
|
85
|
-
disabled: !table.getCanNextPage(),
|
|
86
|
-
children: "Next"
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
})]
|
|
90
|
-
}) : null]
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function DataTableColumnHeader({ column, title, className }) {
|
|
94
|
-
if (!column.getCanSort()) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
95
|
-
className,
|
|
96
|
-
children: title
|
|
97
|
-
});
|
|
98
|
-
const sorted = column.getIsSorted();
|
|
99
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.Button, {
|
|
100
|
-
variant: "ghost",
|
|
101
|
-
size: "sm",
|
|
102
|
-
className: require_utils.cn("-ml-2 h-8", className),
|
|
103
|
-
onClick: () => column.toggleSorting(sorted === "asc"),
|
|
104
|
-
children: [title, sorted === "asc" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUpIcon, {}) : sorted === "desc" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowDownIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronsUpDownIcon, {})]
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/patterns/Footer/Footer.tsx
|
|
109
|
-
const footerBackgrounds = {
|
|
110
|
-
none: "",
|
|
111
|
-
muted: "bg-muted",
|
|
112
|
-
glass: "bg-[var(--glass-light)] backdrop-blur-[var(--glass-blur)]"
|
|
113
|
-
};
|
|
114
|
-
function Footer({ className, bordered = false, background = "none", ...props }) {
|
|
115
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
|
|
116
|
-
"data-slot": "footer",
|
|
117
|
-
"data-background": background,
|
|
118
|
-
className: require_utils.cn("grid w-full grid-cols-1 gap-3 px-4 py-3 text-center md:grid-cols-3 md:items-center md:px-6", "text-[length:var(--paragraph-mini-font-size)] leading-[var(--paragraph-mini-line-height)]", footerBackgrounds[background], bordered && "border-t border-border", className),
|
|
119
|
-
...props
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function FooterStart({ className, ...props }) {
|
|
123
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
124
|
-
"data-slot": "footer-start",
|
|
125
|
-
className: require_utils.cn("flex items-center justify-center gap-2 md:justify-self-start md:text-left", className),
|
|
126
|
-
...props
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function FooterCenter({ className, ...props }) {
|
|
130
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
131
|
-
"data-slot": "footer-center",
|
|
132
|
-
className: require_utils.cn("flex items-center justify-center gap-2 md:justify-self-center", className),
|
|
133
|
-
...props
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function FooterEnd({ className, ...props }) {
|
|
137
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
138
|
-
"data-slot": "footer-end",
|
|
139
|
-
className: require_utils.cn("flex flex-wrap items-center justify-center gap-2 md:justify-end md:justify-self-end md:text-right", className),
|
|
140
|
-
...props
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
function FooterPoweredBy({ className, label = "Powered by", children, ...props }) {
|
|
144
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
145
|
-
"data-slot": "footer-powered-by",
|
|
146
|
-
className: require_utils.cn("flex items-center gap-2", className),
|
|
147
|
-
...props,
|
|
148
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Text, {
|
|
149
|
-
as: "span",
|
|
150
|
-
size: "small",
|
|
151
|
-
variant: "muted",
|
|
152
|
-
children: label
|
|
153
|
-
}), children]
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
function FooterSeparator({ className, ...props }) {
|
|
157
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
158
|
-
"data-slot": "footer-separator",
|
|
159
|
-
"aria-hidden": "true",
|
|
160
|
-
className: require_utils.cn("select-none text-border", className),
|
|
161
|
-
...props,
|
|
162
|
-
children: "|"
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region src/patterns/Header/project-tree.ts
|
|
167
|
-
/** True when a node with the given id exists anywhere in the tree. */
|
|
168
|
-
function nodeExistsInTree(tree, id) {
|
|
169
|
-
return tree.some((node) => node.id === id || nodeExistsInTree(node.children, id));
|
|
170
|
-
}
|
|
171
|
-
/** Name of the node with the given id, or undefined. */
|
|
172
|
-
function findProjectName(tree, id) {
|
|
173
|
-
for (const node of tree) {
|
|
174
|
-
if (node.id === id) return node.name;
|
|
175
|
-
const found = findProjectName(node.children, id);
|
|
176
|
-
if (found) return found;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
/** Filter the tree to nodes matching `term`, preserving ancestors of matches. */
|
|
180
|
-
function filterTree(nodes, term) {
|
|
181
|
-
if (!term) return nodes;
|
|
182
|
-
const lower = term.toLowerCase();
|
|
183
|
-
return nodes.flatMap((node) => {
|
|
184
|
-
if (node.name.toLowerCase().includes(lower)) return [node];
|
|
185
|
-
const children = filterTree(node.children, term);
|
|
186
|
-
return children.length > 0 ? [{
|
|
187
|
-
...node,
|
|
188
|
-
children
|
|
189
|
-
}] : [];
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region src/patterns/Header/ProjectPicker.tsx
|
|
194
|
-
const PILL$1 = "flex h-9 items-center gap-1.5 rounded-full border bg-card px-4 text-sm";
|
|
195
|
-
function ProjectPicker({ projectsTree, selectedProjectId, selectedProjectName, onSelect, projectLabel, projectPlaceholder, searchPlaceholder, emptyStateText, isLoading = false }) {
|
|
196
|
-
const [open, setOpen] = react.useState(false);
|
|
197
|
-
const [searchTerm, setSearchTerm] = react.useState("");
|
|
198
|
-
const [collapsedIds, setCollapsedIds] = react.useState(/* @__PURE__ */ new Set());
|
|
199
|
-
const toggleCollapse = (id) => setCollapsedIds((prev) => {
|
|
200
|
-
const next = new Set(prev);
|
|
201
|
-
if (next.has(id)) next.delete(id);
|
|
202
|
-
else next.add(id);
|
|
203
|
-
return next;
|
|
204
|
-
});
|
|
205
|
-
const handleSelect = (id) => {
|
|
206
|
-
onSelect(id);
|
|
207
|
-
setOpen(false);
|
|
208
|
-
};
|
|
209
|
-
const selectedName = selectedProjectId ? findProjectName(projectsTree, selectedProjectId) ?? selectedProjectName : void 0;
|
|
210
|
-
const filteredTree = filterTree(projectsTree, searchTerm);
|
|
211
|
-
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
212
|
-
"data-slot": "header-project-picker",
|
|
213
|
-
className: require_utils.cn(PILL$1, "min-w-44"),
|
|
214
|
-
children: [
|
|
215
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
216
|
-
className: "shrink-0 text-muted-foreground",
|
|
217
|
-
children: [projectLabel, ":"]
|
|
218
|
-
}),
|
|
219
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Skeleton, { className: "h-3 flex-1" }),
|
|
220
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "size-4 shrink-0 text-muted-foreground opacity-40" })
|
|
221
|
-
]
|
|
222
|
-
});
|
|
223
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.Popover, {
|
|
224
|
-
open,
|
|
225
|
-
onOpenChange: (next) => {
|
|
226
|
-
setOpen(next);
|
|
227
|
-
if (!next) setSearchTerm("");
|
|
228
|
-
},
|
|
229
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.PopoverTrigger, {
|
|
230
|
-
"data-slot": "header-project-picker",
|
|
231
|
-
className: require_utils.cn(PILL$1, "text-left transition-colors hover:border-ring/60"),
|
|
232
|
-
children: [
|
|
233
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
234
|
-
className: "shrink-0 text-muted-foreground",
|
|
235
|
-
children: [projectLabel, ":"]
|
|
236
|
-
}),
|
|
237
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
238
|
-
className: require_utils.cn("max-w-36 truncate", selectedName ? "font-medium" : "text-muted-foreground"),
|
|
239
|
-
children: selectedName ?? projectPlaceholder
|
|
240
|
-
}),
|
|
241
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "ml-1 size-4 shrink-0 text-muted-foreground" })
|
|
242
|
-
]
|
|
243
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.PopoverContent, {
|
|
244
|
-
align: "start",
|
|
245
|
-
className: "w-64 p-0",
|
|
246
|
-
role: "tree",
|
|
247
|
-
"aria-label": projectLabel,
|
|
248
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
249
|
-
className: "border-b p-2",
|
|
250
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
251
|
-
className: "relative",
|
|
252
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Search, { className: "absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Input, {
|
|
253
|
-
size: "sm",
|
|
254
|
-
className: "pl-8",
|
|
255
|
-
placeholder: searchPlaceholder,
|
|
256
|
-
value: searchTerm,
|
|
257
|
-
onChange: (e) => setSearchTerm(e.target.value)
|
|
258
|
-
})]
|
|
259
|
-
})
|
|
260
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
261
|
-
className: "max-h-64 overflow-y-auto py-1",
|
|
262
|
-
children: filteredTree.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
263
|
-
className: "px-4 py-2 text-sm text-muted-foreground",
|
|
264
|
-
children: emptyStateText
|
|
265
|
-
}) : filteredTree.map((node) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeNode, {
|
|
266
|
-
node,
|
|
267
|
-
depth: 0,
|
|
268
|
-
selectedId: selectedProjectId,
|
|
269
|
-
onSelect: handleSelect,
|
|
270
|
-
collapsedIds,
|
|
271
|
-
onToggleCollapse: toggleCollapse
|
|
272
|
-
}, node.id))
|
|
273
|
-
})]
|
|
274
|
-
})]
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
function TreeNode({ node, depth, selectedId, onSelect, collapsedIds, onToggleCollapse }) {
|
|
278
|
-
const isSelected = !node.isContextOnly && selectedId === node.id;
|
|
279
|
-
const isCollapsed = collapsedIds.has(node.id);
|
|
280
|
-
const hasChildren = node.children.length > 0;
|
|
281
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
282
|
-
role: "treeitem",
|
|
283
|
-
"aria-selected": node.isContextOnly ? void 0 : isSelected,
|
|
284
|
-
"aria-expanded": hasChildren ? !isCollapsed : void 0,
|
|
285
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
286
|
-
style: { paddingLeft: `${.75 + depth}rem` },
|
|
287
|
-
className: require_utils.cn("flex items-center gap-1 py-2 pr-3 text-sm transition-colors", node.isContextOnly ? "cursor-default text-muted-foreground" : "cursor-pointer hover:bg-accent", isSelected && "bg-accent font-medium"),
|
|
288
|
-
children: [
|
|
289
|
-
hasChildren ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
290
|
-
type: "button",
|
|
291
|
-
"aria-label": isCollapsed ? `Expand ${node.name}` : `Collapse ${node.name}`,
|
|
292
|
-
onClick: () => onToggleCollapse(node.id),
|
|
293
|
-
className: "shrink-0 text-muted-foreground hover:text-foreground",
|
|
294
|
-
children: isCollapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "size-3.5" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "size-3.5" })
|
|
295
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "inline-block w-3.5 shrink-0" }),
|
|
296
|
-
node.isContextOnly ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
297
|
-
className: "flex-1 text-left",
|
|
298
|
-
children: node.name
|
|
299
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
300
|
-
type: "button",
|
|
301
|
-
onClick: () => onSelect(node.id),
|
|
302
|
-
className: "flex-1 text-left",
|
|
303
|
-
children: node.name
|
|
304
|
-
}),
|
|
305
|
-
isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "ml-auto size-3.5 shrink-0 text-primary" })
|
|
306
|
-
]
|
|
307
|
-
}), !isCollapsed && hasChildren && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
308
|
-
role: "group",
|
|
309
|
-
children: node.children.map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeNode, {
|
|
310
|
-
node: child,
|
|
311
|
-
depth: depth + 1,
|
|
312
|
-
selectedId,
|
|
313
|
-
onSelect,
|
|
314
|
-
collapsedIds,
|
|
315
|
-
onToggleCollapse
|
|
316
|
-
}, child.id))
|
|
317
|
-
})]
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
//#endregion
|
|
321
|
-
//#region src/patterns/Header/labels.ts
|
|
322
|
-
/** Default UI strings. Spread-override via the Header `labels` prop if needed. */
|
|
323
|
-
const DEFAULT_LABELS = {
|
|
324
|
-
orgLabel: "Org",
|
|
325
|
-
projectLabel: "Project",
|
|
326
|
-
projectPlaceholder: "Select project...",
|
|
327
|
-
searchPlaceholder: "Search project",
|
|
328
|
-
emptyStateText: "No projects found",
|
|
329
|
-
profileMenuLabel: "Profile menu",
|
|
330
|
-
logoutLabel: "Logout",
|
|
331
|
-
overlayTitle: "Select a Project",
|
|
332
|
-
overlayDescription: "Choose a project to get started. You can change it anytime from the header."
|
|
333
|
-
};
|
|
334
|
-
//#endregion
|
|
335
|
-
//#region src/patterns/Header/api.ts
|
|
336
|
-
const PATHS = {
|
|
337
|
-
token: "/api/v1/studio-auth/sessions/token",
|
|
338
|
-
me: "/api/v1/onboarding/users/me",
|
|
339
|
-
logout: "/api/v1/studio-auth/sessions/logout",
|
|
340
|
-
projects: (clientId) => `/api/v1/onboarding/organization/${clientId}/projects`,
|
|
341
|
-
credits: "/save/api/v1/users"
|
|
342
|
-
};
|
|
343
|
-
/** Join a base URL and path without doubling slashes. */
|
|
344
|
-
function join(baseUrl, path) {
|
|
345
|
-
return `${baseUrl.replace(/\/$/, "")}${path}`;
|
|
346
|
-
}
|
|
347
|
-
function buildEndpoints(apiBaseUrl, overrides) {
|
|
348
|
-
return {
|
|
349
|
-
token: overrides?.token ?? join(apiBaseUrl, PATHS.token),
|
|
350
|
-
me: overrides?.me ?? join(apiBaseUrl, PATHS.me),
|
|
351
|
-
logout: overrides?.logout ?? join(apiBaseUrl, PATHS.logout),
|
|
352
|
-
projects: overrides?.projects ?? ((clientId) => join(apiBaseUrl, PATHS.projects(clientId))),
|
|
353
|
-
credits: overrides?.credits ?? join(apiBaseUrl, PATHS.credits)
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
async function fetchToken(endpoints, fetcher) {
|
|
357
|
-
const res = await fetcher(endpoints.token, { credentials: "include" });
|
|
358
|
-
if (!res.ok) throw new Error(`token request failed: ${res.status}`);
|
|
359
|
-
const { accessToken } = await res.json();
|
|
360
|
-
return accessToken;
|
|
361
|
-
}
|
|
362
|
-
async function fetchMe(endpoints, accessToken, fetcher) {
|
|
363
|
-
const res = await fetcher(endpoints.me, {
|
|
364
|
-
credentials: "include",
|
|
365
|
-
headers: { Authorization: `Bearer ${accessToken}` }
|
|
366
|
-
});
|
|
367
|
-
if (!res.ok) throw new Error(`me request failed: ${res.status}`);
|
|
368
|
-
const data = (await res.json()).response?.data;
|
|
369
|
-
if (!data) throw new Error("me response missing data");
|
|
370
|
-
return data;
|
|
371
|
-
}
|
|
372
|
-
async function fetchProjects(endpoints, clientId, accessToken, fetcher) {
|
|
373
|
-
const res = await fetcher(endpoints.projects(clientId), {
|
|
374
|
-
credentials: "include",
|
|
375
|
-
headers: { Authorization: `Bearer ${accessToken}` }
|
|
376
|
-
});
|
|
377
|
-
if (!res.ok) throw new Error(`projects request failed: ${res.status}`);
|
|
378
|
-
const data = await res.json();
|
|
379
|
-
return {
|
|
380
|
-
projectsTree: data.response?.data?.projectsTree ?? [],
|
|
381
|
-
organizationName: data.response?.data?.organization?.name
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
async function fetchCredits(endpoints, accessToken, fetcher) {
|
|
385
|
-
const res = await fetcher(endpoints.credits, {
|
|
386
|
-
credentials: "include",
|
|
387
|
-
headers: { Authorization: `Bearer ${accessToken}` }
|
|
388
|
-
});
|
|
389
|
-
if (!res.ok) throw new Error(`credits request failed: ${res.status}`);
|
|
390
|
-
return (await res.json()).remainingCredits;
|
|
391
|
-
}
|
|
392
|
-
async function callLogout(endpoints, fetcher) {
|
|
393
|
-
try {
|
|
394
|
-
await fetcher(endpoints.logout, {
|
|
395
|
-
method: "POST",
|
|
396
|
-
credentials: "include"
|
|
397
|
-
});
|
|
398
|
-
} finally {
|
|
399
|
-
if (typeof window !== "undefined") window.location.href = "/";
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
//#endregion
|
|
403
|
-
//#region src/patterns/Header/storage.ts
|
|
404
|
-
const PROJECT_KEY = "ds-header-project";
|
|
405
|
-
function getStoredProject() {
|
|
406
|
-
try {
|
|
407
|
-
const raw = sessionStorage.getItem(PROJECT_KEY);
|
|
408
|
-
return raw ? JSON.parse(raw) : null;
|
|
409
|
-
} catch {
|
|
410
|
-
return null;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
function setStoredProject(project) {
|
|
414
|
-
try {
|
|
415
|
-
sessionStorage.setItem(PROJECT_KEY, JSON.stringify(project));
|
|
416
|
-
} catch {}
|
|
417
|
-
}
|
|
418
|
-
function clearStoredProject() {
|
|
419
|
-
try {
|
|
420
|
-
sessionStorage.removeItem(PROJECT_KEY);
|
|
421
|
-
} catch {}
|
|
422
|
-
}
|
|
423
|
-
//#endregion
|
|
424
|
-
//#region src/patterns/Header/header-store.ts
|
|
425
|
-
function initialState() {
|
|
426
|
-
const stored = typeof window !== "undefined" ? getStoredProject() : null;
|
|
427
|
-
return {
|
|
428
|
-
selectedProjectId: stored?.id ?? "",
|
|
429
|
-
selectedProjectName: stored?.name ?? "",
|
|
430
|
-
organizationName: void 0,
|
|
431
|
-
credits: void 0,
|
|
432
|
-
clientId: stored?.clientId
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
let state = initialState();
|
|
436
|
-
const SERVER_SNAPSHOT = Object.freeze({
|
|
437
|
-
selectedProjectId: "",
|
|
438
|
-
selectedProjectName: "",
|
|
439
|
-
organizationName: void 0,
|
|
440
|
-
credits: void 0,
|
|
441
|
-
clientId: void 0
|
|
442
|
-
});
|
|
443
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
444
|
-
function emit() {
|
|
445
|
-
for (const listener of listeners) listener();
|
|
446
|
-
}
|
|
447
|
-
const headerStore = {
|
|
448
|
-
subscribe(listener) {
|
|
449
|
-
listeners.add(listener);
|
|
450
|
-
return () => listeners.delete(listener);
|
|
451
|
-
},
|
|
452
|
-
getSnapshot() {
|
|
453
|
-
return state;
|
|
454
|
-
},
|
|
455
|
-
getServerSnapshot() {
|
|
456
|
-
return SERVER_SNAPSHOT;
|
|
457
|
-
},
|
|
458
|
-
/** Set the selected project. `name` is best-effort; the Header backfills it from the tree. */
|
|
459
|
-
setProject(id, name = "", clientId) {
|
|
460
|
-
if (id) setStoredProject({
|
|
461
|
-
id,
|
|
462
|
-
name,
|
|
463
|
-
clientId: clientId ?? state.clientId
|
|
464
|
-
});
|
|
465
|
-
else clearStoredProject();
|
|
466
|
-
state = {
|
|
467
|
-
...state,
|
|
468
|
-
selectedProjectId: id,
|
|
469
|
-
selectedProjectName: name,
|
|
470
|
-
clientId: clientId ?? state.clientId
|
|
471
|
-
};
|
|
472
|
-
emit();
|
|
473
|
-
},
|
|
474
|
-
clearProject() {
|
|
475
|
-
clearStoredProject();
|
|
476
|
-
state = {
|
|
477
|
-
...state,
|
|
478
|
-
selectedProjectId: "",
|
|
479
|
-
selectedProjectName: ""
|
|
480
|
-
};
|
|
481
|
-
emit();
|
|
482
|
-
},
|
|
483
|
-
setOrganization(name, clientId) {
|
|
484
|
-
state = {
|
|
485
|
-
...state,
|
|
486
|
-
organizationName: name,
|
|
487
|
-
clientId: clientId ?? state.clientId
|
|
488
|
-
};
|
|
489
|
-
emit();
|
|
490
|
-
},
|
|
491
|
-
setCredits(credits) {
|
|
492
|
-
if (state.credits === credits) return;
|
|
493
|
-
state = {
|
|
494
|
-
...state,
|
|
495
|
-
credits
|
|
496
|
-
};
|
|
497
|
-
emit();
|
|
498
|
-
},
|
|
499
|
-
/** When the active client changes, drop a selection/org from the previous one. */
|
|
500
|
-
reconcileClient(clientId) {
|
|
501
|
-
if (state.clientId === clientId) return;
|
|
502
|
-
if (state.clientId && state.clientId !== clientId) {
|
|
503
|
-
clearStoredProject();
|
|
504
|
-
state = {
|
|
505
|
-
selectedProjectId: "",
|
|
506
|
-
selectedProjectName: "",
|
|
507
|
-
organizationName: void 0,
|
|
508
|
-
credits: state.credits,
|
|
509
|
-
clientId
|
|
510
|
-
};
|
|
511
|
-
} else state = {
|
|
512
|
-
...state,
|
|
513
|
-
clientId
|
|
514
|
-
};
|
|
515
|
-
emit();
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
/** Internal: subscribe a component to the selection store. */
|
|
519
|
-
function useHeaderStore() {
|
|
520
|
-
return react$1.useSyncExternalStore(headerStore.subscribe, headerStore.getSnapshot, headerStore.getServerSnapshot);
|
|
521
|
-
}
|
|
522
|
-
/**
|
|
523
|
-
* Read the current project/org and change the project from anywhere in the app —
|
|
524
|
-
* no need to be inside the <Header>. Reflects user selections made in the header
|
|
525
|
-
* and updates the header when changed here.
|
|
526
|
-
*/
|
|
527
|
-
function useHeaderProject() {
|
|
528
|
-
const snapshot = useHeaderStore();
|
|
529
|
-
return {
|
|
530
|
-
selectedProjectId: snapshot.selectedProjectId,
|
|
531
|
-
selectedProjectName: snapshot.selectedProjectName || void 0,
|
|
532
|
-
organizationName: snapshot.organizationName,
|
|
533
|
-
setProject: react$1.useCallback((id) => headerStore.setProject(id), []),
|
|
534
|
-
clearProject: react$1.useCallback(() => headerStore.clearProject(), [])
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
/** Read the logged-in user's remaining credits (read-only; the Header owns it). */
|
|
538
|
-
function useHeaderCredits() {
|
|
539
|
-
return useHeaderStore().credits;
|
|
540
|
-
}
|
|
541
|
-
//#endregion
|
|
542
|
-
//#region src/patterns/Header/session.ts
|
|
543
|
-
/** Read the raw session JWT from the `{environmentId}-sessionId` cookie. */
|
|
544
|
-
function getSessionToken(environmentId) {
|
|
545
|
-
if (typeof document === "undefined") return null;
|
|
546
|
-
const name = `${environmentId}-sessionId`;
|
|
547
|
-
for (const part of document.cookie.split(";")) {
|
|
548
|
-
const [key, ...rest] = part.trim().split("=");
|
|
549
|
-
if (key === name) return decodeURIComponent(rest.join("="));
|
|
550
|
-
}
|
|
551
|
-
return null;
|
|
552
|
-
}
|
|
553
|
-
/** Decode a JWT payload without verifying the signature (display/expiry only). */
|
|
554
|
-
function decodeJwt(token) {
|
|
555
|
-
try {
|
|
556
|
-
const payload = token.split(".")[1];
|
|
557
|
-
if (!payload) return null;
|
|
558
|
-
const base64 = payload.replace(/-/g, "+").replace(/_/g, "/");
|
|
559
|
-
const json = atob(base64);
|
|
560
|
-
return JSON.parse(json);
|
|
561
|
-
} catch {
|
|
562
|
-
return null;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
/** True when a valid, unexpired session cookie exists for the environment. */
|
|
566
|
-
function isSessionValid(environmentId) {
|
|
567
|
-
const token = getSessionToken(environmentId);
|
|
568
|
-
if (!token) return false;
|
|
569
|
-
const payload = decodeJwt(token);
|
|
570
|
-
if (!payload) return false;
|
|
571
|
-
if (typeof payload.exp !== "number") return true;
|
|
572
|
-
return payload.exp * 1e3 > Date.now();
|
|
573
|
-
}
|
|
574
|
-
//#endregion
|
|
575
|
-
//#region src/patterns/Header/use-global-header.ts
|
|
576
|
-
/** Window event other modules can dispatch to show/hide the project dropdown. */
|
|
577
|
-
const TOGGLE_PROJECT_DROPDOWN_EVENT = "toggle-project-dropdown";
|
|
578
|
-
const DEFAULT_STALE_TIME = 5 * 6e4;
|
|
579
|
-
const DEFAULT_GC_TIME = 10 * 6e4;
|
|
580
|
-
function useGlobalHeader({ apiBaseUrl, environmentId, clientId, _dangerouslyInjectAccessToken: injectedToken, showProjectDropdown = false, showProfile = false, showOrg = false, showCredits = false, endpoints: endpointOverrides, fetcher: fetcherProp, staleTime = DEFAULT_STALE_TIME, gcTime = DEFAULT_GC_TIME, onProjectChange }) {
|
|
581
|
-
const fetcher = react$1.useMemo(() => fetcherProp ?? ((input, init) => fetch(input, init)), [fetcherProp]);
|
|
582
|
-
const endpoints = react$1.useMemo(() => buildEndpoints(apiBaseUrl, endpointOverrides), [apiBaseUrl, endpointOverrides]);
|
|
583
|
-
const isAuthenticated = isSessionValid(environmentId);
|
|
584
|
-
const tokenQuery = (0, _tanstack_react_query.useQuery)({
|
|
585
|
-
queryKey: [
|
|
586
|
-
"ds-header",
|
|
587
|
-
"token",
|
|
588
|
-
endpoints.token
|
|
589
|
-
],
|
|
590
|
-
queryFn: () => fetchToken(endpoints, fetcher),
|
|
591
|
-
enabled: isAuthenticated && !injectedToken,
|
|
592
|
-
staleTime,
|
|
593
|
-
gcTime
|
|
594
|
-
});
|
|
595
|
-
const token = injectedToken ?? tokenQuery.data;
|
|
596
|
-
const wantsUser = showProfile || showProjectDropdown || showOrg;
|
|
597
|
-
const meQuery = (0, _tanstack_react_query.useQuery)({
|
|
598
|
-
queryKey: [
|
|
599
|
-
"ds-header",
|
|
600
|
-
"me",
|
|
601
|
-
endpoints.me,
|
|
602
|
-
token
|
|
603
|
-
],
|
|
604
|
-
queryFn: () => fetchMe(endpoints, token, fetcher),
|
|
605
|
-
enabled: isAuthenticated && !!token && wantsUser,
|
|
606
|
-
staleTime,
|
|
607
|
-
gcTime
|
|
608
|
-
});
|
|
609
|
-
const effectiveClientId = clientId ?? meQuery.data?.clientId;
|
|
610
|
-
const projectsQuery = (0, _tanstack_react_query.useQuery)({
|
|
611
|
-
queryKey: [
|
|
612
|
-
"ds-header",
|
|
613
|
-
"projects",
|
|
614
|
-
effectiveClientId,
|
|
615
|
-
token
|
|
616
|
-
],
|
|
617
|
-
queryFn: () => fetchProjects(endpoints, effectiveClientId, token, fetcher),
|
|
618
|
-
enabled: isAuthenticated && !!token && !!effectiveClientId && (showProjectDropdown || showOrg),
|
|
619
|
-
staleTime,
|
|
620
|
-
gcTime
|
|
621
|
-
});
|
|
622
|
-
const creditsQuery = (0, _tanstack_react_query.useQuery)({
|
|
623
|
-
queryKey: [
|
|
624
|
-
"ds-header",
|
|
625
|
-
"credits",
|
|
626
|
-
endpoints.credits,
|
|
627
|
-
token
|
|
628
|
-
],
|
|
629
|
-
queryFn: () => fetchCredits(endpoints, token, fetcher),
|
|
630
|
-
enabled: isAuthenticated && !!token && showCredits,
|
|
631
|
-
staleTime: 0,
|
|
632
|
-
gcTime
|
|
633
|
-
});
|
|
634
|
-
const projectsTree = projectsQuery.data?.projectsTree ?? [];
|
|
635
|
-
const userEmail = showProfile ? meQuery.data?.email : void 0;
|
|
636
|
-
const creditsHref = react$1.useMemo(() => {
|
|
637
|
-
try {
|
|
638
|
-
return new URL("/user/activity", apiBaseUrl).toString();
|
|
639
|
-
} catch {
|
|
640
|
-
return "/user/activity";
|
|
641
|
-
}
|
|
642
|
-
}, [apiBaseUrl]);
|
|
643
|
-
const selection = useHeaderStore();
|
|
644
|
-
react$1.useEffect(() => {
|
|
645
|
-
if (effectiveClientId) headerStore.reconcileClient(effectiveClientId);
|
|
646
|
-
}, [effectiveClientId]);
|
|
647
|
-
react$1.useEffect(() => {
|
|
648
|
-
if (!projectsQuery.data) return;
|
|
649
|
-
const tree = projectsQuery.data.projectsTree;
|
|
650
|
-
const id = headerStore.getSnapshot().selectedProjectId;
|
|
651
|
-
if (id && !nodeExistsInTree(tree, id)) headerStore.clearProject();
|
|
652
|
-
else if (id) {
|
|
653
|
-
const name = findProjectName(tree, id);
|
|
654
|
-
if (name && name !== headerStore.getSnapshot().selectedProjectName) headerStore.setProject(id, name, effectiveClientId);
|
|
655
|
-
}
|
|
656
|
-
headerStore.setOrganization(projectsQuery.data.organizationName, effectiveClientId);
|
|
657
|
-
}, [projectsQuery.data, effectiveClientId]);
|
|
658
|
-
react$1.useEffect(() => {
|
|
659
|
-
if (creditsQuery.data !== void 0) headerStore.setCredits(creditsQuery.data);
|
|
660
|
-
}, [creditsQuery.data]);
|
|
661
|
-
const selectProject = (id) => {
|
|
662
|
-
const name = findProjectName(projectsTree, id) ?? "";
|
|
663
|
-
headerStore.setProject(id, name, effectiveClientId);
|
|
664
|
-
onProjectChange?.(id);
|
|
665
|
-
};
|
|
666
|
-
const logout = () => {
|
|
667
|
-
headerStore.clearProject();
|
|
668
|
-
callLogout(endpoints, fetcher);
|
|
669
|
-
};
|
|
670
|
-
const [projectDropdownVisible, setProjectDropdownVisible] = react$1.useState(showProjectDropdown);
|
|
671
|
-
react$1.useEffect(() => setProjectDropdownVisible(showProjectDropdown), [showProjectDropdown]);
|
|
672
|
-
react$1.useEffect(() => {
|
|
673
|
-
const handler = (e) => {
|
|
674
|
-
setProjectDropdownVisible(e.detail.show);
|
|
675
|
-
};
|
|
676
|
-
window.addEventListener(TOGGLE_PROJECT_DROPDOWN_EVENT, handler);
|
|
677
|
-
return () => window.removeEventListener(TOGGLE_PROJECT_DROPDOWN_EVENT, handler);
|
|
678
|
-
}, []);
|
|
679
|
-
const isProjectsLoading = projectsQuery.isFetching && !projectsQuery.data;
|
|
680
|
-
return {
|
|
681
|
-
isAuthenticated,
|
|
682
|
-
userEmail,
|
|
683
|
-
organizationName: selection.organizationName,
|
|
684
|
-
projectsTree,
|
|
685
|
-
selectedProjectId: selection.selectedProjectId,
|
|
686
|
-
selectedProjectName: selection.selectedProjectName || void 0,
|
|
687
|
-
isProjectsLoading,
|
|
688
|
-
isOrgLoading: showOrg && isProjectsLoading,
|
|
689
|
-
credits: selection.credits,
|
|
690
|
-
creditsHref,
|
|
691
|
-
projectDropdownVisible,
|
|
692
|
-
showOverlay: isAuthenticated && projectDropdownVisible && !selection.selectedProjectId,
|
|
693
|
-
selectProject,
|
|
694
|
-
logout
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
//#endregion
|
|
698
|
-
//#region src/patterns/Header/Header.tsx
|
|
699
|
-
const LOGO_HREF = {
|
|
700
|
-
psai: "https://sapientaiproducts.com/",
|
|
701
|
-
slingshot: "https://sapientaiproducts.com/slingshot",
|
|
702
|
-
sustain: "https://www.publicissapient.com/",
|
|
703
|
-
bodhi: "https://sapientaiproducts.com/bodhi"
|
|
704
|
-
};
|
|
705
|
-
const PILL = "flex h-9 items-center gap-1.5 rounded-full border bg-card px-4 text-sm";
|
|
706
|
-
/** The header bar shell — a sticky glass strip. */
|
|
707
|
-
function HeaderBar({ className, ...props }) {
|
|
708
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
|
|
709
|
-
"data-slot": "header",
|
|
710
|
-
className: require_utils.cn("sticky top-4 z-10 mt-4 flex h-16 items-center gap-1 rounded-2xl border border-border/50 px-6 shadow-sm", "bg-[var(--glass-light)] backdrop-blur-[var(--glass-blur)]", className),
|
|
711
|
-
...props
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
/** Product logo linking to its home, with a Suspense-safe fallback. */
|
|
715
|
-
function HeaderLogo({ brand }) {
|
|
716
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
717
|
-
href: LOGO_HREF[brand],
|
|
718
|
-
"aria-label": "Go to product home",
|
|
719
|
-
"data-slot": "header-logo",
|
|
720
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Logo, {
|
|
721
|
-
brand,
|
|
722
|
-
className: "h-8 w-auto"
|
|
723
|
-
})
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
/** Read-only organisation pill. */
|
|
727
|
-
function OrgPill({ name, loading }) {
|
|
728
|
-
if (loading && !name) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
729
|
-
className: require_utils.cn(PILL, "ml-3"),
|
|
730
|
-
"data-slot": "header-org",
|
|
731
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
732
|
-
className: "shrink-0 text-muted-foreground",
|
|
733
|
-
children: [DEFAULT_LABELS.orgLabel, ":"]
|
|
734
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Skeleton, { className: "h-4 w-24" })]
|
|
735
|
-
});
|
|
736
|
-
if (!name) return null;
|
|
737
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
738
|
-
className: require_utils.cn(PILL, "ml-3 select-none"),
|
|
739
|
-
title: name,
|
|
740
|
-
"data-slot": "header-org",
|
|
741
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
742
|
-
className: "shrink-0 text-muted-foreground",
|
|
743
|
-
children: [DEFAULT_LABELS.orgLabel, ":"]
|
|
744
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
745
|
-
className: "max-w-36 truncate font-medium",
|
|
746
|
-
children: name
|
|
747
|
-
})]
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
/** Light/dark toggle — defers to ThemeProvider. */
|
|
751
|
-
function ThemeToggle() {
|
|
752
|
-
const { theme, toggleTheme } = require_ThemeProvider.useTheme();
|
|
753
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Button, {
|
|
754
|
-
variant: "ghost",
|
|
755
|
-
size: "icon",
|
|
756
|
-
onClick: toggleTheme,
|
|
757
|
-
"aria-label": "Toggle theme",
|
|
758
|
-
children: theme === "light" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Moon, { className: "size-4" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sun, { className: "size-4" })
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
/** Profile menu — avatar trigger with email + logout. */
|
|
762
|
-
function ProfileMenu({ email, onLogout }) {
|
|
763
|
-
const initial = email?.trim().charAt(0).toUpperCase() || "?";
|
|
764
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.DropdownMenuTrigger, {
|
|
765
|
-
asChild: true,
|
|
766
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Button, {
|
|
767
|
-
variant: "ghost",
|
|
768
|
-
size: "icon",
|
|
769
|
-
"aria-label": DEFAULT_LABELS.profileMenuLabel,
|
|
770
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Avatar, {
|
|
771
|
-
className: "size-7",
|
|
772
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.AvatarFallback, { children: initial })
|
|
773
|
-
})
|
|
774
|
-
})
|
|
775
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.DropdownMenuContent, {
|
|
776
|
-
align: "end",
|
|
777
|
-
sideOffset: 8,
|
|
778
|
-
className: "min-w-44",
|
|
779
|
-
children: [email && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.DropdownMenuLabel, {
|
|
780
|
-
className: "truncate font-normal text-muted-foreground",
|
|
781
|
-
children: email
|
|
782
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.DropdownMenuSeparator, {})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.DropdownMenuItem, {
|
|
783
|
-
onSelect: onLogout,
|
|
784
|
-
variant: "destructive",
|
|
785
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LogOut, {}), DEFAULT_LABELS.logoutLabel]
|
|
786
|
-
})]
|
|
787
|
-
})] });
|
|
788
|
-
}
|
|
789
|
-
let sharedClient;
|
|
790
|
-
function getQueryClient() {
|
|
791
|
-
sharedClient ??= new _tanstack_react_query.QueryClient({ defaultOptions: { queries: {
|
|
792
|
-
retry: 1,
|
|
793
|
-
refetchOnWindowFocus: false
|
|
794
|
-
} } });
|
|
795
|
-
return sharedClient;
|
|
796
|
-
}
|
|
797
|
-
/** Drop-in global header. Must be rendered inside a <ThemeProvider>. */
|
|
798
|
-
function Header(props) {
|
|
799
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.QueryClientProvider, {
|
|
800
|
-
client: getQueryClient(),
|
|
801
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderInner, { ...props })
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
function HeaderInner({ logoType, showOrg = false, showProjectDropdown = false, showProfile = false, showThemeSwitcher = false, showCredits = false, pageTitle, feedbackUrl, logoAddon, className, onCloseProjectOverlay, ...rest }) {
|
|
805
|
-
const { product } = require_ThemeProvider.useTheme();
|
|
806
|
-
const brand = logoType ?? product;
|
|
807
|
-
const state = useGlobalHeader({
|
|
808
|
-
showOrg,
|
|
809
|
-
showProjectDropdown,
|
|
810
|
-
showProfile,
|
|
811
|
-
showCredits,
|
|
812
|
-
...rest
|
|
813
|
-
});
|
|
814
|
-
const showProjectUi = showProjectDropdown && state.isAuthenticated;
|
|
815
|
-
const showOrgUi = showOrg && state.isAuthenticated;
|
|
816
|
-
const showProfileUi = showProfile && state.isAuthenticated;
|
|
817
|
-
const showCreditsUi = showCredits && state.isAuthenticated && state.credits !== void 0;
|
|
818
|
-
const showActions = showThemeSwitcher || showProfileUi || showCreditsUi || !!feedbackUrl;
|
|
819
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HeaderBar, {
|
|
820
|
-
className,
|
|
821
|
-
children: [
|
|
822
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderLogo, { brand }),
|
|
823
|
-
pageTitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
824
|
-
"data-slot": "header-title",
|
|
825
|
-
className: "ml-5 font-semibold text-foreground text-sm",
|
|
826
|
-
children: pageTitle
|
|
827
|
-
}),
|
|
828
|
-
logoAddon,
|
|
829
|
-
showOrgUi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrgPill, {
|
|
830
|
-
name: state.organizationName,
|
|
831
|
-
loading: state.isOrgLoading
|
|
832
|
-
}),
|
|
833
|
-
showProjectUi && state.projectDropdownVisible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
834
|
-
className: "ml-2",
|
|
835
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectPicker, {
|
|
836
|
-
projectsTree: state.projectsTree,
|
|
837
|
-
selectedProjectId: state.selectedProjectId,
|
|
838
|
-
selectedProjectName: state.selectedProjectName,
|
|
839
|
-
onSelect: state.selectProject,
|
|
840
|
-
projectLabel: DEFAULT_LABELS.projectLabel,
|
|
841
|
-
projectPlaceholder: DEFAULT_LABELS.projectPlaceholder,
|
|
842
|
-
searchPlaceholder: DEFAULT_LABELS.searchPlaceholder,
|
|
843
|
-
emptyStateText: DEFAULT_LABELS.emptyStateText,
|
|
844
|
-
isLoading: state.isProjectsLoading
|
|
845
|
-
})
|
|
846
|
-
}),
|
|
847
|
-
showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
848
|
-
className: "ml-auto flex items-center gap-2",
|
|
849
|
-
children: [
|
|
850
|
-
feedbackUrl && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Button, {
|
|
851
|
-
variant: "ghost",
|
|
852
|
-
size: "icon",
|
|
853
|
-
asChild: true,
|
|
854
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
855
|
-
href: feedbackUrl,
|
|
856
|
-
target: "_blank",
|
|
857
|
-
rel: "noopener noreferrer",
|
|
858
|
-
"aria-label": "Share feedback",
|
|
859
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MessageSquareShare, { className: "size-4" })
|
|
860
|
-
})
|
|
861
|
-
}),
|
|
862
|
-
showThemeSwitcher && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeToggle, {}),
|
|
863
|
-
showCreditsUi && state.credits !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
864
|
-
href: state.creditsHref,
|
|
865
|
-
"aria-label": "View credit activity",
|
|
866
|
-
className: "rounded-full outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
867
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Credits, { value: state.credits })
|
|
868
|
-
}),
|
|
869
|
-
showProfileUi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfileMenu, {
|
|
870
|
-
email: state.userEmail,
|
|
871
|
-
onLogout: state.logout
|
|
872
|
-
})
|
|
873
|
-
]
|
|
874
|
-
})
|
|
875
|
-
]
|
|
876
|
-
}), showProjectUi && state.showOverlay && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectOverlay, {
|
|
877
|
-
organizationName: state.organizationName,
|
|
878
|
-
projectsTree: state.projectsTree,
|
|
879
|
-
selectedProjectId: state.selectedProjectId,
|
|
880
|
-
onSelect: state.selectProject,
|
|
881
|
-
isLoading: state.isProjectsLoading,
|
|
882
|
-
onClose: onCloseProjectOverlay
|
|
883
|
-
})] });
|
|
884
|
-
}
|
|
885
|
-
function ProjectOverlay({ organizationName, projectsTree, selectedProjectId, onSelect, isLoading, onClose }) {
|
|
886
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
887
|
-
role: "dialog",
|
|
888
|
-
"aria-modal": "true",
|
|
889
|
-
"aria-label": DEFAULT_LABELS.overlayTitle,
|
|
890
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",
|
|
891
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
892
|
-
className: "relative mx-4 flex w-full max-w-md flex-col items-center gap-6 rounded-2xl border bg-card p-8 text-card-foreground shadow-2xl",
|
|
893
|
-
children: [
|
|
894
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Button, {
|
|
895
|
-
variant: "ghost",
|
|
896
|
-
size: "icon",
|
|
897
|
-
onClick: onClose ?? (() => window.history.back()),
|
|
898
|
-
className: "absolute top-4 right-4",
|
|
899
|
-
"aria-label": "Close",
|
|
900
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "size-5" })
|
|
901
|
-
}),
|
|
902
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
903
|
-
className: "flex flex-col items-center gap-3 text-center",
|
|
904
|
-
children: [
|
|
905
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
906
|
-
className: "rounded-full bg-primary/10 p-4",
|
|
907
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.FolderOpen, { className: "size-8 text-primary" })
|
|
908
|
-
}),
|
|
909
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
910
|
-
className: "font-semibold text-foreground text-xl",
|
|
911
|
-
children: DEFAULT_LABELS.overlayTitle
|
|
912
|
-
}),
|
|
913
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
914
|
-
className: "text-muted-foreground text-sm",
|
|
915
|
-
children: DEFAULT_LABELS.overlayDescription
|
|
916
|
-
})
|
|
917
|
-
]
|
|
918
|
-
}),
|
|
919
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
920
|
-
className: "flex w-full justify-center gap-2",
|
|
921
|
-
children: [organizationName && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
922
|
-
className: require_utils.cn(PILL, "select-none"),
|
|
923
|
-
title: organizationName,
|
|
924
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
925
|
-
className: "shrink-0 text-muted-foreground",
|
|
926
|
-
children: [DEFAULT_LABELS.orgLabel, ":"]
|
|
927
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
928
|
-
className: "max-w-52 truncate font-medium",
|
|
929
|
-
children: organizationName
|
|
930
|
-
})]
|
|
931
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectPicker, {
|
|
932
|
-
projectsTree,
|
|
933
|
-
selectedProjectId,
|
|
934
|
-
onSelect,
|
|
935
|
-
projectLabel: DEFAULT_LABELS.projectLabel,
|
|
936
|
-
projectPlaceholder: DEFAULT_LABELS.projectPlaceholder,
|
|
937
|
-
searchPlaceholder: DEFAULT_LABELS.searchPlaceholder,
|
|
938
|
-
emptyStateText: DEFAULT_LABELS.emptyStateText,
|
|
939
|
-
isLoading
|
|
940
|
-
})]
|
|
941
|
-
})
|
|
942
|
-
]
|
|
943
|
-
})
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
//#endregion
|
|
947
|
-
//#region src/patterns/MediaObject/MediaObject.tsx
|
|
948
|
-
function MediaObject({ className, interactive, ...props }) {
|
|
949
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", {
|
|
950
|
-
"data-slot": "media-object",
|
|
951
|
-
className: require_utils.cn("group/media flex flex-col overflow-hidden rounded-2xl border bg-card", interactive && "transition-all hover:-translate-y-0.5 hover:shadow-md", className),
|
|
952
|
-
...props
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
function MediaObjectImage({ className, alt, ...props }) {
|
|
956
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
957
|
-
"data-slot": "media-object-image",
|
|
958
|
-
alt,
|
|
959
|
-
className: require_utils.cn("aspect-[16/9] w-full object-cover transition-transform group-hover/media:scale-[1.02]", className),
|
|
960
|
-
...props
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
function MediaObjectIcon({ className, ...props }) {
|
|
964
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
965
|
-
"data-slot": "media-object-icon",
|
|
966
|
-
className: require_utils.cn("flex size-10 shrink-0 items-center justify-center", className),
|
|
967
|
-
...props
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
function MediaObjectContent({ className, ...props }) {
|
|
971
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
972
|
-
"data-slot": "media-object-content",
|
|
973
|
-
className: require_utils.cn("flex flex-1 flex-col gap-3 p-5", className),
|
|
974
|
-
...props
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
function MediaObjectTitle({ size, ...props }) {
|
|
978
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Heading, {
|
|
979
|
-
"data-slot": "media-object-title",
|
|
980
|
-
as: "h3",
|
|
981
|
-
size: size ?? "4",
|
|
982
|
-
...props
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
function MediaObjectText({ ...props }) {
|
|
986
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Text, {
|
|
987
|
-
"data-slot": "media-object-text",
|
|
988
|
-
variant: "muted",
|
|
989
|
-
size: "small",
|
|
990
|
-
...props
|
|
991
|
-
});
|
|
992
|
-
}
|
|
993
|
-
function MediaObjectActions({ className, ...props }) {
|
|
994
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
995
|
-
"data-slot": "media-object-actions",
|
|
996
|
-
className: require_utils.cn("mt-auto flex items-center gap-2 pt-2", className),
|
|
997
|
-
...props
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
const mediaObjectGroupVariants = (0, class_variance_authority.cva)("grid", {
|
|
1001
|
-
variants: {
|
|
1002
|
-
columns: {
|
|
1003
|
-
1: "grid-cols-1",
|
|
1004
|
-
2: "grid-cols-1 sm:grid-cols-2",
|
|
1005
|
-
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
1006
|
-
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
1007
|
-
},
|
|
1008
|
-
gap: {
|
|
1009
|
-
sm: "gap-4",
|
|
1010
|
-
md: "gap-6",
|
|
1011
|
-
lg: "gap-8"
|
|
1012
|
-
}
|
|
1013
|
-
},
|
|
1014
|
-
defaultVariants: {
|
|
1015
|
-
columns: 3,
|
|
1016
|
-
gap: "lg"
|
|
1017
|
-
}
|
|
1018
|
-
});
|
|
1019
|
-
function MediaObjectGroup({ className, columns, gap, ...props }) {
|
|
1020
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1021
|
-
"data-slot": "media-object-group",
|
|
1022
|
-
className: require_utils.cn(mediaObjectGroupVariants({
|
|
1023
|
-
columns,
|
|
1024
|
-
gap
|
|
1025
|
-
}), className),
|
|
1026
|
-
...props
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
//#endregion
|
|
1030
|
-
//#region src/patterns/SectionCard/SectionCard.tsx
|
|
1031
|
-
function SectionCard({ title, action, className, children, ...props }) {
|
|
1032
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ThemeProvider.Card, {
|
|
1033
|
-
"data-slot": "section-card",
|
|
1034
|
-
variant: "glass",
|
|
1035
|
-
tint: "light",
|
|
1036
|
-
className: require_utils.cn("gap-5 rounded-2xl p-5 sm:p-6", className),
|
|
1037
|
-
...props,
|
|
1038
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1039
|
-
"data-slot": "section-card-header",
|
|
1040
|
-
className: "flex items-center justify-between gap-3",
|
|
1041
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Heading, {
|
|
1042
|
-
"data-slot": "section-card-title",
|
|
1043
|
-
size: "3",
|
|
1044
|
-
children: title
|
|
1045
|
-
}), action ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1046
|
-
"data-slot": "section-card-action",
|
|
1047
|
-
children: action
|
|
1048
|
-
}) : null]
|
|
1049
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1050
|
-
"data-slot": "section-card-body",
|
|
1051
|
-
children
|
|
1052
|
-
})]
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
//#endregion
|
|
1056
|
-
//#region src/patterns/SectionHeading/SectionHeading.tsx
|
|
1057
|
-
function SectionHeading({ title, subtitle, eyebrow, align = "center", gradient = false, titleSize = "1", titleAs = "h2", className, ...props }) {
|
|
1058
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
1059
|
-
"data-slot": "section-heading",
|
|
1060
|
-
gap: "sm",
|
|
1061
|
-
align: align === "center" ? "center" : "start",
|
|
1062
|
-
className: require_utils.cn(align === "center" && "text-center", className),
|
|
1063
|
-
...props,
|
|
1064
|
-
children: [
|
|
1065
|
-
eyebrow ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Text, {
|
|
1066
|
-
"data-slot": "section-heading-eyebrow",
|
|
1067
|
-
size: "caption",
|
|
1068
|
-
variant: "muted",
|
|
1069
|
-
children: eyebrow
|
|
1070
|
-
}) : null,
|
|
1071
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Heading, {
|
|
1072
|
-
"data-slot": "section-heading-title",
|
|
1073
|
-
as: titleAs,
|
|
1074
|
-
size: titleSize,
|
|
1075
|
-
gradient,
|
|
1076
|
-
align,
|
|
1077
|
-
children: title
|
|
1078
|
-
}),
|
|
1079
|
-
subtitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThemeProvider.Text, {
|
|
1080
|
-
"data-slot": "section-heading-subtitle",
|
|
1081
|
-
size: "large",
|
|
1082
|
-
variant: "muted",
|
|
1083
|
-
align,
|
|
1084
|
-
children: subtitle
|
|
1085
|
-
}) : null
|
|
1086
|
-
]
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
//#endregion
|
|
1090
|
-
exports.DEFAULT_LABELS = DEFAULT_LABELS;
|
|
1091
|
-
exports.DataTable = DataTable;
|
|
1092
|
-
exports.DataTableColumnHeader = DataTableColumnHeader;
|
|
1093
|
-
exports.Footer = Footer;
|
|
1094
|
-
exports.FooterCenter = FooterCenter;
|
|
1095
|
-
exports.FooterEnd = FooterEnd;
|
|
1096
|
-
exports.FooterPoweredBy = FooterPoweredBy;
|
|
1097
|
-
exports.FooterSeparator = FooterSeparator;
|
|
1098
|
-
exports.FooterStart = FooterStart;
|
|
1099
|
-
exports.Header = Header;
|
|
1100
|
-
exports.HeaderBar = HeaderBar;
|
|
1101
|
-
exports.HeaderLogo = HeaderLogo;
|
|
1102
|
-
exports.MediaObject = MediaObject;
|
|
1103
|
-
exports.MediaObjectActions = MediaObjectActions;
|
|
1104
|
-
exports.MediaObjectContent = MediaObjectContent;
|
|
1105
|
-
exports.MediaObjectGroup = MediaObjectGroup;
|
|
1106
|
-
exports.MediaObjectIcon = MediaObjectIcon;
|
|
1107
|
-
exports.MediaObjectImage = MediaObjectImage;
|
|
1108
|
-
exports.MediaObjectText = MediaObjectText;
|
|
1109
|
-
exports.MediaObjectTitle = MediaObjectTitle;
|
|
1110
|
-
exports.OrgPill = OrgPill;
|
|
1111
|
-
exports.ProfileMenu = ProfileMenu;
|
|
1112
|
-
exports.ProjectPicker = ProjectPicker;
|
|
1113
|
-
exports.SectionCard = SectionCard;
|
|
1114
|
-
exports.SectionHeading = SectionHeading;
|
|
1115
|
-
exports.TOGGLE_PROJECT_DROPDOWN_EVENT = TOGGLE_PROJECT_DROPDOWN_EVENT;
|
|
1116
|
-
exports.ThemeToggle = ThemeToggle;
|
|
1117
|
-
exports.buildEndpoints = buildEndpoints;
|
|
1118
|
-
exports.getSessionToken = getSessionToken;
|
|
1119
|
-
exports.isSessionValid = isSessionValid;
|
|
1120
|
-
exports.mediaObjectGroupVariants = mediaObjectGroupVariants;
|
|
1121
|
-
exports.useGlobalHeader = useGlobalHeader;
|
|
1122
|
-
exports.useHeaderCredits = useHeaderCredits;
|
|
1123
|
-
exports.useHeaderProject = useHeaderProject;
|
|
1124
|
-
|
|
1125
|
-
//# sourceMappingURL=index.cjs.map
|
|
2
|
+
const require_patterns_DataTable_index = require("./DataTable/index.cjs");
|
|
3
|
+
const require_patterns_Footer_index = require("./Footer/index.cjs");
|
|
4
|
+
const require_Header = require("../Header.cjs");
|
|
5
|
+
const require_patterns_MediaObject_index = require("./MediaObject/index.cjs");
|
|
6
|
+
const require_patterns_SectionCard_index = require("./SectionCard/index.cjs");
|
|
7
|
+
const require_patterns_SectionHeading_index = require("./SectionHeading/index.cjs");
|
|
8
|
+
exports.DEFAULT_LABELS = require_Header.DEFAULT_LABELS;
|
|
9
|
+
exports.DataTable = require_patterns_DataTable_index.DataTable;
|
|
10
|
+
exports.DataTableColumnHeader = require_patterns_DataTable_index.DataTableColumnHeader;
|
|
11
|
+
exports.Footer = require_patterns_Footer_index.Footer;
|
|
12
|
+
exports.FooterCenter = require_patterns_Footer_index.FooterCenter;
|
|
13
|
+
exports.FooterEnd = require_patterns_Footer_index.FooterEnd;
|
|
14
|
+
exports.FooterPoweredBy = require_patterns_Footer_index.FooterPoweredBy;
|
|
15
|
+
exports.FooterSeparator = require_patterns_Footer_index.FooterSeparator;
|
|
16
|
+
exports.FooterStart = require_patterns_Footer_index.FooterStart;
|
|
17
|
+
exports.Header = require_Header.Header;
|
|
18
|
+
exports.HeaderBar = require_Header.HeaderBar;
|
|
19
|
+
exports.HeaderLogo = require_Header.HeaderLogo;
|
|
20
|
+
exports.MediaObject = require_patterns_MediaObject_index.MediaObject;
|
|
21
|
+
exports.MediaObjectActions = require_patterns_MediaObject_index.MediaObjectActions;
|
|
22
|
+
exports.MediaObjectContent = require_patterns_MediaObject_index.MediaObjectContent;
|
|
23
|
+
exports.MediaObjectGroup = require_patterns_MediaObject_index.MediaObjectGroup;
|
|
24
|
+
exports.MediaObjectIcon = require_patterns_MediaObject_index.MediaObjectIcon;
|
|
25
|
+
exports.MediaObjectImage = require_patterns_MediaObject_index.MediaObjectImage;
|
|
26
|
+
exports.MediaObjectText = require_patterns_MediaObject_index.MediaObjectText;
|
|
27
|
+
exports.MediaObjectTitle = require_patterns_MediaObject_index.MediaObjectTitle;
|
|
28
|
+
exports.OrgPill = require_Header.OrgPill;
|
|
29
|
+
exports.ProfileMenu = require_Header.ProfileMenu;
|
|
30
|
+
exports.ProjectPicker = require_Header.ProjectPicker;
|
|
31
|
+
exports.SectionCard = require_patterns_SectionCard_index.SectionCard;
|
|
32
|
+
exports.SectionHeading = require_patterns_SectionHeading_index.SectionHeading;
|
|
33
|
+
exports.TOGGLE_PROJECT_DROPDOWN_EVENT = require_Header.TOGGLE_PROJECT_DROPDOWN_EVENT;
|
|
34
|
+
exports.ThemeToggle = require_Header.ThemeToggle;
|
|
35
|
+
exports.buildEndpoints = require_Header.buildEndpoints;
|
|
36
|
+
exports.getSessionToken = require_Header.getSessionToken;
|
|
37
|
+
exports.isSessionValid = require_Header.isSessionValid;
|
|
38
|
+
exports.mediaObjectGroupVariants = require_patterns_MediaObject_index.mediaObjectGroupVariants;
|
|
39
|
+
exports.useGlobalHeader = require_Header.useGlobalHeader;
|
|
40
|
+
exports.useHeaderCredits = require_Header.useHeaderCredits;
|
|
41
|
+
exports.useHeaderProject = require_Header.useHeaderProject;
|