Repository: satnaing/shadcn-admin Branch: main Commit: 8747b9a2b8f3 Files: 238 Total size: 525.1 KB Directory structure: gitextract_5m319v_v/ ├── .github/ │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── config.yml │ │ ├── ✨-feature-request.md │ │ └── 🐞-bug-report.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ ├── ci.yml │ └── stale.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── components.json ├── cz.yaml ├── eslint.config.js ├── index.html ├── knip.config.ts ├── netlify.toml ├── package.json ├── src/ │ ├── assets/ │ │ ├── brand-icons/ │ │ │ ├── icon-discord.tsx │ │ │ ├── icon-docker.tsx │ │ │ ├── icon-facebook.tsx │ │ │ ├── icon-figma.tsx │ │ │ ├── icon-github.tsx │ │ │ ├── icon-gitlab.tsx │ │ │ ├── icon-gmail.tsx │ │ │ ├── icon-medium.tsx │ │ │ ├── icon-notion.tsx │ │ │ ├── icon-skype.tsx │ │ │ ├── icon-slack.tsx │ │ │ ├── icon-stripe.tsx │ │ │ ├── icon-telegram.tsx │ │ │ ├── icon-trello.tsx │ │ │ ├── icon-whatsapp.tsx │ │ │ ├── icon-zoom.tsx │ │ │ └── index.ts │ │ ├── clerk-full-logo.tsx │ │ ├── clerk-logo.tsx │ │ ├── custom/ │ │ │ ├── icon-dir.tsx │ │ │ ├── icon-layout-compact.tsx │ │ │ ├── icon-layout-default.tsx │ │ │ ├── icon-layout-full.tsx │ │ │ ├── icon-sidebar-floating.tsx │ │ │ ├── icon-sidebar-inset.tsx │ │ │ ├── icon-sidebar-sidebar.tsx │ │ │ ├── icon-theme-dark.tsx │ │ │ ├── icon-theme-light.tsx │ │ │ └── icon-theme-system.tsx │ │ └── logo.tsx │ ├── components/ │ │ ├── coming-soon.tsx │ │ ├── command-menu.tsx │ │ ├── config-drawer.tsx │ │ ├── confirm-dialog.tsx │ │ ├── data-table/ │ │ │ ├── bulk-actions.tsx │ │ │ ├── column-header.tsx │ │ │ ├── faceted-filter.tsx │ │ │ ├── index.ts │ │ │ ├── pagination.tsx │ │ │ ├── toolbar.tsx │ │ │ └── view-options.tsx │ │ ├── date-picker.tsx │ │ ├── layout/ │ │ │ ├── app-sidebar.tsx │ │ │ ├── app-title.tsx │ │ │ ├── authenticated-layout.tsx │ │ │ ├── data/ │ │ │ │ └── sidebar-data.ts │ │ │ ├── header.tsx │ │ │ ├── main.tsx │ │ │ ├── nav-group.tsx │ │ │ ├── nav-user.tsx │ │ │ ├── team-switcher.tsx │ │ │ ├── top-nav.tsx │ │ │ └── types.ts │ │ ├── learn-more.tsx │ │ ├── long-text.tsx │ │ ├── navigation-progress.tsx │ │ ├── password-input.tsx │ │ ├── profile-dropdown.tsx │ │ ├── search.tsx │ │ ├── select-dropdown.tsx │ │ ├── sign-out-dialog.tsx │ │ ├── skip-to-main.tsx │ │ ├── theme-switch.tsx │ │ └── ui/ │ │ ├── alert-dialog.tsx │ │ ├── alert.tsx │ │ ├── avatar.tsx │ │ ├── badge.tsx │ │ ├── button.tsx │ │ ├── calendar.tsx │ │ ├── card.tsx │ │ ├── checkbox.tsx │ │ ├── collapsible.tsx │ │ ├── command.tsx │ │ ├── dialog.tsx │ │ ├── dropdown-menu.tsx │ │ ├── form.tsx │ │ ├── input-otp.tsx │ │ ├── input.tsx │ │ ├── label.tsx │ │ ├── popover.tsx │ │ ├── radio-group.tsx │ │ ├── scroll-area.tsx │ │ ├── select.tsx │ │ ├── separator.tsx │ │ ├── sheet.tsx │ │ ├── sidebar.tsx │ │ ├── skeleton.tsx │ │ ├── sonner.tsx │ │ ├── switch.tsx │ │ ├── table.tsx │ │ ├── tabs.tsx │ │ ├── textarea.tsx │ │ └── tooltip.tsx │ ├── config/ │ │ └── fonts.ts │ ├── context/ │ │ ├── direction-provider.tsx │ │ ├── font-provider.tsx │ │ ├── layout-provider.tsx │ │ ├── search-provider.tsx │ │ └── theme-provider.tsx │ ├── features/ │ │ ├── apps/ │ │ │ ├── data/ │ │ │ │ └── apps.tsx │ │ │ └── index.tsx │ │ ├── auth/ │ │ │ ├── auth-layout.tsx │ │ │ ├── forgot-password/ │ │ │ │ ├── components/ │ │ │ │ │ └── forgot-password-form.tsx │ │ │ │ └── index.tsx │ │ │ ├── otp/ │ │ │ │ ├── components/ │ │ │ │ │ └── otp-form.tsx │ │ │ │ └── index.tsx │ │ │ ├── sign-in/ │ │ │ │ ├── components/ │ │ │ │ │ └── user-auth-form.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── sign-in-2.tsx │ │ │ └── sign-up/ │ │ │ ├── components/ │ │ │ │ └── sign-up-form.tsx │ │ │ └── index.tsx │ │ ├── chats/ │ │ │ ├── components/ │ │ │ │ └── new-chat.tsx │ │ │ ├── data/ │ │ │ │ ├── chat-types.ts │ │ │ │ └── convo.json │ │ │ └── index.tsx │ │ ├── dashboard/ │ │ │ ├── components/ │ │ │ │ ├── analytics-chart.tsx │ │ │ │ ├── analytics.tsx │ │ │ │ ├── overview.tsx │ │ │ │ └── recent-sales.tsx │ │ │ └── index.tsx │ │ ├── errors/ │ │ │ ├── forbidden.tsx │ │ │ ├── general-error.tsx │ │ │ ├── maintenance-error.tsx │ │ │ ├── not-found-error.tsx │ │ │ └── unauthorized-error.tsx │ │ ├── settings/ │ │ │ ├── account/ │ │ │ │ ├── account-form.tsx │ │ │ │ └── index.tsx │ │ │ ├── appearance/ │ │ │ │ ├── appearance-form.tsx │ │ │ │ └── index.tsx │ │ │ ├── components/ │ │ │ │ ├── content-section.tsx │ │ │ │ └── sidebar-nav.tsx │ │ │ ├── display/ │ │ │ │ ├── display-form.tsx │ │ │ │ └── index.tsx │ │ │ ├── index.tsx │ │ │ ├── notifications/ │ │ │ │ ├── index.tsx │ │ │ │ └── notifications-form.tsx │ │ │ └── profile/ │ │ │ ├── index.tsx │ │ │ └── profile-form.tsx │ │ ├── tasks/ │ │ │ ├── components/ │ │ │ │ ├── data-table-bulk-actions.tsx │ │ │ │ ├── data-table-row-actions.tsx │ │ │ │ ├── tasks-columns.tsx │ │ │ │ ├── tasks-dialogs.tsx │ │ │ │ ├── tasks-import-dialog.tsx │ │ │ │ ├── tasks-multi-delete-dialog.tsx │ │ │ │ ├── tasks-mutate-drawer.tsx │ │ │ │ ├── tasks-primary-buttons.tsx │ │ │ │ ├── tasks-provider.tsx │ │ │ │ └── tasks-table.tsx │ │ │ ├── data/ │ │ │ │ ├── data.tsx │ │ │ │ ├── schema.ts │ │ │ │ └── tasks.ts │ │ │ └── index.tsx │ │ └── users/ │ │ ├── components/ │ │ │ ├── data-table-bulk-actions.tsx │ │ │ ├── data-table-row-actions.tsx │ │ │ ├── users-action-dialog.tsx │ │ │ ├── users-columns.tsx │ │ │ ├── users-delete-dialog.tsx │ │ │ ├── users-dialogs.tsx │ │ │ ├── users-invite-dialog.tsx │ │ │ ├── users-multi-delete-dialog.tsx │ │ │ ├── users-primary-buttons.tsx │ │ │ ├── users-provider.tsx │ │ │ └── users-table.tsx │ │ ├── data/ │ │ │ ├── data.ts │ │ │ ├── schema.ts │ │ │ └── users.ts │ │ └── index.tsx │ ├── hooks/ │ │ ├── use-dialog-state.tsx │ │ ├── use-mobile.tsx │ │ └── use-table-url-state.ts │ ├── lib/ │ │ ├── cookies.ts │ │ ├── handle-server-error.ts │ │ ├── show-submitted-data.tsx │ │ └── utils.ts │ ├── main.tsx │ ├── routeTree.gen.ts │ ├── routes/ │ │ ├── (auth)/ │ │ │ ├── forgot-password.tsx │ │ │ ├── otp.tsx │ │ │ ├── sign-in-2.tsx │ │ │ ├── sign-in.tsx │ │ │ └── sign-up.tsx │ │ ├── (errors)/ │ │ │ ├── 401.tsx │ │ │ ├── 403.tsx │ │ │ ├── 404.tsx │ │ │ ├── 500.tsx │ │ │ └── 503.tsx │ │ ├── __root.tsx │ │ ├── _authenticated/ │ │ │ ├── apps/ │ │ │ │ └── index.tsx │ │ │ ├── chats/ │ │ │ │ └── index.tsx │ │ │ ├── errors/ │ │ │ │ └── $error.tsx │ │ │ ├── help-center/ │ │ │ │ └── index.tsx │ │ │ ├── index.tsx │ │ │ ├── route.tsx │ │ │ ├── settings/ │ │ │ │ ├── account.tsx │ │ │ │ ├── appearance.tsx │ │ │ │ ├── display.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── notifications.tsx │ │ │ │ └── route.tsx │ │ │ ├── tasks/ │ │ │ │ └── index.tsx │ │ │ └── users/ │ │ │ └── index.tsx │ │ └── clerk/ │ │ ├── (auth)/ │ │ │ ├── route.tsx │ │ │ ├── sign-in.tsx │ │ │ └── sign-up.tsx │ │ ├── _authenticated/ │ │ │ ├── route.tsx │ │ │ └── user-management.tsx │ │ └── route.tsx │ ├── stores/ │ │ └── auth-store.ts │ ├── styles/ │ │ ├── index.css │ │ └── theme.css │ ├── tanstack-table.d.ts │ └── vite-env.d.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.node.json └── vite.config.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at . All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. ================================================ FILE: .github/CONTRIBUTING.md ================================================ # Contributing to Shadcn-Admin Thank you for considering contributing to **shadcn-admin**! Every contribution is valuable, whether it's reporting bugs, suggesting improvements, adding features, or refining README. ## Table of Contents 1. [Getting Started](#getting-started) 2. [How to Contribute](#how-to-contribute) 3. [Code Standards](#code-standards) 4. [Pull Request Guidelines](#pull-request-guidelines) 5. [Reporting Issues](#reporting-issues) 6. [Community Guidelines](#community-guidelines) --- ## Getting Started 1. **Fork** the repository. 2. **Clone** your fork: ```bash git clone https://github.com/your-username/shadcn-admin.git ``` 3. **Install dependencies:** ```bash pnpm install ``` 4. **Run the project locally:** ```bash pnpm dev ``` 5. Create a new branch for your contribution: ```bash git checkout -b feature/your-feature ``` --- ## How to Contribute - **Feature Requests:** Open an issue or start a discussion to discuss the feature before implementation. - **Bug Fixes:** Provide clear reproduction steps in your issue. - **Documentation:** Improvements to the documentation (README) are always appreciated. > **Note:** Pull Requests adding new features without a prior issue or discussion will **not be accepted**. --- ## Code Standards - Follow the existing **ESLint** and **Prettier** configurations. - Ensure your code is **type-safe** with **TypeScript**. - Maintain consistency with the existing code structure. > **Tips!** Before submitting your changes, run the following commands: ```bash pnpm lint && pnpm format && pnpm knip && pnpm build ``` --- ## Pull Request Guidelines - **Follow the [PR Template](./PULL_REQUEST_TEMPLATE.md):** - Description - Types of changes - Checklist - Further comments - Related Issue - Ensure your changes pass **CI checks**. - Keep PRs **focused** and **concise**. - Reference related issues in your PR description. --- ## Reporting Issues - Clearly describe the issue. - Provide reproduction steps if applicable. - Include screenshots or code examples if relevant. --- ## Community Guidelines - Be respectful and constructive. - Follow the [Code of Conduct](./CODE_OF_CONDUCT.md). - Stay on topic in discussions. --- Thank you for helping make **shadcn-admin** better! 🚀 If you have any questions, feel free to reach out via [Discussions](https://github.com/satnaing/shadcn-admin/discussions). ================================================ FILE: .github/FUNDING.yml ================================================ github: [satnaing] buy_me_a_coffee: satnaing # patreon: # Replace with a single Patreon username # open_collective: # Replace with a single Open Collective username # ko_fi: # Replace with a single Ko-fi username # tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel # community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry # liberapay: # Replace with a single Liberapay username # issuehunt: # Replace with a single IssueHunt username # lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry # polar: # Replace with a single Polar username # thanks_dev: # Replace with a single thanks.dev username # custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: false contact_links: - name: Shadcn-Admin Discussions url: https://github.com/satnaing/shadcn-admin/discussions about: Please ask and answer questions here. ================================================ FILE: .github/ISSUE_TEMPLATE/✨-feature-request.md ================================================ --- name: "✨ Feature Request" about: Suggest an idea for improving Shadcn-Admin title: "[Feature Request]: " labels: enhancement assignees: "" --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/ISSUE_TEMPLATE/🐞-bug-report.md ================================================ --- name: "\U0001F41E Bug report" about: Report a bug or unexpected behavior in Shadcn-Admin title: "[BUG]: " labels: bug assignees: "" --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ ## Description ## Types of changes - [ ] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Others (any other types not listed above) ## Checklist - [ ] I have read the [Contributing Guide](https://github.com/satnaing/shadcn-admin/blob/main/.github/CONTRIBUTING.md) ## Further comments ## Related Issue Closes: # ================================================ FILE: .github/workflows/ci.yml ================================================ name: Continuous Integration on: push: branches: - main pull_request: branches: - main jobs: install-lint-build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 - name: Install pnpm run: npm install -g pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Lint the code run: pnpm lint # - name: Analyze unused files and dependencies # run: pnpm knip - name: Run Prettier check run: pnpm format:check - name: Build the project run: pnpm build ================================================ FILE: .github/workflows/stale.yml ================================================ name: Close inactive issues/PR on: schedule: - cron: '38 18 * * *' jobs: stale: runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - uses: actions/stale@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-issue-stale: 120 days-before-issue-close: 120 stale-issue-label: "stale" stale-issue-message: "This issue is stale because it has been open for 120 days with no activity." close-issue-message: "This issue was closed because it has been inactive for 120 days since being marked as stale." days-before-pr-stale: 120 days-before-pr-close: 120 stale-pr-label: "stale" stale-pr-message: "This PR is stale because it has been open for 120 days with no activity." close-pr-message: "This PR was closed because it has been inactive for 120 days since being marked as stale." operations-per-run: 0 ================================================ FILE: .gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr *.local .env # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? ================================================ FILE: .prettierignore ================================================ # Ignore everything /* # Except these files & folders !/src !index.html !package.json !tailwind.config.js !tsconfig.json !tsconfig.node.json !vite.config.ts !.prettierrc !README.md !eslint.config.js !postcss.config.js # Ignore auto generated routeTree.gen.ts /src/routeTree.gen.ts ================================================ FILE: .prettierrc ================================================ { "arrowParens": "always", "semi": false, "tabWidth": 2, "printWidth": 80, "singleQuote": true, "jsxSingleQuote": true, "trailingComma": "es5", "bracketSpacing": true, "endOfLine": "lf", "plugins": [ "@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss" ], "tailwindStylesheet": "./src/styles/index.css", "importOrder": [ "^path$", "^vite$", "^@vitejs/(.*)$", "^react$", "^react-dom/client$", "^react/(.*)$", "^globals$", "^zod$", "^axios$", "^date-fns$", "^react-hook-form$", "^use-intl$", "^@radix-ui/(.*)$", "^@hookform/resolvers/zod$", "^@tanstack/react-query$", "^@tanstack/react-router$", "^@tanstack/react-table$", "", "^@/assets/(.*)", "^@/api/(.*)$", "^@/stores/(.*)$", "^@/lib/(.*)$", "^@/utils/(.*)$", "^@/constants/(.*)$", "^@/context/(.*)$", "^@/hooks/(.*)$", "^@/components/layouts/(.*)$", "^@/components/ui/(.*)$", "^@/components/errors/(.*)$", "^@/components/(.*)$", "^@/features/(.*)$", "^[./]" ] } ================================================ FILE: CHANGELOG.md ================================================ ## v2.2.1 (2025-11-06) ### Fix - **style**: update data attribute class in authenticated layout (#249) - prevent navigation to 500 page during development (#240) - **style**: apply variant 'destructive' to sign-out buttons (#236) - add missing space in profile form (#235) ### Refactor - enhance tables and update table layout (#234) ## v2.2.0 (2025-10-09) ### Feat - add analytics tab in dashboard page (#220) - add extra AppTitle component for sidebar header (#216) - update 2-column sign in page (#213) ### Fix - update sidebar menu chevron direction in RTL mode (#229) - pagination button spacing (#215) - upgrade lucide-react to solve antivirus warning (#211) ### Refactor - move sidebar related components into app-sidebar - change SidebarInset component from 'main' to 'div' - replace extra main container query with content container query - replace inline svg logo with logo component (#214) ## v2.1.0 (2025-08-23) ### Feat - enhance data table pagination with page numbers (#207) - enhance auth flow with sign-out dialogs and redirect functionality (#206) ### Refactor - reorganize utility files into `lib/` folder (#209) - extract data-table components and reorganize structure (#208) ## v2.0.0 (2025-08-16) ### BREAKING CHANGE - CSS file structure has been reorganized ### Feat - add search param sync in apps route (#200) - improve tables and sync table states with search param (#199) - add data table bulk action toolbar (#196) - add config drawer and update overall layout (#186) - RTL support (#179) ### Fix - adjust layout styles in search and top nav in dashboard page - update spacing and layout styles - update faceted icon color - improve user table hover & selected styles (#195) - add max-width for large screens to improve responsiveness (#194) - adjust chat border radius for better responsiveness (#193) - update hard-coded or inconsistent colors (#191) - use variable for inset layout height calculation - faded-bottom overflow issue in inset layout - hide unnecessary configs on mobile (#189) - adjust file input text vertical alignment (#188) ### Refactor - enforce consistency and code quality (#198) - improve code quality and consistency (#197) - update error routes (#192) - remove DirSwitch component and its usage in Tasks (#190) - standardize using cookie as persist state (#187) - separate CSS into modular theme and base styles (#185) - replace tabler icons with lucide icons (#183) ## v1.4.2 (2025-07-23) ### Fix - remove unnecessary transitions in table (#176) - overflow background in tables (#175) ## v1.4.1 (2025-06-25) ### Fix - user list overflow in chat (#160) - prevent showing collapsed menu on mobile (#155) - white background select dropdown in dark mode (#149) ### Refactor - update font config guide in fonts.ts (#164) ## v1.4.0 (2025-05-25) ### Feat - **clerk**: add Clerk for auth and protected route (#146) ### Fix - add an indicator for nested pages in search (#147) - update faded-bottom color with css variable (#139) ## v1.3.0 (2025-04-16) ### Fix - replace custom otp with input-otp component (#131) - disable layout animation on mobile (#130) - upgrade react-day-picker and update calendar component (#129) ### Others - upgrade Tailwind CSS to v4 (#125) - upgrade dependencies (#128) - configure automatic code-splitting (#127) ## v1.2.0 (2025-04-12) ### Feat - add loading indicator during page transitions (#119) - add light favicons and theme-based switching (#112) - add new chat dialog in chats page (#90) ### Fix - add fallback font for fontFamily (#110) - broken focus behavior in add user dialog (#113) ## v1.1.0 (2025-01-30) ### Feat - allow changing font family in setting ### Fix - update sidebar color in dark mode for consistent look (#87) - use overflow-clip in table paginations (#86) - **style**: update global scrollbar style (#82) - toolbar filter placeholder typo in user table (#76) ## v1.0.3 (2024-12-28) ### Fix - add gap between buttons in import task dialog (#70) - hide button sort if column cannot be hidden & update filterFn (#69) - nav links added in profile dropdown (#68) ### Refactor - optimize states in users/tasks context (#71) ## v1.0.2 (2024-12-25) ### Fix - update overall layout due to scroll-lock bug (#66) ### Refactor - analyze and remove unused files/exports with knip (#67) ## v1.0.1 (2024-12-14) ### Fix - merge two button components into one (#60) - loading all tabler-icon chunks in dev mode (#59) - display menu dropdown when sidebar collapsed (#58) - update spacing & alignment in dialogs/drawers - update border & transition of sticky columns in user table - update heading alignment to left in user dialogs - add height and scroll area in user mutation dialogs - update `/dashboard` route to just `/` - **build**: replace require with import in tailwind.config.js ### Refactor - remove unnecessary layout-backup file ## v1.0.0 (2024-12-09) ### BREAKING CHANGE - Restructured the entire folder hierarchy to adopt a feature-based structure. This change improves code modularity and maintainability but introduces breaking changes. ### Feat - implement task dialogs - implement user invite dialog - implement users CRUD - implement global command/search - implement custom sidebar trigger - implement coming-soon page ### Fix - uncontrolled issue in account setting - card layout issue in app integrations page - remove form reset logic from useEffect in task import - update JSX types due to react 19 - prevent card stretch in filtered app layout - layout wrap issue in tasks page on mobile - update user column hover and selected colors - add setTimeout in user dialog closing - layout shift issue in dropdown modal - z-axis overflow issue in header - stretch search bar only in mobile - language dropdown issue in account setting - update overflow contents with scroll area ### Refactor - update layouts and extract common layout - reorganize project to feature-based structure ## v1.0.0-beta.5 (2024-11-11) ### Feat - add multiple language support (#37) ### Fix - ensure site syncs with system theme changes (#49) - recent sales responsive on ipad view (#40) ## v1.0.0-beta.4 (2024-09-22) ### Feat - upgrade theme button to theme dropdown (#33) - **a11y**: add "Skip to Main" button to improve keyboard navigation (#27) ### Fix - optimize onComplete/onIncomplete invocation (#32) - solve asChild attribute issue in custom button (#31) - improve custom Button component (#28) ## v1.0.0-beta.3 (2024-08-25) ### Feat - implement chat page (#21) - add 401 error page (#12) - implement apps page - add otp page ### Fix - prevent focus zoom on mobile devices (#20) - resolve eslint script issue (#18) - **a11y**: update default aria-label of each pin-input - resolve OTP paste issue in multi-digit pin-input - update layouts and solve overflow issues (#11) - sync pin inputs programmatically ## v1.0.0-beta.2 (2024-03-18) ### Feat - implement custom pin-input component (#2) ## v1.0.0-beta.1 (2024-02-08) ### Feat - update theme-color meta tag when theme is updated - add coming soon page in broken pages - implement tasks table and page - add remaining settings pages - add example error page for settings - update general error page to be more flexible - implement settings layout and settings profile page - add error pages - add password-input custom component - add sign-up page - add forgot-password page - add box sign in page - add email + password sign in page - make sidebar responsive and accessible - add tailwind prettier plugin - make sidebar collapsed state in local storage - add check current active nav hook - add loader component ui - update dropdown nav by default if child is active - add main-panel in dashboard - **ui**: add dark mode - **ui**: implement side nav ui ### Fix - update incorrect overflow side nav height - exclude shadcn components from linting and remove unused props - solve text overflow issue when nav text is long - replace nav with dropdown in mobile topnav - make sidebar scrollable when overflow - update nav link keys - **ui**: update label style ### Refactor - move password-input component into custom component dir - add custom button component - extract redundant codes into layout component - update react-router to use new api for routing - update main panel layout - update major layouts and styling - update main panel to be responsive - update sidebar collapsed state to false in mobile - update sidebar logo and title - **ui**: remove unnecessary spacing - remove unused files ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2024 Sat Naing Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # Shadcn Admin Dashboard Admin Dashboard UI crafted with Shadcn and Vite. Built with responsiveness and accessibility in mind. ![alt text](public/images/shadcn-admin.png) [![Sponsored by Clerk](https://img.shields.io/badge/Sponsored%20by-Clerk-5b6ee1?logo=clerk)](https://go.clerk.com/GttUAaK) I've been creating dashboard UIs at work and for my personal projects. I always wanted to make a reusable collection of dashboard UI for future projects; and here it is now. While I've created a few custom components, some of the code is directly adapted from ShadcnUI examples. > This is not a starter project (template) though. I'll probably make one in the future. ## Features - Light/dark mode - Responsive - Accessible - With built-in Sidebar component - Global search command - 10+ pages - Extra custom components - RTL support
Customized Components (click to expand) This project uses Shadcn UI components, but some have been slightly modified for better RTL (Right-to-Left) support and other improvements. These customized components differ from the original Shadcn UI versions. If you want to update components using the Shadcn CLI (e.g., `npx shadcn@latest add `), it's generally safe for non-customized components. For the listed customized ones, you may need to manually merge changes to preserve the project's modifications and avoid overwriting RTL support or other updates. > If you don't require RTL support, you can safely update the 'RTL Updated Components' via the Shadcn CLI, as these changes are primarily for RTL compatibility. The 'Modified Components' may have other customizations to consider. ### Modified Components - scroll-area - sonner - separator ### RTL Updated Components - alert-dialog - calendar - command - dialog - dropdown-menu - select - table - sheet - sidebar - switch **Notes:** - **Modified Components**: These have general updates, potentially including RTL adjustments. - **RTL Updated Components**: These have specific changes for RTL language support (e.g., layout, positioning). - For implementation details, check the source files in `src/components/ui/`. - All other Shadcn UI components in the project are standard and can be safely updated via the CLI.
## Tech Stack **UI:** [ShadcnUI](https://ui.shadcn.com) (TailwindCSS + RadixUI) **Build Tool:** [Vite](https://vitejs.dev/) **Routing:** [TanStack Router](https://tanstack.com/router/latest) **Type Checking:** [TypeScript](https://www.typescriptlang.org/) **Linting/Formatting:** [ESLint](https://eslint.org/) & [Prettier](https://prettier.io/) **Icons:** [Lucide Icons](https://lucide.dev/icons/), [Tabler Icons](https://tabler.io/icons) (Brand icons only) **Auth (partial):** [Clerk](https://go.clerk.com/GttUAaK) ## Run Locally Clone the project ```bash git clone https://github.com/satnaing/shadcn-admin.git ``` Go to the project directory ```bash cd shadcn-admin ``` Install dependencies ```bash pnpm install ``` Start the server ```bash pnpm run dev ``` ## Sponsoring this project ❤️ If you find this project helpful or use this in your own work, consider [sponsoring me](https://github.com/sponsors/satnaing) to support development and maintenance. You can [buy me a coffee](https://buymeacoffee.com/satnaing) as well. Don’t worry, every penny helps. Thank you! 🙏 For questions or sponsorship inquiries, feel free to reach out at [satnaingdev@gmail.com](mailto:satnaingdev@gmail.com). ### Current Sponsor - [Clerk](https://go.clerk.com/GttUAaK) - authentication and user management for the modern web ## Author Crafted with 🤍 by [@satnaing](https://github.com/satnaing) ## License Licensed under the [MIT License](https://choosealicense.com/licenses/mit/) ================================================ FILE: components.json ================================================ { "$schema": "https://ui.shadcn.com/schema.json", "style": "new-york", "rsc": false, "tsx": true, "tailwind": { "config": "", "css": "src/styles/index.css", "baseColor": "slate", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "iconLibrary": "lucide" } ================================================ FILE: cz.yaml ================================================ --- commitizen: name: cz_conventional_commits tag_format: v$version update_changelog_on_bump: true version_provider: npm version_scheme: semver ================================================ FILE: eslint.config.js ================================================ import globals from 'globals' import js from '@eslint/js' import pluginQuery from '@tanstack/eslint-plugin-query' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import { defineConfig } from 'eslint/config' import tseslint from 'typescript-eslint' export default defineConfig( { ignores: ['dist', 'src/components/ui'] }, { extends: [ js.configs.recommended, ...tseslint.configs.recommended, ...pluginQuery.configs['flat/recommended'], ], files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], 'no-console': 'error', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { args: 'all', argsIgnorePattern: '^_', caughtErrors: 'all', caughtErrorsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true, }, ], // Enforce type-only imports for TypeScript types '@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports', fixStyle: 'inline-type-imports', disallowTypeAnnotations: false, }, ], // Prevent duplicate imports from the same module 'no-duplicate-imports': 'error', }, } ) ================================================ FILE: index.html ================================================ Shadcn Admin
================================================ FILE: knip.config.ts ================================================ import type { KnipConfig } from 'knip'; const config: KnipConfig = { ignore: ['src/components/ui/**', 'src/routeTree.gen.ts'], ignoreDependencies: ["tailwindcss", "tw-animate-css"] }; export default config; ================================================ FILE: netlify.toml ================================================ [[redirects]] from = "/*" to = "/index.html" status = 200 ================================================ FILE: package.json ================================================ { "name": "shadcn-admin", "private": false, "version": "2.2.1", "type": "module", "scripts": { "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview", "format:check": "prettier --check .", "format": "prettier --write .", "knip": "knip" }, "dependencies": { "@clerk/clerk-react": "^5.58.1", "@hookform/resolvers": "^5.2.2", "@radix-ui/react-alert-dialog": "^1.1.15", "@radix-ui/react-avatar": "^1.1.11", "@radix-ui/react-checkbox": "^1.3.3", "@radix-ui/react-collapsible": "^1.1.12", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-direction": "^1.1.1", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-popover": "^1.1.15", "@radix-ui/react-radio-group": "^1.3.8", "@radix-ui/react-scroll-area": "^1.2.10", "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-switch": "^1.2.6", "@radix-ui/react-tabs": "^1.1.13", "@radix-ui/react-tooltip": "^1.2.8", "@tailwindcss/vite": "^4.1.18", "@tanstack/react-query": "^5.90.12", "@tanstack/react-router": "^1.141.2", "@tanstack/react-table": "^8.21.3", "axios": "^1.13.5", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "1.1.1", "date-fns": "^4.1.0", "input-otp": "^1.4.2", "lucide-react": "^0.561.0", "react": "^19.2.3", "react-day-picker": "9.12.0", "react-dom": "^19.2.3", "react-hook-form": "^7.68.0", "react-top-loading-bar": "^3.0.2", "recharts": "^3.6.0", "sonner": "^2.0.7", "tailwind-merge": "^3.4.0", "tailwindcss": "^4.1.18", "tw-animate-css": "^1.4.0", "zod": "^4.2.0", "zustand": "^5.0.9" }, "devDependencies": { "@eslint/js": "^9.39.2", "@faker-js/faker": "^10.1.0", "@tanstack/eslint-plugin-query": "^5.91.2", "@tanstack/react-query-devtools": "^5.91.1", "@tanstack/react-router-devtools": "^1.141.2", "@tanstack/router-plugin": "^1.141.2", "@trivago/prettier-plugin-sort-imports": "^6.0.0", "@types/node": "^25.0.2", "@types/react": "^19.2.7", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react-swc": "^4.2.2", "eslint": "^9.39.2", "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-refresh": "^0.4.25", "globals": "^16.5.0", "knip": "^5.73.4", "prettier": "^3.7.4", "prettier-plugin-tailwindcss": "^0.7.2", "typescript": "~5.9.3", "typescript-eslint": "^8.49.0", "vite": "^7.3.0" } } ================================================ FILE: src/assets/brand-icons/icon-discord.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconDiscord({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Discord ) } ================================================ FILE: src/assets/brand-icons/icon-docker.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconDocker({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Docker ) } ================================================ FILE: src/assets/brand-icons/icon-facebook.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconFacebook({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Facebook ) } ================================================ FILE: src/assets/brand-icons/icon-figma.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconFigma({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Figma ) } ================================================ FILE: src/assets/brand-icons/icon-github.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconGithub({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > GitHub ) } ================================================ FILE: src/assets/brand-icons/icon-gitlab.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconGitlab({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > GitLab ) } ================================================ FILE: src/assets/brand-icons/icon-gmail.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconGmail({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Gmail ) } ================================================ FILE: src/assets/brand-icons/icon-medium.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconMedium({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Medium ) } ================================================ FILE: src/assets/brand-icons/icon-notion.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconNotion({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Notion ) } ================================================ FILE: src/assets/brand-icons/icon-skype.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconSkype({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Skype ) } ================================================ FILE: src/assets/brand-icons/icon-slack.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconSlack({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Slack ) } ================================================ FILE: src/assets/brand-icons/icon-stripe.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconStripe({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Stripe ) } ================================================ FILE: src/assets/brand-icons/icon-telegram.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconTelegram({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Telegram ) } ================================================ FILE: src/assets/brand-icons/icon-trello.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconTrello({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Trello ) } ================================================ FILE: src/assets/brand-icons/icon-whatsapp.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconWhatsapp({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > WhatsApp ) } ================================================ FILE: src/assets/brand-icons/icon-zoom.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconZoom({ className, ...props }: SVGProps) { return ( path]:stroke-current', className)} fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' {...props} > Zoom ) } ================================================ FILE: src/assets/brand-icons/index.ts ================================================ export { IconDiscord } from './icon-discord' export { IconDocker } from './icon-docker' export { IconFacebook } from './icon-facebook' export { IconFigma } from './icon-figma' export { IconGithub } from './icon-github' export { IconGitlab } from './icon-gitlab' export { IconGmail } from './icon-gmail' export { IconMedium } from './icon-medium' export { IconNotion } from './icon-notion' export { IconSkype } from './icon-skype' export { IconSlack } from './icon-slack' export { IconStripe } from './icon-stripe' export { IconTelegram } from './icon-telegram' export { IconTrello } from './icon-trello' export { IconWhatsapp } from './icon-whatsapp' export { IconZoom } from './icon-zoom' ================================================ FILE: src/assets/clerk-full-logo.tsx ================================================ import { type SVGProps } from 'react' export function ClerkFullLogo(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/clerk-logo.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function ClerkLogo({ className, ...props }: SVGProps) { return ( path]:fill-foreground', className)} {...props} > Clerk ) } ================================================ FILE: src/assets/custom/icon-dir.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' import { type Direction } from '@/context/direction-provider' type IconDirProps = SVGProps & { dir: Direction } export function IconDir({ dir, className, ...props }: IconDirProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-layout-compact.tsx ================================================ import { type SVGProps } from 'react' export function IconLayoutCompact(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-layout-default.tsx ================================================ import { type SVGProps } from 'react' export function IconLayoutDefault(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-layout-full.tsx ================================================ import { type SVGProps } from 'react' export function IconLayoutFull(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-sidebar-floating.tsx ================================================ import { type SVGProps } from 'react' export function IconSidebarFloating(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-sidebar-inset.tsx ================================================ import { type SVGProps } from 'react' export function IconSidebarInset(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-sidebar-sidebar.tsx ================================================ import { type SVGProps } from 'react' export function IconSidebarSidebar(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-theme-dark.tsx ================================================ import { type SVGProps } from 'react' export function IconThemeDark(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-theme-light.tsx ================================================ import { type SVGProps } from 'react' export function IconThemeLight(props: SVGProps) { return ( ) } ================================================ FILE: src/assets/custom/icon-theme-system.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function IconThemeSystem({ className, ...props }: SVGProps) { return ( ) } ================================================ FILE: src/assets/logo.tsx ================================================ import { type SVGProps } from 'react' import { cn } from '@/lib/utils' export function Logo({ className, ...props }: SVGProps) { return ( ) } ================================================ FILE: src/components/coming-soon.tsx ================================================ import { Telescope } from 'lucide-react' export function ComingSoon() { return (

Coming Soon!

This page has not been created yet.
Stay tuned though!

) } ================================================ FILE: src/components/command-menu.tsx ================================================ import React from 'react' import { useNavigate } from '@tanstack/react-router' import { ArrowRight, ChevronRight, Laptop, Moon, Sun } from 'lucide-react' import { useSearch } from '@/context/search-provider' import { useTheme } from '@/context/theme-provider' import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from '@/components/ui/command' import { sidebarData } from './layout/data/sidebar-data' import { ScrollArea } from './ui/scroll-area' export function CommandMenu() { const navigate = useNavigate() const { setTheme } = useTheme() const { open, setOpen } = useSearch() const runCommand = React.useCallback( (command: () => unknown) => { setOpen(false) command() }, [setOpen] ) return ( No results found. {sidebarData.navGroups.map((group) => ( {group.items.map((navItem, i) => { if (navItem.url) return ( { runCommand(() => navigate({ to: navItem.url })) }} >
{navItem.title}
) return navItem.items?.map((subItem, i) => ( { runCommand(() => navigate({ to: subItem.url })) }} >
{navItem.title} {subItem.title}
)) })}
))} runCommand(() => setTheme('light'))}> Light runCommand(() => setTheme('dark'))}> Dark runCommand(() => setTheme('system'))}> System
) } ================================================ FILE: src/components/config-drawer.tsx ================================================ import { type SVGProps } from 'react' import { Root as Radio, Item } from '@radix-ui/react-radio-group' import { CircleCheck, RotateCcw, Settings } from 'lucide-react' import { IconDir } from '@/assets/custom/icon-dir' import { IconLayoutCompact } from '@/assets/custom/icon-layout-compact' import { IconLayoutDefault } from '@/assets/custom/icon-layout-default' import { IconLayoutFull } from '@/assets/custom/icon-layout-full' import { IconSidebarFloating } from '@/assets/custom/icon-sidebar-floating' import { IconSidebarInset } from '@/assets/custom/icon-sidebar-inset' import { IconSidebarSidebar } from '@/assets/custom/icon-sidebar-sidebar' import { IconThemeDark } from '@/assets/custom/icon-theme-dark' import { IconThemeLight } from '@/assets/custom/icon-theme-light' import { IconThemeSystem } from '@/assets/custom/icon-theme-system' import { cn } from '@/lib/utils' import { useDirection } from '@/context/direction-provider' import { type Collapsible, useLayout } from '@/context/layout-provider' import { useTheme } from '@/context/theme-provider' import { Button } from '@/components/ui/button' import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, } from '@/components/ui/sheet' import { useSidebar } from './ui/sidebar' export function ConfigDrawer() { const { setOpen } = useSidebar() const { resetDir } = useDirection() const { resetTheme } = useTheme() const { resetLayout } = useLayout() const handleReset = () => { setOpen(true) resetDir() resetTheme() resetLayout() } return ( Theme Settings Adjust the appearance and layout to suit your preferences.
) } function SectionTitle({ title, showReset = false, onReset, className, }: { title: string showReset?: boolean onReset?: () => void className?: string }) { return (
{title} {showReset && onReset && ( )}
) } function RadioGroupItem({ item, isTheme = false, }: { item: { value: string label: string icon: (props: SVGProps) => React.ReactElement } isTheme?: boolean }) { return (
{item.label}
) } function ThemeConfig() { const { defaultTheme, theme, setTheme } = useTheme() return (
setTheme(defaultTheme)} /> {[ { value: 'system', label: 'System', icon: IconThemeSystem, }, { value: 'light', label: 'Light', icon: IconThemeLight, }, { value: 'dark', label: 'Dark', icon: IconThemeDark, }, ].map((item) => ( ))}
Choose between system preference, light mode, or dark mode
) } function SidebarConfig() { const { defaultVariant, variant, setVariant } = useLayout() return (
setVariant(defaultVariant)} /> {[ { value: 'inset', label: 'Inset', icon: IconSidebarInset, }, { value: 'floating', label: 'Floating', icon: IconSidebarFloating, }, { value: 'sidebar', label: 'Sidebar', icon: IconSidebarSidebar, }, ].map((item) => ( ))}
) } function LayoutConfig() { const { open, setOpen } = useSidebar() const { defaultCollapsible, collapsible, setCollapsible } = useLayout() const radioState = open ? 'default' : collapsible return (
{ setOpen(true) setCollapsible(defaultCollapsible) }} /> { if (v === 'default') { setOpen(true) return } setOpen(false) setCollapsible(v as Collapsible) }} className='grid w-full max-w-md grid-cols-3 gap-4' aria-label='Select layout style' aria-describedby='layout-description' > {[ { value: 'default', label: 'Default', icon: IconLayoutDefault, }, { value: 'icon', label: 'Compact', icon: IconLayoutCompact, }, { value: 'offcanvas', label: 'Full layout', icon: IconLayoutFull, }, ].map((item) => ( ))}
Choose between default expanded, compact icon-only, or full layout mode
) } function DirConfig() { const { defaultDir, dir, setDir } = useDirection() return (
setDir(defaultDir)} /> {[ { value: 'ltr', label: 'Left to Right', icon: (props: SVGProps) => ( ), }, { value: 'rtl', label: 'Right to Left', icon: (props: SVGProps) => ( ), }, ].map((item) => ( ))}
Choose between left-to-right or right-to-left site direction
) } ================================================ FILE: src/components/confirm-dialog.tsx ================================================ import { cn } from '@/lib/utils' import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@/components/ui/alert-dialog' import { Button } from '@/components/ui/button' type ConfirmDialogProps = { open: boolean onOpenChange: (open: boolean) => void title: React.ReactNode disabled?: boolean desc: React.JSX.Element | string cancelBtnText?: string confirmText?: React.ReactNode destructive?: boolean handleConfirm: () => void isLoading?: boolean className?: string children?: React.ReactNode } export function ConfirmDialog(props: ConfirmDialogProps) { const { title, desc, children, className, confirmText, cancelBtnText, destructive, isLoading, disabled = false, handleConfirm, ...actions } = props return ( {title}
{desc}
{children} {cancelBtnText ?? 'Cancel'}
) } ================================================ FILE: src/components/data-table/bulk-actions.tsx ================================================ import { useState, useEffect, useRef } from 'react' import { type Table } from '@tanstack/react-table' import { X } from 'lucide-react' import { cn } from '@/lib/utils' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Separator } from '@/components/ui/separator' import { Tooltip, TooltipContent, TooltipTrigger, } from '@/components/ui/tooltip' type DataTableBulkActionsProps = { table: Table entityName: string children: React.ReactNode } /** * A modular toolbar for displaying bulk actions when table rows are selected. * * @template TData The type of data in the table. * @param {object} props The component props. * @param {Table} props.table The react-table instance. * @param {string} props.entityName The name of the entity being acted upon (e.g., "task", "user"). * @param {React.ReactNode} props.children The action buttons to be rendered inside the toolbar. * @returns {React.ReactNode | null} The rendered component or null if no rows are selected. */ export function DataTableBulkActions({ table, entityName, children, }: DataTableBulkActionsProps): React.ReactNode | null { const selectedRows = table.getFilteredSelectedRowModel().rows const selectedCount = selectedRows.length const toolbarRef = useRef(null) const [announcement, setAnnouncement] = useState('') // Announce selection changes to screen readers useEffect(() => { if (selectedCount > 0) { const message = `${selectedCount} ${entityName}${selectedCount > 1 ? 's' : ''} selected. Bulk actions toolbar is available.` // Use queueMicrotask to defer state update and avoid cascading renders queueMicrotask(() => { setAnnouncement(message) }) // Clear announcement after a delay const timer = setTimeout(() => setAnnouncement(''), 3000) return () => clearTimeout(timer) } }, [selectedCount, entityName]) const handleClearSelection = () => { table.resetRowSelection() } const handleKeyDown = (event: React.KeyboardEvent) => { const buttons = toolbarRef.current?.querySelectorAll('button') if (!buttons) return const currentIndex = Array.from(buttons).findIndex( (button) => button === document.activeElement ) switch (event.key) { case 'ArrowRight': { event.preventDefault() const nextIndex = (currentIndex + 1) % buttons.length buttons[nextIndex]?.focus() break } case 'ArrowLeft': { event.preventDefault() const prevIndex = currentIndex === 0 ? buttons.length - 1 : currentIndex - 1 buttons[prevIndex]?.focus() break } case 'Home': event.preventDefault() buttons[0]?.focus() break case 'End': event.preventDefault() buttons[buttons.length - 1]?.focus() break case 'Escape': { // Check if the Escape key came from a dropdown trigger or content // We can't check dropdown state because Radix UI closes it before our handler runs const target = event.target as HTMLElement const activeElement = document.activeElement as HTMLElement // Check if the event target or currently focused element is a dropdown trigger const isFromDropdownTrigger = target?.getAttribute('data-slot') === 'dropdown-menu-trigger' || activeElement?.getAttribute('data-slot') === 'dropdown-menu-trigger' || target?.closest('[data-slot="dropdown-menu-trigger"]') || activeElement?.closest('[data-slot="dropdown-menu-trigger"]') // Check if the focused element is inside dropdown content (which is portaled) const isFromDropdownContent = activeElement?.closest('[data-slot="dropdown-menu-content"]') || target?.closest('[data-slot="dropdown-menu-content"]') if (isFromDropdownTrigger || isFromDropdownContent) { // Escape was meant for the dropdown - don't clear selection return } // Escape was meant for the toolbar - clear selection event.preventDefault() handleClearSelection() break } } } if (selectedCount === 0) { return null } return ( <> {/* Live region for screen reader announcements */}
{announcement}
1 ? 's' : ''}`} aria-describedby='bulk-actions-description' tabIndex={-1} onKeyDown={handleKeyDown} className={cn( 'fixed bottom-6 left-1/2 z-50 -translate-x-1/2 rounded-xl', 'transition-all delay-100 duration-300 ease-out hover:scale-105', 'focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none' )} >

Clear selection (Escape)

) } ================================================ FILE: src/components/data-table/column-header.tsx ================================================ import { ArrowDownIcon, ArrowUpIcon, CaretSortIcon, EyeNoneIcon, } from '@radix-ui/react-icons' import { type Column } from '@tanstack/react-table' import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' type DataTableColumnHeaderProps = React.HTMLAttributes & { column: Column title: string } export function DataTableColumnHeader({ column, title, className, }: DataTableColumnHeaderProps) { if (!column.getCanSort()) { return
{title}
} return (
column.toggleSorting(false)}> Asc column.toggleSorting(true)}> Desc {column.getCanHide() && ( <> column.toggleVisibility(false)}> Hide )}
) } ================================================ FILE: src/components/data-table/faceted-filter.tsx ================================================ import * as React from 'react' import { CheckIcon, PlusCircledIcon } from '@radix-ui/react-icons' import { type Column } from '@tanstack/react-table' import { cn } from '@/lib/utils' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from '@/components/ui/command' import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover' import { Separator } from '@/components/ui/separator' type DataTableFacetedFilterProps = { column?: Column title?: string options: { label: string value: string icon?: React.ComponentType<{ className?: string }> }[] } export function DataTableFacetedFilter({ column, title, options, }: DataTableFacetedFilterProps) { const facets = column?.getFacetedUniqueValues() const selectedValues = new Set(column?.getFilterValue() as string[]) return ( No results found. {options.map((option) => { const isSelected = selectedValues.has(option.value) return ( { if (isSelected) { selectedValues.delete(option.value) } else { selectedValues.add(option.value) } const filterValues = Array.from(selectedValues) column?.setFilterValue( filterValues.length ? filterValues : undefined ) }} >
{option.icon && ( )} {option.label} {facets?.get(option.value) && ( {facets.get(option.value)} )}
) })}
{selectedValues.size > 0 && ( <> column?.setFilterValue(undefined)} className='justify-center text-center' > Clear filters )}
) } ================================================ FILE: src/components/data-table/index.ts ================================================ export { DataTablePagination } from './pagination' export { DataTableColumnHeader } from './column-header' export { DataTableFacetedFilter } from './faceted-filter' export { DataTableViewOptions } from './view-options' export { DataTableToolbar } from './toolbar' export { DataTableBulkActions } from './bulk-actions' ================================================ FILE: src/components/data-table/pagination.tsx ================================================ import { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons' import { type Table } from '@tanstack/react-table' import { cn, getPageNumbers } from '@/lib/utils' import { Button } from '@/components/ui/button' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select' type DataTablePaginationProps = { table: Table className?: string } export function DataTablePagination({ table, className, }: DataTablePaginationProps) { const currentPage = table.getState().pagination.pageIndex + 1 const totalPages = table.getPageCount() const pageNumbers = getPageNumbers(currentPage, totalPages) return (
Page {currentPage} of {totalPages}

Rows per page

Page {currentPage} of {totalPages}
{/* Page number buttons */} {pageNumbers.map((pageNumber, index) => (
{pageNumber === '...' ? ( ... ) : ( )}
))}
) } ================================================ FILE: src/components/data-table/toolbar.tsx ================================================ import { Cross2Icon } from '@radix-ui/react-icons' import { type Table } from '@tanstack/react-table' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { DataTableFacetedFilter } from './faceted-filter' import { DataTableViewOptions } from './view-options' type DataTableToolbarProps = { table: Table searchPlaceholder?: string searchKey?: string filters?: { columnId: string title: string options: { label: string value: string icon?: React.ComponentType<{ className?: string }> }[] }[] } export function DataTableToolbar({ table, searchPlaceholder = 'Filter...', searchKey, filters = [], }: DataTableToolbarProps) { const isFiltered = table.getState().columnFilters.length > 0 || table.getState().globalFilter return (
{searchKey ? ( table.getColumn(searchKey)?.setFilterValue(event.target.value) } className='h-8 w-[150px] lg:w-[250px]' /> ) : ( table.setGlobalFilter(event.target.value)} className='h-8 w-[150px] lg:w-[250px]' /> )}
{filters.map((filter) => { const column = table.getColumn(filter.columnId) if (!column) return null return ( ) })}
{isFiltered && ( )}
) } ================================================ FILE: src/components/data-table/view-options.tsx ================================================ import { DropdownMenuTrigger } from '@radix-ui/react-dropdown-menu' import { MixerHorizontalIcon } from '@radix-ui/react-icons' import { type Table } from '@tanstack/react-table' import { Button } from '@/components/ui/button' import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, } from '@/components/ui/dropdown-menu' type DataTableViewOptionsProps = { table: Table } export function DataTableViewOptions({ table, }: DataTableViewOptionsProps) { return ( Toggle columns {table .getAllColumns() .filter( (column) => typeof column.accessorFn !== 'undefined' && column.getCanHide() ) .map((column) => { return ( column.toggleVisibility(!!value)} > {column.id} ) })} ) } ================================================ FILE: src/components/date-picker.tsx ================================================ import { format } from 'date-fns' import { Calendar as CalendarIcon } from 'lucide-react' import { Button } from '@/components/ui/button' import { Calendar } from '@/components/ui/calendar' import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover' type DatePickerProps = { selected: Date | undefined onSelect: (date: Date | undefined) => void placeholder?: string } export function DatePicker({ selected, onSelect, placeholder = 'Pick a date', }: DatePickerProps) { return ( date > new Date() || date < new Date('1900-01-01') } /> ) } ================================================ FILE: src/components/layout/app-sidebar.tsx ================================================ import { useLayout } from '@/context/layout-provider' import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarRail, } from '@/components/ui/sidebar' // import { AppTitle } from './app-title' import { sidebarData } from './data/sidebar-data' import { NavGroup } from './nav-group' import { NavUser } from './nav-user' import { TeamSwitcher } from './team-switcher' export function AppSidebar() { const { collapsible, variant } = useLayout() return ( {/* Replace with the following /* if you want to use the normal app title instead of TeamSwitch dropdown */} {/* */} {sidebarData.navGroups.map((props) => ( ))} ) } ================================================ FILE: src/components/layout/app-title.tsx ================================================ import { Link } from '@tanstack/react-router' import { Menu, X } from 'lucide-react' import { cn } from '@/lib/utils' import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar, } from '@/components/ui/sidebar' import { Button } from '../ui/button' export function AppTitle() { const { setOpenMobile } = useSidebar() return (
setOpenMobile(false)} className='grid flex-1 text-start text-sm leading-tight' > Shadcn-Admin Vite + ShadcnUI
) } function ToggleSidebar({ className, onClick, ...props }: React.ComponentProps) { const { toggleSidebar } = useSidebar() return ( ) } ================================================ FILE: src/components/layout/authenticated-layout.tsx ================================================ import { Outlet } from '@tanstack/react-router' import { getCookie } from '@/lib/cookies' import { cn } from '@/lib/utils' import { LayoutProvider } from '@/context/layout-provider' import { SearchProvider } from '@/context/search-provider' import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar' import { AppSidebar } from '@/components/layout/app-sidebar' import { SkipToMain } from '@/components/skip-to-main' type AuthenticatedLayoutProps = { children?: React.ReactNode } export function AuthenticatedLayout({ children }: AuthenticatedLayoutProps) { const defaultOpen = getCookie('sidebar_state') !== 'false' return ( {children ?? } ) } ================================================ FILE: src/components/layout/data/sidebar-data.ts ================================================ import { Construction, LayoutDashboard, Monitor, Bug, ListTodo, FileX, HelpCircle, Lock, Bell, Package, Palette, ServerOff, Settings, Wrench, UserCog, UserX, Users, MessagesSquare, ShieldCheck, AudioWaveform, Command, GalleryVerticalEnd, } from 'lucide-react' import { ClerkLogo } from '@/assets/clerk-logo' import { type SidebarData } from '../types' export const sidebarData: SidebarData = { user: { name: 'satnaing', email: 'satnaingdev@gmail.com', avatar: '/avatars/shadcn.jpg', }, teams: [ { name: 'Shadcn Admin', logo: Command, plan: 'Vite + ShadcnUI', }, { name: 'Acme Inc', logo: GalleryVerticalEnd, plan: 'Enterprise', }, { name: 'Acme Corp.', logo: AudioWaveform, plan: 'Startup', }, ], navGroups: [ { title: 'General', items: [ { title: 'Dashboard', url: '/', icon: LayoutDashboard, }, { title: 'Tasks', url: '/tasks', icon: ListTodo, }, { title: 'Apps', url: '/apps', icon: Package, }, { title: 'Chats', url: '/chats', badge: '3', icon: MessagesSquare, }, { title: 'Users', url: '/users', icon: Users, }, { title: 'Secured by Clerk', icon: ClerkLogo, items: [ { title: 'Sign In', url: '/clerk/sign-in', }, { title: 'Sign Up', url: '/clerk/sign-up', }, { title: 'User Management', url: '/clerk/user-management', }, ], }, ], }, { title: 'Pages', items: [ { title: 'Auth', icon: ShieldCheck, items: [ { title: 'Sign In', url: '/sign-in', }, { title: 'Sign In (2 Col)', url: '/sign-in-2', }, { title: 'Sign Up', url: '/sign-up', }, { title: 'Forgot Password', url: '/forgot-password', }, { title: 'OTP', url: '/otp', }, ], }, { title: 'Errors', icon: Bug, items: [ { title: 'Unauthorized', url: '/errors/unauthorized', icon: Lock, }, { title: 'Forbidden', url: '/errors/forbidden', icon: UserX, }, { title: 'Not Found', url: '/errors/not-found', icon: FileX, }, { title: 'Internal Server Error', url: '/errors/internal-server-error', icon: ServerOff, }, { title: 'Maintenance Error', url: '/errors/maintenance-error', icon: Construction, }, ], }, ], }, { title: 'Other', items: [ { title: 'Settings', icon: Settings, items: [ { title: 'Profile', url: '/settings', icon: UserCog, }, { title: 'Account', url: '/settings/account', icon: Wrench, }, { title: 'Appearance', url: '/settings/appearance', icon: Palette, }, { title: 'Notifications', url: '/settings/notifications', icon: Bell, }, { title: 'Display', url: '/settings/display', icon: Monitor, }, ], }, { title: 'Help Center', url: '/help-center', icon: HelpCircle, }, ], }, ], } ================================================ FILE: src/components/layout/header.tsx ================================================ import { useEffect, useState } from 'react' import { cn } from '@/lib/utils' import { Separator } from '@/components/ui/separator' import { SidebarTrigger } from '@/components/ui/sidebar' type HeaderProps = React.HTMLAttributes & { fixed?: boolean ref?: React.Ref } export function Header({ className, fixed, children, ...props }: HeaderProps) { const [offset, setOffset] = useState(0) useEffect(() => { const onScroll = () => { setOffset(document.body.scrollTop || document.documentElement.scrollTop) } // Add scroll listener to the body document.addEventListener('scroll', onScroll, { passive: true }) // Clean up the event listener on unmount return () => document.removeEventListener('scroll', onScroll) }, []) return (
10 && fixed ? 'shadow' : 'shadow-none', className )} {...props} >
10 && fixed && 'after:absolute after:inset-0 after:-z-10 after:bg-background/20 after:backdrop-blur-lg' )} > {children}
) } ================================================ FILE: src/components/layout/main.tsx ================================================ import { cn } from '@/lib/utils' type MainProps = React.HTMLAttributes & { fixed?: boolean fluid?: boolean ref?: React.Ref } export function Main({ fixed, className, fluid, ...props }: MainProps) { return (
) } ================================================ FILE: src/components/layout/nav-group.tsx ================================================ import { type ReactNode } from 'react' import { Link, useLocation } from '@tanstack/react-router' import { ChevronRight } from 'lucide-react' import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible' import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar, } from '@/components/ui/sidebar' import { Badge } from '../ui/badge' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '../ui/dropdown-menu' import { type NavCollapsible, type NavItem, type NavLink, type NavGroup as NavGroupProps, } from './types' export function NavGroup({ title, items }: NavGroupProps) { const { state, isMobile } = useSidebar() const href = useLocation({ select: (location) => location.href }) return ( {title} {items.map((item) => { const key = `${item.title}-${item.url}` if (!item.items) return if (state === 'collapsed' && !isMobile) return ( ) return })} ) } function NavBadge({ children }: { children: ReactNode }) { return {children} } function SidebarMenuLink({ item, href }: { item: NavLink; href: string }) { const { setOpenMobile } = useSidebar() return ( setOpenMobile(false)}> {item.icon && } {item.title} {item.badge && {item.badge}} ) } function SidebarMenuCollapsible({ item, href, }: { item: NavCollapsible href: string }) { const { setOpenMobile } = useSidebar() return ( {item.icon && } {item.title} {item.badge && {item.badge}} {item.items.map((subItem) => ( setOpenMobile(false)}> {subItem.icon && } {subItem.title} {subItem.badge && {subItem.badge}} ))} ) } function SidebarMenuCollapsedDropdown({ item, href, }: { item: NavCollapsible href: string }) { return ( {item.icon && } {item.title} {item.badge && {item.badge}} {item.title} {item.badge ? `(${item.badge})` : ''} {item.items.map((sub) => ( {sub.icon && } {sub.title} {sub.badge && ( {sub.badge} )} ))} ) } function checkIsActive(href: string, item: NavItem, mainNav = false) { return ( href === item.url || // /endpint?search=param href.split('?')[0] === item.url || // endpoint !!item?.items?.filter((i) => i.url === href).length || // if child nav is active (mainNav && href.split('/')[1] !== '' && href.split('/')[1] === item?.url?.split('/')[1]) ) } ================================================ FILE: src/components/layout/nav-user.tsx ================================================ import { Link } from '@tanstack/react-router' import { BadgeCheck, Bell, ChevronsUpDown, CreditCard, LogOut, Sparkles, } from 'lucide-react' import useDialogState from '@/hooks/use-dialog-state' import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar, } from '@/components/ui/sidebar' import { SignOutDialog } from '@/components/sign-out-dialog' type NavUserProps = { user: { name: string email: string avatar: string } } export function NavUser({ user }: NavUserProps) { const { isMobile } = useSidebar() const [open, setOpen] = useDialogState() return ( <> SN
{user.name} {user.email}
SN
{user.name} {user.email}
Upgrade to Pro Account Billing Notifications setOpen(true)} > Sign out
) } ================================================ FILE: src/components/layout/team-switcher.tsx ================================================ import * as React from 'react' import { ChevronsUpDown, Plus } from 'lucide-react' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar, } from '@/components/ui/sidebar' type TeamSwitcherProps = { teams: { name: string logo: React.ElementType plan: string }[] } export function TeamSwitcher({ teams }: TeamSwitcherProps) { const { isMobile } = useSidebar() const [activeTeam, setActiveTeam] = React.useState(teams[0]) return (
{activeTeam.name} {activeTeam.plan}
Teams {teams.map((team, index) => ( setActiveTeam(team)} className='gap-2 p-2' >
{team.name} ⌘{index + 1}
))}
Add team
) } ================================================ FILE: src/components/layout/top-nav.tsx ================================================ import { Link } from '@tanstack/react-router' import { Menu } from 'lucide-react' import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' type TopNavProps = React.HTMLAttributes & { links: { title: string href: string isActive: boolean disabled?: boolean }[] } export function TopNav({ className, links, ...props }: TopNavProps) { return ( <>
{links.map(({ title, href, isActive, disabled }) => ( {title} ))}
) } ================================================ FILE: src/components/layout/types.ts ================================================ import { type LinkProps } from '@tanstack/react-router' type User = { name: string email: string avatar: string } type Team = { name: string logo: React.ElementType plan: string } type BaseNavItem = { title: string badge?: string icon?: React.ElementType } type NavLink = BaseNavItem & { url: LinkProps['to'] | (string & {}) items?: never } type NavCollapsible = BaseNavItem & { items: (BaseNavItem & { url: LinkProps['to'] | (string & {}) })[] url?: never } type NavItem = NavCollapsible | NavLink type NavGroup = { title: string items: NavItem[] } type SidebarData = { user: User teams: Team[] navGroups: NavGroup[] } export type { SidebarData, NavGroup, NavItem, NavCollapsible, NavLink } ================================================ FILE: src/components/learn-more.tsx ================================================ import { type Root, type Content, type Trigger } from '@radix-ui/react-popover' import { CircleQuestionMark } from 'lucide-react' import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover' type LearnMoreProps = React.ComponentProps & { contentProps?: React.ComponentProps triggerProps?: React.ComponentProps } export function LearnMore({ children, contentProps, triggerProps, ...props }: LearnMoreProps) { return ( {children} ) } ================================================ FILE: src/components/long-text.tsx ================================================ import { useRef, useState } from 'react' import { cn } from '@/lib/utils' import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover' import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip' type LongTextProps = { children: React.ReactNode className?: string contentClassName?: string } export function LongText({ children, className = '', contentClassName = '', }: LongTextProps) { const ref = useRef(null) const [isOverflown, setIsOverflown] = useState(false) // Use ref callback to check overflow when element is mounted const refCallback = (node: HTMLDivElement | null) => { ref.current = node if (node && checkOverflow(node)) { queueMicrotask(() => setIsOverflown(true)) } } if (!isOverflown) return (
{children}
) return ( <>
{children}

{children}

{children}

{children}

) } const checkOverflow = (textContainer: HTMLDivElement | null) => { if (textContainer) { return ( textContainer.offsetHeight < textContainer.scrollHeight || textContainer.offsetWidth < textContainer.scrollWidth ) } return false } ================================================ FILE: src/components/navigation-progress.tsx ================================================ import { useEffect, useRef } from 'react' import { useRouterState } from '@tanstack/react-router' import LoadingBar, { type LoadingBarRef } from 'react-top-loading-bar' export function NavigationProgress() { const ref = useRef(null) const state = useRouterState() useEffect(() => { if (state.status === 'pending') { ref.current?.continuousStart() } else { ref.current?.complete() } }, [state.status]) return ( ) } ================================================ FILE: src/components/password-input.tsx ================================================ import * as React from 'react' import { Eye, EyeOff } from 'lucide-react' import { cn } from '@/lib/utils' import { Button } from './ui/button' type PasswordInputProps = Omit< React.InputHTMLAttributes, 'type' > & { ref?: React.Ref } export function PasswordInput({ className, disabled, ref, ...props }: PasswordInputProps) { const [showPassword, setShowPassword] = React.useState(false) return (
) } ================================================ FILE: src/components/profile-dropdown.tsx ================================================ import { Link } from '@tanstack/react-router' import useDialogState from '@/hooks/use-dialog-state' import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { Button } from '@/components/ui/button' import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { SignOutDialog } from '@/components/sign-out-dialog' export function ProfileDropdown() { const [open, setOpen] = useDialogState() return ( <>

satnaing

satnaingdev@gmail.com

Profile ⇧⌘P Billing ⌘B Settings ⌘S New Team setOpen(true)}> Sign out ⇧⌘Q
) } ================================================ FILE: src/components/search.tsx ================================================ import { SearchIcon } from 'lucide-react' import { cn } from '@/lib/utils' import { useSearch } from '@/context/search-provider' import { Button } from './ui/button' type SearchProps = { className?: string type?: React.HTMLInputTypeAttribute placeholder?: string } export function Search({ className = '', placeholder = 'Search', }: SearchProps) { const { setOpen } = useSearch() return ( ) } ================================================ FILE: src/components/select-dropdown.tsx ================================================ import { Loader } from 'lucide-react' import { cn } from '@/lib/utils' import { FormControl } from '@/components/ui/form' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select' type SelectDropdownProps = { onValueChange?: (value: string) => void defaultValue: string | undefined placeholder?: string isPending?: boolean items: { label: string; value: string }[] | undefined disabled?: boolean className?: string isControlled?: boolean } export function SelectDropdown({ defaultValue, onValueChange, isPending, items, placeholder, disabled, className = '', isControlled = false, }: SelectDropdownProps) { const defaultState = isControlled ? { value: defaultValue, onValueChange } : { defaultValue, onValueChange } return ( ) } ================================================ FILE: src/components/sign-out-dialog.tsx ================================================ import { useNavigate, useLocation } from '@tanstack/react-router' import { useAuthStore } from '@/stores/auth-store' import { ConfirmDialog } from '@/components/confirm-dialog' interface SignOutDialogProps { open: boolean onOpenChange: (open: boolean) => void } export function SignOutDialog({ open, onOpenChange }: SignOutDialogProps) { const navigate = useNavigate() const location = useLocation() const { auth } = useAuthStore() const handleSignOut = () => { auth.reset() // Preserve current location for redirect after sign-in const currentPath = location.href navigate({ to: '/sign-in', search: { redirect: currentPath }, replace: true, }) } return ( ) } ================================================ FILE: src/components/skip-to-main.tsx ================================================ export function SkipToMain() { return ( Skip to Main ) } ================================================ FILE: src/components/theme-switch.tsx ================================================ import { useEffect } from 'react' import { Check, Moon, Sun } from 'lucide-react' import { cn } from '@/lib/utils' import { useTheme } from '@/context/theme-provider' import { Button } from '@/components/ui/button' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' export function ThemeSwitch() { const { theme, setTheme } = useTheme() /* Update theme-color meta tag * when theme is updated */ useEffect(() => { const themeColor = theme === 'dark' ? '#020817' : '#fff' const metaThemeColor = document.querySelector("meta[name='theme-color']") if (metaThemeColor) metaThemeColor.setAttribute('content', themeColor) }, [theme]) return ( setTheme('light')}> Light{' '} setTheme('dark')}> Dark setTheme('system')}> System ) } ================================================ FILE: src/components/ui/alert-dialog.tsx ================================================ import * as React from 'react' import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog' import { cn } from '@/lib/utils' import { buttonVariants } from '@/components/ui/button' function AlertDialog({ ...props }: React.ComponentProps) { return } function AlertDialogTrigger({ ...props }: React.ComponentProps) { return ( ) } function AlertDialogPortal({ ...props }: React.ComponentProps) { return ( ) } function AlertDialogOverlay({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogContent({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) { return (
) } function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) { return (
) } function AlertDialogTitle({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogDescription({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogAction({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogCancel({ className, ...props }: React.ComponentProps) { return ( ) } export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, } ================================================ FILE: src/components/ui/alert.tsx ================================================ import * as React from 'react' import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const alertVariants = cva( 'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current', { variants: { variant: { default: 'bg-card text-card-foreground', destructive: 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90', }, }, defaultVariants: { variant: 'default', }, } ) function Alert({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps) { return (
) } function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) { return (
) } function AlertDescription({ className, ...props }: React.ComponentProps<'div'>) { return (
) } export { Alert, AlertTitle, AlertDescription } ================================================ FILE: src/components/ui/avatar.tsx ================================================ import * as React from 'react' import * as AvatarPrimitive from '@radix-ui/react-avatar' import { cn } from '@/lib/utils' function Avatar({ className, ...props }: React.ComponentProps) { return ( ) } function AvatarImage({ className, ...props }: React.ComponentProps) { return ( ) } function AvatarFallback({ className, ...props }: React.ComponentProps) { return ( ) } export { Avatar, AvatarImage, AvatarFallback } ================================================ FILE: src/components/ui/badge.tsx ================================================ import * as React from 'react' import { Slot } from '@radix-ui/react-slot' import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const badgeVariants = cva( 'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', { variants: { variant: { default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90', secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90', destructive: 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground', }, }, defaultVariants: { variant: 'default', }, } ) function Badge({ className, variant, asChild = false, ...props }: React.ComponentProps<'span'> & VariantProps & { asChild?: boolean }) { const Comp = asChild ? Slot : 'span' return ( ) } export { Badge, badgeVariants } ================================================ FILE: src/components/ui/button.tsx ================================================ import * as React from 'react' import { Slot } from '@radix-ui/react-slot' import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", { variants: { variant: { default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90', destructive: 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', outline: 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50', secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80', ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50', link: 'text-primary underline-offset-4 hover:underline', }, size: { default: 'h-9 px-4 py-2 has-[>svg]:px-3', sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5', lg: 'h-10 rounded-md px-6 has-[>svg]:px-4', icon: 'size-9', }, }, defaultVariants: { variant: 'default', size: 'default', }, } ) function Button({ className, variant, size, asChild = false, ...props }: React.ComponentProps<'button'> & VariantProps & { asChild?: boolean }) { const Comp = asChild ? Slot : 'button' return ( ) } export { Button, buttonVariants } ================================================ FILE: src/components/ui/calendar.tsx ================================================ import * as React from 'react' import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from 'lucide-react' import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker' import { cn } from '@/lib/utils' import { Button, buttonVariants } from '@/components/ui/button' function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', formatters, components, ...props }: React.ComponentProps & { buttonVariant?: React.ComponentProps['variant'] }) { const defaultClassNames = getDefaultClassNames() return ( svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className )} captionLayout={captionLayout} formatters={{ formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }), ...formatters, }} classNames={{ root: cn('w-fit', defaultClassNames.root), months: cn( 'flex gap-4 flex-col md:flex-row relative', defaultClassNames.months ), month: cn('flex flex-col w-full gap-4', defaultClassNames.month), nav: cn( 'flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav ), button_previous: cn( buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous ), button_next: cn( buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next ), month_caption: cn( 'flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption ), dropdowns: cn( 'w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns ), dropdown_root: cn( 'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md', defaultClassNames.dropdown_root ), dropdown: cn( 'absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown ), caption_label: cn( 'select-none font-medium', captionLayout === 'label' ? 'text-sm' : 'rounded-md ps-2 pe-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label ), table: 'w-full border-collapse', weekdays: cn('flex', defaultClassNames.weekdays), weekday: cn( 'text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday ), week: cn('flex w-full mt-2', defaultClassNames.week), week_number_header: cn( 'select-none w-(--cell-size)', defaultClassNames.week_number_header ), week_number: cn( 'text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number ), day: cn( 'relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', defaultClassNames.day ), range_start: cn( 'rounded-l-md bg-accent', defaultClassNames.range_start ), range_middle: cn('rounded-none', defaultClassNames.range_middle), range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end), today: cn( 'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today ), outside: cn( 'text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside ), disabled: cn( 'text-muted-foreground opacity-50', defaultClassNames.disabled ), hidden: cn('invisible', defaultClassNames.hidden), ...classNames, }} components={{ Root: ({ className, rootRef, ...props }) => { return (
) }, Chevron: ({ className, orientation, ...props }) => { if (orientation === 'left') { return ( ) } if (orientation === 'right') { return ( ) } return ( ) }, DayButton: CalendarDayButton, WeekNumber: ({ children, ...props }) => { return (
{children}
) }, ...components, }} {...props} /> ) } function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps) { const defaultClassNames = getDefaultClassNames() const ref = React.useRef(null) React.useEffect(() => { if (modifiers.focused) ref.current?.focus() }, [modifiers.focused]) return ( ) } function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) { const { toggleSidebar } = useSidebar() return (