From dd50c0273baceabdff7a6bafeadbbb98d2d968ee Mon Sep 17 00:00:00 2001 From: Lago Date: Mon, 13 Apr 2026 11:08:58 +0000 Subject: [PATCH] Initial commit: Google-style search UI demo with Power Apps Code Apps template - React + TypeScript + Vite template - Google-style dark search page - Dummy search results for Power Apps documentation - Ready for PAC code init and Power Platform deployment --- index.html | 13 ++++ package.json | 32 ++++++++ public/vite.svg | 1 + src/App.css | 175 +++++++++++++++++++++++++++++++++++++++++++ src/App.tsx | 91 ++++++++++++++++++++++ src/assets/react.svg | 1 + src/index.css | 68 +++++++++++++++++ src/main.tsx | 10 +++ tsconfig.json | 7 ++ vite.config.ts | 8 ++ 10 files changed, 406 insertions(+) create mode 100644 index.html create mode 100644 package.json create mode 100644 public/vite.svg create mode 100644 src/App.css create mode 100644 src/App.tsx create mode 100644 src/assets/react.svg create mode 100644 src/index.css create mode 100644 src/main.tsx create mode 100644 tsconfig.json create mode 100644 vite.config.ts diff --git a/index.html b/index.html new file mode 100644 index 0000000..5ec37c5 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + vite + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..e715096 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "vite", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@microsoft/power-apps": "^1.0.3", + "react": "^19.2.0", + "react-dom": "^19.2.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@microsoft/power-apps-vite": "^1.0.2", + "@types/node": "^24.10.1", + "@types/react": "^19.2.5", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.46.4", + "vite": "^7.2.4" + } +} diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.css b/src/App.css new file mode 100644 index 0000000..89992b6 --- /dev/null +++ b/src/App.css @@ -0,0 +1,175 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: Arial, sans-serif; + background: #202124; + color: #e8eaed; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +.app { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +/* Header */ +.search-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.75rem 1.5rem; + border-bottom: 1px solid #3c4043; +} + +.logo { + font-size: 1.25rem; + font-weight: 600; + color: #8ab4f8; +} + +.search-header nav { + display: flex; + gap: 1.25rem; +} + +.search-header nav a { + color: #9aa0a6; + text-decoration: none; + font-size: 0.875rem; +} + +.search-header nav a:hover { + color: #e8eaed; +} + +/* Main */ +.search-main { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + padding-top: 8vh; +} + +.search-box { + width: 100%; + max-width: 584px; + display: flex; + flex-direction: column; + gap: 1rem; +} + +.search-box input { + width: 100%; + padding: 0.875rem 1.25rem; + border-radius: 24px; + border: 1px solid #3c4043; + background: #202124; + color: #e8eaed; + font-size: 1rem; + outline: none; + transition: border-color 0.2s, box-shadow 0.2s; +} + +.search-box input:focus { + border-color: #8ab4f8; + box-shadow: 0 0 0 4px rgba(138, 180, 248, 0.15); +} + +.search-buttons { + display: flex; + justify-content: center; + gap: 0.75rem; +} + +.search-buttons button { + padding: 0.5rem 1rem; + border-radius: 4px; + border: 1px solid #303134; + background: #303134; + color: #e8eaed; + font-size: 0.875rem; + cursor: pointer; + transition: background 0.2s, border-color 0.2s; +} + +.search-buttons button:hover { + background: #35363a; + border-color: #3c4043; +} + +/* Results */ +.results { + width: 100%; + max-width: 584px; + margin-top: 2rem; + padding: 0 1rem; +} + +.results-count { + color: #9aa0a6; + font-size: 0.875rem; + margin-bottom: 1.25rem; +} + +.result-item { + margin-bottom: 1.5rem; +} + +.result-title { + display: block; + font-size: 1.125rem; + color: #b4d7fe; + text-decoration: none; + margin-bottom: 0.25rem; +} + +.result-title:hover { + text-decoration: underline; +} + +.result-url { + display: block; + font-size: 0.8125rem; + color: #b4b4b4; + text-decoration: none; + margin-bottom: 0.25rem; +} + +.result-desc { + font-size: 0.875rem; + color: #9aa0a6; + line-height: 1.5; +} + +/* Footer */ +.search-footer { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.75rem 1.5rem; + border-top: 1px solid #3c4043; + color: #9aa0a6; + font-size: 0.8125rem; +} + +.search-footer nav { + display: flex; + gap: 1.25rem; +} + +.search-footer nav a { + color: #9aa0a6; + text-decoration: none; +} + +.search-footer nav a:hover { + color: #e8eaed; +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..07ebfd1 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,91 @@ +import { useState } from 'react' +import './App.css' + +const dummyResults = [ + { + title: 'Power Apps Code Apps Documentation', + url: 'https://learn.microsoft.com/en-us/power-apps/developer/code-apps/', + desc: 'Official Microsoft documentation for building custom web applications that run on Power Platform runtime. Includes tutorials, best practices, and API references.' + }, + { + title: 'Create a code app from scratch', + url: 'https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/create-an-app-from-scratch', + desc: 'Step-by-step guide to building your first Power Apps code app using React, TypeScript, and Vite. Covers authentication, data binding, and deployment.' + }, + { + title: 'Power Platform CLI (PAC) overview', + url: 'https://learn.microsoft.com/en-us/power-apps/developer/cli/introduction', + desc: 'Reference for the Power Apps CLI tool used to authenticate, initialize, build, and deploy code apps from the command line.' + }, + { + title: 'Content Security Policy for code apps', + url: 'https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/content-security-policy', + desc: 'How to configure CSP headers and source allowlists for Power Apps code apps in production environments.' + }, + { + title: 'ALM for Power Apps code apps', + url: 'https://learn.microsoft.com/en-us/power-apps/developer/code-apps/how-to/alm', + desc: 'Application lifecycle management guidance for code apps, including solution packaging, environment promotion, and version control.' + }, +] + +function App() { + const [query, setQuery] = useState('') + const [searched, setSearched] = useState(false) + + const handleSearch = (e: React.FormEvent) => { + e.preventDefault() + setSearched(true) + } + + return ( +
+
+ 🦎 CrotolamoSearch + +
+ +
+
+ setQuery(e.target.value)} + /> +
+ + +
+
+ + {searched && ( +
+

About {dummyResults.length} results

+ {dummyResults.map((r, i) => ( +
+ {r.title} + {r.url} +

{r.desc}

+
+ ))} +
+ )} +
+ + +
+ ) +} + +export default App diff --git a/src/assets/react.svg b/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..08a3ac9 --- /dev/null +++ b/src/index.css @@ -0,0 +1,68 @@ +:root { + font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..bef5202 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.tsx' + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..162cc5a --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; +import { powerApps } from "@microsoft/power-apps-vite/plugin" + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [react(), powerApps()], +});