commit 735bf856ec26a7eead19199a2441d802f8bc3da6 Author: Alexandr Andreyev Date: Thu Aug 14 23:13:42 2025 +0300 initial diff --git a/fab-ui/.gitignore b/fab-ui/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/fab-ui/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/fab-ui/index.html b/fab-ui/index.html new file mode 100644 index 0000000..283e961 --- /dev/null +++ b/fab-ui/index.html @@ -0,0 +1,16 @@ + + + + + + + Vite + Lit + TS + + + + + +

Vite + Lit

+
+ + diff --git a/fab-ui/package.json b/fab-ui/package.json new file mode 100644 index 0000000..304c725 --- /dev/null +++ b/fab-ui/package.json @@ -0,0 +1,18 @@ +{ + "name": "fab-ui", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "lit": "^3.3.1" + }, + "devDependencies": { + "typescript": "~5.8.3", + "vite": "^7.1.2" + } +} diff --git a/fab-ui/public/vite.svg b/fab-ui/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/fab-ui/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/fab-ui/src/assets/lit.svg b/fab-ui/src/assets/lit.svg new file mode 100644 index 0000000..4a9c1fe --- /dev/null +++ b/fab-ui/src/assets/lit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/fab-ui/src/index.css b/fab-ui/src/index.css new file mode 100644 index 0000000..4e54422 --- /dev/null +++ b/fab-ui/src/index.css @@ -0,0 +1,38 @@ +: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; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } +} diff --git a/fab-ui/src/my-element.ts b/fab-ui/src/my-element.ts new file mode 100644 index 0000000..02f0a5f --- /dev/null +++ b/fab-ui/src/my-element.ts @@ -0,0 +1,127 @@ +import { LitElement, css, html } from 'lit' +import { customElement, property } from 'lit/decorators.js' +import litLogo from './assets/lit.svg' +import viteLogo from '/vite.svg' + +/** + * An example element. + * + * @slot - This element has a slot + * @csspart button - The button + */ +@customElement('my-element') +export class MyElement extends LitElement { + /** + * Copy for the read the docs hint. + */ + @property() + docsHint = 'Click on the Vite and Lit logos to learn more' + + /** + * The number of times the button has been clicked. + */ + @property({ type: Number }) + count = 0 + + render() { + return html` +
+ + + + + + +
+ +
+ +
+

${this.docsHint}

+ ` + } + + private _onClick() { + this.count++ + } + + static styles = css` + :host { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; + } + + .logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; + } + .logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); + } + .logo.lit:hover { + filter: drop-shadow(0 0 2em #325cffaa); + } + + .card { + padding: 2em; + } + + .read-the-docs { + color: #888; + } + + ::slotted(h1) { + font-size: 3.2em; + line-height: 1.1; + } + + a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; + } + a:hover { + color: #535bf2; + } + + 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) { + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } + } + ` +} + +declare global { + interface HTMLElementTagNameMap { + 'my-element': MyElement + } +} diff --git a/fab-ui/src/vite-env.d.ts b/fab-ui/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/fab-ui/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/fab-ui/tsconfig.json b/fab-ui/tsconfig.json new file mode 100644 index 0000000..4ab6f23 --- /dev/null +++ b/fab-ui/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2022", + "experimentalDecorators": true, + "useDefineForClassFields": false, + "module": "ESNext", + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +}