├── .cloneignore ├── .env.example ├── .eslintrc.cjs ├── .gitignore ├── README.md ├── components.json ├── css.d.ts ├── next.config.js ├── package.json ├── pnpm-lock.yaml ├── postcss.config.cjs ├── prettier.config.js ├── public ├── background-3.png ├── explorer-tools-dark.png ├── favicon.ico ├── google0297be4585eb90db.html ├── icons │ ├── calculator.png │ ├── chrome.png │ ├── colorgradient.png │ ├── drive.png │ ├── exit-full-screen.png │ ├── explorer.ico │ ├── explorer.png │ ├── file.png │ ├── folder-desktop.png │ ├── folder-documents.png │ ├── folder-downloads.png │ ├── folder-music.png │ ├── folder-pictures.png │ ├── folder-videos.png │ ├── folder.png │ ├── full-screen.png │ ├── github-icon.png │ ├── imageres_185.png │ ├── motoX3.jpg │ ├── network.png │ ├── notepad.png │ ├── pc.ico │ ├── pc.png │ ├── projects.ico │ ├── projects.png │ ├── settings.png │ ├── shortcut.png │ ├── speed-master.jpg │ ├── tools-folder.png │ ├── user-folder.png │ ├── vscode.png │ ├── windows-drive.png │ └── x-twitter.svg ├── lock-space.jpg ├── noise.png ├── skills │ ├── css.png │ ├── docker.png │ ├── express.png │ ├── figma.png │ ├── firebase.png │ ├── framer.png │ ├── go.png │ ├── graphql.png │ ├── html.png │ ├── js.png │ ├── mongodb.png │ ├── mui.png │ ├── mysql.png │ ├── next.png │ ├── node.png │ ├── postgresql.png │ ├── prisma.png │ ├── react.png │ ├── reactnative.png │ ├── reactquery.png │ ├── redux.png │ ├── stripe.png │ ├── tailwind.png │ ├── tauri.png │ └── ts.png ├── start-dark.ico ├── start-light.ico └── taskbar-icon.png ├── src ├── app │ ├── _components │ │ └── this-pc.tsx │ ├── layout.tsx │ ├── loading.tsx │ ├── lock-screen │ │ └── page.tsx │ ├── page.tsx │ └── sitemap.ts ├── components │ ├── TaskBar │ │ ├── button.tsx │ │ ├── index.tsx │ │ ├── search-icon.tsx │ │ ├── system-tray-options.tsx │ │ └── taskbar-search.tsx │ ├── calculator.tsx │ ├── component.tsx │ ├── desktop │ │ ├── desktop-item.tsx │ │ ├── explorer-desktop-item.tsx │ │ ├── explorer │ │ │ ├── _components │ │ │ │ └── explorer-items.tsx │ │ │ ├── data.ts │ │ │ ├── emittors.ts │ │ │ ├── explorer.tsx │ │ │ ├── index.tsx │ │ │ └── navigation-pane.tsx │ │ ├── full-screen-item.tsx │ │ └── screen.tsx │ ├── drag-window.tsx │ ├── edil-ozi │ │ └── horizontal-scroll.tsx │ ├── fluentui │ │ ├── button.tsx │ │ ├── input.tsx │ │ └── slider.tsx │ ├── icons.tsx │ ├── iframe.tsx │ ├── lazy-items │ │ ├── calculator-item.tsx │ │ └── projects-item.tsx │ ├── loader.tsx │ ├── lock-screen.tsx │ ├── motion-comps.tsx │ ├── popover.tsx │ ├── projects.tsx │ ├── segoe-ui-icon.tsx │ ├── tailwind-indicator.tsx │ └── ui │ │ ├── accordion.tsx │ │ ├── button.tsx │ │ ├── context-menu.tsx │ │ ├── dialog.tsx │ │ ├── dropdown-menu.tsx │ │ ├── menu-cns.tsx │ │ ├── popover.tsx │ │ ├── resizable.tsx │ │ └── tooltip.tsx ├── env.js ├── font │ ├── Segoe-UI-Icons.ttf │ ├── index.ts │ ├── mapped-icons.ts │ └── segoe-ui-variable-display.ttf ├── hooks │ ├── useBattery.ts │ ├── useDebounceCallback.ts │ ├── useDebounceValue.ts │ ├── useEffectAfterMount.ts │ ├── useElement.ts │ ├── useEventListener.ts │ ├── useIsClient.ts │ ├── useIsSignedIn.ts │ ├── useIsomorphicLayoutEffect.ts │ ├── useLenis.ts │ ├── useOnClickOutside.ts │ ├── useOnline.ts │ ├── usePrevious.ts │ ├── useSearchParam.ts │ ├── useSearchParams.tsx │ ├── useTheme.ts │ ├── useTime.ts │ ├── useUnmount.ts │ └── useWinState.ts ├── icons │ └── AlertOutline.tsx ├── lib │ ├── Setting │ │ ├── SettingStore.ts │ │ ├── setting-init.tsx │ │ └── useSetting.tsx │ ├── emittors.ts │ ├── images.ts │ ├── loading │ │ ├── loading-comps.tsx │ │ ├── loading-manager.ts │ │ ├── loading.tsx │ │ └── useLoading.ts │ ├── preload-images.ts │ ├── routes-map.ts │ ├── site-config.ts │ ├── utils.ts │ └── withDefaultProps.tsx ├── styles │ ├── fluent.css │ └── globals.css └── types │ └── types.ts ├── tailwind.config.ts ├── tsconfig.json └── types.d.ts /.cloneignore: -------------------------------------------------------------------------------- 1 | -> src/components/drag-window.tsx <--> "" 2 | -> src/components/TaskBar/search-icon.tsx <--> p:%Template%\src\components\stub-component.tsx <--> r:React.Fragment->svg 3 | -> src/styles/fluent.css <--> "" 4 | -> src/components/component.tsx <--> p:%Template%\src\components\stub-component.tsx <--> a:export { Comp as Component } 5 | -> src/lib/withDefaultProps.tsx <--> export const withDefaultProps = (...args: any) => args[0]; 6 | 7 | src/app/command-gen 8 | src/app/radio-button 9 | src/app/demo 10 | src/app/test 11 | src/app/test-focus 12 | src/app/youtube 13 | help/ 14 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Since the ".env" file is gitignored, you can use the ".env.example" file to 2 | # build a new ".env" file when you clone the repo. Keep this file up-to-date 3 | # when you add new variables to `.env`. 4 | 5 | # This file will be committed to version control, so make sure not to have any 6 | # secrets in it. If you are cloning this repo, create a copy of this file named 7 | # ".env" and populate it with your secrets. 8 | 9 | # When adding additional environment variables, the schema in "/src/env.js" 10 | # should be updated accordingly. 11 | 12 | # Example: 13 | # SERVERVAR="foo" 14 | # NEXT_PUBLIC_CLIENTVAR="bar" 15 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | const config = { 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "project": true 6 | }, 7 | "plugins": [ 8 | // "@typescript-eslint" 9 | ], 10 | "extends": [ 11 | "next/core-web-vitals", 12 | // "plugin:@typescript-eslint/recommended-type-checked", 13 | "plugin:@typescript-eslint/stylistic-type-checked" 14 | ], 15 | "rules": { 16 | "@typescript-eslint/array-type": "off", 17 | "@typescript-eslint/consistent-type-definitions": "off", 18 | "@typescript-eslint/consistent-type-imports": [ 19 | "warn", 20 | { 21 | "prefer": "type-imports", 22 | "fixStyle": "inline-type-imports" 23 | } 24 | ], 25 | "@typescript-eslint/prefer-nullish-coalescing": "warn", 26 | "prefer-const": "warn", 27 | // "@typescript-eslint/no-unused-vars": [ 28 | // "warn", 29 | // { 30 | // "argsIgnorePattern": "^_" 31 | // } 32 | // ], 33 | "@typescript-eslint/require-await": "off", 34 | "@typescript-eslint/no-misused-promises": [ 35 | "error", 36 | { 37 | "checksVoidReturn": { 38 | "attributes": false 39 | } 40 | } 41 | ] 42 | } 43 | } 44 | module.exports = config; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # database 12 | /prisma/db.sqlite 13 | /prisma/db.sqlite-journal 14 | db.sqlite 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | next-env.d.ts 20 | 21 | # production 22 | /build 23 | 24 | # misc 25 | .DS_Store 26 | *.pem 27 | 28 | # debug 29 | npm-debug.log* 30 | yarn-debug.log* 31 | yarn-error.log* 32 | .pnpm-debug.log* 33 | 34 | # local env files 35 | # do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables 36 | .env 37 | .env*.local 38 | 39 | # vercel 40 | .vercel 41 | 42 | # typescript 43 | *.tsbuildinfo 44 | 45 | # idea files 46 | .idea 47 | /icons 48 | *.todo 49 | tempCodeRunnerFile.* 50 | .vscode/settings.json 51 | *.psd 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create **O**wn App 2 | 3 | This project bootstrapped with `create-own-app`. 4 | 5 | ## What's next? How do I make an app with this? 6 | 7 | We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary. 8 | 9 | - [Next.js](https://nextjs.org) 10 | - [NextAuth.js](https://next-auth.js.org) 11 | - [Prisma](https://prisma.io) 12 | - [Drizzle](https://orm.drizzle.team) 13 | - [Tailwind CSS](https://tailwindcss.com) +/ [Shadcn](https://ui.shadcn.com/) 14 | - [tRPC](https://trpc.io) 15 | 16 | ## Learn More 17 | 18 | To learn more about the [Create-OWN-App](https://own-app.oimmi.com/), take a look at the following resources: 19 | 20 | - [Documentation](https://own-app.oimmi.com/) 21 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/styles/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | } 20 | } -------------------------------------------------------------------------------- /css.d.ts: -------------------------------------------------------------------------------- 1 | import type * as CSS from "csstype"; 2 | 3 | declare module "csstype" { 4 | interface Properties { 5 | // Allow any CSS Custom Properties 6 | [index: `--${string}`]: any; 7 | [index: string]: any; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful 3 | * for Docker builds. 4 | */ 5 | await import("./src/env.js"); 6 | 7 | const routes = { 8 | desktop: "/", 9 | lock: "/lock-screen", 10 | }; 11 | 12 | /** @type {import("next").NextConfig} */ 13 | const config = { 14 | typescript: { 15 | ignoreBuildErrors: true, 16 | }, 17 | experimental: { 18 | reactCompiler: true, 19 | }, 20 | async redirects() { 21 | return [ 22 | { 23 | source: routes.desktop, 24 | destination: routes.lock, 25 | permanent: false, 26 | missing: [ 27 | { 28 | type: "query", 29 | key: "authorized", 30 | value: "true", 31 | }, 32 | // { 33 | // type: "cookie", 34 | // key: "authorized", 35 | // value: "true", 36 | // }, 37 | ], 38 | }, 39 | ]; 40 | }, 41 | // images: { 42 | // remotePatterns: [ 43 | // { 44 | // protocol: "https", 45 | // hostname: "github.com", 46 | // pathname: "/programming-with-ia/windows-11/**", 47 | // search: "" 48 | // } 49 | // ] 50 | // } 51 | }; 52 | 53 | export default config; 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fluent-ui", 3 | "version": "0.1.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "dev": "next dev --turbopack", 8 | "dev:old": "next dev --hostname localhost", 9 | "build": "next build", 10 | "start": "next start", 11 | "lint": "next lint", 12 | "lint:fix": "next lint --fix", 13 | "preview": "run-s build start", 14 | "typecheck": "tsc --noEmit", 15 | "check": "run-s lint typecheck", 16 | "clean": "rimraf .next", 17 | "format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx,css}\" --cache", 18 | "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx,css}\" --cache", 19 | "clone-project": "C:\\Users\\immi\\AppData\\Local\\Programs\\Python\\Python311\\python.exe -u \"e:\\my programms\\clone copy project gitignore patterns new.py\" --src \"C:\\Users\\immi\\Desktop\\Code\\nextJs\\fluent-ui\" --dest \"C:\\Users\\immi\\Desktop\\Code\\nextJs\\windows-11\"" 20 | }, 21 | "dependencies": { 22 | "@iconify-icons/fluent": "^1.2.38", 23 | "@iconify/react": "^5.0.2", 24 | "@lexz451/next-nprogress": "^0.2.7", 25 | "@radix-ui/react-accordion": "^1.2.1", 26 | "@radix-ui/react-context-menu": "^2.2.4", 27 | "@radix-ui/react-dialog": "^1.1.2", 28 | "@radix-ui/react-dropdown-menu": "^2.1.2", 29 | "@radix-ui/react-icons": "^1.3.0", 30 | "@radix-ui/react-popover": "^1.1.4", 31 | "@radix-ui/react-scroll-area": "^1.2.0", 32 | "@radix-ui/react-slot": "^1.1.0", 33 | "@radix-ui/react-tooltip": "^1.1.2", 34 | "@t3-oss/env-nextjs": "^0.10.1", 35 | "babel-plugin-react-compiler": "19.0.0-beta-e552027-20250112", 36 | "class-variance-authority": "^0.7.0", 37 | "clsx": "^2.1.1", 38 | "cookies-next": "^5.0.2", 39 | "date-fns": "^4.1.0", 40 | "emittor": "^0.2.0-beta.2", 41 | "framer-motion": "^11.15.0", 42 | "geist": "^1.3.0", 43 | "lenis": "^1.1.16", 44 | "lodash": "^4.17.21", 45 | "lodash.debounce": "^4.0.8", 46 | "lucide-react": "^0.441.0", 47 | "next": "15.1.0", 48 | "next-themes": "^0.3.0", 49 | "re-resizable": "^6.9.18", 50 | "react": "19.0.0", 51 | "react-dom": "19.0.0", 52 | "react-icons": "5.3.0", 53 | "react-player": "^2.16.0", 54 | "react-resizable": "^3.0.5", 55 | "react-resizable-layout": "^0.7.2", 56 | "react-resizable-panels": "^2.1.3", 57 | "react-rnd": "^10.4.14", 58 | "shadcn-theme-editor": "^1.4.1", 59 | "tailwind-merge": "^2.5.2", 60 | "tailwindcss-animate": "^1.0.7", 61 | "tailwindcss-full-bleed": "^2.0.2", 62 | "type-fest": "^4.30.0", 63 | "zod": "^3.23.3" 64 | }, 65 | "devDependencies": { 66 | "@tailwindcss/container-queries": "^0.1.1", 67 | "@types/eslint": "^8.56.10", 68 | "@types/lodash": "^4.17.14", 69 | "@types/lodash.debounce": "^4.0.9", 70 | "@types/node": "^20.14.10", 71 | "@types/react": "19.0.0", 72 | "@types/react-dom": "19.0.0", 73 | "@types/react-resizable": "^3.0.8", 74 | "@typescript-eslint/eslint-plugin": "^8.1.0", 75 | "@typescript-eslint/parser": "^8.1.0", 76 | "autoprefixer": "^10.4.20", 77 | "eslint": "^8.57.0", 78 | "eslint-config-next": "15.1.0", 79 | "i": "^0.3.7", 80 | "mini-svg-data-uri": "^1.4.4", 81 | "npm": "^10.9.0", 82 | "postcss": "^8.4.39", 83 | "postcss-nesting": "^13.0.1", 84 | "prettier": "^3.3.2", 85 | "prettier-plugin-tailwindcss": "^0.6.5", 86 | "tailwind-scrollbar": "^3.1.0", 87 | "tailwindcss": "^3.4.3", 88 | "tailwindcss-elevation": "^2.0.0", 89 | "typescript": "^5.5.3" 90 | }, 91 | "ct3aMetadata": { 92 | "initVersion": "7.37.0" 93 | }, 94 | "packageManager": "pnpm@9.8.0", 95 | "pnpm": { 96 | "overrides": { 97 | "@types/react": "19.0.1", 98 | "@types/react-dom": "19.0.2" 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | const config = { 2 | plugins: { 3 | 'tailwindcss/nesting': 'postcss-nesting', 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | module.exports = config; 9 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */ 2 | const config = { 3 | plugins: ["prettier-plugin-tailwindcss"], 4 | tabWidth: 4, 5 | }; 6 | 7 | export default config; 8 | -------------------------------------------------------------------------------- /public/background-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/background-3.png -------------------------------------------------------------------------------- /public/explorer-tools-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/explorer-tools-dark.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/favicon.ico -------------------------------------------------------------------------------- /public/google0297be4585eb90db.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google0297be4585eb90db.html -------------------------------------------------------------------------------- /public/icons/calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/calculator.png -------------------------------------------------------------------------------- /public/icons/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/chrome.png -------------------------------------------------------------------------------- /public/icons/colorgradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/colorgradient.png -------------------------------------------------------------------------------- /public/icons/drive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/drive.png -------------------------------------------------------------------------------- /public/icons/exit-full-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/exit-full-screen.png -------------------------------------------------------------------------------- /public/icons/explorer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/explorer.ico -------------------------------------------------------------------------------- /public/icons/explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/explorer.png -------------------------------------------------------------------------------- /public/icons/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/file.png -------------------------------------------------------------------------------- /public/icons/folder-desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder-desktop.png -------------------------------------------------------------------------------- /public/icons/folder-documents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder-documents.png -------------------------------------------------------------------------------- /public/icons/folder-downloads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder-downloads.png -------------------------------------------------------------------------------- /public/icons/folder-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder-music.png -------------------------------------------------------------------------------- /public/icons/folder-pictures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder-pictures.png -------------------------------------------------------------------------------- /public/icons/folder-videos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder-videos.png -------------------------------------------------------------------------------- /public/icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/folder.png -------------------------------------------------------------------------------- /public/icons/full-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/full-screen.png -------------------------------------------------------------------------------- /public/icons/github-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/github-icon.png -------------------------------------------------------------------------------- /public/icons/imageres_185.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/imageres_185.png -------------------------------------------------------------------------------- /public/icons/motoX3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/motoX3.jpg -------------------------------------------------------------------------------- /public/icons/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/network.png -------------------------------------------------------------------------------- /public/icons/notepad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/notepad.png -------------------------------------------------------------------------------- /public/icons/pc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/pc.ico -------------------------------------------------------------------------------- /public/icons/pc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/pc.png -------------------------------------------------------------------------------- /public/icons/projects.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/projects.ico -------------------------------------------------------------------------------- /public/icons/projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/projects.png -------------------------------------------------------------------------------- /public/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/settings.png -------------------------------------------------------------------------------- /public/icons/shortcut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/shortcut.png -------------------------------------------------------------------------------- /public/icons/speed-master.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/speed-master.jpg -------------------------------------------------------------------------------- /public/icons/tools-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/tools-folder.png -------------------------------------------------------------------------------- /public/icons/user-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/user-folder.png -------------------------------------------------------------------------------- /public/icons/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/vscode.png -------------------------------------------------------------------------------- /public/icons/windows-drive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/icons/windows-drive.png -------------------------------------------------------------------------------- /public/icons/x-twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /public/lock-space.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/lock-space.jpg -------------------------------------------------------------------------------- /public/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/noise.png -------------------------------------------------------------------------------- /public/skills/css.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/css.png -------------------------------------------------------------------------------- /public/skills/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/docker.png -------------------------------------------------------------------------------- /public/skills/express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/express.png -------------------------------------------------------------------------------- /public/skills/figma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/figma.png -------------------------------------------------------------------------------- /public/skills/firebase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/firebase.png -------------------------------------------------------------------------------- /public/skills/framer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/framer.png -------------------------------------------------------------------------------- /public/skills/go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/go.png -------------------------------------------------------------------------------- /public/skills/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/graphql.png -------------------------------------------------------------------------------- /public/skills/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/html.png -------------------------------------------------------------------------------- /public/skills/js.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/js.png -------------------------------------------------------------------------------- /public/skills/mongodb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/mongodb.png -------------------------------------------------------------------------------- /public/skills/mui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/mui.png -------------------------------------------------------------------------------- /public/skills/mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/mysql.png -------------------------------------------------------------------------------- /public/skills/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/next.png -------------------------------------------------------------------------------- /public/skills/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/node.png -------------------------------------------------------------------------------- /public/skills/postgresql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/postgresql.png -------------------------------------------------------------------------------- /public/skills/prisma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/prisma.png -------------------------------------------------------------------------------- /public/skills/react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/react.png -------------------------------------------------------------------------------- /public/skills/reactnative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/reactnative.png -------------------------------------------------------------------------------- /public/skills/reactquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/reactquery.png -------------------------------------------------------------------------------- /public/skills/redux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/redux.png -------------------------------------------------------------------------------- /public/skills/stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/stripe.png -------------------------------------------------------------------------------- /public/skills/tailwind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/tailwind.png -------------------------------------------------------------------------------- /public/skills/tauri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/tauri.png -------------------------------------------------------------------------------- /public/skills/ts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/skills/ts.png -------------------------------------------------------------------------------- /public/start-dark.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/start-dark.ico -------------------------------------------------------------------------------- /public/start-light.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/start-light.ico -------------------------------------------------------------------------------- /public/taskbar-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programming-with-ia/windows-11/10c8d116c976471beccd153e6c9ff7e9247dd3fa/public/taskbar-icon.png -------------------------------------------------------------------------------- /src/app/_components/this-pc.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable @next/next/no-img-element */ 2 | import React from "react"; 3 | import { 4 | Accordion, 5 | AccordionContent, 6 | AccordionItem, 7 | AccordionTrigger, 8 | } from "@/components/ui/accordion"; 9 | import { adjustArrayLength, cn, joinPath } from "@/lib/utils"; 10 | // import Image from "next/image"; 11 | import { DesktopIcons, ExplorerIcons } from "@/lib/images"; 12 | import { 13 | getDataByPath, 14 | navigationData, 15 | } from "@/components/desktop/explorer/data"; 16 | import { CommonPaths, explorerPathEmittor } from "@/components/desktop/explorer/emittors"; 17 | type ThisPCItemProps = { 18 | icon: string; 19 | label?: string; 20 | } & React.ComponentProps<"button">; 21 | 22 | import zip from "lodash/zip"; 23 | 24 | // & Omit< 25 | // React.ComponentProps<"button">, 26 | // "children" 27 | // > 28 | 29 | function ThisPCItemBase({ 30 | icon, 31 | children, 32 | label, 33 | className, 34 | ...p 35 | }: ThisPCItemProps) { 36 | return ( 37 | 52 | ); 53 | } 54 | 55 | function ThisPcDriveItem({ 56 | label, 57 | fill, 58 | space, 59 | ...p 60 | }: Omit & { fill: string; space: string }) { 61 | return ( 62 | 63 |
64 | {label} 65 | 66 | 70 | 71 | {space} 72 |
73 |
74 | ); 75 | } 76 | 77 | function ThisPcFolderItem(props: Omit) { 78 | return ; 79 | } 80 | 81 | const FoldersItems = [ 82 | { icon: ExplorerIcons.FolderDesktop, label: "Desktop" }, 83 | // { icon: ExplorerIcons.FolderDocuments, label: "Documents" }, 84 | // { icon: ExplorerIcons.FolderDownloads, label: "Downloads" }, 85 | { icon: ExplorerIcons.FolderMusic, label: "Music" }, 86 | { icon: ExplorerIcons.FolderPictures, label: "Pictures" }, 87 | { icon: ExplorerIcons.FolderVideos, label: "Videos" }, 88 | ]; 89 | 90 | function ThisPC() { 91 | const disksData = navigationData[CommonPaths.pc]?.folders ?? {}; 92 | const disksNames = Object.keys(disksData); 93 | const dirvesCustomData = zip( 94 | disksNames, 95 | adjustArrayLength<[string, string]>( 96 | [ 97 | ["408.1 GB free of 988 GB", "58.7%"], 98 | ["498.8 GB free of 1895 GB", "73.7%"], 99 | ["2816.7 GB free of 3712 GB", "24.1%"], 100 | ], 101 | disksNames.length, 102 | ), 103 | ); 104 | const userData = getDataByPath(CommonPaths.user); 105 | return ( 106 | 111 | 112 | Folders 113 | 114 | {Object.keys(userData.folders ?? {}) 115 | .slice(0, 4) // limit 116 | .map((folderName, idx) => ( 117 | 121 | explorerPathEmittor.setState( 122 | joinPath(CommonPaths.user, folderName), 123 | ) 124 | } 125 | icon={ 126 | userData.folders![folderName]?.icon ?? 127 | DesktopIcons.Folder 128 | } 129 | /> 130 | ))} 131 | 132 | 133 | 134 | Devices and drives 135 | 136 | {dirvesCustomData 137 | .filter(Boolean) 138 | .map(([diskName, diskData], idx) => ( 139 | 145 | explorerPathEmittor.setState( 146 | joinPath( 147 | CommonPaths.pc, 148 | diskName ?? "", 149 | ), 150 | ) 151 | } 152 | icon={ 153 | disksData[diskName ?? ""]?.icon ?? 154 | ExplorerIcons.Drive 155 | } 156 | /> 157 | ))} 158 | 159 | 160 | 161 | ); 162 | } 163 | 164 | export default ThisPC; 165 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata, Viewport } from "next"; 2 | import { ThemeProvider } from "next-themes"; 3 | import React, { Suspense } from "react"; 4 | import { ProgressBar } from "@lexz451/next-nprogress"; 5 | import { TailwindIndicator } from "@/components/tailwind-indicator"; 6 | import "@/styles/globals.css"; 7 | import { roboto, SegoeUIDisplayFont, SegoIconFont } from "@/font"; 8 | import { LoadingHelper } from "@/lib/loading/loading-comps"; 9 | import { ThemeHelper } from "@/hooks/useTheme"; 10 | import SettingInit from "@/lib/Setting/setting-init"; 11 | import { siteConfig } from "@/lib/site-config"; 12 | import { routes } from "@/lib/routes-map"; 13 | let ShadcnThemeEditor: any; 14 | if (process.env.NODE_ENV === "development") { 15 | import("shadcn-theme-editor").then((module) => { 16 | ShadcnThemeEditor = module.default; // or module, depending on the module's export 17 | }); 18 | } else { 19 | // eslint-disable-next-line react/display-name 20 | ShadcnThemeEditor = () => null; 21 | } 22 | 23 | export const metadata: Metadata = { 24 | title: siteConfig.name, 25 | description: siteConfig.description, 26 | applicationName: siteConfig.name, 27 | authors: siteConfig.authors, 28 | generator: siteConfig.authors.name, 29 | keywords: siteConfig.keywords, 30 | alternates: { 31 | types: { 32 | "text/html": [ 33 | { url: new URL(routes.desktop, siteConfig.url), title: "Home" }, 34 | { 35 | url: new URL(routes.lock, siteConfig.url), 36 | title: "Lock Screen", 37 | }, 38 | { url: siteConfig.repo, title: "Source Code (Github)" }, 39 | ], 40 | }, 41 | }, 42 | twitter: { 43 | title: siteConfig.name, 44 | description: siteConfig.description, 45 | creator: "@o_immi", 46 | creatorId: "1813232551131291651", 47 | }, 48 | // https://i.ibb.co/Jk7gMHT/bg-dark.jpg 49 | }; 50 | 51 | export const viewport: Viewport = { 52 | themeColor: siteConfig.color, 53 | }; 54 | 55 | export default function RootLayout({ 56 | children, 57 | }: Readonly<{ 58 | children: React.ReactNode; 59 | }>) { 60 | return ( 61 | 62 | 63 | <>{children} 64 | 65 | 66 | ); 67 | } 68 | 69 | function Body({ children }: { children: React.ReactNode }) { 70 | return ( 71 | 75 | Loading.............}> 76 | 82 | 83 | 90 | 91 | 92 | {children} 93 | 94 | 95 | 96 | 97 | 98 | 78 | ); 79 | }, 80 | ); 81 | 82 | TaskBarButton.displayName = "TaskBarButton"; 83 | 84 | export default TaskBarButton; 85 | -------------------------------------------------------------------------------- /src/components/TaskBar/search-icon.tsx: -------------------------------------------------------------------------------- 1 | // Private File: Original content is not included. 2 | // This is an auto-generated placeholder. 3 | // File exists but is not accessible for public use. 4 | 5 | // This file is used as placeholder 6 | export default function Comp({ children }: any) { 7 | return <>{children}; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/TaskBar/taskbar-search.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { useRef, useState } from "react"; 4 | import TaskBarSearchIcon from "./search-icon"; 5 | import { motion } from "framer-motion"; 6 | import clsx from "clsx"; 7 | 8 | function TaskbarSearch() { 9 | const [isCurrentActive, setIsActive] = useState(false); 10 | const inputRef = useRef(null); 11 | const [value, setValue] = useState(""); 12 | const isActive = isCurrentActive || !!value; 13 | 14 | return ( 15 |
inputRef.current?.focus()} 17 | className="inline-flex cursor-text items-center gap-2 rounded-full border-b border-foreground/10 bg-foreground/10 px-3.5 py-1.5 focus-within:ring-1" 18 | onFocus={() => setIsActive(true)} 19 | onBlur={() => setIsActive(false)} 20 | > 21 | {React.useMemo( 22 | () => ( 23 | 30 | ), 31 | [isActive], 32 | )} 33 | setValue(e.target.value)} 36 | ref={inputRef} 37 | placeholder="Search" 38 | className="flex-1 bg-transparent text-sm text-foreground/90 !outline-none !ring-0 placeholder:text-muted-foreground" 39 | type="text" 40 | /> 41 |
42 | ); 43 | } 44 | 45 | export default TaskbarSearch; 46 | -------------------------------------------------------------------------------- /src/components/calculator.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import { Button } from "@/components/fluentui/button"; 3 | import React, { useState, useEffect } from "react"; 4 | 5 | const Calculator: React.FC = () => { 6 | const [displayValue, setDisplayValue] = useState("0"); 7 | const [operator, setOperator] = useState(null); 8 | const [firstValue, setFirstValue] = useState(null); 9 | const [waitingForOperand, setWaitingForOperand] = useState(false); 10 | 11 | const inputDigit = (digit: string) => { 12 | if (waitingForOperand) { 13 | setDisplayValue(digit); 14 | setWaitingForOperand(false); 15 | } else { 16 | setDisplayValue( 17 | displayValue === "0" ? digit : displayValue + digit, 18 | ); 19 | } 20 | }; 21 | 22 | const inputDot = () => { 23 | if (!displayValue.includes(".")) { 24 | setDisplayValue(displayValue + "."); 25 | } 26 | }; 27 | 28 | const handleOperator = (nextOperator: string) => { 29 | const inputValue = parseFloat(displayValue); 30 | if (firstValue === null) { 31 | setFirstValue(displayValue); 32 | } else if (operator) { 33 | const result = performCalculation( 34 | parseFloat(firstValue), 35 | inputValue, 36 | operator, 37 | ); 38 | setDisplayValue(String(result)); 39 | setFirstValue(String(result)); 40 | } 41 | setWaitingForOperand(true); 42 | setOperator(nextOperator); 43 | }; 44 | 45 | const performCalculation = ( 46 | first: number, 47 | second: number, 48 | operator: string, 49 | ) => { 50 | switch (operator) { 51 | case "+": 52 | return first + second; 53 | case "-": 54 | return first - second; 55 | case "*": 56 | return first * second; 57 | case "/": 58 | return second !== 0 ? first / second : "Error"; 59 | case "%": 60 | return first % second; 61 | default: 62 | return second; 63 | } 64 | }; 65 | 66 | const clearAll = () => { 67 | setDisplayValue("0"); 68 | setFirstValue(null); 69 | setOperator(null); 70 | setWaitingForOperand(false); 71 | }; 72 | 73 | const clearLastChar = () => { 74 | setDisplayValue( 75 | displayValue.length > 1 ? displayValue.slice(0, -1) : "0", 76 | ); 77 | }; 78 | 79 | const handleEqual = () => { 80 | if (operator && firstValue !== null) { 81 | const result = performCalculation( 82 | parseFloat(firstValue), 83 | parseFloat(displayValue), 84 | operator, 85 | ); 86 | setDisplayValue(String(result)); 87 | setFirstValue(null); 88 | setOperator(null); 89 | setWaitingForOperand(false); 90 | } 91 | }; 92 | 93 | const handleKeyDown = (e: KeyboardEvent) => { 94 | const { key } = e; 95 | 96 | if (!isNaN(Number(key))) { 97 | inputDigit(key); 98 | } else if (key === ".") { 99 | inputDot(); 100 | } else if (key === "+") { 101 | handleOperator("+"); 102 | } else if (key === "-") { 103 | handleOperator("-"); 104 | } else if (key === "*") { 105 | handleOperator("*"); 106 | } else if (key === "/") { 107 | handleOperator("/"); 108 | } else if (key === "%") { 109 | handleOperator("%"); 110 | } else if (key === "Enter") { 111 | handleEqual(); 112 | } else if (key === "Escape") { 113 | e.preventDefault(); 114 | clearAll(); 115 | } else if (key === "Backspace") { 116 | e.preventDefault(); 117 | clearLastChar(); 118 | } 119 | }; 120 | 121 | useEffect(() => { 122 | window.addEventListener("keydown", handleKeyDown); 123 | return () => { 124 | window.removeEventListener("keydown", handleKeyDown); 125 | }; 126 | }, [displayValue, operator, firstValue]); 127 | 128 | return ( 129 |
130 |
131 | 132 | {operator} 133 | 134 | {displayValue} 135 |
136 |
137 | 144 | 151 | 158 | 165 | 166 | 173 | 180 | 187 | 194 | 195 | 202 | 209 | 216 | 223 | 224 | 231 | 238 | 245 | 252 | 253 | 260 | 267 | 274 |
275 |
276 | ); 277 | }; 278 | 279 | export default Calculator; 280 | -------------------------------------------------------------------------------- /src/components/component.tsx: -------------------------------------------------------------------------------- 1 | // Private File: Original content is not included. 2 | // This is an auto-generated placeholder. 3 | // File exists but is not accessible for public use. 4 | 5 | // This file is used as placeholder 6 | export default function Comp({ children }: any) { 7 | return <>{children}; 8 | } 9 | export { Comp as Component } -------------------------------------------------------------------------------- /src/components/desktop/desktop-item.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import { clsx, cn } from "@/lib/utils"; 3 | // import Image from "next/image"; 4 | import React from "react"; 5 | import { type DraggableWindowProps } from "../drag-window"; 6 | import dynamic from "next/dynamic"; 7 | import { useWinState } from "@/hooks/useWinState"; 8 | import { DesktopItemContextMenuEmittor } from "@/lib/emittors"; 9 | import { DesktopIcons } from "@/lib/images"; 10 | import { Component } from "../component"; 11 | import { composeEventHandlers } from "@radix-ui/primitive"; 12 | // import { AnimatePresence } from "framer-motion"; 13 | const DraggableWindowBase = dynamic(() => 14 | import("../drag-window").then((all) => all.DraggableWindowBase), 15 | ); 16 | 17 | type DesktopItemProps = 18 | React.ComponentProps & { 19 | icon: string; 20 | smallIcon?: boolean; 21 | name: string; 22 | isShortcut?: boolean; 23 | isWindowOpen?: boolean; 24 | As?: E; 25 | win?: { 26 | child: React.ReactNode; 27 | } & Pick< 28 | DraggableWindowProps, 29 | | "image" 30 | | "wrapperClassName" 31 | | "className" 32 | | "id" 33 | | "resizeAbleProps" 34 | | "style" 35 | >; 36 | titleBar?: DraggableWindowProps["titlebar"]; 37 | taskBarItem?: DraggableWindowProps["taskBarItem"]; 38 | onWinClose?: DraggableWindowProps["onClose"]; 39 | }; 40 | 41 | export const taskbarBtnClick = (winId: string | undefined) => { 42 | if (!winId) return; 43 | 44 | const taskbarbtn = document.querySelector( 45 | `[data-win-for="${winId}"]`, 46 | ); 47 | if (taskbarbtn) { 48 | taskbarbtn.click(); 49 | } 50 | }; 51 | 52 | export function DesktopItemBase({ 53 | icon, 54 | smallIcon, 55 | name, 56 | className, 57 | win, 58 | isShortcut, 59 | titleBar, 60 | isWindowOpen = false, 61 | onWinClose, 62 | onContextMenu, 63 | id, 64 | As = "button" as E, 65 | ...p 66 | }: DesktopItemProps) { 67 | return ( 68 | <> 69 | ) => { 77 | e.currentTarget.focus(); 78 | DesktopItemContextMenuEmittor.setState(e.currentTarget.id); 79 | onContextMenu?.(e); 80 | }} 81 | {...p} 82 | > 83 |
89 | {name} 90 | {isShortcut && ( 91 | 98 | )} 99 |
100 |

{name}

101 |
102 | {win?.child && isWindowOpen && ( 103 | 114 | {win.child} 115 | 116 | )} 117 | 118 | ); 119 | } 120 | 121 | export function LinkDesktopItem({ 122 | href, 123 | onDoubleClick, 124 | onClick, 125 | ...p 126 | }: Pick & 127 | React.ComponentPropsWithoutRef<"a">) { 128 | return ( 129 | e.preventDefault())} 134 | onDoubleClick={composeEventHandlers(onDoubleClick, (e) => { 135 | window.open(href, "_blank"); 136 | })} 137 | /> 138 | ); 139 | } 140 | 141 | function DesktopItem({ 142 | onDoubleClick, 143 | ...props 144 | }: Omit) { 145 | const [isWinShow, setIsWinShow] = useWinState(props.win?.id); 146 | 147 | const DblClickHandler: typeof onDoubleClick = (e) => { 148 | onDoubleClick?.(e); 149 | setIsWinShow(true); 150 | }; 151 | 152 | return ( 153 | setIsWinShow(false)} 156 | isWindowOpen={isWinShow} 157 | {...props} 158 | /> 159 | ); 160 | } 161 | 162 | export default DesktopItem; 163 | -------------------------------------------------------------------------------- /src/components/desktop/explorer-desktop-item.tsx: -------------------------------------------------------------------------------- 1 | import { DesktopItemBase } from "./desktop-item"; 2 | import { openExplorer } from "@/components/desktop/explorer/emittors"; 3 | import { DesktopIcons } from "@/lib/images"; 4 | 5 | function ExplorerDesktopItem({ 6 | name, 7 | explorerPath, 8 | icon = DesktopIcons.Folder, 9 | }: { 10 | icon?: string; 11 | name: string; 12 | explorerPath: string; 13 | }) { 14 | return ( 15 | openExplorer(explorerPath)} 18 | icon={icon} 19 | name={name} 20 | /> 21 | ); 22 | } 23 | 24 | export default ExplorerDesktopItem; 25 | -------------------------------------------------------------------------------- /src/components/desktop/explorer/_components/explorer-items.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable @next/next/no-img-element */ 2 | import { Component } from "@/components/component"; 3 | import { DesktopIcons } from "@/lib/images"; 4 | import { cn } from "@/lib/utils"; 5 | import React from "react"; 6 | type ExplorerItemProps = { 7 | label: string; 8 | icon: string; 9 | isShortcut?: boolean; 10 | // href?: string; 11 | } & React.ComponentProps<"button">; 12 | export function LargeItem({ 13 | label, 14 | icon, 15 | isShortcut, 16 | // href, 17 | className, 18 | ...props 19 | }: ExplorerItemProps) { 20 | // const Comp = href ? Link : "button"; 21 | // console.log("explorer item"); 22 | return ( 23 | // 33 | 34 | {label 39 | {isShortcut && ( 40 | 47 | )} 48 | 49 | {label} 50 | 51 | ); 52 | } 53 | 54 | export const ExplorerItems = { 55 | Large: LargeItem, 56 | }; 57 | -------------------------------------------------------------------------------- /src/components/desktop/explorer/data.ts: -------------------------------------------------------------------------------- 1 | import { DesktopIcons, ExplorerIcons, GH_PublicTree } from "@/lib/images"; 2 | import { ValueOf } from "type-fest"; 3 | import { FolderTreeProps, NavigationTreeNode } from "./navigation-pane"; 4 | import { explorerPathEmittor } from "./emittors"; 5 | import { joinPath } from "@/lib/utils"; 6 | 7 | // use images from GitHub repo 8 | export const skills = ( 9 | [ 10 | { icon: "/skills/js.png", label: "JavaScript" }, 11 | { icon: "/skills/mongodb.png", label: "MongoDB" }, 12 | { icon: "/skills/mui.png", label: "Material UI" }, 13 | { icon: "/skills/mysql.png", label: "MySQL" }, 14 | { icon: "/skills/next.png", label: "Next.js" }, 15 | { icon: "/skills/node.png", label: "Node.js" }, 16 | { icon: "/skills/postgresql.png", label: "PostgreSQL" }, 17 | { icon: "/skills/prisma.png", label: "Prisma" }, 18 | { icon: "/skills/react.png", label: "React" }, 19 | { icon: "/skills/reactnative.png", label: "React Native" }, 20 | { icon: "/skills/reactquery.png", label: "React Query" }, 21 | { icon: "/skills/redux.png", label: "Redux" }, 22 | { icon: "/skills/stripe.png", label: "Stripe" }, 23 | { icon: "/skills/tailwind.png", label: "Tailwind CSS" }, 24 | { icon: "/skills/tauri.png", label: "Tauri" }, 25 | { icon: "/skills/ts.png", label: "TypeScript" }, 26 | { icon: "/skills/css.png", label: "CSS" }, 27 | { icon: "/skills/docker.png", label: "Docker" }, 28 | { icon: "/skills/express.png", label: "Express" }, 29 | { icon: "/skills/figma.png", label: "Figma" }, 30 | { icon: "/skills/firebase.png", label: "Firebase" }, 31 | { icon: "/skills/framer.png", label: "Framer Motion" }, 32 | { icon: "/skills/go.png", label: "Go" }, 33 | { icon: "/skills/graphql.png", label: "GraphQL" }, 34 | { icon: "/skills/html.png", label: "HTML" }, 35 | ] as const 36 | ).map((s) => ({ label: s.label, icon: `${GH_PublicTree}${s.icon}` })); 37 | 38 | const HandleFolderExpand: ValueOf["onExpand"] = ({ 39 | files, 40 | folders, 41 | icon, 42 | name, 43 | path, 44 | }) => console.log(path); 45 | 46 | function addKeysToNestedObject< 47 | T extends Record, 48 | Obj = Record, 49 | >(obj: Obj, inheritBy: keyof T, keyValuePairs: Partial): Obj { 50 | // Create a new object to avoid mutating the original 51 | const newObj = {} as Obj; 52 | 53 | // Iterate over the keys of the object 54 | for (const key in obj) { 55 | const value = obj[key] as T; 56 | const isObj = value && typeof value === "object"; 57 | 58 | newObj[key] = value as any; 59 | 60 | if (!isObj) continue; 61 | for (const newKey in keyValuePairs) { 62 | if (newKey in value) continue; 63 | value[newKey] = keyValuePairs[newKey] as any; 64 | } 65 | 66 | if (inheritBy in value) { 67 | (newObj[key] as any)[inheritBy] = addKeysToNestedObject( 68 | value[inheritBy], 69 | inheritBy, 70 | keyValuePairs, 71 | ) as any; 72 | } 73 | } 74 | 75 | return newObj; 76 | } 77 | 78 | export function getDataByPath(path: string) { 79 | let data: NavigationTreeNode = {}; 80 | const paths = path?.split("\\"); 81 | 82 | // if (!paths?.length) return emptyMessage; 83 | if (path && paths?.length) { 84 | data = navigationData[paths[0]!] ?? {}; 85 | for (const fn of paths.slice(1)) { 86 | data = data?.folders?.[fn] ?? {}; 87 | } 88 | } 89 | return data; 90 | } 91 | 92 | export const navigationData = addKeysToNestedObject( 93 | { 94 | "This PC": { 95 | icon: DesktopIcons.PC, 96 | initExpand: true, 97 | folders: { 98 | "Local Disk (C:)": { 99 | files: ["boot.ini", "autoexec.bat"], 100 | folders: { 101 | Empty: {}, 102 | Users: { 103 | folders: { 104 | Public: { 105 | files: ["readme.txt"], 106 | }, 107 | Admin: { 108 | files: ["document.docx", "notes.txt"], 109 | folders: { 110 | Desktop: { 111 | files: [ 112 | "shortcut.lnk", 113 | "tasklist.txt", 114 | ], 115 | icon: ExplorerIcons.FolderDesktop, 116 | }, 117 | Music: { 118 | icon: ExplorerIcons.FolderMusic, 119 | }, 120 | Pictures: { 121 | icon: ExplorerIcons.FolderPictures, 122 | }, 123 | Videos: { 124 | icon: ExplorerIcons.FolderVideos, 125 | }, 126 | Downloads: { 127 | files: [ 128 | "installer.exe", 129 | "image.png", 130 | ], 131 | icon: ExplorerIcons.FolderDownloads, 132 | }, 133 | Documents: { 134 | files: [ 135 | "resume.pdf", 136 | "project.xlsx", 137 | ], 138 | icon: ExplorerIcons.FolderDocuments, 139 | }, 140 | }, 141 | }, 142 | }, 143 | }, 144 | "Program Files": { 145 | folders: { 146 | Microsoft: { 147 | files: ["app.exe", "readme.md"], 148 | }, 149 | Adobe: { 150 | files: ["setup.exe"], 151 | }, 152 | }, 153 | }, 154 | Windows: { 155 | files: ["win.ini", "system32.dll"], 156 | folders: { 157 | System32: { 158 | files: ["cmd.exe", "config.sys"], 159 | }, 160 | Logs: { 161 | files: ["error.log", "setup.log"], 162 | }, 163 | }, 164 | }, 165 | }, 166 | icon: ExplorerIcons.WindowsDrive, 167 | }, 168 | "Local Disk (D:)": { 169 | files: ["movie.mp4", "backup.zip"], 170 | folders: { 171 | Games: { 172 | files: ["game.exe", "savefile.dat"], 173 | }, 174 | Projects: { 175 | files: ["plan.docx", "budget.xlsx"], 176 | folders: { 177 | "2025": { 178 | files: ["timeline.pptx"], 179 | }, 180 | }, 181 | }, 182 | }, 183 | icon: ExplorerIcons.Drive, 184 | }, 185 | "Local Disk (E:)": { 186 | folders: { 187 | Music: { 188 | files: ["song.mp3", "playlist.m3u"], 189 | }, 190 | Photos: { 191 | files: ["vacation.jpg", "portrait.png"], 192 | folders: { 193 | "2024": { 194 | files: ["beach.jpg", "hiking.png"], 195 | }, 196 | }, 197 | }, 198 | }, 199 | icon: ExplorerIcons.Drive, 200 | }, 201 | }, 202 | }, 203 | } satisfies FolderTreeProps["data"], 204 | "folders", 205 | { onClick: ({ path }) => explorerPathEmittor.setState(path) }, 206 | ); 207 | -------------------------------------------------------------------------------- /src/components/desktop/explorer/emittors.ts: -------------------------------------------------------------------------------- 1 | import { createEmittor } from "emittor"; 2 | import type {} from "./explorer"; 3 | import { doubleClick, joinPath } from "@/lib/utils"; 4 | 5 | export const CommonPaths = { 6 | user: joinPath("This PC", "Local Disk (C:)", "Users", "Admin"), 7 | pc: "This PC", 8 | desktop: "", 9 | }; 10 | CommonPaths.desktop = joinPath(CommonPaths.user, "Desktop"); 11 | 12 | export const explorerPathEmittor = createEmittor( 13 | CommonPaths.pc, 14 | ); 15 | 16 | export function openExplorer(path: string) { 17 | explorerPathEmittor.setState(path); 18 | doubleClick("explorer-desktop-item"); 19 | } 20 | -------------------------------------------------------------------------------- /src/components/desktop/explorer/index.tsx: -------------------------------------------------------------------------------- 1 | import { DesktopItemBase } from "@/components/desktop/desktop-item"; 2 | import React, { useState } from "react"; 3 | // import Explorer from './explorer'; 4 | import dynamic from "next/dynamic"; 5 | import { useWinState } from "@/hooks/useWinState"; 6 | import { DesktopIcons } from "@/lib/images"; 7 | const ExplorerWindow = dynamic(() => 8 | import("./explorer").then((a) => a.ExplorerMain), 9 | ); 10 | const ExplorerTitleBar = dynamic(() => 11 | import("./explorer").then((a) => a.ExplorerTitleBar), 12 | ); 13 | 14 | function ExplorerItem() { 15 | const winId = "file-explorer"; 16 | const [isWinShow, setIsWinShow] = useWinState(winId); 17 | return ( 18 | <> 19 | setIsWinShow(false)} 22 | onDoubleClick={() => setIsWinShow(true)} 23 | smallIcon 24 | className="gap-1.5" 25 | icon={DesktopIcons.Explorer} 26 | name="File Explorer" 27 | id="explorer-desktop-item" 28 | {...(isWinShow 29 | ? { 30 | win: { 31 | className: "flex flex-col", 32 | child: , 33 | id: winId, 34 | resizeAbleProps: { 35 | defaultSize: { 36 | width: "75vw", 37 | height: "600px", 38 | }, 39 | }, 40 | style: { 41 | "--titlebar-height": "92px", 42 | }, 43 | }, 44 | titleBar: { 45 | className: 46 | "bg-background/80 grid grid-cols-[1fr_auto]", 47 | getTitleBarChild: ExplorerTitleBar, 48 | }, 49 | } 50 | : {})} 51 | /> 52 | 53 | ); 54 | } 55 | 56 | export default ExplorerItem; 57 | -------------------------------------------------------------------------------- /src/components/desktop/explorer/navigation-pane.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable @next/next/no-img-element */ 2 | "use client"; 3 | import SegoeIcon, { getSegoeIcon } from "@/components/segoe-ui-icon"; 4 | import React, { useState } from "react"; 5 | import { useEffectAfterMount } from "../../../hooks/useEffectAfterMount"; 6 | import { withDefaultProps } from "@/lib/withDefaultProps"; 7 | import { clsxLite, cn, joinPath } from "@/lib/utils"; 8 | import { DesktopIcons, ExplorerIcons } from "@/lib/images"; 9 | 10 | export type NavigationTreeNode = { 11 | files?: string[]; 12 | icon?: string; 13 | folders?: Record; 14 | initExpand?: boolean; 15 | onExpand?: ( 16 | obj: Pick & { 17 | name: string; 18 | path: string; 19 | }, 20 | ) => void; 21 | onClick?: NavigationTreeNode["onExpand"]; 22 | }; 23 | 24 | interface FolderNodeProps { 25 | icon?: string; 26 | name: string; 27 | node: NavigationTreeNode; 28 | path: string | undefined; 29 | enableFiles?: boolean; 30 | } 31 | 32 | const NavigationItem = withDefaultProps("button", { 33 | className: 34 | "flex items-center text-nowrap py-1.5 cursor-default bleed-bg-l hocus:bleed-foreground/5 justify-self-stretch", 35 | }); 36 | 37 | const FolderNode: React.FC = ({ 38 | name, 39 | node, 40 | path = "", 41 | enableFiles = true, 42 | }) => { 43 | const [isOpen, setIsOpen] = useState(node.initExpand ?? false); 44 | const folderNames = Object.keys(node.folders ?? {}); 45 | const hasContent = Boolean( 46 | (enableFiles && node.files?.length) || folderNames.length, 47 | ); 48 | 49 | const toggleFolder = () => { 50 | setIsOpen((prev) => !prev); 51 | }; 52 | 53 | const currentPath = joinPath(path, name); 54 | console.log("folderNode-render"); 55 | useEffectAfterMount(() => { 56 | isOpen && node.onExpand?.({ ...node, name, path: currentPath }); 57 | }, [isOpen]); 58 | 59 | return ( 60 |
61 | {/* Folder Name */} 62 | 65 | node.onClick?.({ ...node, name, path: currentPath }) 66 | } 67 | className="explorer-nav-panel-item" 68 | > 69 | (e.stopPropagation(), toggleFolder())} 76 | /> 77 | 78 | i 83 | {`${name}`} 84 | 85 | 86 | {/* Render Content Dynamically */} 87 | {isOpen && hasContent && ( 88 |
89 | {/* Render Folders */} 90 | {Boolean(folderNames.length) && 91 | folderNames.map((folderName, idx) => { 92 | const treeNode = node.folders![folderName]!; 93 | return ( 94 | 102 | ); 103 | })} 104 | 105 | {/* Render Files */} 106 | {enableFiles && 107 | node.files?.map((file, idx) => ( 108 | 113 | 📄 {file} 114 | 115 | ))} 116 |
117 | )} 118 |
119 | ); 120 | }; 121 | 122 | export type FolderTreeProps = { 123 | data: Record; 124 | path?: string; 125 | }; 126 | 127 | const FolderTree: React.FC = ({ data, path }) => { 128 | return ( 129 | <> 130 | {Object.keys(data).map((key) => ( 131 | 139 | ))} 140 | 141 | ); 142 | }; 143 | 144 | export default FolderTree; 145 | -------------------------------------------------------------------------------- /src/components/desktop/full-screen-item.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import DesktopItem from "@/components/desktop/desktop-item"; 3 | import { DesktopIcons } from "@/lib/images"; 4 | import { cn } from "@/lib/utils"; 5 | import type { CompoProps } from "@/types/types"; 6 | import React, { useEffect, useState } from "react"; 7 | 8 | function FullScreenBtn({ 9 | className, 10 | }: Pick, "className">) { 11 | const [isFullScreen, setIsFullScreen] = useState(false); 12 | 13 | const handleFullScreen = () => { 14 | if (!isFullScreen) { 15 | document.documentElement.requestFullscreen(); 16 | } else { 17 | document 18 | .exitFullscreen() 19 | .catch((...e) => 20 | console.error("Error When exiting on full screen mode", e), 21 | ); 22 | } 23 | }; 24 | 25 | // Function to check if the user is in fullscreen mode 26 | useEffect(() => { 27 | const checkFullScreen = () => { 28 | const tolerance = 6; 29 | setIsFullScreen( 30 | Math.abs(window.innerHeight - screen.height) <= tolerance, 31 | ); 32 | }; 33 | const onFullScreenChange = () => { 34 | setIsFullScreen(document.fullscreenElement != null); 35 | }; 36 | window.addEventListener("resize", checkFullScreen); 37 | document.addEventListener("fullscreenchange", onFullScreenChange); 38 | 39 | // Initial check if already in full-screen mode 40 | checkFullScreen(); 41 | 42 | return () => { 43 | window.removeEventListener("resize", checkFullScreen); 44 | document.removeEventListener( 45 | "fullscreenchange", 46 | onFullScreenChange, 47 | ); 48 | }; 49 | }, []); 50 | console.log(isFullScreen); 51 | return ( 52 | <> 53 | 66 | 67 | ); 68 | } 69 | 70 | export default FullScreenBtn; 71 | -------------------------------------------------------------------------------- /src/components/desktop/screen.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@/lib/utils"; 2 | import React from "react"; 3 | 4 | function Screen({ children, className, ...p }: React.ComponentProps<"main">) { 5 | return ( 6 |
13 | {children} 14 |
15 | ); 16 | } 17 | 18 | export default Screen; 19 | -------------------------------------------------------------------------------- /src/components/drag-window.tsx: -------------------------------------------------------------------------------- 1 | // Private File: Original content is not included. 2 | // This is an auto-generated placeholder. 3 | // File exists but is not accessible for public use. 4 | 5 | -------------------------------------------------------------------------------- /src/components/edil-ozi/horizontal-scroll.tsx: -------------------------------------------------------------------------------- 1 | import React, { type FC, useRef, useEffect } from "react"; 2 | import { motion, useTransform, useScroll } from "framer-motion"; 3 | 4 | type Props = { 5 | childLength?: number; 6 | } & React.ComponentProps<"div">; 7 | 8 | const HorizontalScrollCarousel: FC = ({ children, childLength }) => { 9 | const targetRef = useRef(null); // Target element for scroll tracking 10 | const containerRef = useRef(null); // Container for the scroll 11 | 12 | // Set the container dynamically after mounting 13 | useEffect(() => { 14 | const element = document.querySelector( 15 | "#projects>[data-win-viewport]", //! fix later 16 | ) as HTMLElement | null; 17 | if (element) { 18 | containerRef.current = element; 19 | } else { 20 | console.warn(`Container element not found.`); 21 | } 22 | }, []); 23 | 24 | // Set up useScroll 25 | const { scrollYProgress } = useScroll({ 26 | target: targetRef, 27 | container: containerRef, // Use the RefObject 28 | }); 29 | 30 | // Map scrollYProgress to horizontal translation 31 | const x = useTransform(scrollYProgress, [0, 1], ["0%", "-90%"]); 32 | 33 | return ( 34 |
41 |
42 | 43 | {children} 44 | 45 |
46 |
47 | ); 48 | }; 49 | 50 | export default HorizontalScrollCarousel; 51 | -------------------------------------------------------------------------------- /src/components/fluentui/button.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { Slot } from "@radix-ui/react-slot"; 3 | import { cva, type VariantProps } from "class-variance-authority"; 4 | import { 5 | Primitive, 6 | type PrimitivePropsWithRef, 7 | } from "@radix-ui/react-primitive"; 8 | 9 | import { cn } from "@/lib/utils"; 10 | 11 | const buttonVariants = cva( 12 | "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", 13 | { 14 | variants: { 15 | variant: { 16 | default: 17 | "bg-primary text-primary-foreground shadow hover:bg-primary/90", 18 | destructive: 19 | "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", 20 | outline: 21 | "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", 22 | secondary: 23 | "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", 24 | ghost: "hover:bg-accent hover:text-accent-foreground", 25 | link: "text-primary underline-offset-4 hover:underline", 26 | }, 27 | size: { 28 | default: "h-9 px-4 py-2", 29 | sm: "h-8 rounded-md px-3 text-xs", 30 | lg: "h-10 rounded-md px-8", 31 | icon: "h-9 w-9", 32 | }, 33 | }, 34 | defaultVariants: { 35 | variant: "default", 36 | size: "default", 37 | }, 38 | }, 39 | ); 40 | export const BadgeBtnVariants = cva( 41 | "inline-flex cursor-default justify-between gap-1 rounded-md text-xs font-normal border border-foreground/5", 42 | { 43 | variants: { 44 | variant: { 45 | primary: "bg-primary hocus:bg-primary-hover", 46 | secondary: "bg-foreground/10 hocus:bg-foreground/15", 47 | secondaryLite: "bg-foreground/5 hocus:bg-foreground/10", 48 | ghost: "hocus:bg-foreground/10", 49 | ghostLite: "hocus:bg-foreground/5", 50 | }, 51 | size: { 52 | default: "px-2 py-1", 53 | icon: "py-1 px-1.5", 54 | }, 55 | }, 56 | defaultVariants: { 57 | variant: "secondary", 58 | size: "default", 59 | }, 60 | }, 61 | ); 62 | 63 | type ButtonProps = PrimitivePropsWithRef<"button"> & 64 | VariantProps; 65 | Primitive.button; 66 | 67 | const Button = React.forwardRef( 68 | ({ className, variant, size, ...props }, ref) => { 69 | return ( 70 | // @ts-ignore 71 | 76 | ); 77 | }, 78 | ); 79 | Button.displayName = "Button"; 80 | 81 | export { Button, buttonVariants }; 82 | -------------------------------------------------------------------------------- /src/components/fluentui/input.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as React from "react"; 4 | import { X } from "lucide-react"; 5 | import { clsx, cn, toAttr } from "@/lib/utils"; 6 | 7 | export interface InputProps 8 | extends React.InputHTMLAttributes { 9 | pClassName?: string; 10 | toolBtns?: React.ReactNode; 11 | pStyle?: { "--no-focus-indicator-bg"?: string } & React.CSSProperties; 12 | } 13 | 14 | export interface TextAreaProps 15 | extends React.TextareaHTMLAttributes { 16 | pClassName?: string; 17 | } 18 | 19 | export const inputClasses = 20 | /*clsx(*/ "flex h-full w-full outline-none rounded-md bg-transparent file:border-0 file:bg-transparent file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 fluent-input"; 21 | 22 | function InputWrapper({ 23 | className, 24 | fluent = true, 25 | ...p 26 | }: React.ComponentProps<"div"> & { fluent?: boolean }) { 27 | return ( 28 |
*:first-child]:pl-3 [&>*:only-child]:!px-3", 33 | fluent && "focus-indicator", 34 | className, 35 | )} 36 | /> 37 | ); 38 | } 39 | export const InputButtonCNs = 40 | "inline-flex py-[3px] h-fit items-center justify-center rounded-sm bg-transparent px-2 text-foreground/60 hover:bg-foreground/10 active:opacity-80"; 41 | 42 | export const InputButtonVisibility = { 43 | onEmpty: "only-empty", 44 | onText: "only-text", 45 | onFocus: "only-focus", 46 | }; 47 | 48 | export function InputButton({ 49 | className, 50 | icon, 51 | tabIndex, 52 | ...p 53 | }: Omit, "children"> & { 54 | icon: React.ReactNode; 55 | }) { 56 | return ( 57 | 66 | ); 67 | } 68 | 69 | export function getCurrentInput( 70 | e: React.MouseEvent | React.KeyboardEvent, 71 | ) { 72 | return e.currentTarget 73 | .closest("[data-input-wrapper]") 74 | ?.querySelector("input") as HTMLInputElement | undefined; 75 | } 76 | 77 | const Input = React.forwardRef( 78 | ( 79 | { className, children, pClassName, pStyle, type, toolBtns, ...props }, 80 | ref, 81 | ) => { 82 | return ( 83 | 88 | 94 | {toolBtns} 95 | {children} 96 | 97 | ); 98 | }, 99 | ); 100 | Input.displayName = "Input"; 101 | 102 | const FluentInput = React.forwardRef( 103 | ({ children, ...p }, ref) => { 104 | const innerRef = React.useRef(null); 105 | 106 | React.useImperativeHandle(ref, () => innerRef.current!); 107 | 108 | const clear = () => { 109 | if (innerRef.current) { 110 | innerRef.current.value = ""; 111 | innerRef.current.focus(); 112 | } 113 | }; 114 | 115 | return ( 116 | 117 | {true && ( // children 118 |
119 | } /> 120 | } /> 121 | {children} 122 |
123 | )} 124 | 125 | ); 126 | }, 127 | ); 128 | 129 | FluentInput.displayName = "FluentInput"; 130 | 131 | const TextArea = React.forwardRef( 132 | ({ className, pClassName, ...props }, ref) => { 133 | return ( 134 | 135 |