xertica-ui 2.5.0 → 2.5.2
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/CHANGELOG.md +35 -0
- package/README.md +56 -17
- package/assets/xertica-logo.svg +37 -37
- package/assets/xertica-x-logo.svg +20 -20
- package/bin/cli.ts +14 -2
- package/bin/generate-tokens.ts +262 -262
- package/bin/language-config.ts +359 -358
- package/components/assistant/code-block/CodeBlock.tsx +268 -268
- package/components/assistant/formatted-document/FormattedDocument.tsx +147 -147
- package/components/assistant/modern-chat-input/ModernChatInput.tsx +564 -564
- package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +99 -99
- package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -104
- package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -81
- package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +88 -88
- package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +75 -75
- package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +564 -564
- package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +67 -67
- package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +103 -103
- package/components/assistant/xertica-assistant/use-assistant.ts +615 -615
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +611 -611
- package/components/blocks/card-patterns/ActivityCard.tsx +100 -100
- package/components/blocks/card-patterns/ActivityCardSkeleton.tsx +56 -56
- package/components/blocks/card-patterns/FeatureCardSkeleton.tsx +58 -58
- package/components/blocks/card-patterns/NotificationCard.tsx +140 -140
- package/components/blocks/card-patterns/NotificationCardSkeleton.tsx +81 -81
- package/components/blocks/card-patterns/ProfileCard.tsx +112 -112
- package/components/blocks/card-patterns/ProfileCardSkeleton.tsx +69 -69
- package/components/blocks/card-patterns/ProjectCard.tsx +123 -123
- package/components/blocks/card-patterns/ProjectCardSkeleton.tsx +67 -67
- package/components/blocks/card-patterns/QuickActionCardSkeleton.tsx +44 -44
- package/components/blocks/card-patterns/card-patterns.stories.tsx +594 -594
- package/components/blocks/card-patterns/index.ts +29 -29
- package/components/brand/language-selector/LanguageSelector.tsx +102 -102
- package/components/brand/language-selector/language-selector.stories.tsx +111 -111
- package/components/brand/language-selector/language-selector.test.tsx +101 -101
- package/components/brand/theme-toggle/ThemeToggle.tsx +74 -74
- package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
- package/components/index.ts +86 -86
- package/components/layout/sidebar/sidebar.mdx +1 -1
- package/components/layout/sidebar/sidebar.stories.tsx +1033 -787
- package/components/layout/sidebar/sidebar.tsx +338 -1
- package/components/media/FloatingMediaWrapper.tsx +371 -371
- package/components/media/audio-player/AudioPlayer.tsx +768 -768
- package/components/media/video-player/VideoPlayer.tsx +310 -310
- package/components/pages/home-content/HomeContent.tsx +120 -120
- package/components/pages/home-content/home-content.mdx +62 -62
- package/components/pages/home-page/HomePage.tsx +78 -78
- package/components/pages/home-page/home-page.mdx +53 -53
- package/components/pages/template-content/TemplateContent.tsx +1354 -1354
- package/components/pages/template-content/template-content.mdx +61 -61
- package/components/pages/template-page/TemplatePage.stories.tsx +32 -32
- package/components/pages/template-page/template-page.mdx +53 -53
- package/components/shared/error-boundary.stories.tsx +114 -114
- package/components/shared/error-boundary.tsx +150 -150
- package/components/shared/error-fallbacks.tsx +222 -222
- package/components/ui/accordion/accordion.mdx +8 -8
- package/components/ui/alert/alert.mdx +8 -8
- package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
- package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
- package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
- package/components/ui/avatar/avatar.mdx +8 -8
- package/components/ui/badge/badge.mdx +8 -8
- package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
- package/components/ui/button/button.mdx +8 -8
- package/components/ui/calendar/calendar.mdx +8 -8
- package/components/ui/card/card.mdx +8 -8
- package/components/ui/carousel/carousel.mdx +8 -8
- package/components/ui/chart/chart.mdx +8 -8
- package/components/ui/chart/chart.test.tsx +178 -178
- package/components/ui/chart/chart.tsx +2245 -2239
- package/components/ui/checkbox/checkbox.mdx +8 -8
- package/components/ui/collapsible/collapsible.mdx +8 -8
- package/components/ui/command/command.mdx +8 -8
- package/components/ui/context-menu/context-menu.mdx +8 -8
- package/components/ui/dialog/dialog.mdx +8 -8
- package/components/ui/drawer/drawer.mdx +8 -8
- package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
- package/components/ui/empty/empty.mdx +8 -8
- package/components/ui/file-upload/file-upload.mdx +8 -8
- package/components/ui/hover-card/hover-card.mdx +8 -8
- package/components/ui/input/input.mdx +8 -8
- package/components/ui/input-otp/input-otp.mdx +8 -8
- package/components/ui/label/label.mdx +8 -8
- package/components/ui/map/map.mdx +8 -8
- package/components/ui/menubar/menubar.mdx +8 -8
- package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
- package/components/ui/notification-badge/notification-badge.mdx +8 -8
- package/components/ui/pagination/pagination.mdx +8 -8
- package/components/ui/popover/popover.mdx +8 -8
- package/components/ui/progress/progress.mdx +8 -8
- package/components/ui/radio-group/radio-group.mdx +8 -8
- package/components/ui/rating/rating.mdx +8 -8
- package/components/ui/resizable/resizable.mdx +8 -8
- package/components/ui/route-map/route-map.mdx +8 -8
- package/components/ui/scroll-area/scroll-area.mdx +8 -8
- package/components/ui/search/search.mdx +8 -8
- package/components/ui/select/select.mdx +8 -8
- package/components/ui/separator/separator.mdx +8 -8
- package/components/ui/sheet/sheet.mdx +8 -8
- package/components/ui/simple-map/simple-map.mdx +8 -8
- package/components/ui/skeleton/skeleton.mdx +8 -8
- package/components/ui/slider/slider.mdx +8 -8
- package/components/ui/sonner/sonner.mdx +8 -8
- package/components/ui/stats-card/index.ts +2 -2
- package/components/ui/stats-card/stats-card-skeleton.tsx +60 -60
- package/components/ui/stats-card/stats-card.mdx +8 -8
- package/components/ui/stats-card/stats-card.tsx +109 -109
- package/components/ui/stepper/stepper.mdx +8 -8
- package/components/ui/switch/switch.mdx +8 -8
- package/components/ui/table/table.mdx +8 -8
- package/components/ui/tabs/tabs.mdx +8 -8
- package/components/ui/textarea/textarea.mdx +8 -8
- package/components/ui/timeline/timeline.mdx +8 -8
- package/components/ui/toggle/toggle.mdx +8 -8
- package/components/ui/toggle-group/toggle-group.mdx +8 -8
- package/components/ui/tooltip/tooltip.mdx +8 -8
- package/components/ui/tree-view/tree-view.mdx +8 -8
- package/components.json +511 -511
- package/contexts/AuthContext.tsx +121 -121
- package/contexts/BrandColorsContext.tsx +282 -282
- package/contexts/LanguageContext.test.tsx +121 -121
- package/contexts/LanguageContext.tsx +250 -250
- package/contexts/theme-data.ts +391 -391
- package/dist/{AssistantChart-DoZCyS5r.cjs → AssistantChart-9w31gdAb.cjs} +4 -4
- package/dist/{AssistantChart-CldVCVDe.cjs → AssistantChart-BAudAfne.cjs} +5 -5
- package/dist/{AssistantChart-Bdd44uBn.cjs → AssistantChart-BAx9VQvb.cjs} +127 -388
- package/dist/{AssistantChart-Cu3m7RBo.js → AssistantChart-BP8upjMk.js} +5 -5
- package/dist/{AssistantChart-CFhDdGyU.js → AssistantChart-CVko2A1W.js} +130 -391
- package/dist/{AssistantChart-C_hwFRRr.js → AssistantChart-CVzmmhx4.js} +4 -4
- package/dist/{AudioPlayer-IAU5q5T1.cjs → AudioPlayer-1ypwE2Wh.cjs} +1 -1
- package/dist/{AudioPlayer-CGRUtUdN.js → AudioPlayer-DuKXrCfy.js} +1 -1
- package/dist/{LanguageContext-CS14yCpi.js → LanguageContext-BwhwC3G2.js} +2 -2
- package/dist/{LanguageContext-B_KFTCzT.cjs → LanguageContext-DvUt5jBg.cjs} +2 -2
- package/dist/{ThemeContext-C2EwAPDt.js → ThemeContext-BbBNoFTG.js} +2 -2
- package/dist/{ThemeContext-Bmod0Cg2.cjs → ThemeContext-BblcjQup.cjs} +13 -8
- package/dist/{ThemeContext-BWq9ACPo.js → ThemeContext-Bo-W2WZH.js} +13 -8
- package/dist/{ThemeContext-j5aGtPky.cjs → ThemeContext-CP3a0jxy.cjs} +193 -262
- package/dist/{ThemeContext-vTjumZeM.cjs → ThemeContext-Cmr8Ex8H.cjs} +2 -2
- package/dist/ThemeContext-CpqYShLq.cjs +324 -0
- package/dist/{ThemeContext-CQSo4Iwc.js → ThemeContext-D3LzacmG.js} +8 -1
- package/dist/ThemeContext-Du2nE1PL.js +325 -0
- package/dist/ThemeContext-GeEBTJ3q.cjs +1621 -0
- package/dist/ThemeContext-JyLK9B1o.js +1622 -0
- package/dist/{ThemeContext-CGk3KK0k.cjs → ThemeContext-U4dEYc6C.cjs} +8 -1
- package/dist/{ThemeContext-BXjrgUjW.js → ThemeContext-ept8jhXI.js} +200 -261
- package/dist/{VerifyEmailPage-CGIwmWrm.js → VerifyEmailPage-B31mCrMc.js} +1 -1
- package/dist/{VerifyEmailPage-C0c2e5n0.js → VerifyEmailPage-BE-L9mB7.js} +7 -7
- package/dist/{VerifyEmailPage-DSBMRHtl.js → VerifyEmailPage-BIBOKV7Z.js} +41 -36
- package/dist/{VerifyEmailPage-DgIid028.js → VerifyEmailPage-BJjAMUTW.js} +4 -4
- package/dist/{VerifyEmailPage--1Vurewl.cjs → VerifyEmailPage-BRSP-Pwt.cjs} +3 -3
- package/dist/{VerifyEmailPage-Cwi3kbol.cjs → VerifyEmailPage-Bae2cBXT.cjs} +7 -7
- package/dist/{VerifyEmailPage-De6bQjrz.cjs → VerifyEmailPage-BiRm7Nh4.cjs} +41 -36
- package/dist/{VerifyEmailPage-ByerOcm4.cjs → VerifyEmailPage-Bv8Ah_TK.cjs} +23 -20
- package/dist/VerifyEmailPage-Bvfv8HVQ.js +3214 -0
- package/dist/{VerifyEmailPage-BComraR7.cjs → VerifyEmailPage-CR7kb5df.cjs} +22 -12
- package/dist/{VerifyEmailPage-CpqqpLpo.cjs → VerifyEmailPage-C_Zk6Gen.cjs} +1 -1
- package/dist/{VerifyEmailPage-MTD7AG1Z.js → VerifyEmailPage-C_ihbcth.js} +4 -4
- package/dist/{VerifyEmailPage-1WwWczAn.js → VerifyEmailPage-CbgjOF0v.js} +22 -12
- package/dist/{VerifyEmailPage-DvMLZgFt.js → VerifyEmailPage-CdYPSJoO.js} +1 -1
- package/dist/{VerifyEmailPage-By3Jf__L.cjs → VerifyEmailPage-CkBYfsNy.cjs} +4 -4
- package/dist/{VerifyEmailPage-CJLz3jrn.js → VerifyEmailPage-Cyl55sJb.js} +23 -20
- package/dist/VerifyEmailPage-D-FRj5TU.cjs +3213 -0
- package/dist/{VerifyEmailPage-B4peJjAT.cjs → VerifyEmailPage-DF2ilhum.cjs} +334 -356
- package/dist/{VerifyEmailPage-CYXtbKi3.cjs → VerifyEmailPage-DMBh4NM9.cjs} +1 -1
- package/dist/{VerifyEmailPage-CgMxRb4z.js → VerifyEmailPage-DTtFfC-J.js} +3 -3
- package/dist/{VerifyEmailPage-CFLMls1p.cjs → VerifyEmailPage-Dt7zgA4w.cjs} +4 -4
- package/dist/{VerifyEmailPage-C5TNQTBa.js → VerifyEmailPage-EhudUdqF.js} +343 -355
- package/dist/{VerifyEmailPage-DGhuIqkb.js → VerifyEmailPage-X14vhdyl.js} +4 -4
- package/dist/VerifyEmailPage-hdB8JQGv.cjs +3213 -0
- package/dist/{VerifyEmailPage-Bp1XXl3H.cjs → VerifyEmailPage-u_Dn7t1U.cjs} +4 -4
- package/dist/VerifyEmailPage-vYHbYK3q.js +3214 -0
- package/dist/{XerticaProvider-CBGc4EMA.cjs → XerticaProvider-AChwphCO.cjs} +4 -4
- package/dist/{XerticaProvider-BIrqfZ-i.cjs → XerticaProvider-AbWlr7Af.cjs} +8 -11
- package/dist/{XerticaProvider-D-yNhF94.cjs → XerticaProvider-B8CaV7xu.cjs} +1 -1
- package/dist/{XerticaProvider-CEoWMTxu.js → XerticaProvider-BITjgC5p.js} +2 -2
- package/dist/{XerticaProvider-CllrbMEJ.cjs → XerticaProvider-By8q3Roe.cjs} +2 -2
- package/dist/{XerticaProvider-C1DKnvLh.js → XerticaProvider-CUYJZc32.js} +4 -4
- package/dist/{XerticaProvider-ET0ihewn.cjs → XerticaProvider-CW9hpCdF.cjs} +2 -2
- package/dist/{XerticaProvider-Dt5HEzbQ.js → XerticaProvider-CWgby5mY.js} +10 -10
- package/dist/XerticaProvider-CWs6EwNa.js +49 -0
- package/dist/XerticaProvider-CjQAQPcn.cjs +48 -0
- package/dist/XerticaProvider-D5lLumH-.js +49 -0
- package/dist/{XerticaProvider-DYq4JWtg.js → XerticaProvider-DQtvJU7m.js} +1 -1
- package/dist/XerticaProvider-qQUDop71.cjs +48 -0
- package/dist/{XerticaProvider-B7EVH-NF.js → XerticaProvider-siSt9uG2.js} +2 -2
- package/dist/{XerticaXLogo-Zw2B276b.cjs → XerticaXLogo-8TTzBjHw.cjs} +1 -1
- package/dist/{XerticaXLogo-B7xQ5dhi.js → XerticaXLogo-BWaag64t.js} +1 -1
- package/dist/{XerticaXLogo-DZbo4vOE.js → XerticaXLogo-CFuIlYFH.js} +12 -12
- package/dist/{XerticaXLogo-bvZSgwGF.cjs → XerticaXLogo-CU-U-GP4.cjs} +7 -13
- package/dist/XerticaXLogo-ChryA6xj.js +252 -0
- package/dist/{XerticaXLogo-CQUUjXoH.cjs → XerticaXLogo-CziKMQil.cjs} +8 -8
- package/dist/XerticaXLogo-DHz5SugF.js +252 -0
- package/dist/XerticaXLogo-DTee_y8X.cjs +251 -0
- package/dist/{XerticaXLogo-Cmsp-Eey.js → XerticaXLogo-DfUvz-lD.js} +9 -9
- package/dist/XerticaXLogo-kslQ8Tk_.cjs +251 -0
- package/dist/{alert-dialog-s-vmNkJ_.js → alert-dialog-iDe5VE5o.js} +3 -3
- package/dist/{alert-dialog-DSKByiKZ.cjs → alert-dialog-yckpaOpy.cjs} +3 -3
- package/dist/cli.js +16 -6
- package/dist/components/ui/chart/chart.d.ts +7 -5
- package/dist/{google-maps-loader-Y-QkD-Li.cjs → google-maps-loader-BqsYL48U.cjs} +0 -5
- package/dist/{google-maps-loader-CTYySAun.js → google-maps-loader-t2IlYBzw.js} +0 -4
- package/dist/index-CkTUgOwX.js +8 -0
- package/dist/{index-COtD8bRW.cjs → index-D3RLKRAs.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +454 -1027
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +1 -1
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/{sidebar-DAaY8bRU.cjs → sidebar-B3EYhli0.cjs} +33 -24
- package/dist/{sidebar-nzPoVHBQ.cjs → sidebar-B9NR0lCe.cjs} +46 -41
- package/dist/{sidebar-CeTMuzOx.cjs → sidebar-BvF5I2Ue.cjs} +47 -128
- package/dist/{sidebar-q7P2Godd.cjs → sidebar-C5B_LHek.cjs} +1 -1
- package/dist/{sidebar-CrQDDdcz.js → sidebar-CA6_ek3f.js} +33 -24
- package/dist/sidebar-CLmIjgNd.cjs +1136 -0
- package/dist/{sidebar-BxGXsDAd.cjs → sidebar-CVUGHOS_.cjs} +8 -16
- package/dist/{sidebar-BViy8Eeu.js → sidebar-CmvwjnVb.js} +9 -17
- package/dist/{sidebar-B6SlKZYN.js → sidebar-CplprZpM.js} +49 -40
- package/dist/sidebar-Duermn32.js +1133 -0
- package/dist/{sidebar-BbVIQvlP.js → sidebar-Dz7bd3zP.js} +1 -1
- package/dist/{sidebar-0ocFLSks.js → sidebar-KIS0C2JH.js} +50 -127
- package/dist/sidebar-OTO_up7Z.js +801 -0
- package/dist/sidebar-zowjejT2.cjs +800 -0
- package/dist/{use-audio-player-nv8ZSGa1.js → use-audio-player-Bkh23vQ3.js} +3 -7
- package/dist/{use-audio-player-NKsWyjWu.cjs → use-audio-player-Dn1NR9xN.cjs} +3 -7
- package/dist/{xertica-assistant-dyP7KHM5.cjs → xertica-assistant-B1IaHXnB.cjs} +388 -529
- package/dist/{xertica-assistant-ciJaWqm1.js → xertica-assistant-BMqdyRVi.js} +10 -28
- package/dist/{xertica-assistant-V_IdW4WF.cjs → xertica-assistant-Bj3vBCq_.cjs} +9 -27
- package/dist/{xertica-assistant-yX1CFBBo.js → xertica-assistant-DPsESB6t.js} +390 -531
- package/dist/{CodeBlock-7TTgmdGG.cjs → xertica-assistant-Qp3ydksa.cjs} +51 -263
- package/dist/{CodeBlock-BeSt1h5P.js → xertica-assistant-gnCJdcZY.js} +7 -219
- package/dist/xertica-ui.css +2 -2
- package/docs/architecture-improvements.md +456 -456
- package/docs/architecture.md +312 -312
- package/docs/components/assistant.md +428 -428
- package/docs/components/branding.md +252 -252
- package/docs/components/card-patterns.md +447 -447
- package/docs/components/error-boundary.md +201 -201
- package/docs/components/hooks.md +432 -432
- package/docs/components/language-selector.md +176 -176
- package/docs/components/pages.md +323 -323
- package/docs/components/sidebar.md +331 -331
- package/docs/components/stats-card.md +138 -138
- package/docs/doc-audit.md +244 -244
- package/docs/getting-started.md +616 -616
- package/docs/guidelines.md +330 -330
- package/docs/i18n.md +480 -480
- package/docs/installation.md +268 -268
- package/docs/llms.md +295 -295
- package/docs/state-management.md +289 -289
- package/guidelines/Guidelines.md +409 -409
- package/llms-compact.txt +1 -1
- package/llms-full.txt +10688 -10688
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/styles/xertica/base.css +90 -90
- package/styles/xertica/tokens.css +240 -240
- package/templates/.prettierignore +4 -4
- package/templates/.prettierrc +10 -10
- package/templates/CLAUDE.md +180 -180
- package/templates/package.json +2 -2
- package/templates/src/app/App.tsx +46 -46
- package/templates/src/app/components/AuthGuard.tsx +131 -131
- package/templates/src/features/assistant/data/mock.ts +75 -75
- package/templates/src/features/assistant/hooks/useAssistantConfig.ts +20 -20
- package/templates/src/features/assistant/index.ts +5 -5
- package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -70
- package/templates/src/features/auth/ui/LoginContent.tsx +92 -92
- package/templates/src/features/auth/ui/ResetPasswordContent.tsx +183 -183
- package/templates/src/features/auth/ui/SocialLoginButtons.tsx +78 -78
- package/templates/src/features/auth/ui/VerifyEmailContent.tsx +80 -80
- package/templates/src/features/home/data/mock.ts +41 -41
- package/templates/src/features/home/hooks/useFeatureCards.ts +20 -20
- package/templates/src/features/home/index.ts +11 -11
- package/templates/src/features/home/ui/HomeContent.tsx +117 -117
- package/templates/src/features/template/ui/CrudTemplate.tsx +112 -112
- package/templates/src/features/template/ui/DashboardTemplate.tsx +110 -110
- package/templates/src/features/template/ui/FormTemplate.tsx +117 -117
- package/templates/src/features/template/ui/LoginTemplate.tsx +59 -59
- package/templates/src/features/template/ui/TemplateContent.tsx +1322 -1322
- package/templates/src/i18n.ts +124 -124
- package/templates/src/locales/en/common.json +21 -21
- package/templates/src/locales/en/components/activityCard.json +10 -10
- package/templates/src/locales/en/components/assistant.json +119 -119
- package/templates/src/locales/en/components/media.json +29 -29
- package/templates/src/locales/en/components/notificationCard.json +5 -5
- package/templates/src/locales/en/components/profileCard.json +8 -8
- package/templates/src/locales/en/components/projectCard.json +10 -10
- package/templates/src/locales/en/components/sidebar.json +14 -14
- package/templates/src/locales/en/components/stats.json +8 -8
- package/templates/src/locales/en/components/team.json +14 -14
- package/templates/src/locales/en/errors.json +9 -9
- package/templates/src/locales/en/languageSelector.json +7 -7
- package/templates/src/locales/en/nav.json +6 -6
- package/templates/src/locales/en/pages/crudTemplate.json +25 -25
- package/templates/src/locales/en/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/en/pages/forgotPassword.json +10 -10
- package/templates/src/locales/en/pages/formTemplate.json +16 -16
- package/templates/src/locales/en/pages/home.json +7 -7
- package/templates/src/locales/en/pages/login.json +15 -15
- package/templates/src/locales/en/pages/loginTemplate.json +9 -9
- package/templates/src/locales/en/pages/resetPassword.json +18 -18
- package/templates/src/locales/en/pages/templates.json +317 -317
- package/templates/src/locales/en/pages/verifyEmail.json +12 -12
- package/templates/src/locales/en/themeToggle.json +6 -6
- package/templates/src/locales/es/common.json +21 -21
- package/templates/src/locales/es/components/activityCard.json +10 -10
- package/templates/src/locales/es/components/assistant.json +119 -119
- package/templates/src/locales/es/components/media.json +29 -29
- package/templates/src/locales/es/components/notificationCard.json +5 -5
- package/templates/src/locales/es/components/profileCard.json +8 -8
- package/templates/src/locales/es/components/projectCard.json +10 -10
- package/templates/src/locales/es/components/sidebar.json +14 -14
- package/templates/src/locales/es/components/stats.json +8 -8
- package/templates/src/locales/es/components/team.json +14 -14
- package/templates/src/locales/es/errors.json +9 -9
- package/templates/src/locales/es/languageSelector.json +7 -7
- package/templates/src/locales/es/nav.json +6 -6
- package/templates/src/locales/es/pages/crudTemplate.json +25 -25
- package/templates/src/locales/es/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/es/pages/forgotPassword.json +10 -10
- package/templates/src/locales/es/pages/formTemplate.json +16 -16
- package/templates/src/locales/es/pages/home.json +7 -7
- package/templates/src/locales/es/pages/login.json +15 -15
- package/templates/src/locales/es/pages/loginTemplate.json +9 -9
- package/templates/src/locales/es/pages/resetPassword.json +18 -18
- package/templates/src/locales/es/pages/templates.json +317 -317
- package/templates/src/locales/es/pages/verifyEmail.json +12 -12
- package/templates/src/locales/es/themeToggle.json +6 -6
- package/templates/src/locales/pt-BR/common.json +21 -21
- package/templates/src/locales/pt-BR/components/activityCard.json +10 -10
- package/templates/src/locales/pt-BR/components/assistant.json +119 -119
- package/templates/src/locales/pt-BR/components/media.json +29 -29
- package/templates/src/locales/pt-BR/components/notificationCard.json +5 -5
- package/templates/src/locales/pt-BR/components/profileCard.json +8 -8
- package/templates/src/locales/pt-BR/components/projectCard.json +10 -10
- package/templates/src/locales/pt-BR/components/sidebar.json +14 -14
- package/templates/src/locales/pt-BR/components/stats.json +8 -8
- package/templates/src/locales/pt-BR/components/team.json +14 -14
- package/templates/src/locales/pt-BR/errors.json +9 -9
- package/templates/src/locales/pt-BR/languageSelector.json +7 -7
- package/templates/src/locales/pt-BR/nav.json +6 -6
- package/templates/src/locales/pt-BR/pages/crudTemplate.json +25 -25
- package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +20 -20
- package/templates/src/locales/pt-BR/pages/forgotPassword.json +10 -10
- package/templates/src/locales/pt-BR/pages/formTemplate.json +16 -16
- package/templates/src/locales/pt-BR/pages/home.json +7 -7
- package/templates/src/locales/pt-BR/pages/login.json +15 -15
- package/templates/src/locales/pt-BR/pages/loginTemplate.json +9 -9
- package/templates/src/locales/pt-BR/pages/resetPassword.json +18 -18
- package/templates/src/locales/pt-BR/pages/templates.json +317 -317
- package/templates/src/locales/pt-BR/pages/verifyEmail.json +12 -12
- package/templates/src/locales/pt-BR/themeToggle.json +6 -6
- package/templates/src/pages/AssistantPage.tsx +470 -470
- package/templates/src/pages/HomePage.tsx +53 -53
- package/templates/src/shared/error-boundary.tsx +150 -150
- package/templates/src/shared/error-fallbacks.tsx +222 -222
- package/templates/src/styles/xertica/tokens.css +240 -240
- package/templates/vite.config.js +20 -20
- package/templates/vite.config.ts +55 -55
- package/dist/AssistantChart-BKVtGUKF.js +0 -3383
- package/dist/AssistantChart-CxGjH7Qk.js +0 -3477
- package/dist/AssistantChart-DIpshm3i.js +0 -4784
- package/dist/AssistantChart-D_PTeu8P.cjs +0 -3503
- package/dist/AssistantChart-WeycT5Pd.cjs +0 -3551
- package/dist/AssistantChart-zjsy2GaZ.cjs +0 -4810
- package/dist/AudioPlayer-B1lt5cPl.cjs +0 -989
- package/dist/AudioPlayer-BZ7bibzU.cjs +0 -982
- package/dist/AudioPlayer-BpRPS4-1.cjs +0 -1277
- package/dist/AudioPlayer-C12BjQBV.cjs +0 -997
- package/dist/AudioPlayer-CFeV8t-5.cjs +0 -936
- package/dist/AudioPlayer-Coly3q5R.js +0 -1278
- package/dist/AudioPlayer-CySJIyvL.js +0 -937
- package/dist/AudioPlayer-DMcG_c7L.js +0 -990
- package/dist/AudioPlayer-DcFKRJE_.js +0 -998
- package/dist/AudioPlayer-e8LfNoqO.js +0 -983
- package/dist/BrandColorsContext-565dDHd5.js +0 -660
- package/dist/BrandColorsContext-BcJbtkqn.cjs +0 -659
- package/dist/CodeBlock-BgfYL_rD.cjs +0 -2094
- package/dist/CodeBlock-BlcqlA9M.cjs +0 -2094
- package/dist/CodeBlock-Bnmeu5ez.cjs +0 -2094
- package/dist/CodeBlock-BtfPlbAI.js +0 -2078
- package/dist/CodeBlock-CIySIuYr.js +0 -2078
- package/dist/CodeBlock-CuPtUM-7.cjs +0 -2094
- package/dist/CodeBlock-D6ffWXgc.js +0 -2078
- package/dist/CodeBlock-D8dcwbit.cjs +0 -2094
- package/dist/CodeBlock-DMZrFnlw.cjs +0 -2094
- package/dist/CodeBlock-DlBehYN8.js +0 -2078
- package/dist/CodeBlock-DnYNI8rQ.js +0 -2078
- package/dist/CodeBlock-DvKWbSnE.cjs +0 -2094
- package/dist/CodeBlock-DwMCfkFY.js +0 -2078
- package/dist/CodeBlock-Dy6CNYyj.js +0 -2078
- package/dist/CodeBlock-U1pPOQI7.cjs +0 -2094
- package/dist/CodeBlock-f_GpNhEB.js +0 -2078
- package/dist/CodeBlock-oB6u8nI1.js +0 -2078
- package/dist/CodeBlock-tZC31B73.cjs +0 -2094
- package/dist/FeatureCard-CxC-7C-C.cjs +0 -300
- package/dist/FeatureCard-DbHWCb4E.js +0 -301
- package/dist/ImageWithFallback-CGtidP6B.cjs +0 -4542
- package/dist/ImageWithFallback-lsg3pdFg.js +0 -4508
- package/dist/LanguageSelector-B5YfbHra.js +0 -231
- package/dist/LanguageSelector-D6uacAIM.cjs +0 -230
- package/dist/LayoutContext-B45-e9DI.cjs +0 -93
- package/dist/LayoutContext-BAql6ZRY.js +0 -97
- package/dist/LayoutContext-Bav3UMEA.js +0 -94
- package/dist/LayoutContext-BvK-ggDa.cjs +0 -96
- package/dist/ThemeContext-BoH4NLfN.js +0 -734
- package/dist/ThemeContext-r69W20Xg.cjs +0 -733
- package/dist/VerifyEmailPage-COiyNl1y.js +0 -2825
- package/dist/VerifyEmailPage-CqKsR2v8.js +0 -2827
- package/dist/VerifyEmailPage-DjQKRlUS.cjs +0 -2824
- package/dist/VerifyEmailPage-s-1X3LDJ.cjs +0 -2826
- package/dist/XerticaOrbe-KL1RBHzw.cjs +0 -1354
- package/dist/XerticaOrbe-zwS1p2a8.js +0 -1355
- package/dist/XerticaProvider-6btlAlzc.js +0 -17
- package/dist/XerticaProvider-BNoNOxQ5.cjs +0 -16
- package/dist/XerticaProvider-BlY2limY.cjs +0 -38
- package/dist/XerticaProvider-DDuiIcKo.js +0 -39
- package/dist/XerticaProvider-cI9hSs27.cjs +0 -38
- package/dist/XerticaProvider-hSwhNQex.js +0 -39
- package/dist/alert-dialog-BOje--vD.js +0 -847
- package/dist/alert-dialog-BtEuQqrg.cjs +0 -870
- package/dist/breadcrumb-CqJ7bHY5.js +0 -161
- package/dist/breadcrumb-m9Hb2_XN.cjs +0 -177
- package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +0 -6
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +0 -21
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +0 -49
- package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +0 -16
- package/dist/components/blocks/audio-player/AudioPlayer.d.ts +0 -35
- package/dist/components/blocks/audio-player/index.d.ts +0 -1
- package/dist/components/blocks/document-editor/DocumentEditor.d.ts +0 -26
- package/dist/components/blocks/document-editor/index.d.ts +0 -1
- package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +0 -41
- package/dist/components/blocks/podcast-player/index.d.ts +0 -1
- package/dist/components/ui/chart/parts/chart-dashboard.d.ts +0 -113
- package/dist/components/ui/chart/parts/chart-metric.d.ts +0 -118
- package/dist/components/ui/chart/parts/chart-primitives.d.ts +0 -101
- package/dist/components/ui/chart/parts/chart-shared.d.ts +0 -20
- package/dist/components/ui/chart/parts/chart-utils.d.ts +0 -12
- package/dist/components/ui/chart/parts/index.d.ts +0 -5
- package/dist/dropdown-menu-BDB5CmQs.cjs +0 -247
- package/dist/dropdown-menu-DQidbKBD.js +0 -231
- package/dist/google-maps-loader-BFWp6VPd.js +0 -287
- package/dist/google-maps-loader-BKcdgFbu.cjs +0 -312
- package/dist/google-maps-loader-CumCNXeG.js +0 -312
- package/dist/google-maps-loader-eS3uQ5TA.cjs +0 -287
- package/dist/header-Cgy6vYPk.cjs +0 -731
- package/dist/header-DRlT4jgI.js +0 -715
- package/dist/header-Dux00SI4.cjs +0 -731
- package/dist/header-EkGKXPsD.js +0 -715
- package/dist/header-WfEywpyc.cjs +0 -731
- package/dist/header-tifNQn2U.js +0 -715
- package/dist/index-BhapVLVj.js +0 -8
- package/dist/index-D6fxYEY8.cjs +0 -7
- package/dist/index-DAIp0_HK.js +0 -8
- package/dist/index-DW5tYe26.js +0 -8
- package/dist/index-GA__GvnG.cjs +0 -7
- package/dist/input-2R4loU86.js +0 -127
- package/dist/input-DWANSKGb.cjs +0 -145
- package/dist/progress-DPtzoVV8.js +0 -175
- package/dist/progress-EeaoqqUs.cjs +0 -191
- package/dist/rich-text-editor-0mraWT5y.cjs +0 -2376
- package/dist/rich-text-editor-B-IkcPD0.js +0 -2874
- package/dist/rich-text-editor-B6jMRLzk.cjs +0 -1939
- package/dist/rich-text-editor-B8_oYcIR.js +0 -1730
- package/dist/rich-text-editor-B9UbSXNb.js +0 -1203
- package/dist/rich-text-editor-BYuRBNBU.js +0 -2373
- package/dist/rich-text-editor-Bb9pySTs.cjs +0 -2374
- package/dist/rich-text-editor-BcL6L3cm.cjs +0 -2374
- package/dist/rich-text-editor-BoVZYtTs.cjs +0 -2391
- package/dist/rich-text-editor-Bp3zQqMC.js +0 -2954
- package/dist/rich-text-editor-CMgSN_w2.js +0 -1189
- package/dist/rich-text-editor-CPV1lEPH.cjs +0 -1748
- package/dist/rich-text-editor-CeucBdIv.cjs +0 -2971
- package/dist/rich-text-editor-CoKqbCtu.cjs +0 -1799
- package/dist/rich-text-editor-Cw56T_mB.js +0 -2356
- package/dist/rich-text-editor-Cyt8qs2b.js +0 -1921
- package/dist/rich-text-editor-D6H84OcX.cjs +0 -1220
- package/dist/rich-text-editor-D76gD-QI.js +0 -2328
- package/dist/rich-text-editor-DKkokOnA.js +0 -1781
- package/dist/rich-text-editor-DNsdpN64.cjs +0 -2359
- package/dist/rich-text-editor-DfG8bCyY.js +0 -2358
- package/dist/rich-text-editor-Dxjw31Z4.js +0 -2341
- package/dist/rich-text-editor-DzP0Epmb.js +0 -2356
- package/dist/rich-text-editor-bRkNoeZY.cjs +0 -2891
- package/dist/rich-text-editor-lyYE2ZG5.cjs +0 -1207
- package/dist/rich-text-editor-skplNlBM.cjs +0 -2345
- package/dist/select-Bkbr0f-Z.cjs +0 -162
- package/dist/select-CvIVdX2n.js +0 -145
- package/dist/sidebar-CK_0ZQHj.cjs +0 -803
- package/dist/sidebar-CUuOvYhK.js +0 -787
- package/dist/sidebar-DQj1z3jG.cjs +0 -758
- package/dist/sidebar-Djn5syhi.cjs +0 -786
- package/dist/sidebar-LluMXfam.js +0 -759
- package/dist/sidebar-_rT7rBMk.js +0 -787
- package/dist/slider-Bc5Hd0y1.js +0 -56
- package/dist/slider-N7hFFj6X.cjs +0 -73
- package/dist/tooltip-Ded96neP.cjs +0 -137
- package/dist/tooltip-HDOoD2-0.js +0 -120
- package/dist/use-audio-player-B31J-aqh.cjs +0 -187
- package/dist/use-audio-player-BkmEmj8Q.js +0 -185
- package/dist/use-audio-player-CLFTWFW1.cjs +0 -184
- package/dist/use-audio-player-CLLn00I6.js +0 -188
- package/dist/use-file-upload-BcjEo2S5.js +0 -404
- package/dist/use-file-upload-CRJR68Tj.cjs +0 -403
- package/dist/use-mobile-B0hNy_Y6.cjs +0 -4303
- package/dist/use-mobile-BXuYROXM.js +0 -4202
- package/dist/use-mobile-Bbd51ASU.cjs +0 -4392
- package/dist/use-mobile-Bk6CX-TC.js +0 -4359
- package/dist/use-mobile-BvYdisLP.js +0 -4202
- package/dist/use-mobile-BzuxjzNX.cjs +0 -4392
- package/dist/use-mobile-CG2-SdXV.cjs +0 -4235
- package/dist/use-mobile-CKb5pqTs.js +0 -4269
- package/dist/use-mobile-CYuAuGDl.js +0 -4202
- package/dist/use-mobile-CaENcqm-.js +0 -4508
- package/dist/use-mobile-CbrYgJGJ.js +0 -4203
- package/dist/use-mobile-Cd4xPrKq.cjs +0 -46
- package/dist/use-mobile-DMOvImGQ.cjs +0 -4542
- package/dist/use-mobile-DRB3BQgD.cjs +0 -4235
- package/dist/use-mobile-DZvv7QMR.js +0 -4359
- package/dist/use-mobile-DdI_TXam.cjs +0 -4235
- package/dist/use-mobile-DlceKf8a.js +0 -4359
- package/dist/use-mobile-DsOnow1o.cjs +0 -4236
- package/dist/use-mobile-Kcj6jSnK.cjs +0 -4392
- package/dist/use-mobile-bnKcua_i.js +0 -4202
- package/dist/use-mobile-j4w2Jrf1.js +0 -30
- package/dist/use-mobile-ncXBeE2z.cjs +0 -4235
- package/dist/use-rich-text-editor-DjiddBGv.js +0 -282
- package/dist/use-rich-text-editor-lpeswbCs.cjs +0 -281
- package/dist/xertica-assistant-BdiZag0h.js +0 -2187
- package/dist/xertica-assistant-CrgTb6Hs.cjs +0 -2155
- package/dist/xertica-assistant-DCsnQyi5.js +0 -2156
- package/dist/xertica-assistant-DUBpmEgo.cjs +0 -2186
- package/dist/{rich-text-editor-DgF8s7xW.js → rich-text-editor-BmsjY03B.js} +26 -26
- package/dist/{rich-text-editor-mWoaSCE4.cjs → rich-text-editor-GS2kpTAK.cjs} +26 -26
|
@@ -1,787 +1,1033 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Sidebar, useSidebar } from './sidebar';
|
|
3
|
-
import { useLayout } from '../../../contexts/LayoutContext';
|
|
4
|
-
import { BrowserRouter } from 'react-router-dom';
|
|
5
|
-
import {
|
|
6
|
-
Home,
|
|
7
|
-
Users,
|
|
8
|
-
Settings,
|
|
9
|
-
BarChart,
|
|
10
|
-
Plus,
|
|
11
|
-
Clock,
|
|
12
|
-
FileEdit,
|
|
13
|
-
ArrowRightLeft,
|
|
14
|
-
PanelLeft,
|
|
15
|
-
Menu,
|
|
16
|
-
Trash2,
|
|
17
|
-
Map,
|
|
18
|
-
Archive,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
>
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
{ path: '/
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
{
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Sidebar, useSidebar } from './sidebar';
|
|
3
|
+
import { useLayout } from '../../../contexts/LayoutContext';
|
|
4
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
5
|
+
import {
|
|
6
|
+
Home,
|
|
7
|
+
Users,
|
|
8
|
+
Settings,
|
|
9
|
+
BarChart,
|
|
10
|
+
Plus,
|
|
11
|
+
Clock,
|
|
12
|
+
FileEdit,
|
|
13
|
+
ArrowRightLeft,
|
|
14
|
+
PanelLeft,
|
|
15
|
+
Menu,
|
|
16
|
+
Trash2,
|
|
17
|
+
Map,
|
|
18
|
+
Archive,
|
|
19
|
+
ShoppingCart,
|
|
20
|
+
Package,
|
|
21
|
+
Tag,
|
|
22
|
+
Truck,
|
|
23
|
+
CreditCard,
|
|
24
|
+
Bell,
|
|
25
|
+
Shield,
|
|
26
|
+
Key,
|
|
27
|
+
Database,
|
|
28
|
+
Server,
|
|
29
|
+
Activity,
|
|
30
|
+
TrendingUp,
|
|
31
|
+
PieChart,
|
|
32
|
+
BarChart2,
|
|
33
|
+
FileText,
|
|
34
|
+
Folder,
|
|
35
|
+
MessageSquare,
|
|
36
|
+
Mail,
|
|
37
|
+
Phone,
|
|
38
|
+
Globe,
|
|
39
|
+
Layers,
|
|
40
|
+
Zap,
|
|
41
|
+
} from 'lucide-react';
|
|
42
|
+
import React, { useState } from 'react';
|
|
43
|
+
import { Badge } from '../../ui/badge';
|
|
44
|
+
import { Button } from '../../ui/button';
|
|
45
|
+
import { Progress } from '../../ui/progress';
|
|
46
|
+
|
|
47
|
+
const meta: Meta<typeof Sidebar> = {
|
|
48
|
+
title: 'Layout/Sidebar',
|
|
49
|
+
component: Sidebar,
|
|
50
|
+
decorators: [
|
|
51
|
+
Story => (
|
|
52
|
+
<BrowserRouter>
|
|
53
|
+
<div className="flex h-screen w-full overflow-hidden bg-background">
|
|
54
|
+
<Story />
|
|
55
|
+
</div>
|
|
56
|
+
</BrowserRouter>
|
|
57
|
+
),
|
|
58
|
+
],
|
|
59
|
+
parameters: {
|
|
60
|
+
layout: 'fullscreen',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default meta;
|
|
65
|
+
type Story = StoryObj<typeof Sidebar>;
|
|
66
|
+
|
|
67
|
+
export const Default: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
variant: 'default',
|
|
70
|
+
expanded: false,
|
|
71
|
+
user: { email: 'admin@example.com' },
|
|
72
|
+
onLogout: () => console.log('Logged out'),
|
|
73
|
+
location: { pathname: '/home' },
|
|
74
|
+
routes: [
|
|
75
|
+
{ path: '/home', label: 'Home', icon: Home },
|
|
76
|
+
{ path: '/dashboard', label: 'Dashboard', icon: Users },
|
|
77
|
+
{ path: '/settings', label: 'Settings', icon: Settings },
|
|
78
|
+
],
|
|
79
|
+
footer: {
|
|
80
|
+
showUser: true,
|
|
81
|
+
showSettings: true,
|
|
82
|
+
showLogout: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
render: args => {
|
|
86
|
+
const { sidebarWidth: contextWidth } = useLayout();
|
|
87
|
+
const [isExpanded, setIsExpanded] = useState(args.expanded);
|
|
88
|
+
|
|
89
|
+
// In Storybook, we match the sidebar widths (280 expanded, 80 collapsed)
|
|
90
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
95
|
+
style={{ transform: 'translateZ(0)' }}
|
|
96
|
+
>
|
|
97
|
+
<Sidebar
|
|
98
|
+
{...args}
|
|
99
|
+
expanded={isExpanded}
|
|
100
|
+
onToggle={() => setIsExpanded(!isExpanded)}
|
|
101
|
+
width={currentWidth}
|
|
102
|
+
navigate={() => {}}
|
|
103
|
+
/>
|
|
104
|
+
<div
|
|
105
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
106
|
+
style={{ left: `${currentWidth}px` }}
|
|
107
|
+
>
|
|
108
|
+
<div className="text-center">
|
|
109
|
+
<p className="text-muted-foreground">Traditional System Navigation</p>
|
|
110
|
+
<p className="text-xs text-muted-foreground mt-2">Click on the menu icon to expand</p>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const DefaultWithGroups: Story = {
|
|
119
|
+
args: {
|
|
120
|
+
variant: 'default',
|
|
121
|
+
expanded: false,
|
|
122
|
+
user: { name: 'Admin', email: 'admin@example.com' },
|
|
123
|
+
onLogout: () => console.log('Logged out'),
|
|
124
|
+
location: { pathname: '/home' },
|
|
125
|
+
navigationGroups: [
|
|
126
|
+
{
|
|
127
|
+
id: 'main',
|
|
128
|
+
label: 'Principal',
|
|
129
|
+
items: [
|
|
130
|
+
{ path: '/home', label: 'Início', icon: Home },
|
|
131
|
+
{
|
|
132
|
+
path: '/dashboard',
|
|
133
|
+
label: 'Dashboard',
|
|
134
|
+
icon: BarChart,
|
|
135
|
+
children: [
|
|
136
|
+
{ path: '/dashboard/overview', label: 'Visão Geral', icon: BarChart },
|
|
137
|
+
{ path: '/dashboard/reports', label: 'Relatórios', icon: FileEdit },
|
|
138
|
+
{ path: '/dashboard/analytics', label: 'Analytics', icon: Map },
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'admin',
|
|
145
|
+
label: 'Administração',
|
|
146
|
+
items: [
|
|
147
|
+
{
|
|
148
|
+
path: '/users',
|
|
149
|
+
label: 'Usuários',
|
|
150
|
+
icon: Users,
|
|
151
|
+
children: [
|
|
152
|
+
{ path: '/users/list', label: 'Lista de Usuários', icon: Users },
|
|
153
|
+
{ path: '/users/roles', label: 'Perfis de Acesso', icon: Settings },
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
{ path: '/settings', label: 'Configurações', icon: Settings },
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
footer: {
|
|
161
|
+
showUser: true,
|
|
162
|
+
showSettings: false,
|
|
163
|
+
showLogout: true,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
render: args => {
|
|
167
|
+
const [isExpanded, setIsExpanded] = useState(args.expanded);
|
|
168
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<div
|
|
172
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
173
|
+
style={{ transform: 'translateZ(0)' }}
|
|
174
|
+
>
|
|
175
|
+
<Sidebar
|
|
176
|
+
{...args}
|
|
177
|
+
expanded={isExpanded}
|
|
178
|
+
onToggle={() => setIsExpanded(!isExpanded)}
|
|
179
|
+
width={currentWidth}
|
|
180
|
+
navigate={() => {}}
|
|
181
|
+
/>
|
|
182
|
+
<div
|
|
183
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
184
|
+
style={{ left: `${currentWidth}px` }}
|
|
185
|
+
>
|
|
186
|
+
<div className="text-center">
|
|
187
|
+
<p className="text-muted-foreground">Navigation with Groups and Children</p>
|
|
188
|
+
<p className="text-xs text-muted-foreground mt-2">
|
|
189
|
+
Expand and click the arrow button on items to see sub-menus
|
|
190
|
+
</p>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export const Assistant: Story = {
|
|
199
|
+
args: {
|
|
200
|
+
variant: 'assistant',
|
|
201
|
+
expanded: false,
|
|
202
|
+
user: { email: 'admin@example.com' },
|
|
203
|
+
onLogout: () => console.log('Logged out'),
|
|
204
|
+
location: { pathname: '/assistant/refatoracao' },
|
|
205
|
+
search: {
|
|
206
|
+
show: true,
|
|
207
|
+
placeholder: 'Buscar tópicos...',
|
|
208
|
+
filter: {
|
|
209
|
+
show: true,
|
|
210
|
+
content: (
|
|
211
|
+
<div className="p-2 space-y-2">
|
|
212
|
+
<div className="text-xs font-semibold uppercase text-muted-foreground px-2 text-left">
|
|
213
|
+
Filter by Status
|
|
214
|
+
</div>
|
|
215
|
+
<div className="flex flex-wrap gap-2 p-1">
|
|
216
|
+
<Badge className="bg-sidebar-foreground/20 text-sidebar-foreground border-none cursor-pointer hover:bg-sidebar-foreground/30">
|
|
217
|
+
Active
|
|
218
|
+
</Badge>
|
|
219
|
+
<Badge
|
|
220
|
+
variant="outline"
|
|
221
|
+
className="text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10"
|
|
222
|
+
>
|
|
223
|
+
Archived
|
|
224
|
+
</Badge>
|
|
225
|
+
<Badge
|
|
226
|
+
variant="outline"
|
|
227
|
+
className="text-sidebar-foreground/70 border-sidebar-foreground/20 cursor-pointer hover:bg-sidebar-foreground/10"
|
|
228
|
+
>
|
|
229
|
+
Pending
|
|
230
|
+
</Badge>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
),
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
fixedArea: {
|
|
237
|
+
show: true,
|
|
238
|
+
icon: Plus,
|
|
239
|
+
onClick: () => console.log('New Conversation clicked'),
|
|
240
|
+
content: (
|
|
241
|
+
<Button className="w-full bg-sidebar-primary hover:bg-sidebar-primary/90 text-sidebar-primary-foreground shadow-lg font-bold border-none transition-all duration-300 transform hover:scale-[1.02] active:scale-[0.98]">
|
|
242
|
+
<Plus className="w-4 h-4 mr-2" />
|
|
243
|
+
New Conversation
|
|
244
|
+
</Button>
|
|
245
|
+
),
|
|
246
|
+
},
|
|
247
|
+
navigationGroups: [
|
|
248
|
+
{
|
|
249
|
+
id: 'recent',
|
|
250
|
+
label: 'Recent',
|
|
251
|
+
icon: Clock,
|
|
252
|
+
items: [
|
|
253
|
+
{
|
|
254
|
+
path: '/assistant/refatoracao',
|
|
255
|
+
label: 'Edit Sidebar',
|
|
256
|
+
description: 'Active now',
|
|
257
|
+
actions: [
|
|
258
|
+
{ label: 'Rename', icon: FileEdit, onClick: () => console.log('Open rename...') },
|
|
259
|
+
{
|
|
260
|
+
label: 'Move',
|
|
261
|
+
icon: ArrowRightLeft,
|
|
262
|
+
children: [
|
|
263
|
+
{
|
|
264
|
+
label: 'Active Projects',
|
|
265
|
+
onClick: () => console.log('Moved to Active Projects'),
|
|
266
|
+
},
|
|
267
|
+
{ label: 'Monitoring', onClick: () => console.log('Moved to Monitoring') },
|
|
268
|
+
{ label: 'Archive', onClick: () => console.log('Moved to Archive') },
|
|
269
|
+
],
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
label: 'Clear',
|
|
273
|
+
icon: Trash2,
|
|
274
|
+
onClick: () => console.log('History Cleared!'),
|
|
275
|
+
variant: 'destructive',
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: 'projects',
|
|
283
|
+
label: 'Project Monitoring',
|
|
284
|
+
icon: Map,
|
|
285
|
+
actions: [
|
|
286
|
+
{
|
|
287
|
+
label: 'New Category',
|
|
288
|
+
icon: Plus,
|
|
289
|
+
onClick: () => console.log('Create new category...'),
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
label: 'Archive Group',
|
|
293
|
+
icon: Archive,
|
|
294
|
+
onClick: () => console.log('Archiving group...'),
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
items: [
|
|
298
|
+
{
|
|
299
|
+
path: '/assistant/br163',
|
|
300
|
+
label: 'Panel Status',
|
|
301
|
+
icon: () => <div className="w-2 h-2 rounded-full bg-yellow-500" />,
|
|
302
|
+
description: (
|
|
303
|
+
<div className="space-y-1.5 min-w-[160px]">
|
|
304
|
+
<Progress value={67} className="h-1.5 bg-sidebar-foreground/10" />
|
|
305
|
+
<div className="flex justify-between items-center text-[10px] text-sidebar-foreground/60">
|
|
306
|
+
<span>Label</span>
|
|
307
|
+
<span>67%</span>
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
),
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
render: args => {
|
|
317
|
+
const [isExpanded, setIsExpanded] = useState(args.expanded);
|
|
318
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
319
|
+
|
|
320
|
+
return (
|
|
321
|
+
<div
|
|
322
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
323
|
+
style={{ transform: 'translateZ(0)' }}
|
|
324
|
+
>
|
|
325
|
+
<Sidebar
|
|
326
|
+
{...args}
|
|
327
|
+
expanded={isExpanded}
|
|
328
|
+
onToggle={() => setIsExpanded(!isExpanded)}
|
|
329
|
+
width={currentWidth}
|
|
330
|
+
navigate={() => {}}
|
|
331
|
+
/>
|
|
332
|
+
<div
|
|
333
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
334
|
+
style={{ left: `${currentWidth}px` }}
|
|
335
|
+
>
|
|
336
|
+
<div className="text-center">
|
|
337
|
+
<p className="text-muted-foreground">Assistant Mode Content</p>
|
|
338
|
+
<p className="text-xs text-muted-foreground mt-2">Click on the menu icon to expand</p>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
);
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export const Collapsed: Story = {
|
|
347
|
+
args: {
|
|
348
|
+
...Default.args,
|
|
349
|
+
expanded: false,
|
|
350
|
+
},
|
|
351
|
+
render: args => {
|
|
352
|
+
const [isExpanded, setIsExpanded] = useState(args.expanded);
|
|
353
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
354
|
+
|
|
355
|
+
return (
|
|
356
|
+
<div
|
|
357
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
358
|
+
style={{ transform: 'translateZ(0)' }}
|
|
359
|
+
>
|
|
360
|
+
<Sidebar
|
|
361
|
+
{...args}
|
|
362
|
+
expanded={isExpanded}
|
|
363
|
+
onToggle={() => setIsExpanded(!isExpanded)}
|
|
364
|
+
width={currentWidth}
|
|
365
|
+
navigate={() => {}}
|
|
366
|
+
/>
|
|
367
|
+
<div
|
|
368
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
369
|
+
style={{ left: `${currentWidth}px` }}
|
|
370
|
+
>
|
|
371
|
+
<div className="text-center">
|
|
372
|
+
<p className="text-muted-foreground">Compact Navigation</p>
|
|
373
|
+
<p className="text-xs text-muted-foreground mt-2">Click on the menu icon to expand</p>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
);
|
|
378
|
+
},
|
|
379
|
+
};
|
|
380
|
+
export const NoFooter: Story = {
|
|
381
|
+
args: {
|
|
382
|
+
...Default.args,
|
|
383
|
+
showFooter: false,
|
|
384
|
+
},
|
|
385
|
+
render: args => {
|
|
386
|
+
const [isExpanded, setIsExpanded] = useState(args.expanded);
|
|
387
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
388
|
+
|
|
389
|
+
return (
|
|
390
|
+
<div
|
|
391
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
392
|
+
style={{ transform: 'translateZ(0)' }}
|
|
393
|
+
>
|
|
394
|
+
<Sidebar
|
|
395
|
+
{...args}
|
|
396
|
+
expanded={isExpanded}
|
|
397
|
+
onToggle={() => setIsExpanded(!isExpanded)}
|
|
398
|
+
width={currentWidth}
|
|
399
|
+
navigate={() => {}}
|
|
400
|
+
/>
|
|
401
|
+
<div
|
|
402
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
403
|
+
style={{ left: `${currentWidth}px` }}
|
|
404
|
+
>
|
|
405
|
+
<div className="text-center">
|
|
406
|
+
<p className="text-muted-foreground">Sidebar without Footer</p>
|
|
407
|
+
<p className="text-xs text-muted-foreground mt-2">Click on the menu icon to expand</p>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
);
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export const Autonomous: Story = {
|
|
416
|
+
args: {
|
|
417
|
+
...Default.args,
|
|
418
|
+
expanded: undefined,
|
|
419
|
+
onToggle: undefined,
|
|
420
|
+
},
|
|
421
|
+
render: args => {
|
|
422
|
+
return (
|
|
423
|
+
<div
|
|
424
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
425
|
+
style={{ transform: 'translateZ(0)' }}
|
|
426
|
+
>
|
|
427
|
+
<Sidebar {...args} />
|
|
428
|
+
<div
|
|
429
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
430
|
+
style={{ left: `80px` }}
|
|
431
|
+
>
|
|
432
|
+
<div className="text-center max-w-md">
|
|
433
|
+
<p className="text-muted-foreground font-bold">Autonomous Sidebar</p>
|
|
434
|
+
<p className="text-sm text-muted-foreground/80 mt-2">
|
|
435
|
+
This instance is managing its own state internally. No `expanded` or `onToggle` props
|
|
436
|
+
are passed.
|
|
437
|
+
</p>
|
|
438
|
+
<p className="text-xs text-muted-foreground mt-4">
|
|
439
|
+
Note: Layout coordination (content padding) must be handled manually when using
|
|
440
|
+
autonomous mode without LayoutProvider.
|
|
441
|
+
</p>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
);
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Desktop view with sub-items expanded.
|
|
451
|
+
* Items with `children` show a ChevronRight button; clicking it opens a
|
|
452
|
+
* dropdown listing the child routes positioned to the right of the sidebar.
|
|
453
|
+
*/
|
|
454
|
+
export const WithSubitemsDesktop: Story = {
|
|
455
|
+
name: 'With Sub-items (Desktop)',
|
|
456
|
+
args: {
|
|
457
|
+
variant: 'default',
|
|
458
|
+
expanded: true,
|
|
459
|
+
user: { name: 'Admin', email: 'admin@example.com' },
|
|
460
|
+
onLogout: () => console.log('Logged out'),
|
|
461
|
+
location: { pathname: '/dashboard' },
|
|
462
|
+
navigationGroups: [
|
|
463
|
+
{
|
|
464
|
+
id: 'main',
|
|
465
|
+
label: 'Principal',
|
|
466
|
+
items: [
|
|
467
|
+
{ path: '/home', label: 'Início', icon: Home },
|
|
468
|
+
{
|
|
469
|
+
path: '/dashboard',
|
|
470
|
+
label: 'Dashboard',
|
|
471
|
+
icon: BarChart,
|
|
472
|
+
children: [
|
|
473
|
+
{ path: '/dashboard/overview', label: 'Visão Geral', icon: BarChart },
|
|
474
|
+
{ path: '/dashboard/reports', label: 'Relatórios', icon: FileEdit },
|
|
475
|
+
{ path: '/dashboard/analytics', label: 'Analytics', icon: Map },
|
|
476
|
+
{ path: '/dashboard/trends', label: 'Tendências', icon: TrendingUp },
|
|
477
|
+
{ path: '/dashboard/kpis', label: 'KPIs', icon: Activity },
|
|
478
|
+
{ path: '/dashboard/charts', label: 'Gráficos', icon: PieChart },
|
|
479
|
+
{ path: '/dashboard/comparison', label: 'Comparativos', icon: BarChart2 },
|
|
480
|
+
],
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
path: '/reports',
|
|
484
|
+
label: 'Relatórios',
|
|
485
|
+
icon: FileText,
|
|
486
|
+
children: [
|
|
487
|
+
{ path: '/reports/sales', label: 'Vendas', icon: ShoppingCart },
|
|
488
|
+
{ path: '/reports/financial', label: 'Financeiro', icon: CreditCard },
|
|
489
|
+
{ path: '/reports/operational', label: 'Operacional', icon: Layers },
|
|
490
|
+
{ path: '/reports/exports', label: 'Exportações', icon: FileEdit },
|
|
491
|
+
],
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
path: '/catalog',
|
|
495
|
+
label: 'Catálogo',
|
|
496
|
+
icon: Package,
|
|
497
|
+
children: [
|
|
498
|
+
{ path: '/catalog/products', label: 'Produtos', icon: Package },
|
|
499
|
+
{ path: '/catalog/categories', label: 'Categorias', icon: Tag },
|
|
500
|
+
{ path: '/catalog/inventory', label: 'Estoque', icon: Database },
|
|
501
|
+
],
|
|
502
|
+
},
|
|
503
|
+
],
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
id: 'commerce',
|
|
507
|
+
label: 'Comercial',
|
|
508
|
+
items: [
|
|
509
|
+
{
|
|
510
|
+
path: '/orders',
|
|
511
|
+
label: 'Pedidos',
|
|
512
|
+
icon: ShoppingCart,
|
|
513
|
+
children: [
|
|
514
|
+
{ path: '/orders/pending', label: 'Pendentes', icon: Clock },
|
|
515
|
+
{ path: '/orders/processing', label: 'Em Andamento', icon: Zap },
|
|
516
|
+
{ path: '/orders/shipped', label: 'Enviados', icon: Truck },
|
|
517
|
+
{ path: '/orders/delivered', label: 'Entregues', icon: Package },
|
|
518
|
+
{ path: '/orders/cancelled', label: 'Cancelados', icon: Trash2 },
|
|
519
|
+
],
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
path: '/logistics',
|
|
523
|
+
label: 'Logística',
|
|
524
|
+
icon: Truck,
|
|
525
|
+
children: [
|
|
526
|
+
{ path: '/logistics/carriers', label: 'Transportadoras', icon: Truck },
|
|
527
|
+
{ path: '/logistics/tracking', label: 'Rastreamento', icon: Map },
|
|
528
|
+
{ path: '/logistics/warehouses', label: 'Armazéns', icon: Archive },
|
|
529
|
+
],
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
path: '/billing',
|
|
533
|
+
label: 'Faturamento',
|
|
534
|
+
icon: CreditCard,
|
|
535
|
+
children: [
|
|
536
|
+
{ path: '/billing/invoices', label: 'Faturas', icon: FileText },
|
|
537
|
+
{ path: '/billing/payments', label: 'Pagamentos', icon: CreditCard },
|
|
538
|
+
{ path: '/billing/refunds', label: 'Estornos', icon: ArrowRightLeft },
|
|
539
|
+
],
|
|
540
|
+
},
|
|
541
|
+
],
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
id: 'communication',
|
|
545
|
+
label: 'Comunicação',
|
|
546
|
+
items: [
|
|
547
|
+
{
|
|
548
|
+
path: '/notifications',
|
|
549
|
+
label: 'Notificações',
|
|
550
|
+
icon: Bell,
|
|
551
|
+
children: [
|
|
552
|
+
{ path: '/notifications/email', label: 'E-mail', icon: Mail },
|
|
553
|
+
{ path: '/notifications/sms', label: 'SMS', icon: Phone },
|
|
554
|
+
{ path: '/notifications/push', label: 'Push', icon: Bell },
|
|
555
|
+
],
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
path: '/messages',
|
|
559
|
+
label: 'Mensagens',
|
|
560
|
+
icon: MessageSquare,
|
|
561
|
+
children: [
|
|
562
|
+
{ path: '/messages/inbox', label: 'Caixa de Entrada', icon: Mail },
|
|
563
|
+
{ path: '/messages/sent', label: 'Enviadas', icon: MessageSquare },
|
|
564
|
+
{ path: '/messages/templates', label: 'Templates', icon: FileText },
|
|
565
|
+
],
|
|
566
|
+
},
|
|
567
|
+
{ path: '/integrations', label: 'Integrações', icon: Globe },
|
|
568
|
+
],
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
id: 'admin',
|
|
572
|
+
label: 'Administração',
|
|
573
|
+
items: [
|
|
574
|
+
{
|
|
575
|
+
path: '/users',
|
|
576
|
+
label: 'Usuários',
|
|
577
|
+
icon: Users,
|
|
578
|
+
children: [
|
|
579
|
+
{ path: '/users/list', label: 'Lista de Usuários', icon: Users },
|
|
580
|
+
{ path: '/users/roles', label: 'Perfis de Acesso', icon: Shield },
|
|
581
|
+
{ path: '/users/permissions', label: 'Permissões', icon: Key },
|
|
582
|
+
{ path: '/users/audit', label: 'Auditoria', icon: Activity },
|
|
583
|
+
],
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
path: '/infrastructure',
|
|
587
|
+
label: 'Infraestrutura',
|
|
588
|
+
icon: Server,
|
|
589
|
+
children: [
|
|
590
|
+
{ path: '/infrastructure/servers', label: 'Servidores', icon: Server },
|
|
591
|
+
{ path: '/infrastructure/databases', label: 'Bancos de Dados', icon: Database },
|
|
592
|
+
{ path: '/infrastructure/backups', label: 'Backups', icon: Archive },
|
|
593
|
+
],
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
path: '/files',
|
|
597
|
+
label: 'Arquivos',
|
|
598
|
+
icon: Folder,
|
|
599
|
+
children: [
|
|
600
|
+
{ path: '/files/documents', label: 'Documentos', icon: FileText },
|
|
601
|
+
{ path: '/files/media', label: 'Mídia', icon: Layers },
|
|
602
|
+
{ path: '/files/exports', label: 'Exportações', icon: FileEdit },
|
|
603
|
+
],
|
|
604
|
+
},
|
|
605
|
+
{ path: '/settings', label: 'Configurações', icon: Settings },
|
|
606
|
+
],
|
|
607
|
+
},
|
|
608
|
+
],
|
|
609
|
+
footer: {
|
|
610
|
+
showUser: true,
|
|
611
|
+
showSettings: false,
|
|
612
|
+
showLogout: true,
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
render: args => {
|
|
616
|
+
const [isExpanded, setIsExpanded] = useState(true);
|
|
617
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
618
|
+
|
|
619
|
+
return (
|
|
620
|
+
<div
|
|
621
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
622
|
+
style={{ transform: 'translateZ(0)' }}
|
|
623
|
+
>
|
|
624
|
+
<Sidebar
|
|
625
|
+
{...args}
|
|
626
|
+
expanded={isExpanded}
|
|
627
|
+
onToggle={() => setIsExpanded(!isExpanded)}
|
|
628
|
+
width={currentWidth}
|
|
629
|
+
navigate={() => {}}
|
|
630
|
+
/>
|
|
631
|
+
<div
|
|
632
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
633
|
+
style={{ left: `${currentWidth}px` }}
|
|
634
|
+
>
|
|
635
|
+
<div className="text-center max-w-sm space-y-2">
|
|
636
|
+
<p className="text-muted-foreground font-medium">Desktop — Subitens</p>
|
|
637
|
+
<p className="text-xs text-muted-foreground">
|
|
638
|
+
Itens com subitens exibem um botão{' '}
|
|
639
|
+
<code className="bg-muted px-1 rounded text-xs">ChevronRight</code> ao final da
|
|
640
|
+
linha. Clique nele para abrir o dropdown de rotas filhas.
|
|
641
|
+
</p>
|
|
642
|
+
<p className="text-xs text-muted-foreground mt-2">
|
|
643
|
+
Use o botão de toggle para alternar entre expandido e recolhido.
|
|
644
|
+
</p>
|
|
645
|
+
</div>
|
|
646
|
+
</div>
|
|
647
|
+
</div>
|
|
648
|
+
);
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Mobile view with sub-items.
|
|
654
|
+
* Simulates a narrow viewport (375 px) so the sidebar renders in its
|
|
655
|
+
* full-screen overlay mode. When expanded the sidebar covers the entire
|
|
656
|
+
* container; clicking a nav item (or the back-arrow toggle) closes it.
|
|
657
|
+
*
|
|
658
|
+
* Sub-item dropdowns behave identically to desktop — the ChevronRight
|
|
659
|
+
* button opens a `DropdownMenuContent` positioned to the right.
|
|
660
|
+
* This story exists so the mobile layout can be inspected and adjusted.
|
|
661
|
+
*/
|
|
662
|
+
export const WithSubitemsMobile: Story = {
|
|
663
|
+
name: 'With Sub-items (Mobile)',
|
|
664
|
+
parameters: {
|
|
665
|
+
viewport: { defaultViewport: 'mobile1' },
|
|
666
|
+
},
|
|
667
|
+
args: {
|
|
668
|
+
variant: 'default',
|
|
669
|
+
expanded: false,
|
|
670
|
+
user: { name: 'Admin', email: 'admin@example.com' },
|
|
671
|
+
onLogout: () => console.log('Logged out'),
|
|
672
|
+
location: { pathname: '/dashboard' },
|
|
673
|
+
navigationGroups: [
|
|
674
|
+
{
|
|
675
|
+
id: 'main',
|
|
676
|
+
label: 'Principal',
|
|
677
|
+
items: [
|
|
678
|
+
{ path: '/home', label: 'Início', icon: Home },
|
|
679
|
+
{
|
|
680
|
+
path: '/dashboard',
|
|
681
|
+
label: 'Dashboard',
|
|
682
|
+
icon: BarChart,
|
|
683
|
+
children: [
|
|
684
|
+
{ path: '/dashboard/overview', label: 'Visão Geral', icon: BarChart },
|
|
685
|
+
{ path: '/dashboard/reports', label: 'Relatórios', icon: FileEdit },
|
|
686
|
+
{ path: '/dashboard/analytics', label: 'Analytics', icon: Map },
|
|
687
|
+
{ path: '/dashboard/trends', label: 'Tendências', icon: TrendingUp },
|
|
688
|
+
{ path: '/dashboard/kpis', label: 'KPIs', icon: Activity },
|
|
689
|
+
{ path: '/dashboard/charts', label: 'Gráficos', icon: PieChart },
|
|
690
|
+
{ path: '/dashboard/comparison', label: 'Comparativos', icon: BarChart2 },
|
|
691
|
+
],
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
path: '/reports',
|
|
695
|
+
label: 'Relatórios',
|
|
696
|
+
icon: FileText,
|
|
697
|
+
children: [
|
|
698
|
+
{ path: '/reports/sales', label: 'Vendas', icon: ShoppingCart },
|
|
699
|
+
{ path: '/reports/financial', label: 'Financeiro', icon: CreditCard },
|
|
700
|
+
{ path: '/reports/operational', label: 'Operacional', icon: Layers },
|
|
701
|
+
{ path: '/reports/exports', label: 'Exportações', icon: FileEdit },
|
|
702
|
+
],
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
path: '/catalog',
|
|
706
|
+
label: 'Catálogo',
|
|
707
|
+
icon: Package,
|
|
708
|
+
children: [
|
|
709
|
+
{ path: '/catalog/products', label: 'Produtos', icon: Package },
|
|
710
|
+
{ path: '/catalog/categories', label: 'Categorias', icon: Tag },
|
|
711
|
+
{ path: '/catalog/inventory', label: 'Estoque', icon: Database },
|
|
712
|
+
],
|
|
713
|
+
},
|
|
714
|
+
],
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
id: 'commerce',
|
|
718
|
+
label: 'Comercial',
|
|
719
|
+
items: [
|
|
720
|
+
{
|
|
721
|
+
path: '/orders',
|
|
722
|
+
label: 'Pedidos',
|
|
723
|
+
icon: ShoppingCart,
|
|
724
|
+
children: [
|
|
725
|
+
{ path: '/orders/pending', label: 'Pendentes', icon: Clock },
|
|
726
|
+
{ path: '/orders/processing', label: 'Em Andamento', icon: Zap },
|
|
727
|
+
{ path: '/orders/shipped', label: 'Enviados', icon: Truck },
|
|
728
|
+
{ path: '/orders/delivered', label: 'Entregues', icon: Package },
|
|
729
|
+
{ path: '/orders/cancelled', label: 'Cancelados', icon: Trash2 },
|
|
730
|
+
],
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
path: '/logistics',
|
|
734
|
+
label: 'Logística',
|
|
735
|
+
icon: Truck,
|
|
736
|
+
children: [
|
|
737
|
+
{ path: '/logistics/carriers', label: 'Transportadoras', icon: Truck },
|
|
738
|
+
{ path: '/logistics/tracking', label: 'Rastreamento', icon: Map },
|
|
739
|
+
{ path: '/logistics/warehouses', label: 'Armazéns', icon: Archive },
|
|
740
|
+
],
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
path: '/billing',
|
|
744
|
+
label: 'Faturamento',
|
|
745
|
+
icon: CreditCard,
|
|
746
|
+
children: [
|
|
747
|
+
{ path: '/billing/invoices', label: 'Faturas', icon: FileText },
|
|
748
|
+
{ path: '/billing/payments', label: 'Pagamentos', icon: CreditCard },
|
|
749
|
+
{ path: '/billing/refunds', label: 'Estornos', icon: ArrowRightLeft },
|
|
750
|
+
],
|
|
751
|
+
},
|
|
752
|
+
],
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
id: 'communication',
|
|
756
|
+
label: 'Comunicação',
|
|
757
|
+
items: [
|
|
758
|
+
{
|
|
759
|
+
path: '/notifications',
|
|
760
|
+
label: 'Notificações',
|
|
761
|
+
icon: Bell,
|
|
762
|
+
children: [
|
|
763
|
+
{ path: '/notifications/email', label: 'E-mail', icon: Mail },
|
|
764
|
+
{ path: '/notifications/sms', label: 'SMS', icon: Phone },
|
|
765
|
+
{ path: '/notifications/push', label: 'Push', icon: Bell },
|
|
766
|
+
],
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
path: '/messages',
|
|
770
|
+
label: 'Mensagens',
|
|
771
|
+
icon: MessageSquare,
|
|
772
|
+
children: [
|
|
773
|
+
{ path: '/messages/inbox', label: 'Caixa de Entrada', icon: Mail },
|
|
774
|
+
{ path: '/messages/sent', label: 'Enviadas', icon: MessageSquare },
|
|
775
|
+
{ path: '/messages/templates', label: 'Templates', icon: FileText },
|
|
776
|
+
],
|
|
777
|
+
},
|
|
778
|
+
{ path: '/integrations', label: 'Integrações', icon: Globe },
|
|
779
|
+
],
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
id: 'admin',
|
|
783
|
+
label: 'Administração',
|
|
784
|
+
items: [
|
|
785
|
+
{
|
|
786
|
+
path: '/users',
|
|
787
|
+
label: 'Usuários',
|
|
788
|
+
icon: Users,
|
|
789
|
+
children: [
|
|
790
|
+
{ path: '/users/list', label: 'Lista de Usuários', icon: Users },
|
|
791
|
+
{ path: '/users/roles', label: 'Perfis de Acesso', icon: Shield },
|
|
792
|
+
{ path: '/users/permissions', label: 'Permissões', icon: Key },
|
|
793
|
+
{ path: '/users/audit', label: 'Auditoria', icon: Activity },
|
|
794
|
+
],
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
path: '/infrastructure',
|
|
798
|
+
label: 'Infraestrutura',
|
|
799
|
+
icon: Server,
|
|
800
|
+
children: [
|
|
801
|
+
{ path: '/infrastructure/servers', label: 'Servidores', icon: Server },
|
|
802
|
+
{ path: '/infrastructure/databases', label: 'Bancos de Dados', icon: Database },
|
|
803
|
+
{ path: '/infrastructure/backups', label: 'Backups', icon: Archive },
|
|
804
|
+
],
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
path: '/files',
|
|
808
|
+
label: 'Arquivos',
|
|
809
|
+
icon: Folder,
|
|
810
|
+
children: [
|
|
811
|
+
{ path: '/files/documents', label: 'Documentos', icon: FileText },
|
|
812
|
+
{ path: '/files/media', label: 'Mídia', icon: Layers },
|
|
813
|
+
{ path: '/files/exports', label: 'Exportações', icon: FileEdit },
|
|
814
|
+
],
|
|
815
|
+
},
|
|
816
|
+
{ path: '/settings', label: 'Configurações', icon: Settings },
|
|
817
|
+
],
|
|
818
|
+
},
|
|
819
|
+
],
|
|
820
|
+
footer: {
|
|
821
|
+
showUser: true,
|
|
822
|
+
showSettings: false,
|
|
823
|
+
showLogout: true,
|
|
824
|
+
},
|
|
825
|
+
},
|
|
826
|
+
render: args => {
|
|
827
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
828
|
+
|
|
829
|
+
return (
|
|
830
|
+
/* Constrain to ~375 px to reproduce a mobile viewport inside Storybook */
|
|
831
|
+
<div
|
|
832
|
+
className="relative bg-muted/20 overflow-hidden border rounded-[var(--radius-lg)]"
|
|
833
|
+
style={{ width: '375px', height: '100vh', margin: '0 auto' }}
|
|
834
|
+
>
|
|
835
|
+
{/* Page content visible when sidebar is closed */}
|
|
836
|
+
{!isExpanded && (
|
|
837
|
+
<div className="h-full flex flex-col">
|
|
838
|
+
<div className="flex items-center gap-3 px-4 py-3 border-b border-border bg-background">
|
|
839
|
+
<button
|
|
840
|
+
onClick={() => setIsExpanded(true)}
|
|
841
|
+
className="p-2 rounded-md hover:bg-accent transition-colors"
|
|
842
|
+
aria-label="Abrir menu"
|
|
843
|
+
>
|
|
844
|
+
<Menu className="w-5 h-5" />
|
|
845
|
+
</button>
|
|
846
|
+
<span className="font-semibold text-sm">Minha Aplicação</span>
|
|
847
|
+
</div>
|
|
848
|
+
<div className="flex-1 flex items-center justify-center p-8">
|
|
849
|
+
<div className="text-center space-y-2">
|
|
850
|
+
<p className="text-muted-foreground font-medium">Mobile — Subitens</p>
|
|
851
|
+
<p className="text-xs text-muted-foreground">
|
|
852
|
+
Clique no ícone de menu (☰) no topo para abrir a sidebar em modo
|
|
853
|
+
tela-cheia. Itens com subitens mostram um{' '}
|
|
854
|
+
<code className="bg-muted px-1 rounded text-xs">ChevronRight</code> ao final
|
|
855
|
+
da linha.
|
|
856
|
+
</p>
|
|
857
|
+
</div>
|
|
858
|
+
</div>
|
|
859
|
+
</div>
|
|
860
|
+
)}
|
|
861
|
+
|
|
862
|
+
<Sidebar
|
|
863
|
+
{...args}
|
|
864
|
+
expanded={isExpanded}
|
|
865
|
+
onToggle={() => setIsExpanded(prev => !prev)}
|
|
866
|
+
width={375}
|
|
867
|
+
navigate={() => setIsExpanded(false)}
|
|
868
|
+
/>
|
|
869
|
+
</div>
|
|
870
|
+
);
|
|
871
|
+
},
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Compound Component API — demonstrates using Sidebar.Root + sub-components
|
|
876
|
+
* for full layout control. This is the recommended pattern for advanced
|
|
877
|
+
* customization without forking the component.
|
|
878
|
+
*/
|
|
879
|
+
export const CompoundComponentAPI: Story = {
|
|
880
|
+
name: 'Compound Component API',
|
|
881
|
+
render: () => {
|
|
882
|
+
const [isExpanded, setIsExpanded] = React.useState(true);
|
|
883
|
+
const currentWidth = isExpanded ? 280 : 80;
|
|
884
|
+
const groups = [
|
|
885
|
+
{
|
|
886
|
+
id: 'main',
|
|
887
|
+
label: 'Principal',
|
|
888
|
+
items: [
|
|
889
|
+
{ path: '/home', label: 'Início', icon: Home },
|
|
890
|
+
{ path: '/dashboard', label: 'Dashboard', icon: BarChart },
|
|
891
|
+
],
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
id: 'admin',
|
|
895
|
+
label: 'Administração',
|
|
896
|
+
items: [
|
|
897
|
+
{ path: '/users', label: 'Usuários', icon: Users },
|
|
898
|
+
{ path: '/settings', label: 'Configurações', icon: Settings },
|
|
899
|
+
],
|
|
900
|
+
},
|
|
901
|
+
];
|
|
902
|
+
|
|
903
|
+
return (
|
|
904
|
+
<div
|
|
905
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
906
|
+
style={{ transform: 'translateZ(0)' }}
|
|
907
|
+
>
|
|
908
|
+
{/* Compound Component usage */}
|
|
909
|
+
<Sidebar.Root
|
|
910
|
+
expanded={isExpanded}
|
|
911
|
+
onToggle={() => setIsExpanded(prev => !prev)}
|
|
912
|
+
width={currentWidth}
|
|
913
|
+
location={{ pathname: '/home' }}
|
|
914
|
+
navigate={() => {}}
|
|
915
|
+
>
|
|
916
|
+
<Sidebar.Header />
|
|
917
|
+
<Sidebar.Nav navigationGroups={groups} />
|
|
918
|
+
<Sidebar.Footer
|
|
919
|
+
user={{ name: 'Admin', email: 'admin@example.com' }}
|
|
920
|
+
onLogout={() => console.log('logout')}
|
|
921
|
+
showUser
|
|
922
|
+
showSettings
|
|
923
|
+
showLogout
|
|
924
|
+
/>
|
|
925
|
+
</Sidebar.Root>
|
|
926
|
+
|
|
927
|
+
<div
|
|
928
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
929
|
+
style={{ left: `${currentWidth}px` }}
|
|
930
|
+
>
|
|
931
|
+
<div className="text-center max-w-md space-y-3">
|
|
932
|
+
<p className="text-muted-foreground font-bold">Compound Component API</p>
|
|
933
|
+
<p className="text-sm text-muted-foreground/80">
|
|
934
|
+
Built with <code className="bg-muted px-1 rounded text-xs"><Sidebar.Root></code>
|
|
935
|
+
, <code className="bg-muted px-1 rounded text-xs"><Sidebar.Header></code>,{' '}
|
|
936
|
+
<code className="bg-muted px-1 rounded text-xs"><Sidebar.Nav></code>, and{' '}
|
|
937
|
+
<code className="bg-muted px-1 rounded text-xs"><Sidebar.Footer></code>.
|
|
938
|
+
</p>
|
|
939
|
+
<p className="text-xs text-muted-foreground">
|
|
940
|
+
Each sub-component reads shared state from{' '}
|
|
941
|
+
<code className="bg-muted px-1 rounded text-xs">SidebarContext</code> via{' '}
|
|
942
|
+
<code className="bg-muted px-1 rounded text-xs">Sidebar.Root</code>.
|
|
943
|
+
</p>
|
|
944
|
+
</div>
|
|
945
|
+
</div>
|
|
946
|
+
</div>
|
|
947
|
+
);
|
|
948
|
+
},
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Headless Hook — demonstrates using `useSidebar` directly for fully custom rendering.
|
|
953
|
+
* The hook manages all state; the UI is entirely up to the consumer.
|
|
954
|
+
*/
|
|
955
|
+
export const HeadlessHook: Story = {
|
|
956
|
+
name: 'Headless Hook (useSidebar)',
|
|
957
|
+
render: () => {
|
|
958
|
+
const groups = [
|
|
959
|
+
{
|
|
960
|
+
id: 'main',
|
|
961
|
+
label: 'Principal',
|
|
962
|
+
items: [
|
|
963
|
+
{ path: '/home', label: 'Início', icon: Home },
|
|
964
|
+
{ path: '/dashboard', label: 'Dashboard', icon: BarChart },
|
|
965
|
+
{ path: '/users', label: 'Usuários', icon: Users },
|
|
966
|
+
],
|
|
967
|
+
},
|
|
968
|
+
];
|
|
969
|
+
|
|
970
|
+
const {
|
|
971
|
+
expanded,
|
|
972
|
+
toggleExpanded,
|
|
973
|
+
navigationGroups: resolvedGroups,
|
|
974
|
+
} = useSidebar({ defaultExpanded: true, navigationGroups: groups });
|
|
975
|
+
|
|
976
|
+
const width = expanded ? 280 : 80;
|
|
977
|
+
|
|
978
|
+
return (
|
|
979
|
+
<div
|
|
980
|
+
className="relative h-screen w-full border rounded-[var(--radius-lg)] bg-muted/20 overflow-hidden"
|
|
981
|
+
style={{ transform: 'translateZ(0)' }}
|
|
982
|
+
>
|
|
983
|
+
{/* Fully custom sidebar built with useSidebar hook */}
|
|
984
|
+
<div
|
|
985
|
+
className="absolute inset-y-0 left-0 bg-sidebar text-sidebar-foreground flex flex-col transition-all duration-300 z-50"
|
|
986
|
+
style={{ width: `${width}px` }}
|
|
987
|
+
>
|
|
988
|
+
<div className="p-4">
|
|
989
|
+
<button
|
|
990
|
+
onClick={toggleExpanded}
|
|
991
|
+
className="w-full h-10 flex items-center justify-center rounded-md bg-sidebar-foreground/10 hover:bg-sidebar-foreground/20 text-sidebar-foreground transition-colors"
|
|
992
|
+
aria-label={expanded ? 'Collapse' : 'Expand'}
|
|
993
|
+
>
|
|
994
|
+
{expanded ? <PanelLeft className="w-5 h-5" /> : <Menu className="w-5 h-5" />}
|
|
995
|
+
</button>
|
|
996
|
+
</div>
|
|
997
|
+
<nav className="flex-1 px-3 space-y-1">
|
|
998
|
+
{resolvedGroups
|
|
999
|
+
.flatMap(g => g.items)
|
|
1000
|
+
.map(item => {
|
|
1001
|
+
const Icon = item.icon;
|
|
1002
|
+
return (
|
|
1003
|
+
<button
|
|
1004
|
+
key={item.path}
|
|
1005
|
+
className="w-full h-10 flex items-center gap-3 px-3 rounded-md text-sidebar-foreground/80 hover:bg-sidebar-foreground/15 hover:text-sidebar-foreground transition-colors"
|
|
1006
|
+
>
|
|
1007
|
+
{Icon && <Icon className="w-5 h-5 flex-shrink-0" />}
|
|
1008
|
+
{expanded && <span className="truncate text-sm">{item.label}</span>}
|
|
1009
|
+
</button>
|
|
1010
|
+
);
|
|
1011
|
+
})}
|
|
1012
|
+
</nav>
|
|
1013
|
+
</div>
|
|
1014
|
+
|
|
1015
|
+
<div
|
|
1016
|
+
className="absolute inset-y-0 right-0 p-8 flex items-center justify-center transition-all duration-300"
|
|
1017
|
+
style={{ left: `${width}px` }}
|
|
1018
|
+
>
|
|
1019
|
+
<div className="text-center max-w-md space-y-3">
|
|
1020
|
+
<p className="text-muted-foreground font-bold">Headless Hook</p>
|
|
1021
|
+
<p className="text-sm text-muted-foreground/80">
|
|
1022
|
+
State managed by <code className="bg-muted px-1 rounded text-xs">useSidebar()</code>.
|
|
1023
|
+
The entire UI is custom — no Sidebar component used.
|
|
1024
|
+
</p>
|
|
1025
|
+
<p className="text-xs text-muted-foreground">
|
|
1026
|
+
Sidebar is currently: <strong>{expanded ? 'Expanded' : 'Collapsed'}</strong>
|
|
1027
|
+
</p>
|
|
1028
|
+
</div>
|
|
1029
|
+
</div>
|
|
1030
|
+
</div>
|
|
1031
|
+
);
|
|
1032
|
+
},
|
|
1033
|
+
};
|