WebOrbiton
v1.5.0

AtheraStudio Code

516 lines · 98.6 KB
  1. (function () {
  2. "use strict";
  3. ​
  4. var A = (window.Athera = window.Athera || {});
  5. ​
  6. A.snippetData = {
  7. html: [
  8. { ctx: ["top", "html"], label: "html5", d: ["Pusta strona HTML5", "Blank HTML5 page"], body:
  9. '<!DOCTYPE html>\n<html lang="${1:en}">\n<head>\n\t<meta charset="UTF-8">\n\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\n\t<title>${2:My Page}</title>\n\t<link rel="stylesheet" href="${3:style.css}">\n</head>\n<body>\n\t${}\n\t<script src="${4:script.js}"></script>\n</body>\n</html>' },
  10. { ctx: ["top", "html"], label: "page:layout", d: ["Strona z nagłówkiem, menu, treścią i stopką", "Page with header, menu, content and footer"], body:
  11. '<!DOCTYPE html>\n<html lang="${1:en}">\n<head>\n\t<meta charset="UTF-8">\n\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\n\t<title>${2:My Page}</title>\n\t<meta name="description" content="${3:Page description}">\n\t<link rel="stylesheet" href="style.css">\n</head>\n<body>\n\t<header class="site-header">\n\t\t<a href="/" class="logo">${4:Logo}</a>\n\t\t<nav>\n\t\t\t<ul>\n\t\t\t\t<li><a href="index.html">Home</a></li>\n\t\t\t\t<li><a href="about.html">About</a></li>\n\t\t\t\t<li><a href="contact.html">Contact</a></li>\n\t\t\t</ul>\n\t\t</nav>\n\t</header>\n\n\t<main>\n\t\t<h1>${5:Heading}</h1>\n\t\t${}\n\t</main>\n\n\t<footer class="site-footer">\n\t\t<p>&copy; ${6:2026} ${7:Company Name}</p>\n\t</footer>\n\t<script src="script.js"></script>\n</body>\n</html>' },
  12. { ctx: ["top", "html"], label: "page:landing", d: ["Strona typu landing page (hero, funkcje, CTA)", "Landing page (hero, features, CTA)"], body:
  13. '<!DOCTYPE html>\n<html lang="${1:en}">\n<head>\n\t<meta charset="UTF-8">\n\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\n\t<title>${2:Product}</title>\n\t<link rel="stylesheet" href="style.css">\n</head>\n<body>\n\t<header class="site-header">\n\t\t<a href="/" class="logo">${3:Logo}</a>\n\t\t<a href="#contact" class="btn">Contact</a>\n\t</header>\n\n\t<section class="hero">\n\t\t<h1>${4:Main headline}</h1>\n\t\t<p>${5:A short description of what you offer.}</p>\n\t\t<a href="#start" class="btn btn-primary">${6:Get started}</a>\n\t</section>\n\n\t<section class="features" id="start">\n\t\t<article class="feature">\n\t\t\t<h3>Fast</h3>\n\t\t\t<p>Feature description.</p>\n\t\t</article>\n\t\t<article class="feature">\n\t\t\t<h3>Simple</h3>\n\t\t\t<p>Feature description.</p>\n\t\t</article>\n\t\t<article class="feature">\n\t\t\t<h3>Secure</h3>\n\t\t\t<p>Feature description.</p>\n\t\t</article>\n\t</section>\n\n\t<section class="cta" id="contact">\n\t\t<h2>${7:Ready to get started?}</h2>\n\t\t<a href="mailto:${8:contact@example.com}" class="btn btn-primary">Contact us</a>\n\t</section>\n\n\t<footer class="site-footer">\n\t\t<p>&copy; 2026 ${9:Name}</p>\n\t</footer>\n</body>\n</html>' },
  14. { ctx: ["html"], label: "head", d: ["Sekcja head z podstawowymi tagami", "Head section with the essential tags"], body:
  15. '<head>\n\t<meta charset="UTF-8">\n\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\n\t<title>${1:My Page}</title>\n\t${}\n</head>' },
  16. { ctx: ["html"], label: "body", d: ["Sekcja body", "Body section"], body: "<body>\n\t${}\n</body>" },
  17. ​
  18. { ctx: ["head"], label: "meta:essentials", d: ["Kodowanie, viewport, tytuł i opis", "Charset, viewport, title and description"], body:
  19. '<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width, initial-scale=1.0">\n<title>${1:My Page}</title>\n<meta name="description" content="${2:Page description}">' },
  20. { ctx: ["head"], label: "meta:seo", d: ["Komplet tagów SEO", "Full set of SEO tags"], body:
  21. '<meta name="description" content="${1:Page description, up to 160 characters}">\n<meta name="keywords" content="${2:keyword, another keyword}">\n<meta name="author" content="${3:Author}">\n<meta name="robots" content="index, follow">\n<link rel="canonical" href="${4:https://example.com/}">' },
  22. { ctx: ["head"], label: "meta:og", d: ["Open Graph i Twitter (podgląd linku w social media)", "Open Graph and Twitter (link preview in social media)"], body:
  23. '<meta property="og:type" content="website">\n<meta property="og:title" content="${1:Title}">\n<meta property="og:description" content="${2:Description}">\n<meta property="og:image" content="${3:https://example.com/og.jpg}">\n<meta property="og:url" content="${4:https://example.com/}">\n<meta name="twitter:card" content="summary_large_image">' },
  24. { ctx: ["head"], label: "meta:charset", d: ["Kodowanie dokumentu", "Document character encoding"], body: '<meta charset="${1:UTF-8}">' },
  25. { ctx: ["head"], label: "meta:viewport", d: ["Widok mobilny i skalowanie", "Mobile viewport and scaling"], body: '<meta name="viewport" content="width=device-width, initial-scale=1.0">' },
  26. { ctx: ["head"], label: "meta:desc", d: ["Opis strony dla wyszukiwarek", "Search engine page description"], body: '<meta name="description" content="${1:Page description}">' },
  27. { ctx: ["head"], label: "meta:author", d: ["Autor strony", "Page author"], body: '<meta name="author" content="${1:Author}">' },
  28. { ctx: ["head"], label: "meta:keywords", d: ["Słowa kluczowe strony", "Page keywords"], body: '<meta name="keywords" content="${1:keyword, another keyword}">' },
  29. { ctx: ["head"], label: "meta:robots", d: ["Instrukcje indeksowania", "Search indexing instructions"], body: '<meta name="robots" content="${1:index, follow}">' },
  30. { ctx: ["head"], label: "meta:theme-color", d: ["Kolor motywu przeglądarki", "Browser theme color"], body: '<meta name="theme-color" content="${1:#ffffff}">' },
  31. { ctx: ["head"], label: "meta:referrer", d: ["Polityka nagłówka Referer", "Referrer header policy"], body: '<meta name="referrer" content="${1:strict-origin-when-cross-origin}">' },
  32. { ctx: ["head"], label: "meta:color-scheme", d: ["Obsługiwane schematy kolorów", "Supported color schemes"], body: '<meta name="color-scheme" content="${1:light dark}">' },
  33. { ctx: ["head"], label: "meta:og:type", d: ["Typ Open Graph", "Open Graph content type"], body: '<meta property="og:type" content="${1:website}">' },
  34. { ctx: ["head"], label: "meta:og:title", d: ["Tytuł Open Graph", "Open Graph title"], body: '<meta property="og:title" content="${1:Page title}">' },
  35. { ctx: ["head"], label: "meta:og:desc", d: ["Opis Open Graph", "Open Graph description"], body: '<meta property="og:description" content="${1:Page description}">' },
  36. { ctx: ["head"], label: "meta:og:image", d: ["Obraz podglądu Open Graph", "Open Graph preview image"], body: '<meta property="og:image" content="${1:https://example.com/og.jpg}">' },
  37. { ctx: ["head"], label: "meta:og:url", d: ["Adres strony Open Graph", "Open Graph page URL"], body: '<meta property="og:url" content="${1:https://example.com/}">' },
  38. { ctx: ["head"], label: "meta:twitter:card", d: ["Typ karty Twitter/X", "Twitter/X card type"], body: '<meta name="twitter:card" content="${1:summary_large_image}">' },
  39. { ctx: ["head"], label: "meta:twitter:title", d: ["Tytuł karty Twitter/X", "Twitter/X card title"], body: '<meta name="twitter:title" content="${1:Page title}">' },
  40. { ctx: ["head"], label: "meta:twitter:desc", d: ["Opis karty Twitter/X", "Twitter/X card description"], body: '<meta name="twitter:description" content="${1:Page description}">' },
  41. { ctx: ["head"], label: "meta:twitter:image", d: ["Obraz karty Twitter/X", "Twitter/X card image"], body: '<meta name="twitter:image" content="${1:https://example.com/og.jpg}">' },
  42. { ctx: ["head"], label: "link:canonical", d: ["Kanonikalny adres strony", "Canonical page URL"], body: '<link rel="canonical" href="${1:https://example.com/}">' },
  43. { ctx: ["head"], label: "link:preconnect", d: ["Wstępne połączenie z originem", "Preconnect to an origin"], body: '<link rel="preconnect" href="${1:https://example.com}" crossorigin>' },
  44. { ctx: ["head"], label: "link:preload", d: ["Wstępne ładowanie zasobu", "Preload a resource"], body: '<link rel="preload" href="${1:font.woff2}" as="${2:font}" type="${3:font/woff2}" crossorigin>' },
  45. { ctx: ["head"], label: "link:icon", d: ["Ikona strony", "Site icon"], body: '<link rel="icon" href="${1:/favicon.ico}">' },
  46. { ctx: ["head"], label: "favicon", d: ["Ikony strony (favicon, Apple)", "Site icons (favicon, Apple)"], body:
  47. '<link rel="icon" href="${1:favicon.ico}" sizes="any">\n<link rel="icon" href="${2:icon.svg}" type="image/svg+xml">\n<link rel="apple-touch-icon" href="${3:apple-touch-icon.png}">\n<meta name="theme-color" content="${4:#ffffff}">' },
  48. { ctx: ["head"], label: "link:css", d: ["Arkusz stylów", "Stylesheet"], body: '<link rel="stylesheet" href="${1:style.css}">' },
  49. { ctx: ["head"], label: "script:defer", d: ["Skrypt ładowany po stronie", "Deferred script"], body: '<script src="${1:script.js}" defer></script>' },
  50. { ctx: ["head"], label: "fonts:google", d: ["Czcionka z Google Fonts", "Google Fonts font"], body:
  51. '<link rel="preconnect" href="https://fonts.googleapis.com">\n<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>\n<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=${1:Inter}:wght@400;600;700&display=swap">' },
  52. { ctx: ["head"], label: "orbitarium", d: ["Orbitarium Design z CDN", "Orbitarium Design from CDN"], body:
  53. '<link rel="stylesheet" href="https://cdn.orbitariumdesign.eu/style.css">\n<script src="https://cdn.orbitariumdesign.eu/script.js" defer></script>' },
  54. { ctx: ["head"], label: "tw:cdn", d: ["Tailwind CSS v4 z CDN (przeglądarka)", "Tailwind CSS v4 from CDN (browser build)"], body: '<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>' },
  55. { ctx: ["head"], label: "tw:style", d: ["Blok stylów Tailwind v4 z motywem", "Tailwind v4 style block with a theme"], body: '<style type="text/tailwindcss">\n\t@theme {\n\t\t--color-primary: ${1:#3862f5};\n\t}\n\t${}\n</style>' },
  56. { ctx: ["head"], label: "bs:css", d: ["Bootstrap 5 CSS z CDN", "Bootstrap 5 CSS from CDN"], body: '<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">' },
  57. { ctx: ["head", "body"], label: "bs:js", d: ["Bootstrap 5 JS z CDN", "Bootstrap 5 JS from CDN"], body: '<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" defer></script>' },
  58. { ctx: ["head"], label: "water:auto", d: ["Water.css z CDN (auto jasny/ciemny)", "Water.css from CDN (auto light/dark)"], body: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">' },
  59. { ctx: ["head"], label: "water:dark", d: ["Water.css z CDN (wymuszony ciemny)", "Water.css from CDN (forced dark)"], body: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.css">' },
  60. { ctx: ["head"], label: "water:light", d: ["Water.css z CDN (wymuszony jasny)", "Water.css from CDN (forced light)"], body: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/light.css">' },
  61. { ctx: ["head"], label: "pico:css", d: ["Pico.css z CDN (auto jasny/ciemny)", "Pico.css from CDN (auto light/dark)"], body: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">' },
  62. { ctx: ["head"], label: "simple:css", d: ["Simple.css z CDN (auto jasny/ciemny)", "Simple.css from CDN (auto light/dark)"], body: '<link rel="stylesheet" href="https://unpkg.com/simpledotcss/simple.min.css">' },
  63. { ctx: ["head"], label: "mvp:css", d: ["MVP.css z CDN (uniwersalny)", "MVP.css from CDN (universal)"], body: '<link rel="stylesheet" href="https://unpkg.com/mvp.css">' },
  64. { ctx: ["head"], label: "sakura:light", d: ["Sakura.css z CDN (jasny)", "Sakura.css from CDN (light)"], body: '<link rel="stylesheet" href="https://unpkg.com/sakura.css/css/sakura.css">' },
  65. { ctx: ["head"], label: "sakura:dark", d: ["Sakura.css z CDN (ciemny)", "Sakura.css from CDN (dark)"], body: '<link rel="stylesheet" href="https://unpkg.com/sakura.css/css/sakura-dark.css">' },
  66. { ctx: ["head"], label: "style", d: ["Blok stylów", "Style block"], body: "<style>\n\t${}\n</style>" },
  67. ​
  68. { ctx: ["body"], label: "layout:header", d: ["Nagłówek z logo i menu", "Header with logo and menu"], body:
  69. '<header class="site-header">\n\t<a href="/" class="logo">${1:Logo}</a>\n\t<nav class="site-nav">\n\t\t<ul>\n\t\t\t<li><a href="${2:index.html}">${3:Home}</a></li>\n\t\t\t<li><a href="${4:about.html}">${5:About}</a></li>\n\t\t\t<li><a href="${6:contact.html}">${7:Contact}</a></li>\n\t\t</ul>\n\t</nav>\n</header>' },
  70. { ctx: ["body"], label: "layout:hero", d: ["Sekcja powitalna z hasłem i przyciskiem", "Hero section with headline and button"], body:
  71. '<section class="hero">\n\t<h1>${1:Main headline}</h1>\n\t<p>${2:Short description.}</p>\n\t<a href="${3:#}" class="btn btn-primary">${4:Learn more}</a>\n</section>' },
  72. { ctx: ["body"], label: "layout:cards", d: ["Siatka trzech kart", "Grid of three cards"], body:
  73. '<section class="cards">\n\t<article class="card">\n\t\t<img src="${1:img/1.jpg}" alt="${2:Description}">\n\t\t<h3>${3:Title}</h3>\n\t\t<p>${4:Card description.}</p>\n\t</article>\n\t<article class="card">\n\t\t<img src="img/2.jpg" alt="">\n\t\t<h3>Title</h3>\n\t\t<p>Card description.</p>\n\t</article>\n\t<article class="card">\n\t\t<img src="img/3.jpg" alt="">\n\t\t<h3>Title</h3>\n\t\t<p>Card description.</p>\n\t</article>\n</section>' },
  74. { ctx: ["body"], label: "layout:sidebar", d: ["Treść z panelem bocznym", "Content with sidebar"], body:
  75. '<div class="layout">\n\t<aside class="sidebar">\n\t\t${1:Sidebar}\n\t</aside>\n\t<main class="content">\n\t\t${}\n\t</main>\n</div>' },
  76. { ctx: ["body"], label: "layout:main", d: ["Główna treść z sekcjami", "Main content with sections"], body:
  77. '<main>\n\t<section>\n\t\t<h2>${1:Section}</h2>\n\t\t<p>${2:Content.}</p>\n\t</section>\n</main>' },
  78. { ctx: ["body"], label: "layout:footer", d: ["Stopka z linkami i prawami autorskimi", "Footer with links and copyright"], body:
  79. '<footer class="site-footer">\n\t<nav>\n\t\t<a href="${1:privacy-policy.html}">Privacy policy</a>\n\t\t<a href="${2:contact.html}">Contact</a>\n\t</nav>\n\t<p>&copy; ${3:2026} ${4:Company Name}</p>\n</footer>' },
  80. { ctx: ["body"], label: "tw:container", d: ["Kontener Tailwind", "Tailwind container"], body: '<div class="container mx-auto px-4">\n\t${}\n</div>' },
  81. { ctx: ["body"], label: "tw:btn", d: ["Przycisk Tailwind", "Tailwind button"], body: '<button type="button" class="inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 font-semibold text-white hover:bg-blue-700 transition-colors">\n\t${1:Click me}\n</button>' },
  82. { ctx: ["body"], label: "tw:card", d: ["Karta Tailwind", "Tailwind card"], body:
  83. '<div class="max-w-sm rounded-xl border border-gray-200 bg-white p-6 shadow-sm">\n\t<h3 class="text-lg font-semibold">${1:Title}</h3>\n\t<p class="mt-2 text-gray-600">${2:Description}</p>\n</div>' },
  84. { ctx: ["body"], label: "tw:grid", d: ["Siatka responsywna Tailwind (1/2/3 kolumny)", "Tailwind responsive grid (1/2/3 columns)"], body: '<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">\n\t${}\n</div>' },
  85. { ctx: ["body"], label: "tw:flex-center", d: ["Wyśrodkowanie flex w Tailwind", "Tailwind flex centering"], body: '<div class="flex items-center justify-center">\n\t${}\n</div>' },
  86. { ctx: ["body"], label: "tw:hero", d: ["Sekcja hero Tailwind", "Tailwind hero section"], body:
  87. '<section class="bg-gray-50 py-20">\n\t<div class="container mx-auto px-4 text-center">\n\t\t<h1 class="text-4xl font-bold tracking-tight sm:text-5xl">${1:Main headline}</h1>\n\t\t<p class="mx-auto mt-4 max-w-xl text-lg text-gray-600">${2:Short description}</p>\n\t\t<a href="${3:#}" class="mt-8 inline-block rounded-lg bg-blue-600 px-6 py-3 font-semibold text-white hover:bg-blue-700">${4:Get started}</a>\n\t</div>\n</section>' },
  88. { ctx: ["body"], label: "tw:navbar", d: ["Pasek nawigacji Tailwind", "Tailwind navbar"], body:
  89. '<header class="border-b border-gray-200 bg-white">\n\t<nav class="container mx-auto flex items-center justify-between px-4 py-4">\n\t\t<a href="/" class="text-lg font-bold">${1:Logo}</a>\n\t\t<ul class="hidden gap-6 sm:flex">\n\t\t\t<li><a href="${2:index.html}" class="hover:text-blue-600">Home</a></li>\n\t\t\t<li><a href="${3:about.html}" class="hover:text-blue-600">About</a></li>\n\t\t</ul>\n\t\t<button type="button" class="sm:hidden" aria-label="${4:Open menu}">${5:☰}</button>\n\t</nav>\n</header>' },
  90. { ctx: ["body", "form"], label: "tw:input", d: ["Pole formularza Tailwind", "Tailwind form input"], body: '<label class="block">\n\t<span class="mb-1 text-sm font-medium text-gray-700">${1:Label}</span>\n\t<input type="text" name="${2:name}" class="w-full rounded-lg border border-gray-300 px-3 py-2 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200">\n</label>' },
  91. { ctx: ["body"], label: "tw:dark", d: ["Wariant dark mode Tailwind", "Tailwind dark mode variant"], body: '<div class="bg-white text-gray-900 dark:bg-gray-900 dark:text-gray-100">\n\t${}\n</div>' },
  92. { ctx: ["head"], label: "shadcn:setup", d: ["Tailwind v4 z CDN i motyw shadcn (zmienne CSS)", "Tailwind v4 from CDN with the shadcn theme (CSS variables)"], body:
  93. "<script src=\"https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4\"></script>\n<style type=\"text/tailwindcss\">\n\t@custom-variant dark (&:is(.dark *));\n\n\t:root {\n\t\t--radius: 0.625rem;\n\t\t--background: oklch(1 0 0);\n\t\t--foreground: oklch(0.145 0 0);\n\t\t--card: oklch(1 0 0);\n\t\t--card-foreground: oklch(0.145 0 0);\n\t\t--popover: oklch(1 0 0);\n\t\t--popover-foreground: oklch(0.145 0 0);\n\t\t--primary: oklch(0.205 0 0);\n\t\t--primary-foreground: oklch(0.985 0 0);\n\t\t--secondary: oklch(0.97 0 0);\n\t\t--secondary-foreground: oklch(0.205 0 0);\n\t\t--muted: oklch(0.97 0 0);\n\t\t--muted-foreground: oklch(0.556 0 0);\n\t\t--accent: oklch(0.97 0 0);\n\t\t--accent-foreground: oklch(0.205 0 0);\n\t\t--destructive: oklch(0.577 0.245 27.325);\n\t\t--border: oklch(0.922 0 0);\n\t\t--input: oklch(0.922 0 0);\n\t\t--ring: oklch(0.708 0 0);\n\t}\n\n\t.dark {\n\t\t--background: oklch(0.145 0 0);\n\t\t--foreground: oklch(0.985 0 0);\n\t\t--card: oklch(0.205 0 0);\n\t\t--card-foreground: oklch(0.985 0 0);\n\t\t--popover: oklch(0.205 0 0);\n\t\t--popover-foreground: oklch(0.985 0 0);\n\t\t--primary: oklch(0.922 0 0);\n\t\t--primary-foreground: oklch(0.205 0 0);\n\t\t--secondary: oklch(0.269 0 0);\n\t\t--secondary-foreground: oklch(0.985 0 0);\n\t\t--muted: oklch(0.269 0 0);\n\t\t--muted-foreground: oklch(0.708 0 0);\n\t\t--accent: oklch(0.269 0 0);\n\t\t--accent-foreground: oklch(0.985 0 0);\n\t\t--destructive: oklch(0.704 0.191 22.216);\n\t\t--border: oklch(1 0 0 / 10%);\n\t\t--input: oklch(1 0 0 / 15%);\n\t\t--ring: oklch(0.556 0 0);\n\t}\n\n\t@theme inline {\n\t\t--radius-sm: calc(var(--radius) - 4px);\n\t\t--radius-md: calc(var(--radius) - 2px);\n\t\t--radius-lg: var(--radius);\n\t\t--radius-xl: calc(var(--radius) + 4px);\n\t\t--color-background: var(--background);\n\t\t--color-foreground: var(--foreground);\n\t\t--color-card: var(--card);\n\t\t--color-card-foreground: var(--card-foreground);\n\t\t--color-popover: var(--popover);\n\t\t--color-popover-foreground: var(--popover-foreground);\n\t\t--color-primary: var(--primary);\n\t\t--color-primary-foreground: var(--primary-foreground);\n\t\t--color-secondary: var(--secondary);\n\t\t--color-secondary-foreground: var(--secondary-foreground);\n\t\t--color-muted: var(--muted);\n\t\t--color-muted-foreground: var(--muted-foreground);\n\t\t--color-accent: var(--accent);\n\t\t--color-accent-foreground: var(--accent-foreground);\n\t\t--color-destructive: var(--destructive);\n\t\t--color-border: var(--border);\n\t\t--color-input: var(--input);\n\t\t--color-ring: var(--ring);\n\t}\n\n\t@layer base {\n\t\t* {\n\t\t\t@apply border-border outline-ring/50;\n\t\t}\n\t\tbody {\n\t\t\t@apply bg-background text-foreground;\n\t\t}\n\t}\n</style>" },
  94. { ctx: ["body", "form"], label: "shadcn:button", d: ["Przycisk shadcn (domyślny)", "shadcn button (default)"], body:
  95. "<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 h-9 px-4 py-2\">${1:Button}</button>" },
  96. { ctx: ["body", "form"], label: "shadcn:button:outline", d: ["Przycisk shadcn z obramowaniem", "shadcn outline button"], body:
  97. "<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2\">${1:Button}</button>" },
  98. { ctx: ["body", "form"], label: "shadcn:button:secondary", d: ["Przycisk shadcn drugorzędny", "shadcn secondary button"], body:
  99. "<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80 h-9 px-4 py-2\">${1:Button}</button>" },
  100. { ctx: ["body", "form"], label: "shadcn:button:destructive", d: ["Przycisk shadcn ostrzegawczy", "shadcn destructive button"], body:
  101. "<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 bg-destructive text-white shadow-xs hover:bg-destructive/90 h-9 px-4 py-2\">${1:Button}</button>" },
  102. { ctx: ["body", "form"], label: "shadcn:button:ghost", d: ["Przycisk shadcn bez tła", "shadcn ghost button"], body:
  103. "<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2\">${1:Button}</button>" },
  104. { ctx: ["body", "form"], label: "shadcn:button:link", d: ["Przycisk shadcn jako link", "shadcn link button"], body:
  105. "<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 text-primary underline-offset-4 hover:underline h-9 px-4 py-2\">${1:Button}</button>" },
  106. { ctx: ["body", "form"], label: "shadcn:input", d: ["Pole tekstowe shadcn z etykietą", "shadcn input with a label"], body:
  107. "<div class=\"grid w-full gap-2\">\n\t<label for=\"${1:email}\" class=\"text-sm font-medium leading-none\">${2:Email}</label>\n\t<input type=\"${3:email}\" id=\"${1:email}\" name=\"${1:email}\" placeholder=\"${4:m@example.com}\" class=\"border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\">\n</div>" },
  108. { ctx: ["body", "form"], label: "shadcn:textarea", d: ["Pole wieloliniowe shadcn", "shadcn textarea"], body:
  109. "<div class=\"grid w-full gap-2\">\n\t<label for=\"${1:message}\" class=\"text-sm font-medium leading-none\">${2:Message}</label>\n\t<textarea id=\"${1:message}\" name=\"${1:message}\" rows=\"4\" placeholder=\"${3:Type your message here.}\" class=\"border-input min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"></textarea>\n</div>" },
  110. { ctx: ["body", "form"], label: "shadcn:select", d: ["Lista wyboru shadcn", "shadcn select"], body:
  111. "<select name=\"${1:option}\" class=\"border-input h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50\">\n\t<option value=\"${2:one}\">${3:One}</option>\n\t<option value=\"${4:two}\">${5:Two}</option>\n</select>" },
  112. { ctx: ["body", "form"], label: "shadcn:checkbox", d: ["Pole wyboru shadcn", "shadcn checkbox"], body:
  113. "<div class=\"flex items-center gap-2\">\n\t<input type=\"checkbox\" id=\"${1:terms}\" name=\"${1:terms}\" class=\"border-input accent-primary size-4 shrink-0 rounded-[4px] border shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50\">\n\t<label for=\"${1:terms}\" class=\"text-sm font-medium leading-none\">${2:Accept terms and conditions}</label>\n</div>" },
  114. { ctx: ["body"], label: "shadcn:card", d: ["Karta shadcn", "shadcn card"], body:
  115. "<div class=\"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm\">\n\t<div class=\"flex flex-col gap-1.5 px-6\">\n\t\t<h3 class=\"font-semibold leading-none\">${1:Card title}</h3>\n\t\t<p class=\"text-muted-foreground text-sm\">${2:Card description}</p>\n\t</div>\n\t<div class=\"px-6\">\n\t\t${3}\n\t</div>\n\t<div class=\"flex items-center px-6\">\n\t\t${4}\n\t</div>\n</div>" },
  116. { ctx: ["body"], label: "shadcn:alert", d: ["Alert shadcn", "shadcn alert"], body:
  117. "<div role=\"alert\" class=\"bg-card text-card-foreground relative w-full rounded-lg border px-4 py-3 text-sm\">\n\t<h5 class=\"mb-1 font-medium leading-none tracking-tight\">${1:Heads up!}</h5>\n\t<p class=\"text-muted-foreground\">${2:You can add components to your app.}</p>\n</div>" },
  118. { ctx: ["body"], label: "shadcn:alert:destructive", d: ["Alert shadcn ostrzegawczy", "shadcn destructive alert"], body:
  119. "<div role=\"alert\" class=\"bg-card text-destructive relative w-full rounded-lg border px-4 py-3 text-sm\">\n\t<h5 class=\"mb-1 font-medium leading-none tracking-tight\">${1:Error}</h5>\n\t<p class=\"text-destructive/90\">${2:Your session has expired. Please log in again.}</p>\n</div>" },
  120. { ctx: ["body"], label: "shadcn:badge", d: ["Plakietka shadcn", "shadcn badge"], body:
  121. "<span class=\"inline-flex w-fit items-center justify-center gap-1 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium border-transparent bg-primary text-primary-foreground\">${1:Badge}</span>" },
  122. { ctx: ["body"], label: "shadcn:badge:secondary", d: ["Plakietka shadcn drugorzędna", "shadcn secondary badge"], body:
  123. "<span class=\"inline-flex w-fit items-center justify-center gap-1 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium border-transparent bg-secondary text-secondary-foreground\">${1:Badge}</span>" },
  124. { ctx: ["body"], label: "shadcn:badge:outline", d: ["Plakietka shadcn z obramowaniem", "shadcn outline badge"], body:
  125. "<span class=\"inline-flex w-fit items-center justify-center gap-1 whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium text-foreground\">${1:Badge}</span>" },
  126. { ctx: ["body"], label: "shadcn:separator", d: ["Separator shadcn", "shadcn separator"], body:
  127. "<div role=\"separator\" class=\"bg-border h-px w-full shrink-0\"></div>" },
  128. { ctx: ["body"], label: "shadcn:avatar", d: ["Awatar shadcn", "shadcn avatar"], body:
  129. "<span class=\"relative flex size-10 shrink-0 overflow-hidden rounded-full\">\n\t<img src=\"${1:avatar.jpg}\" alt=\"${2:User}\" class=\"aspect-square size-full object-cover\">\n</span>" },
  130. { ctx: ["body"], label: "shadcn:skeleton", d: ["Szkielet ładowania shadcn", "shadcn skeleton"], body:
  131. "<div class=\"bg-accent h-4 w-full animate-pulse rounded-md\"></div>" },
  132. { ctx: ["body"], label: "shadcn:progress", d: ["Pasek postępu shadcn", "shadcn progress bar"], body:
  133. "<div role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"${1:50}\" class=\"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\">\n\t<div class=\"bg-primary h-full transition-all\" style=\"width: ${1:50}%\"></div>\n</div>" },
  134. { ctx: ["body"], label: "shadcn:table", d: ["Tabela shadcn", "shadcn table"], body:
  135. "<div class=\"relative w-full overflow-x-auto\">\n\t<table class=\"w-full caption-bottom text-sm\">\n\t\t<thead>\n\t\t\t<tr class=\"border-b\">\n\t\t\t\t<th class=\"text-muted-foreground h-10 px-2 text-left align-middle font-medium\">${1:Name}</th>\n\t\t\t\t<th class=\"text-muted-foreground h-10 px-2 text-left align-middle font-medium\">${2:Status}</th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr class=\"hover:bg-muted/50 border-b transition-colors\">\n\t\t\t\t<td class=\"p-2 align-middle\">${3}</td>\n\t\t\t\t<td class=\"p-2 align-middle\">${4}</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>" },
  136. { ctx: ["body"], label: "shadcn:dialog", d: ["Okno dialogowe shadcn (natywne <dialog>)", "shadcn dialog (native <dialog>)"], body:
  137. "<button type=\"button\" onclick=\"document.getElementById('${1:dialog}').showModal()\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 h-9 px-4 py-2\">${2:Open dialog}</button>\n\n<dialog id=\"${1:dialog}\" class=\"bg-background m-auto w-full max-w-lg rounded-lg border p-6 shadow-lg backdrop:bg-black/50\">\n\t<div class=\"flex flex-col gap-2\">\n\t\t<h2 class=\"text-lg font-semibold leading-none\">${3:Are you sure?}</h2>\n\t\t<p class=\"text-muted-foreground text-sm\">${4:This action cannot be undone.}</p>\n\t</div>\n\t<div class=\"mt-6 flex justify-end gap-2\">\n\t\t<form method=\"dialog\">\n\t\t\t<button class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2\">${5:Cancel}</button>\n\t\t</form>\n\t\t<button type=\"button\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 h-9 px-4 py-2\">${6:Continue}</button>\n\t</div>\n</dialog>" },
  138. { ctx: ["body"], label: "shadcn:navbar", d: ["Pasek nawigacji shadcn", "shadcn navbar"], body:
  139. "<header class=\"bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 w-full border-b backdrop-blur\">\n\t<div class=\"mx-auto flex h-14 max-w-screen-2xl items-center justify-between px-4\">\n\t\t<a href=\"${1:/}\" class=\"font-semibold\">${2:Brand}</a>\n\t\t<nav class=\"flex items-center gap-6 text-sm font-medium\">\n\t\t\t<a href=\"${3:#}\" class=\"text-foreground/80 transition-colors hover:text-foreground\">${4:Docs}</a>\n\t\t\t<a href=\"${5:#}\" class=\"text-foreground/80 transition-colors hover:text-foreground\">${6:Pricing}</a>\n\t\t</nav>\n\t</div>\n</header>" },
  140. { ctx: ["body"], label: "shadcn:dark-toggle", d: ["Przełącznik trybu ciemnego (klasa .dark)", "Dark mode toggle (.dark class)"], body:
  141. "<button type=\"button\" onclick=\"document.documentElement.classList.toggle('dark')\" class=\"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2\">${1:Toggle theme}</button>" },
  142. { ctx: ["body"], label: "bs:container", d: ["Kontener Bootstrap", "Bootstrap container"], body: '<div class="container">\n\t${}\n</div>' },
  143. { ctx: ["body"], label: "bs:grid", d: ["Wiersz z kolumnami Bootstrap", "Bootstrap row with columns"], body:
  144. '<div class="row g-3">\n\t<div class="col-12 col-md-6 col-lg-4">\n\t\t${1}\n\t</div>\n\t<div class="col-12 col-md-6 col-lg-4">\n\t\t${2}\n\t</div>\n\t<div class="col-12 col-lg-4">\n\t\t${3}\n\t</div>\n</div>' },
  145. { ctx: ["body"], label: "bs:card", d: ["Karta Bootstrap", "Bootstrap card"], body:
  146. '<div class="card" style="max-width: 22rem;">\n\t<img src="${1:image.jpg}" class="card-img-top" alt="${2:Description}">\n\t<div class="card-body">\n\t\t<h5 class="card-title">${3:Title}</h5>\n\t\t<p class="card-text">${4:Description}</p>\n\t\t<a href="${5:#}" class="btn btn-primary">${6:Go}</a>\n\t</div>\n</div>' },
  147. { ctx: ["body"], label: "bs:navbar", d: ["Navbar Bootstrap z menu mobilnym", "Bootstrap navbar with mobile menu"], body:
  148. '<nav class="navbar navbar-expand-lg navbar-light bg-light">\n\t<div class="container">\n\t\t<a class="navbar-brand" href="${1:/}">${2:Logo}</a>\n\t\t<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="collapse navbar-collapse" id="mainNav">\n\t\t\t<ul class="navbar-nav ms-auto">\n\t\t\t\t<li class="nav-item"><a class="nav-link" href="index.html">Home</a></li>\n\t\t\t\t<li class="nav-item"><a class="nav-link" href="about.html">About</a></li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n</nav>' },
  149. { ctx: ["body"], label: "bs:modal", d: ["Modal Bootstrap", "Bootstrap modal"], body:
  150. '<div class="modal fade" id="${1:modal}" tabindex="-1" aria-labelledby="${1:modal}Label" aria-hidden="true">\n\t<div class="modal-dialog">\n\t\t<div class="modal-content">\n\t\t\t<div class="modal-header">\n\t\t\t\t<h5 class="modal-title" id="${1:modal}Label">${2:Title}</h5>\n\t\t\t\t<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>\n\t\t\t</div>\n\t\t\t<div class="modal-body">\n\t\t\t\t${}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>' },
  151. { ctx: ["body"], label: "bs:alert", d: ["Alert Bootstrap", "Bootstrap alert"], body: '<div class="alert alert-warning alert-dismissible fade show" role="alert">\n\t${1:Message}\n\t<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n</div>' },
  152. { ctx: ["body", "form"], label: "bs:form", d: ["Formularz Bootstrap", "Bootstrap form"], body:
  153. '<form class="row g-3">\n\t<div class="col-12">\n\t\t<label for="${1:email}" class="form-label">E-mail</label>\n\t\t<input type="email" class="form-control" id="${1:email}" name="email" required>\n\t</div>\n\t<div class="col-12">\n\t\t<button type="submit" class="btn btn-primary">Send</button>\n\t</div>\n</form>' },
  154. { ctx: ["body"], label: "bs:table", d: ["Tabela Bootstrap", "Bootstrap table"], body:
  155. '<table class="table table-striped table-hover">\n\t<thead>\n\t\t<tr>\n\t\t\t<th scope="col">${1:Name}</th>\n\t\t\t<th scope="col">${2:Value}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>${3}</td>\n\t\t\t<td>${4}</td>\n\t\t</tr>\n\t</tbody>\n</table>' },
  156. { ctx: ["body"], label: "section", d: ["Sekcja treści z nagłówkiem", "Content section with a heading"], body: '<section aria-labelledby="${1:section-title}">\n\t<h2 id="${1:section-title}">${2:Section title}</h2>\n\t${}\n</section>' },
  157. { ctx: ["body"], label: "article", d: ["Samodzielny artykuł", "Self-contained article"], body: '<article>\n\t<h2>${1:Article title}</h2>\n\t<p>${2:Article content}</p>\n</article>' },
  158. { ctx: ["body"], label: "figure", d: ["Obraz z podpisem", "Image with a caption"], body: '<figure>\n\t<img src="${1:image.jpg}" alt="${2:Image description}">\n\t<figcaption>${3:Image caption}</figcaption>\n</figure>' },
  159. { ctx: ["body"], label: "a", d: ["Link do strony lub zasobu", "Link to a page or resource"], body: '<a href="${1:/page.html}">${2:Link text}</a>' },
  160. { ctx: ["body"], label: "a:external", d: ["Link zewnętrzny otwierany bezpiecznie w nowej karcie", "External link opened safely in a new tab"], body: '<a href="${1:https://example.com}" target="_blank" rel="noopener noreferrer">${2:External link}</a>' },
  161. { ctx: ["body"], label: "a:email", d: ["Link otwierający nową wiadomość e-mail", "Link that opens a new e-mail"], body: '<a href="mailto:${1:hello@example.com}">${2:hello@example.com}</a>' },
  162. { ctx: ["body"], label: "a:phone", d: ["Link umożliwiający połączenie telefoniczne", "Link that starts a phone call"], body: '<a href="tel:${1:+48123456789}">${2:+48 123 456 789}</a>' },
  163. { ctx: ["body"], label: "a:download", d: ["Link do pobrania pliku", "Link to download a file"], body: '<a href="${1:/files/document.pdf}" download="${2:document.pdf}">${3:Download file}</a>' },
  164. { ctx: ["body"], label: "a:anchor", d: ["Link do sekcji na tej stronie", "Link to a section on this page"], body: '<a href="#${1:section-id}">${2:Go to section}</a>' },
  165. { ctx: ["body"], label: "a:button", d: ["Link stylizowany jako przycisk", "Link styled as a button"], body: '<a class="${1:button}" href="${2:/destination}">${3:Continue}</a>' },
  166. { ctx: ["body"], label: "a:icon", d: ["Dostępny link z ikoną", "Accessible link with an icon"], body: '<a href="${1:/destination}" aria-label="${2:Open destination}">\n\t<span aria-hidden="true">${3:→}</span>\n\t<span>${4:Learn more}</span>\n</a>' },
  167. { ctx: ["body"], label: "a:skip", d: ["Skip link dla dostępności", "Accessibility skip link"], body: '<a href="#main" class="skip-link">${1:Skip to content}</a>' },
  168. { ctx: ["body"], label: "button", d: ["Przycisk akcji", "Action button"], body: '<button type="${1:button}">${2:Click me}</button>' },
  169. { ctx: ["body"], label: "h1", d: ["Nagłówek pierwszego poziomu", "Level-one heading"], body: "<h1>${}</h1>" },
  170. { ctx: ["body"], label: "h2", d: ["Nagłówek drugiego poziomu", "Level-two heading"], body: "<h2>${}</h2>" },
  171. { ctx: ["body"], label: "p", d: ["Akapit", "Paragraph"], body: "<p>${}</p>" },
  172. { ctx: ["body"], label: "blockquote", d: ["Cytat blokowy z podaniem źródła", "Block quotation with a citation"], body: '<blockquote cite="${1:https://example.com/source}">\n\t<p>${2:Quoted text}</p>\n\t<cite>${3:Source}</cite>\n</blockquote>' },
  173. { ctx: ["body"], label: "time", d: ["Data lub czas w formacie maszynowym", "Date or time with a machine-readable value"], body: '<time datetime="${1:2026-01-01}">${2:January 1, 2026}</time>' },
  174. { ctx: ["body"], label: "address", d: ["Dane kontaktowe autora lub organizacji", "Contact information for an author or organization"], body: '<address>\n\t<a href="mailto:${1:hello@example.com}">${2:hello@example.com}</a>\n</address>' },
  175. { ctx: ["body"], label: "dl", d: ["Lista opisowa", "Description list"], body: '<dl>\n\t<dt>${1:Term}</dt>\n\t<dd>${2:Definition}</dd>\n</dl>' },
  176. { ctx: ["body"], label: "ol", d: ["Lista uporządkowana", "Ordered list"], body: "<ol>\n\t<li>${}</li>\n</ol>" },
  177. { ctx: ["body"], label: "ul", d: ["Lista nieuporządkowana", "Unordered list"], body: "<ul>\n\t<li>${}</li>\n</ul>" },
  178. { ctx: ["body"], label: "pre:code", d: ["Blok kodu z oznaczeniem języka", "Code block with a language label"], body: '<pre><code class="language-${1:html}">${2:Code}</code></pre>' },
  179. { ctx: ["body"], label: "mark", d: ["Wyróżniony fragment tekstu", "Highlighted text"], body: "<mark>${}</mark>" },
  180. { ctx: ["body"], label: "progress", d: ["Wskaźnik postępu", "Progress indicator"], body: '<progress value="${1:50}" max="${2:100}">${3:50}%</progress>' },
  181. { ctx: ["body"], label: "meter", d: ["Wskaźnik wartości w znanym zakresie", "Gauge within a known range"], body: '<meter min="${1:0}" max="${2:100}" low="${3:30}" high="${4:80}" optimum="${5:100}" value="${6:65}">${6:65}</meter>' },
  182. { ctx: ["body"], label: "audio", d: ["Odtwarzacz audio z kilkoma formatami", "Audio player with multiple formats"], body: '<audio controls preload="metadata">\n\t<source src="${1:audio.mp3}" type="audio/mpeg">\n\t<source src="${2:audio.ogg}" type="audio/ogg">\n\t${3:Your browser does not support audio.}\n</audio>' },
  183. { ctx: ["body"], label: "video:responsive", d: ["Odtwarzacz wideo z napisami i wymiarami", "Video player with captions and dimensions"], body: '<video controls playsinline preload="metadata" poster="${1:poster.jpg}" width="${2:1280}" height="${3:720}">\n\t<source src="${4:video.mp4}" type="video/mp4">\n\t<track src="${5:captions.vtt}" kind="captions" srclang="${6:en}" label="${7:English}">\n\t${8:Your browser does not support video.}\n</video>' },
  184. { ctx: ["body"], label: "template", d: ["Szablon HTML do użycia przez JavaScript", "HTML template for use by JavaScript"], body: '<template id="${1:item-template}">\n\t<article class="item">\n\t\t<h2></h2>\n\t\t<p></p>\n\t</article>\n</template>' },
  185. { ctx: ["body"], label: "form:search", d: ["Dostępny formularz wyszukiwania", "Accessible search form"], body: '<form role="search" action="${1:/search}" method="get">\n\t<label for="${2:site-search}">${3:Search}</label>\n\t<input id="${2:site-search}" type="search" name="q" required>\n\t<button type="submit">${4:Search}</button>\n</form>' },
  186. { ctx: ["body", "form"], label: "form:contact", d: ["Formularz kontaktowy", "Contact form"], body:
  187. '<form action="${1:contact.php}" method="post" class="form">\n\t<label>\n\t\tName\n\t\t<input type="text" name="name" required>\n\t</label>\n\t<label>\n\t\tE-mail\n\t\t<input type="email" name="email" required>\n\t</label>\n\t<label>\n\t\tMessage\n\t\t<textarea name="message" rows="5" required></textarea>\n\t</label>\n\t<button type="submit">${2:Send}</button>\n</form>' },
  188. { ctx: ["body"], label: "form:login", d: ["Formularz logowania", "Login form"], body:
  189. '<form action="${1:login.php}" method="post" class="form">\n\t<label>\n\t\tE-mail\n\t\t<input type="email" name="email" autocomplete="username" required>\n\t</label>\n\t<label>\n\t\tPassword\n\t\t<input type="password" name="password" autocomplete="current-password" required>\n\t</label>\n\t<button type="submit">${2:Sign in}</button>\n</form>' },
  190. { ctx: ["body"], label: "table:data", d: ["Tabela z nagłówkiem", "Table with header"], body:
  191. '<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>${1:Name}</th>\n\t\t\t<th>${2:Value}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>${3}</td>\n\t\t\t<td>${4}</td>\n\t\t</tr>\n\t</tbody>\n</table>' },
  192. { ctx: ["body"], label: "table:caption", d: ["Dostępna tabela z podpisem i nagłówkami", "Accessible table with a caption and headers"], body: '<table>\n\t<caption>${1:Table caption}</caption>\n\t<thead>\n\t\t<tr>\n\t\t\t<th scope="col">${2:Name}</th>\n\t\t\t<th scope="col">${3:Value}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<th scope="row">${4:Item}</th>\n\t\t\t<td>${5:Value}</td>\n\t\t</tr>\n\t</tbody>\n</table>' },
  193. { ctx: ["body"], label: "picture:responsive", d: ["Responsywny obraz z formatami WebP i AVIF", "Responsive image with WebP and AVIF formats"], body: '<picture>\n\t<source srcset="${1:image.avif}" type="image/avif">\n\t<source srcset="${2:image.webp}" type="image/webp">\n\t<img src="${3:image.jpg}" alt="${4:Image description}" width="${5:1200}" height="${6:800}" loading="lazy">\n</picture>' },
  194. { ctx: ["body"], label: "img:responsive", d: ["Obraz z leniwym ładowaniem", "Lazy-loaded image"], body:
  195. '<img src="${1:img/photo.jpg}" alt="${2:Image description}" width="${3:800}" height="${4:600}" loading="lazy">' },
  196. { ctx: ["body"], label: "img:srcset", d: ["Obraz responsywny srcset/sizes", "Responsive image with srcset/sizes"], body:
  197. '<img src="${1:img/photo-800.jpg}"\n\tsrcset="${2:img/photo-400.jpg} 400w, ${1:img/photo-800.jpg} 800w, ${3:img/photo-1200.jpg} 1200w"\n\tsizes="(max-width: 600px) 100vw, 50vw"\n\talt="${4:Image description}" loading="lazy">' },
  198. { ctx: ["body"], label: "picture", d: ["Obraz w kilku formatach (WebP + JPG)", "Image in several formats (WebP + JPG)"], body:
  199. '<picture>\n\t<source srcset="${1:img/photo.webp}" type="image/webp">\n\t<img src="${2:img/photo.jpg}" alt="${3:Description}" loading="lazy">\n</picture>' },
  200. { ctx: ["body"], label: "video", d: ["Wideo z kontrolkami", "Video with controls"], body:
  201. '<video src="${1:video.mp4}" controls preload="metadata" ${2:poster="poster.jpg"}></video>' },
  202. { ctx: ["body"], label: "iframe:youtube", d: ["Film z YouTube", "YouTube video"], body:
  203. '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/${1:ID}" title="${2:Video}" loading="lazy" allowfullscreen></iframe>' },
  204. { ctx: ["body"], label: "nav:menu", d: ["Menu nawigacyjne", "Navigation menu"], body:
  205. '<nav>\n\t<ul>\n\t\t<li><a href="${1:#}">${2:Link}</a></li>\n\t\t<li><a href="${3:#}">${4:Link}</a></li>\n\t</ul>\n</nav>' },
  206. { ctx: ["body"], label: "breadcrumbs", d: ["Okruszki nawigacyjne", "Breadcrumbs"], body:
  207. '<nav aria-label="Breadcrumb">\n\t<ol>\n\t\t<li><a href="/">Home</a></li>\n\t\t<li><a href="${1:/category}">${2:Category}</a></li>\n\t\t<li aria-current="page">${3:Current page}</li>\n\t</ol>\n</nav>' },
  208. { ctx: ["body"], label: "pagination", d: ["Paginacja dostępna", "Accessible pagination"], body:
  209. '<nav aria-label="Pagination">\n\t<ul class="pagination">\n\t\t<li><a href="?page=${1:1}" aria-label="Previous">«</a></li>\n\t\t<li><a href="?page=${1:1}" aria-current="page">1</a></li>\n\t\t<li><a href="?page=2">2</a></li>\n\t\t<li><a href="?page=3">3</a></li>\n\t\t<li><a href="?page=2" aria-label="Next">»</a></li>\n\t</ul>\n</nav>' },
  210. { ctx: ["body"], label: "dialog", d: ["Okno dialogowe (modal)", "Dialog (modal)"], body:
  211. '<dialog id="${1:modal}">\n\t<h2>${2:Title}</h2>\n\t<p>${3:Content}</p>\n\t<form method="dialog">\n\t\t<button>Close</button>\n\t</form>\n</dialog>' },
  212. { ctx: ["body"], label: "details", d: ["Rozwijana sekcja (FAQ)", "Collapsible section (FAQ)"], body:
  213. "<details>\n\t<summary>${1:Question}</summary>\n\t<p>${2:Answer}</p>\n</details>" },
  214. { ctx: ["body"], label: "svg:icon", d: ["Ikona SVG inline z use", "Inline SVG icon with use"], body:
  215. '<svg class="icon" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">\n\t<use href="#${1:icon-name}"></use>\n</svg>' },
  216. { ctx: ["body"], label: "svg:sprite", d: ["Sprite SVG z symbolami", "SVG sprite with symbols"], body:
  217. '<svg xmlns="http://www.w3.org/2000/svg" style="display: none">\n\t<symbol id="${1:icon-name}" viewBox="0 0 24 24" fill="currentColor">\n\t\t${2:<path d="..."/>}\n\t</symbol>\n</svg>' },
  218. { ctx: ["body"], label: "json-ld", d: ["Dane strukturalne Schema.org", "Schema.org structured data"], body:
  219. '<script type="application/ld+json">\n{\n\t"@context": "https://schema.org",\n\t"@type": "Organization",\n\t"name": "${1:Company Name}",\n\t"url": "${2:https://example.com}"\n}\n</script>' },
  220. { ctx: ["body", "form"], label: "honeypot", d: ["Pole anty-spamowe (honeypot)", "Anti-spam honeypot field"], body:
  221. '<div style="display: none;" aria-hidden="true">\n\t<label>Leave this field empty\n\t\t<input type="text" name="${1:website}" tabindex="-1" autocomplete="off">\n\t</label>\n</div>' },
  222. { ctx: ["body"], label: "script", d: ["Skrypt na końcu strony", "Script at the end of the page"], body: '<script src="${1:script.js}"></script>' },
  223. { ctx: ["body"], label: "script:inline", d: ["Skrypt w miejscu", "Inline script"], body: "<script>\n\t${}\n</script>" },
  224. ​
  225. { ctx: ["list"], label: "li", d: ["Element listy", "List item"], body: "<li>${}</li>" },
  226. { ctx: ["list"], label: "li:3", d: ["Trzy elementy listy", "Three list items"], body: "<li>${1}</li>\n<li>${2}</li>\n<li>${3}</li>" },
  227. { ctx: ["list"], label: "li:link", d: ["Element listy z linkiem", "List item with a link"], body: '<li><a href="${1:#}">${2:Link}</a></li>' },
  228. { ctx: ["table"], label: "tr", d: ["Wiersz tabeli", "Table row"], body: "<tr>\n\t<td>${1}</td>\n\t<td>${2}</td>\n</tr>" },
  229. { ctx: ["table"], label: "thead", d: ["Nagłówek tabeli", "Table header"], body: "<thead>\n\t<tr>\n\t\t<th>${1}</th>\n\t\t<th>${2}</th>\n\t</tr>\n</thead>" },
  230. { ctx: ["form"], label: "input:text", d: ["Pole tekstowe z etykietą", "Text field with label"], body: '<label>\n\t${1:Label}\n\t<input type="text" name="${2:name}">\n</label>' },
  231. { ctx: ["form"], label: "input:email", d: ["Pole e-mail z etykietą", "E-mail field with label"], body: '<label>\n\t${1:E-mail}\n\t<input type="email" name="${2:email}" required>\n</label>' },
  232. { ctx: ["form"], label: "input:password", d: ["Pole hasła", "Password field"], body: '<label>\n\t${1:Password}\n\t<input type="password" name="${2:password}" required>\n</label>' },
  233. { ctx: ["form"], label: "input:number", d: ["Pole liczbowe z ograniczeniami", "Number input with constraints"], body: '<label for="${1:quantity}">${2:Quantity}</label>\n<input id="${1:quantity}" type="number" name="${3:quantity}" min="${4:1}" max="${5:10}" step="${6:1}" value="${7:1}">' },
  234. { ctx: ["form"], label: "input:date", d: ["Pole daty", "Date input"], body: '<label for="${1:date}">${2:Date}</label>\n<input id="${1:date}" type="date" name="${3:date}" ${4:required}>' },
  235. { ctx: ["form"], label: "input:file", d: ["Pole przesyłania pliku", "File upload input"], body: '<label for="${1:file}">${2:Choose a file}</label>\n<input id="${1:file}" type="file" name="${3:file}" accept="${4:image/*}" ${5:required}>' },
  236. { ctx: ["form"], label: "input:radio", d: ["Grupa przycisków opcji", "Radio button group"], body: '<fieldset>\n\t<legend>${1:Choose an option}</legend>\n\t<label><input type="radio" name="${2:option}" value="${3:first}" required> ${4:First option}</label>\n\t<label><input type="radio" name="${2:option}" value="${5:second}"> ${6:Second option}</label>\n</fieldset>' },
  237. { ctx: ["form"], label: "input:range", d: ["Suwak wartości", "Range slider input"], body: '<label for="${1:volume}">${2:Volume}</label>\n<input id="${1:volume}" type="range" name="${3:volume}" min="${4:0}" max="${5:100}" value="${6:50}">' },
  238. { ctx: ["form"], label: "input:search", d: ["Pole wyszukiwania", "Search input"], body: '<label for="${1:query}">${2:Search}</label>\n<input id="${1:query}" type="search" name="${3:q}" placeholder="${4:Search...}" autocomplete="off">' },
  239. { ctx: ["form"], label: "input:url", d: ["Pole adresu URL", "URL input"], body: '<label for="${1:website}">${2:Website}</label>\n<input id="${1:website}" type="url" name="${3:website}" placeholder="${4:https://example.com}" ${5:required}>' },
  240. { ctx: ["form"], label: "input:tel", d: ["Pole numeru telefonu", "Telephone number input"], body: '<label for="${1:phone}">${2:Phone}</label>\n<input id="${1:phone}" type="tel" name="${3:phone}" autocomplete="tel" pattern="${4:[+0-9 ()-]+}">' },
  241. { ctx: ["form"], label: "input:datalist", d: ["Pole tekstowe z podpowiedziami", "Text input with suggestions"], body: '<label for="${1:browser}">${2:Choose a browser}</label>\n<input id="${1:browser}" name="${3:browser}" list="${4:browsers}">\n<datalist id="${4:browsers}">\n\t<option value="${5:Firefox}">\n\t<option value="${6:Chrome}">\n\t<option value="${7:Safari}">\n</datalist>' },
  242. { ctx: ["form"], label: "fieldset", d: ["Grupa pól z legendą", "Grouped form fields with a legend"], body: '<fieldset>\n\t<legend>${1:Contact details}</legend>\n\t${}\n</fieldset>' },
  243. { ctx: ["form"], label: "form:multipart", d: ["Formularz przesyłający pliki", "Form for uploading files"], body: '<form action="${1:upload.php}" method="post" enctype="multipart/form-data">\n\t<label for="${2:file}">${3:Choose a file}</label>\n\t<input id="${2:file}" type="file" name="${4:file}" required>\n\t<button type="submit">${5:Upload}</button>\n</form>' },
  244. { ctx: ["form"], label: "textarea", d: ["Pole wieloliniowe", "Multi-line field"], body: '<label>\n\t${1:Message}\n\t<textarea name="${2:message}" rows="5"></textarea>\n</label>' },
  245. { ctx: ["form"], label: "select", d: ["Lista wyboru", "Select list"], body: '<label>\n\t${1:Choose}\n\t<select name="${2:option}">\n\t\t<option value="${3:1}">${4:Option 1}</option>\n\t\t<option value="2">Option 2</option>\n\t</select>\n</label>' },
  246. { ctx: ["form"], label: "checkbox", d: ["Pole wyboru", "Checkbox"], body: '<label>\n\t<input type="checkbox" name="${1:agree}">\n\t${2:I accept the terms}\n</label>' },
  247. { ctx: ["form"], label: "button:submit", d: ["Przycisk wysyłania", "Submit button"], body: '<button type="submit">${1:Send}</button>' },
  248. { ctx: ["select"], label: "option", d: ["Opcja listy", "Option"], body: '<option value="${1}">${2}</option>' }
  249. ],
  250. ​
  251. phpInline: [
  252. { label: "php", d: ["Blok kodu PHP", "PHP code block"], body: "<?php ${} ?>" },
  253. { label: "php:echo", d: ["Bezpieczne wypisanie zmiennej", "Safely print a variable"], body: "<?= htmlspecialchars(${1:\$value}) ?>" },
  254. { label: "php:if", d: ["Warunek w HTML", "Condition in HTML"], body: "<?php if (${1:\$condition}): ?>\n\t${}\n<?php endif; ?>" },
  255. { label: "php:ifelse", d: ["Warunek z gałęzią else w HTML", "If/else block in HTML"], body: "<?php if (${1:\$condition}): ?>\n\t${2:Content}\n<?php else: ?>\n\t${3:Fallback}\n<?php endif; ?>" },
  256. { label: "php:foreach", d: ["Pętla w HTML", "Loop in HTML"], body: "<?php foreach (${1:\$items} as ${2:\$item}): ?>\n\t${}\n<?php endforeach; ?>" },
  257. { label: "php:include", d: ["Dołącz plik (np. nagłówek)", "Include a file (e.g. header)"], body: "<?php include __DIR__ . '/${1:header.php}'; ?>" },
  258. { label: "php:include-once", d: ["Dołącz plik tylko raz", "Include a file once"], body: "<?php require_once __DIR__ . '/${1:header.php}'; ?>" },
  259. { label: "php:csrf-field", d: ["Ukryte pole tokenu CSRF", "Hidden CSRF token field"], body: '<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($csrfToken, ENT_QUOTES, \'UTF-8\') ?>">' },
  260. { label: "php:form", d: ["Formularz z obsługą PHP na tej samej stronie", "Form handled by PHP on the same page"], body:
  261. "<?php\n\$sent = false;\nif (\$_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\$name = trim(\$_POST['name'] ?? '');\n\t\$email = filter_var(\$_POST['email'] ?? '', FILTER_VALIDATE_EMAIL);\n\tif (\$name !== '' && \$email) {\n\t\t\$sent = true;\n\t}\n}\n?>\n<?php if (\$sent): ?>\n\t<p>Thank you, ${1:your message has been sent}.</p>\n<?php else: ?>\n\t<form method=\"post\">\n\t\t<input type=\"text\" name=\"name\" required>\n\t\t<input type=\"email\" name=\"email\" required>\n\t\t<button type=\"submit\">Send</button>\n\t</form>\n<?php endif; ?>" }
  262. ],
  263. ​
  264. css: [
  265. { ctx: ["top"], label: "reset", d: ["Nowoczesny reset CSS", "Modern CSS reset"], body:
  266. "*,\n*::before,\n*::after {\n\tbox-sizing: border-box;\n}\n\n* {\n\tmargin: 0;\n}\n\nbody {\n\tline-height: 1.5;\n\t-webkit-font-smoothing: antialiased;\n}\n\nimg,\npicture,\nvideo,\nsvg {\n\tdisplay: block;\n\tmax-width: 100%;\n}\n\ninput,\nbutton,\ntextarea,\nselect {\n\tfont: inherit;\n}" },
  267. { ctx: ["top"], label: ":root", d: ["Zmienne CSS (kolory, odstępy)", "CSS variables (colors, spacing)"], body:
  268. ":root {\n\t--color-primary: ${1:#3862f5};\n\t--color-text: #0f172a;\n\t--color-bg: #ffffff;\n\t--radius: 12px;\n\t--space: 16px;\n}" },
  269. { ctx: ["top"], label: "tw:input", d: ["Wejściowy plik Tailwind v4", "Tailwind v4 input file"], body: '@import "tailwindcss";\n\n${}' },
  270. { ctx: ["top"], label: "tw:config", d: ["Motyw w @theme (Tailwind v4)", "Theme in @theme (Tailwind v4)"], body:
  271. "@theme {\n\t--color-primary: ${1:#3862f5};\n\t--color-primary-dark: ${2:#2748c4};\n\t--font-sans: ${3:\"Inter\", system-ui, sans-serif};\n\t--radius-card: 12px;\n}" },
  272. { ctx: ["top"], label: "shadcn:globals", d: ["Plik globals.css z motywem shadcn (Tailwind v4)", "globals.css with the shadcn theme (Tailwind v4)"], body:
  273. "@import \"tailwindcss\";\n\n@custom-variant dark (&:is(.dark *));\n\n:root {\n\t--radius: 0.625rem;\n\t--background: oklch(1 0 0);\n\t--foreground: oklch(0.145 0 0);\n\t--card: oklch(1 0 0);\n\t--card-foreground: oklch(0.145 0 0);\n\t--popover: oklch(1 0 0);\n\t--popover-foreground: oklch(0.145 0 0);\n\t--primary: oklch(0.205 0 0);\n\t--primary-foreground: oklch(0.985 0 0);\n\t--secondary: oklch(0.97 0 0);\n\t--secondary-foreground: oklch(0.205 0 0);\n\t--muted: oklch(0.97 0 0);\n\t--muted-foreground: oklch(0.556 0 0);\n\t--accent: oklch(0.97 0 0);\n\t--accent-foreground: oklch(0.205 0 0);\n\t--destructive: oklch(0.577 0.245 27.325);\n\t--border: oklch(0.922 0 0);\n\t--input: oklch(0.922 0 0);\n\t--ring: oklch(0.708 0 0);\n}\n\n.dark {\n\t--background: oklch(0.145 0 0);\n\t--foreground: oklch(0.985 0 0);\n\t--card: oklch(0.205 0 0);\n\t--card-foreground: oklch(0.985 0 0);\n\t--popover: oklch(0.205 0 0);\n\t--popover-foreground: oklch(0.985 0 0);\n\t--primary: oklch(0.922 0 0);\n\t--primary-foreground: oklch(0.205 0 0);\n\t--secondary: oklch(0.269 0 0);\n\t--secondary-foreground: oklch(0.985 0 0);\n\t--muted: oklch(0.269 0 0);\n\t--muted-foreground: oklch(0.708 0 0);\n\t--accent: oklch(0.269 0 0);\n\t--accent-foreground: oklch(0.985 0 0);\n\t--destructive: oklch(0.704 0.191 22.216);\n\t--border: oklch(1 0 0 / 10%);\n\t--input: oklch(1 0 0 / 15%);\n\t--ring: oklch(0.556 0 0);\n}\n\n@theme inline {\n\t--radius-sm: calc(var(--radius) - 4px);\n\t--radius-md: calc(var(--radius) - 2px);\n\t--radius-lg: var(--radius);\n\t--radius-xl: calc(var(--radius) + 4px);\n\t--color-background: var(--background);\n\t--color-foreground: var(--foreground);\n\t--color-card: var(--card);\n\t--color-card-foreground: var(--card-foreground);\n\t--color-popover: var(--popover);\n\t--color-popover-foreground: var(--popover-foreground);\n\t--color-primary: var(--primary);\n\t--color-primary-foreground: var(--primary-foreground);\n\t--color-secondary: var(--secondary);\n\t--color-secondary-foreground: var(--secondary-foreground);\n\t--color-muted: var(--muted);\n\t--color-muted-foreground: var(--muted-foreground);\n\t--color-accent: var(--accent);\n\t--color-accent-foreground: var(--accent-foreground);\n\t--color-destructive: var(--destructive);\n\t--color-border: var(--border);\n\t--color-input: var(--input);\n\t--color-ring: var(--ring);\n}\n\n@layer base {\n\t* {\n\t\t@apply border-border outline-ring/50;\n\t}\n\tbody {\n\t\t@apply bg-background text-foreground;\n\t}\n}\n\n${}" },
  274. { ctx: ["top"], label: "shadcn:theme", d: ["Zmienne motywu shadcn (jasny i ciemny)", "shadcn theme variables (light and dark)"], body:
  275. ":root {\n\t--radius: 0.625rem;\n\t--background: oklch(1 0 0);\n\t--foreground: oklch(0.145 0 0);\n\t--card: oklch(1 0 0);\n\t--card-foreground: oklch(0.145 0 0);\n\t--popover: oklch(1 0 0);\n\t--popover-foreground: oklch(0.145 0 0);\n\t--primary: oklch(0.205 0 0);\n\t--primary-foreground: oklch(0.985 0 0);\n\t--secondary: oklch(0.97 0 0);\n\t--secondary-foreground: oklch(0.205 0 0);\n\t--muted: oklch(0.97 0 0);\n\t--muted-foreground: oklch(0.556 0 0);\n\t--accent: oklch(0.97 0 0);\n\t--accent-foreground: oklch(0.205 0 0);\n\t--destructive: oklch(0.577 0.245 27.325);\n\t--border: oklch(0.922 0 0);\n\t--input: oklch(0.922 0 0);\n\t--ring: oklch(0.708 0 0);\n}\n\n.dark {\n\t--background: oklch(0.145 0 0);\n\t--foreground: oklch(0.985 0 0);\n\t--card: oklch(0.205 0 0);\n\t--card-foreground: oklch(0.985 0 0);\n\t--popover: oklch(0.205 0 0);\n\t--popover-foreground: oklch(0.985 0 0);\n\t--primary: oklch(0.922 0 0);\n\t--primary-foreground: oklch(0.205 0 0);\n\t--secondary: oklch(0.269 0 0);\n\t--secondary-foreground: oklch(0.985 0 0);\n\t--muted: oklch(0.269 0 0);\n\t--muted-foreground: oklch(0.708 0 0);\n\t--accent: oklch(0.269 0 0);\n\t--accent-foreground: oklch(0.985 0 0);\n\t--destructive: oklch(0.704 0.191 22.216);\n\t--border: oklch(1 0 0 / 10%);\n\t--input: oklch(1 0 0 / 15%);\n\t--ring: oklch(0.556 0 0);\n}\n\n@theme inline {\n\t--radius-sm: calc(var(--radius) - 4px);\n\t--radius-md: calc(var(--radius) - 2px);\n\t--radius-lg: var(--radius);\n\t--radius-xl: calc(var(--radius) + 4px);\n\t--color-background: var(--background);\n\t--color-foreground: var(--foreground);\n\t--color-card: var(--card);\n\t--color-card-foreground: var(--card-foreground);\n\t--color-popover: var(--popover);\n\t--color-popover-foreground: var(--popover-foreground);\n\t--color-primary: var(--primary);\n\t--color-primary-foreground: var(--primary-foreground);\n\t--color-secondary: var(--secondary);\n\t--color-secondary-foreground: var(--secondary-foreground);\n\t--color-muted: var(--muted);\n\t--color-muted-foreground: var(--muted-foreground);\n\t--color-accent: var(--accent);\n\t--color-accent-foreground: var(--accent-foreground);\n\t--color-destructive: var(--destructive);\n\t--color-border: var(--border);\n\t--color-input: var(--input);\n\t--color-ring: var(--ring);\n}\n\n@layer base {\n\t* {\n\t\t@apply border-border outline-ring/50;\n\t}\n\tbody {\n\t\t@apply bg-background text-foreground;\n\t}\n}\n\n${}" },
  276. { ctx: ["top"], label: "@media", d: ["Media query (telefon)", "Media query (phone)"], body: "@media (max-width: ${1:768}px) {\n\t${}\n}" },
  277. { ctx: ["top"], label: "@media:min", d: ["Media query od szerokości", "Media query from width"], body: "@media (min-width: ${1:1024}px) {\n\t${}\n}" },
  278. { ctx: ["top"], label: "@media:dark", d: ["Styl dla trybu ciemnego", "Dark mode styles"], body: "@media (prefers-color-scheme: dark) {\n\t${}\n}" },
  279. { ctx: ["top"], label: "@media:print", d: ["Style do druku", "Print styles"], body: "@media print {\n\t${}\n}" },
  280. { ctx: ["top"], label: "@container", d: ["Container query", "Container query"], body: ".${1:card-wrap} {\n\tcontainer-type: inline-size;\n}\n\n@container (min-width: 400px) {\n\t${}\n}" },
  281. { ctx: ["top"], label: "@keyframes", d: ["Animacja", "Animation"], body: "@keyframes ${1:fade-in} {\n\tfrom {\n\t\topacity: 0;\n\t}\n\tto {\n\t\topacity: 1;\n\t}\n}" },
  282. { ctx: ["top"], label: "@font-face", d: ["Własna czcionka", "Custom font"], body:
  283. "@font-face {\n\tfont-family: \"${1:My Font}\";\n\tsrc: url(\"${2:fonts/my-font.woff2}\") format(\"woff2\");\n\tfont-weight: ${3:400};\n\tfont-display: swap;\n}" },
  284. { ctx: ["top"], label: "@import", d: ["Import innego pliku CSS", "Import another CSS file"], body: "@import url(\"${1:file.css}\");" },
  285. { ctx: ["top"], label: "body:base", d: ["Podstawowy styl strony", "Base page style"], body:
  286. "body {\n\tfont-family: ${1:system-ui, sans-serif};\n\tcolor: #0f172a;\n\tbackground: #ffffff;\n\tline-height: 1.6;\n}" },
  287. { ctx: ["top"], label: ".container", d: ["Wyśrodkowany kontener", "Centered container"], body: ".container {\n\twidth: min(100% - 32px, ${1:1200px});\n\tmargin-inline: auto;\n}" },
  288. { ctx: ["top"], label: ".btn", d: ["Styl przycisku", "Button style"], body:
  289. ".btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 10px 18px;\n\tborder: 0;\n\tborder-radius: 10px;\n\tbackground: ${1:#3862f5};\n\tcolor: #fff;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: transform 0.15s ease;\n}\n\n.btn:hover {\n\ttransform: translateY(-1px);\n}" },
  290. { ctx: ["top"], label: ".cards", d: ["Responsywna siatka kart", "Responsive card grid"], body: ".${1:cards} {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(${2:260px}, 1fr));\n\tgap: ${3:24px};\n}" },
  291. { ctx: ["top"], label: ".site-header", d: ["Nagłówek z logo i menu w jednej linii", "Header with logo and menu in one row"], body:
  292. ".site-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 16px 24px;\n}\n\n.site-header ul {\n\tdisplay: flex;\n\tgap: 20px;\n\tlist-style: none;\n\tpadding: 0;\n}" },
  293. { ctx: ["block"], label: "flex:center", d: ["Wyśrodkowanie flexboxem", "Center with flexbox"], body: "display: flex;\nalign-items: center;\njustify-content: center;" },
  294. { ctx: ["block"], label: "flex:between", d: ["Elementy na krańcach", "Items at both ends"], body: "display: flex;\nalign-items: center;\njustify-content: space-between;\ngap: ${1:16px};" },
  295. { ctx: ["block"], label: "flex:column", d: ["Kolumna flex", "Flex column"], body: "display: flex;\nflex-direction: column;\ngap: ${1:16px};" },
  296. { ctx: ["block"], label: "grid:auto", d: ["Automatyczna siatka", "Auto grid"], body: "display: grid;\ngrid-template-columns: repeat(auto-fit, minmax(${1:240px}, 1fr));\ngap: ${2:24px};" },
  297. { ctx: ["block"], label: "grid:center", d: ["Wyśrodkowanie siatką", "Center with grid"], body: "display: grid;\nplace-items: center;" },
  298. { ctx: ["block"], label: "absolute:center", d: ["Wyśrodkowanie absolutne", "Absolute centering"], body: "position: absolute;\ninset: 0;\nmargin: auto;" },
  299. { ctx: ["block"], label: "text:truncate", d: ["Ucięcie tekstu wielokropkiem", "Truncate text with ellipsis"], body: "overflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;" },
  300. { ctx: ["block"], label: "line-clamp", d: ["Ucięcie po N liniach", "Clamp to N lines"], body: "display: -webkit-box;\n-webkit-line-clamp: ${1:2};\n-webkit-box-orient: vertical;\noverflow: hidden;" },
  301. { ctx: ["block"], label: "clamp", d: ["Płynna typografia clamp()", "Fluid typography with clamp()"], body: "font-size: clamp(${1:1.5rem}, ${2:0.5rem + 2vw}, ${3:3rem});" },
  302. { ctx: ["block"], label: ":has", d: ["Selektor :has() (rodzic wg dziecka)", ":has() selector (parent by child)"], body: "${1:.card}:has(${2:img}) {\n\t${}\n}" },
  303. { ctx: ["block"], label: "aspect-ratio", d: ["Proporcje elementu", "Element aspect ratio"], body: "aspect-ratio: ${1:16 / 9};" },
  304. { ctx: ["block"], label: "scroll-snap", d: ["Przewijanie po snapach", "Scroll snapping"], body: "scroll-snap-type: x mandatory;\nscroll-padding: ${1:16px};" },
  305. { ctx: ["block"], label: "backdrop", d: ["Szkło (backdrop-filter)", "Glassmorphism (backdrop-filter)"], body: "background: rgba(255, 255, 255, ${1:0.6});\nbackdrop-filter: blur(${2:12px});" },
  306. { ctx: ["block"], label: "transition", d: ["Płynne przejście", "Smooth transition"], body: "transition: ${1:all} ${2:0.2s} ${3:ease};" },
  307. { ctx: ["block"], label: "shadow", d: ["Miękki cień", "Soft shadow"], body: "box-shadow: 0 ${1:4px} ${2:16px} rgba(0, 0, 0, ${3:0.12});" },
  308. { ctx: ["block"], label: "sticky:top", d: ["Przyklejony do góry", "Sticky at the top"], body: "position: sticky;\ntop: ${1:0};\nz-index: ${2:10};" },
  309. { ctx: ["block"], label: "visually-hidden", d: ["Ukryte wizualnie (dostępne dla czytników)", "Visually hidden (screen reader friendly)"], body:
  310. "position: absolute;\nwidth: 1px;\nheight: 1px;\noverflow: hidden;\nclip: rect(0 0 0 0);\nwhite-space: nowrap;" }
  311. ],
  312. ​
  313. js: [
  314. { label: "qs", d: ["Znajdź element", "Find element"], body: "document.querySelector(\"${1:.selector}\")" },
  315. { label: "qsa", d: ["Znajdź wszystkie elementy", "Find all elements"], body: "document.querySelectorAll(\"${1:.selector}\")" },
  316. { label: "ael", d: ["Nasłuchuj zdarzenia", "Add event listener"], body: "${1:item}.addEventListener(\"${2:click}\", (${3:event}) => {\n\t${}\n});" },
  317. { label: "click", d: ["Kliknięcie w element", "Click on element"], body: "document.querySelector(\"${1:#button}\").addEventListener(\"click\", () => {\n\t${}\n});" },
  318. { label: "ready", d: ["Po załadowaniu strony", "When the page is loaded"], body: "document.addEventListener(\"DOMContentLoaded\", () => {\n\t${}\n});" },
  319. { label: "fetch:json", d: ["Pobierz dane JSON", "Fetch JSON data"], body:
  320. "const response = await fetch(\"${1:/api/data}\");\nif (!response.ok) throw new Error(response.statusText);\nconst ${2:data} = await response.json();" },
  321. { label: "fetch:post", d: ["Wyślij dane POST (JSON)", "Send POST data (JSON)"], body:
  322. "const response = await fetch(\"${1:/api/save}\", {\n\tmethod: \"POST\",\n\theaders: { \"Content-Type\": \"application/json\" },\n\tbody: JSON.stringify(${2:data})\n});" },
  323. { label: "fetch:form", d: ["Wyślij formularz bez przeładowania", "Submit a form without reload"], body:
  324. "document.querySelector(\"${1:form}\").addEventListener(\"submit\", async (event) => {\n\tevent.preventDefault();\n\tconst response = await fetch(event.target.action, {\n\t\tmethod: \"POST\",\n\t\tbody: new FormData(event.target)\n\t});\n\t${}\n});" },
  325. { label: "abort", d: ["Fetch z AbortController", "Fetch with AbortController"], body:
  326. "const controller = new AbortController();\nconst response = await fetch(\"${1:/api/data}\", { signal: controller.signal });\n// controller.abort() aby przerwać" },
  327. { label: "promiseall", d: ["Równoległe async", "Parallel async calls"], body: "const [${1:first}, ${2:second}] = await Promise.all([${3:loadA()}, ${4:loadB()}]);" },
  328. { label: "afn", d: ["Funkcja asynchroniczna", "Async function"], body: "async function ${1:name}(${2}) {\n\t${}\n}" },
  329. { label: "arrow", d: ["Funkcja strzałkowa", "Arrow function"], body: "const ${1:name} = (${2}) => {\n\t${}\n};" },
  330. { label: "log", d: ["Wypisz w konsoli", "Log to console"], body: "console.log(${});" },
  331. { label: "timeout", d: ["Wykonaj z opóźnieniem", "Run after a delay"], body: "setTimeout(() => {\n\t${}\n}, ${1:1000});" },
  332. { label: "interval", d: ["Wykonuj co określony czas", "Run repeatedly"], body: "const ${1:timer} = setInterval(() => {\n\t${}\n}, ${2:1000});" },
  333. { label: "trycatch", d: ["Obsługa błędów", "Error handling"], body: "try {\n\t${}\n} catch (error) {\n\tconsole.error(error);\n}" },
  334. { label: "ls:get", d: ["Odczyt z localStorage", "Read from localStorage"], body: "const ${1:value} = JSON.parse(localStorage.getItem(\"${2:key}\") ?? \"null\");" },
  335. { label: "ls:set", d: ["Zapis do localStorage", "Write to localStorage"], body: "localStorage.setItem(\"${1:key}\", JSON.stringify(${2:value}));" },
  336. { label: "toggle", d: ["Przełącz klasę po kliknięciu", "Toggle a class on click"], body:
  337. "document.querySelector(\"${1:.button}\").addEventListener(\"click\", () => {\n\tdocument.querySelector(\"${2:.menu}\").classList.toggle(\"${3:is-open}\");\n});" },
  338. { label: "debounce", d: ["Funkcja debounce", "Debounce function"], body: "function debounce(fn, ms = ${1:300}) {\n\tlet t;\n\treturn (...args) => {\n\t\tclearTimeout(t);\n\t\tt = setTimeout(() => fn(...args), ms);\n\t};\n}" },
  339. { label: "throttle", d: ["Funkcja throttle", "Throttle function"], body:
  340. "function throttle(fn, ms = ${1:200}) {\n\tlet last = 0;\n\treturn (...args) => {\n\t\tconst now = Date.now();\n\t\tif (now - last >= ms) {\n\t\t\tlast = now;\n\t\t\tfn(...args);\n\t\t}\n\t};\n}" },
  341. { label: "urlparams", d: ["Odczytaj parametry URL", "Read URL parameters"], body: "const ${1:params} = new URLSearchParams(location.search);\nconst ${2:value} = ${1:params}.get(\"${3:key}\");" },
  342. { label: "clipboard", d: ["Kopiuj do schowka", "Copy to clipboard"], body: "navigator.clipboard.writeText(${1:text}).then(() => {\n\t${}\n});" },
  343. { label: "toast", d: ["Prosty toast", "Simple toast"], body:
  344. "function toast(message, ms = ${1:3000}) {\n\tconst el = document.createElement(\"div\");\n\tel.className = \"toast\";\n\tel.textContent = message;\n\tdocument.body.append(el);\n\tsetTimeout(() => el.remove(), ms);\n}" },
  345. { label: "darkmode", d: ["Przełącznik trybu ciemnego z zapamiętywaniem", "Dark mode toggle with persistence"], body:
  346. "const root = document.documentElement;\nconst saved = localStorage.getItem(\"theme\");\nif (saved) root.dataset.theme = saved;\n\ndocument.querySelector(\"${1:#theme-toggle}\").addEventListener(\"click\", () => {\n\tconst next = root.dataset.theme === \"dark\" ? \"light\" : \"dark\";\n\troot.dataset.theme = next;\n\tlocalStorage.setItem(\"theme\", next);\n});" },
  347. { label: "matchmedia", d: ["Reakcja JS na breakpoint", "JS reaction to a breakpoint"], body:
  348. "const mq = window.matchMedia(\"(max-width: ${1:768}px)\");\nmq.addEventListener(\"change\", (e) => {\n\t${}\n});" },
  349. { label: "validate:form", d: ["Walidacja formularza", "Form validation"], body:
  350. "document.querySelector(\"${1:form}\").addEventListener(\"submit\", (event) => {\n\tif (!event.target.checkValidity()) {\n\t\tevent.preventDefault();\n\t\t${}\n\t}\n});" },
  351. { label: "modal:open", d: ["Otwórz/zamknij dialog (modal)", "Open/close a dialog (modal)"], body:
  352. "const modal = document.querySelector(\"${1:dialog}\");\n${2:openBtn}.addEventListener(\"click\", () => modal.showModal());\nmodal.addEventListener(\"click\", (e) => {\n\tif (e.target === modal) modal.close();\n});" },
  353. { label: "lazyload", d: ["Lazy loading obrazów (IntersectionObserver)", "Lazy loading images (IntersectionObserver)"], body:
  354. "const io = new IntersectionObserver((entries, obs) => {\n\tentries.forEach((entry) => {\n\t\tif (entry.isIntersecting) {\n\t\t\tentry.target.src = entry.target.dataset.src;\n\t\t\tobs.unobserve(entry.target);\n\t\t}\n\t});\n});\ndocument.querySelectorAll(\"${1:img[data-src]}\").forEach((el) => io.observe(el));" },
  355. { label: "foreach", d: ["Pętla po elementach", "Loop over elements"], body: "${1:items}.forEach((${2:item}) => {\n\t${}\n});" },
  356. { label: "map", d: ["Przekształć tablicę", "Transform an array"], body: "const ${1:result} = ${2:items}.map((${3:item}) => ${4:item});" },
  357. { label: "filter", d: ["Filtruj tablicę", "Filter an array"], body: "const ${1:result} = ${2:items}.filter((${3:item}) => ${4:condition});" },
  358. { label: "class", d: ["Klasa", "Class"], body: "class ${1:Name} {\n\tconstructor(${2}) {\n\t\t${}\n\t}\n}" },
  359. { label: "import", d: ["Import modułu", "Import a module"], body: "import { ${2:name} } from \"${1:./module.js}\";" },
  360. { label: "observer", d: ["Animacja przy przewijaniu (IntersectionObserver)", "Animate on scroll (IntersectionObserver)"], body:
  361. "const observer = new IntersectionObserver((entries) => {\n\tentries.forEach((entry) => {\n\t\tif (entry.isIntersecting) entry.target.classList.add(\"${1:is-visible}\");\n\t});\n});\ndocument.querySelectorAll(\"${2:.reveal}\").forEach((el) => observer.observe(el));" }
  362. ],
  363. ​
  364. shadcn: [
  365. { label: "shadcn:import", d: ["Import komponentu shadcn", "Import a shadcn component"], body:
  366. "import { ${1:Button} } from \"@/components/ui/${2:button}\"" },
  367. { label: "shadcn:button", d: ["Przycisk shadcn", "shadcn Button"], body:
  368. "<Button variant=\"${1:default}\" size=\"${2:default}\">${3:Click me}</Button>" },
  369. { label: "shadcn:input", d: ["Pole z etykietą shadcn", "shadcn Input with a Label"], body:
  370. "<div className=\"grid w-full gap-2\">\n\t<Label htmlFor=\"${1:email}\">${2:Email}</Label>\n\t<Input type=\"${3:email}\" id=\"${1:email}\" placeholder=\"${4:m@example.com}\" />\n</div>" },
  371. { label: "shadcn:textarea", d: ["Pole wieloliniowe shadcn", "shadcn Textarea"], body:
  372. "<div className=\"grid w-full gap-2\">\n\t<Label htmlFor=\"${1:message}\">${2:Message}</Label>\n\t<Textarea id=\"${1:message}\" placeholder=\"${3:Type your message here.}\" />\n</div>" },
  373. { label: "shadcn:card", d: ["Karta shadcn", "shadcn Card"], body:
  374. "<Card>\n\t<CardHeader>\n\t\t<CardTitle>${1:Card title}</CardTitle>\n\t\t<CardDescription>${2:Card description}</CardDescription>\n\t</CardHeader>\n\t<CardContent>\n\t\t${3}\n\t</CardContent>\n\t<CardFooter>\n\t\t${4}\n\t</CardFooter>\n</Card>" },
  375. { label: "shadcn:dialog", d: ["Okno dialogowe shadcn", "shadcn Dialog"], body:
  376. "<Dialog>\n\t<DialogTrigger asChild>\n\t\t<Button variant=\"outline\">${1:Open}</Button>\n\t</DialogTrigger>\n\t<DialogContent>\n\t\t<DialogHeader>\n\t\t\t<DialogTitle>${2:Are you sure?}</DialogTitle>\n\t\t\t<DialogDescription>${3:This action cannot be undone.}</DialogDescription>\n\t\t</DialogHeader>\n\t\t<DialogFooter>\n\t\t\t<Button type=\"submit\">${4:Continue}</Button>\n\t\t</DialogFooter>\n\t</DialogContent>\n</Dialog>" },
  377. { label: "shadcn:tabs", d: ["Zakładki shadcn", "shadcn Tabs"], body:
  378. "<Tabs defaultValue=\"${1:account}\" className=\"w-full\">\n\t<TabsList>\n\t\t<TabsTrigger value=\"${1:account}\">${2:Account}</TabsTrigger>\n\t\t<TabsTrigger value=\"${3:password}\">${4:Password}</TabsTrigger>\n\t</TabsList>\n\t<TabsContent value=\"${1:account}\">${5}</TabsContent>\n\t<TabsContent value=\"${3:password}\">${6}</TabsContent>\n</Tabs>" },
  379. { label: "shadcn:select", d: ["Lista wyboru shadcn", "shadcn Select"], body:
  380. "<Select>\n\t<SelectTrigger className=\"w-[180px]\">\n\t\t<SelectValue placeholder=\"${1:Select an option}\" />\n\t</SelectTrigger>\n\t<SelectContent>\n\t\t<SelectItem value=\"${2:one}\">${3:One}</SelectItem>\n\t\t<SelectItem value=\"${4:two}\">${5:Two}</SelectItem>\n\t</SelectContent>\n</Select>" },
  381. { label: "shadcn:dropdown", d: ["Menu rozwijane shadcn", "shadcn DropdownMenu"], body:
  382. "<DropdownMenu>\n\t<DropdownMenuTrigger asChild>\n\t\t<Button variant=\"outline\">${1:Open}</Button>\n\t</DropdownMenuTrigger>\n\t<DropdownMenuContent>\n\t\t<DropdownMenuLabel>${2:My account}</DropdownMenuLabel>\n\t\t<DropdownMenuSeparator />\n\t\t<DropdownMenuItem>${3:Profile}</DropdownMenuItem>\n\t\t<DropdownMenuItem>${4:Settings}</DropdownMenuItem>\n\t</DropdownMenuContent>\n</DropdownMenu>" },
  383. { label: "shadcn:alert", d: ["Alert shadcn", "shadcn Alert"], body:
  384. "<Alert variant=\"${1:default}\">\n\t<AlertTitle>${2:Heads up!}</AlertTitle>\n\t<AlertDescription>${3:You can add components to your app.}</AlertDescription>\n</Alert>" },
  385. { label: "shadcn:badge", d: ["Plakietka shadcn", "shadcn Badge"], body:
  386. "<Badge variant=\"${1:default}\">${2:Badge}</Badge>" },
  387. { label: "shadcn:table", d: ["Tabela shadcn", "shadcn Table"], body:
  388. "<Table>\n\t<TableHeader>\n\t\t<TableRow>\n\t\t\t<TableHead>${1:Name}</TableHead>\n\t\t\t<TableHead>${2:Status}</TableHead>\n\t\t</TableRow>\n\t</TableHeader>\n\t<TableBody>\n\t\t<TableRow>\n\t\t\t<TableCell>${3}</TableCell>\n\t\t\t<TableCell>${4}</TableCell>\n\t\t</TableRow>\n\t</TableBody>\n</Table>" },
  389. { label: "shadcn:switch", d: ["Przełącznik shadcn", "shadcn Switch"], body:
  390. "<div className=\"flex items-center gap-2\">\n\t<Switch id=\"${1:airplane-mode}\" />\n\t<Label htmlFor=\"${1:airplane-mode}\">${2:Airplane mode}</Label>\n</div>" },
  391. { label: "shadcn:checkbox", d: ["Pole wyboru shadcn", "shadcn Checkbox"], body:
  392. "<div className=\"flex items-center gap-2\">\n\t<Checkbox id=\"${1:terms}\" />\n\t<Label htmlFor=\"${1:terms}\">${2:Accept terms and conditions}</Label>\n</div>" },
  393. { label: "shadcn:toast", d: ["Powiadomienie (sonner)", "Toast (sonner)"], body:
  394. "toast(\"${1:Saved}\", {\n\tdescription: \"${2:Your changes have been saved.}\"\n})" },
  395. { label: "shadcn:cn", d: ["Funkcja cn() z lib/utils.ts", "The cn() helper from lib/utils.ts"], body:
  396. "import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs))\n}" }
  397. ],
  398. ​
  399. php: [
  400. { label: "echo", d: ["Wypisz", "Print"], body: "echo ${};" },
  401. { label: "if", d: ["Warunek", "Condition"], body: "if (${1:\$condition}) {\n\t${}\n}" },
  402. { label: "ifelse", d: ["Warunek z else", "If / else"], body: "if (${1:\$condition}) {\n\t${2}\n} else {\n\t${}\n}" },
  403. { label: "foreach", d: ["Pętla foreach", "Foreach loop"], body: "foreach (${1:\$items} as ${2:\$item}) {\n\t${}\n}" },
  404. { label: "foreach:kv", d: ["Pętla z kluczem", "Loop with key"], body: "foreach (${1:\$items} as ${2:\$key} => ${3:\$value}) {\n\t${}\n}" },
  405. { label: "for", d: ["Pętla for", "For loop"], body: "for (\$i = 0; \$i < ${1:10}; \$i++) {\n\t${}\n}" },
  406. { label: "while", d: ["Pętla while", "While loop"], body: "while (${1:\$condition}) {\n\t${}\n}" },
  407. { label: "function", d: ["Funkcja", "Function"], body: "function ${1:name}(${2}): ${3:void}\n{\n\t${}\n}" },
  408. { label: "class", d: ["Klasa", "Class"], body: "class ${1:Name}\n{\n\tpublic function __construct(${2})\n\t{\n\t\t${}\n\t}\n}" },
  409. { label: "namespace", d: ["Deklaracja przestrzeni nazw", "Namespace declaration"], body: "namespace ${1:App};\n\n" },
  410. { label: "use", d: ["Import klasy lub przestrzeni nazw", "Import a class or namespace"], body: "use ${1:App\\\\Service\\\\Example};" },
  411. { label: "interface", d: ["Interfejs z metodą", "Interface with a method"], body: "interface ${1:Name}\n{\n\tpublic function ${2:run}(${3}): ${4:void};\n}" },
  412. { label: "trait", d: ["Trait z metodą", "Trait with a method"], body: "trait ${1:Name}\n{\n\tpublic function ${2:run}(): ${3:void}\n\t{\n\t\t${}\n\t}\n}" },
  413. { label: "enum", d: ["Wyliczenie typu string (PHP 8.1+)", "String-backed enum (PHP 8.1+)"], body: "enum ${1:Status}: string\n{\n\tcase ${2:Active} = '${3:active}';\n\tcase ${4:Inactive} = '${5:inactive}';\n}" },
  414. { label: "constructor", d: ["Konstruktor z promocją właściwości", "Constructor with property promotion"], body: "public function __construct(\n\tprivate readonly ${1:string} \$${2:name}\n) {\n\t${}\n}" },
  415. { label: "strict", d: ["Ścisłe typowanie", "Strict typing declaration"], body: "<?php\ndeclare(strict_types=1);\n\n${}" },
  416. { label: "trycatch", d: ["Obsługa wyjątków", "Exception handling"], body: "try {\n\t${}\n} catch (Exception \$e) {\n\techo \$e->getMessage();\n}" },
  417. { label: "trycatch:finally", d: ["Obsługa wyjątku z finally", "Exception handling with finally"], body: "try {\n\t${1:performOperation();}\n} catch (Throwable \$e) {\n\t${2:error_log(\$e->getMessage());}\n} finally {\n\t${}\n}" },
  418. { label: "switch", d: ["Instrukcja switch", "Switch statement"], body: "switch (${1:\$value}) {\n\tcase ${2:1}:\n\t\t${}\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n}" },
  419. { label: "match", d: ["Wyrażenie match (PHP 8)", "Match expression (PHP 8)"], body: "\$${1:result} = match (${2:\$value}) {\n\t${3:1} => ${4:'one'},\n\tdefault => ${5:'other'},\n};" },
  420. { label: "require", d: ["Dołącz plik raz", "Require a file once"], body: "require_once __DIR__ . '/${1:file.php}';" },
  421. { label: "post", d: ["Obsługa formularza POST", "Handle a POST form"], body:
  422. "if (\$_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\$${1:field} = trim(\$_POST['${1:field}'] ?? '');\n\t${}\n}" },
  423. { label: "get", d: ["Bezpieczny odczyt z adresu (GET)", "Safe read from URL (GET)"], body: "\$${1:id} = \$_GET['${1:id}'] ?? ${2:null};" },
  424. { label: "filter:email", d: ["Walidacja adresu e-mail", "Validate an e-mail address"], body: "\$${1:email} = filter_input(INPUT_POST, '${1:email}', FILTER_VALIDATE_EMAIL);\nif (\$${1:email} === false) {\n\t${}\n}" },
  425. { label: "password:hash", d: ["Bezpieczne haszowanie hasła", "Securely hash a password"], body: "\$${1:hash} = password_hash(\$${2:password}, PASSWORD_DEFAULT);" },
  426. { label: "password:verify", d: ["Weryfikacja hasła", "Verify a password"], body: "if (password_verify(\$${1:password}, \$${2:hash})) {\n\t${}\n}" },
  427. { label: "session", d: ["Start sesji", "Start a session"], body: "if (session_status() === PHP_SESSION_NONE) {\n\tsession_start();\n}" },
  428. { label: "csrf", d: ["Generowanie i weryfikacja tokenu CSRF", "CSRF token generation and check"], body:
  429. "if (session_status() === PHP_SESSION_NONE) session_start();\nif (empty(\$_SESSION['csrf_token'])) {\n\t\$_SESSION['csrf_token'] = bin2hex(random_bytes(32));\n}\n\n// weryfikacja przy POST:\nif (!hash_equals(\$_SESSION['csrf_token'], \$_POST['csrf_token'] ?? '')) {\n\thttp_response_code(403);\n\texit('Invalid CSRF token');\n}" },
  430. { label: "redirect", d: ["Przekierowanie", "Redirect"], body: "header('Location: ${1:index.php}');\nexit;" },
  431. { label: "json", d: ["Odpowiedź JSON", "JSON response"], body: "header('Content-Type: application/json; charset=utf-8');\necho json_encode(${1:\$data}, JSON_UNESCAPED_UNICODE);\nexit;" },
  432. { label: "pdo", d: ["Połączenie z bazą (PDO, MySQL)", "Database connection (PDO, MySQL)"], body:
  433. "\$pdo = new PDO(\n\t'mysql:host=${1:localhost};dbname=${2:database};charset=utf8mb4',\n\t'${3:user}',\n\t'${4:password}',\n\t[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]\n);" },
  434. { label: "pdo:sqlite", d: ["Połączenie z bazą (PDO, SQLite)", "Database connection (PDO, SQLite)"], body:
  435. "\$pdo = new PDO(\n\t'sqlite:' . __DIR__ . '/${1:database.sqlite}',\n\tnull,\n\tnull,\n\t[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]\n);" },
  436. { label: "pdo:pgsql", d: ["Połączenie z bazą (PDO, PostgreSQL)", "Database connection (PDO, PostgreSQL)"], body:
  437. "\$pdo = new PDO(\n\t'pgsql:host=${1:localhost};dbname=${2:database}',\n\t'${3:user}',\n\t'${4:password}',\n\t[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]\n);" },
  438. { label: "pdo:select", d: ["Zapytanie SELECT z parametrem", "SELECT query with a parameter"], body:
  439. "\$stmt = \$pdo->prepare('SELECT * FROM ${1:table_name} WHERE ${2:id} = :${2:id}');\n\$stmt->execute(['${2:id}' => ${3:\$id}]);\n\$${4:rows} = \$stmt->fetchAll();" },
  440. { label: "pdo:insert", d: ["Zapytanie INSERT", "INSERT query"], body:
  441. "\$stmt = \$pdo->prepare('INSERT INTO ${1:table_name} (${2:column}) VALUES (:${2:column})');\n\$stmt->execute(['${2:column}' => ${3:\$value}]);" },
  442. { label: "pdo:transaction", d: ["Transakcja PDO z wycofaniem przy błędzie", "PDO transaction with rollback on error"], body:
  443. "try {\n\t\$pdo->beginTransaction();\n\t${1:executeDatabaseOperations();}\n\t\$pdo->commit();\n} catch (Throwable \$e) {\n\tif (\$pdo->inTransaction()) \$pdo->rollBack();\n\tthrow \$e;\n}" },
  444. { label: "mail", d: ["Wysłanie e-maila", "Send an e-mail"], body:
  445. "mail(\n\t'${1:recipient@example.com}',\n\t'${2:Subject}',\n\t${3:\$message},\n\t['From' => '${4:sender@example.com}', 'Content-Type' => 'text/plain; charset=utf-8']\n);" },
  446. { label: "upload", d: ["Odbiór przesłanego pliku", "Handle an uploaded file"], body:
  447. "if (isset(\$_FILES['${1:file}']) && \$_FILES['${1:file}']['error'] === UPLOAD_ERR_OK) {\n\t\$name = basename(\$_FILES['${1:file}']['name']);\n\tmove_uploaded_file(\$_FILES['${1:file}']['tmp_name'], __DIR__ . '/${2:uploads}/' . \$name);\n}" },
  448. { label: "upload:safe", d: ["Odbiór pliku z walidacją typu i rozmiaru", "File upload with type and size validation"], body:
  449. "\$allowed = ['image/jpeg' => 'jpg', 'image/png' => 'png', 'image/webp' => 'webp'];\n\$file = \$_FILES['${1:file}'] ?? null;\nif (\$file && \$file['error'] === UPLOAD_ERR_OK && \$file['size'] <= ${2:2 * 1024 * 1024}) {\n\t\$mime = mime_content_type(\$file['tmp_name']);\n\tif (isset(\$allowed[\$mime])) {\n\t\t\$name = bin2hex(random_bytes(8)) . '.' . \$allowed[\$mime];\n\t\tmove_uploaded_file(\$file['tmp_name'], __DIR__ . '/${3:uploads}/' . \$name);\n\t}\n}" },
  450. { label: "router", d: ["Prosty router regex", "Simple regex router"], body:
  451. "\$routes = [\n\t'~^/${1:page}/([a-z0-9-]+)\$~' => '${2:page.php}',\n];\n\$path = parse_url(\$_SERVER['REQUEST_URI'], PHP_URL_PATH);\nforeach (\$routes as \$pattern => \$file) {\n\tif (preg_match(\$pattern, \$path, \$m)) {\n\t\t\${3:\$slug} = \$m[1];\n\t\trequire __DIR__ . '/' . \$file;\n\t\texit;\n\t}\n}\nhttp_response_code(404);" },
  452. { label: "e", d: ["Funkcja do bezpiecznego wypisywania", "Helper for safe output"], body: "function e(string \$value): string\n{\n\treturn htmlspecialchars(\$value, ENT_QUOTES, 'UTF-8');\n}" }
  453. ],
  454. ​
  455. phpFunctions: [
  456. "echo|echo string ...$values", "print|print(string $arg): int", "isset|isset(mixed $var, ...): bool", "empty|empty(mixed $var): bool",
  457. "unset|unset(mixed $var, ...): void", "var_dump|var_dump(mixed $value, ...): void", "print_r|print_r(mixed $value, bool $return = false): string|bool",
  458. "var_export|var_export(mixed $value, bool $return = false): ?string", "die|die(string|int $status = ''): never", "exit|exit(string|int $status = ''): never",
  459. "strlen|strlen(string $string): int", "mb_strlen|mb_strlen(string $string, ?string $encoding = null): int", "str_replace|str_replace(array|string $search, array|string $replace, string|array $subject): string|array",
  460. "str_contains|str_contains(string $haystack, string $needle): bool", "str_starts_with|str_starts_with(string $haystack, string $needle): bool", "str_ends_with|str_ends_with(string $haystack, string $needle): bool",
  461. "strpos|strpos(string $haystack, string $needle, int $offset = 0): int|false", "stripos|stripos(string $haystack, string $needle, int $offset = 0): int|false", "substr|substr(string $string, int $offset, ?int $length = null): string",
  462. "mb_substr|mb_substr(string $string, int $start, ?int $length = null): string", "strtolower|strtolower(string $string): string", "strtoupper|strtoupper(string $string): string",
  463. "mb_strtolower|mb_strtolower(string $string): string", "mb_strtoupper|mb_strtoupper(string $string): string", "ucfirst|ucfirst(string $string): string", "ucwords|ucwords(string $string): string",
  464. "trim|trim(string $string, string $characters = \" \\n\\r\\t\\v\\x00\"): string", "ltrim|ltrim(string $string): string", "rtrim|rtrim(string $string): string",
  465. "explode|explode(string $separator, string $string, int $limit = PHP_INT_MAX): array", "implode|implode(string $separator, array $array): string", "str_split|str_split(string $string, int $length = 1): array",
  466. "sprintf|sprintf(string $format, mixed ...$values): string", "printf|printf(string $format, mixed ...$values): int", "number_format|number_format(float $num, int $decimals = 0, ?string $decimal_separator = \".\", ?string $thousands_separator = \",\"): string",
  467. "str_pad|str_pad(string $string, int $length, string $pad_string = \" \", int $pad_type = STR_PAD_RIGHT): string", "str_repeat|str_repeat(string $string, int $times): string", "nl2br|nl2br(string $string): string",
  468. "htmlspecialchars|htmlspecialchars(string $string, int $flags = ENT_QUOTES, ?string $encoding = null): string", "html_entity_decode|html_entity_decode(string $string): string", "strip_tags|strip_tags(string $string, array|string|null $allowed_tags = null): string",
  469. "addslashes|addslashes(string $string): string", "urlencode|urlencode(string $string): string", "rawurlencode|rawurlencode(string $string): string", "http_build_query|http_build_query(array|object $data): string",
  470. "preg_match|preg_match(string $pattern, string $subject, array &$matches = null): int|false", "preg_match_all|preg_match_all(string $pattern, string $subject, array &$matches = null): int|false",
  471. "preg_replace|preg_replace(string|array $pattern, string|array $replacement, string|array $subject): string|array|null", "preg_split|preg_split(string $pattern, string $subject): array|false",
  472. "count|count(Countable|array $value): int", "in_array|in_array(mixed $needle, array $haystack, bool $strict = false): bool", "array_key_exists|array_key_exists(string|int $key, array $array): bool",
  473. "array_keys|array_keys(array $array): array", "array_values|array_values(array $array): array", "array_merge|array_merge(array ...$arrays): array", "array_map|array_map(?callable $callback, array $array, array ...$arrays): array",
  474. "array_filter|array_filter(array $array, ?callable $callback = null, int $mode = 0): array", "array_reduce|array_reduce(array $array, callable $callback, mixed $initial = null): mixed",
  475. "array_search|array_search(mixed $needle, array $haystack, bool $strict = false): int|string|false", "array_slice|array_slice(array $array, int $offset, ?int $length = null): array",
  476. "array_splice|array_splice(array &$array, int $offset, ?int $length = null, mixed $replacement = []): array", "array_unique|array_unique(array $array): array", "array_reverse|array_reverse(array $array): array",
  477. "array_push|array_push(array &$array, mixed ...$values): int", "array_pop|array_pop(array &$array): mixed", "array_shift|array_shift(array &$array): mixed", "array_unshift|array_unshift(array &$array, mixed ...$values): int",
  478. "array_column|array_column(array $array, int|string|null $column_key, int|string|null $index_key = null): array", "array_combine|array_combine(array $keys, array $values): array",
  479. "array_fill|array_fill(int $start_index, int $count, mixed $value): array", "array_flip|array_flip(array $array): array", "array_sum|array_sum(array $array): int|float", "array_chunk|array_chunk(array $array, int $length): array",
  480. "array_key_first|array_key_first(array $array): int|string|null", "array_key_last|array_key_last(array $array): int|string|null", "range|range(mixed $start, mixed $end, int|float $step = 1): array",
  481. "sort|sort(array &$array): true", "rsort|rsort(array &$array): true", "usort|usort(array &$array, callable $callback): true", "ksort|ksort(array &$array): true", "asort|asort(array &$array): true", "shuffle|shuffle(array &$array): true",
  482. "json_encode|json_encode(mixed $value, int $flags = 0): string|false", "json_decode|json_decode(string $json, ?bool $associative = null): mixed",
  483. "serialize|serialize(mixed $value): string", "unserialize|unserialize(string $data): mixed",
  484. "is_array|is_array(mixed $value): bool", "is_string|is_string(mixed $value): bool", "is_numeric|is_numeric(mixed $value): bool", "is_int|is_int(mixed $value): bool", "is_null|is_null(mixed $value): bool", "is_bool|is_bool(mixed $value): bool",
  485. "intval|intval(mixed $value, int $base = 10): int", "floatval|floatval(mixed $value): float", "strval|strval(mixed $value): string", "boolval|boolval(mixed $value): bool", "gettype|gettype(mixed $value): string",
  486. "round|round(int|float $num, int $precision = 0): float", "floor|floor(int|float $num): float", "ceil|ceil(int|float $num): float", "abs|abs(int|float $num): int|float", "max|max(mixed $value, mixed ...$values): mixed", "min|min(mixed $value, mixed ...$values): mixed",
  487. "rand|rand(int $min, int $max): int", "random_int|random_int(int $min, int $max): int", "mt_rand|mt_rand(int $min, int $max): int", "pow|pow(mixed $num, mixed $exponent): mixed", "sqrt|sqrt(float $num): float",
  488. "date|date(string $format, ?int $timestamp = null): string", "time|time(): int", "mktime|mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int|false",
  489. "strtotime|strtotime(string $datetime, ?int $baseTimestamp = null): int|false", "checkdate|checkdate(int $month, int $day, int $year): bool", "date_default_timezone_set|date_default_timezone_set(string $timezoneId): bool",
  490. "file_get_contents|file_get_contents(string $filename): string|false", "file_put_contents|file_put_contents(string $filename, mixed $data, int $flags = 0): int|false", "file_exists|file_exists(string $filename): bool",
  491. "is_file|is_file(string $filename): bool", "is_dir|is_dir(string $filename): bool", "mkdir|mkdir(string $directory, int $permissions = 0777, bool $recursive = false): bool", "unlink|unlink(string $filename): bool",
  492. "file|file(string $filename, int $flags = 0): array|false", "fopen|fopen(string $filename, string $mode): resource|false", "fwrite|fwrite(resource $stream, string $data): int|false", "fclose|fclose(resource $stream): bool",
  493. "fgets|fgets(resource $stream): string|false", "scandir|scandir(string $directory): array|false", "glob|glob(string $pattern, int $flags = 0): array|false", "basename|basename(string $path, string $suffix = \"\"): string",
  494. "dirname|dirname(string $path, int $levels = 1): string", "pathinfo|pathinfo(string $path): array|string", "realpath|realpath(string $path): string|false", "move_uploaded_file|move_uploaded_file(string $from, string $to): bool",
  495. "header|header(string $header, bool $replace = true, int $response_code = 0): void", "http_response_code|http_response_code(int $response_code = 0): int|bool", "headers_sent|headers_sent(): bool",
  496. "setcookie|setcookie(string $name, string $value = \"\", array $options = []): bool", "session_start|session_start(array $options = []): bool", "session_destroy|session_destroy(): bool", "session_regenerate_id|session_regenerate_id(bool $delete_old_session = false): bool",
  497. "password_hash|password_hash(string $password, string|int|null $algo = PASSWORD_DEFAULT): string", "password_verify|password_verify(string $password, string $hash): bool",
  498. "md5|md5(string $string): string", "sha1|sha1(string $string): string", "hash|hash(string $algo, string $data): string", "bin2hex|bin2hex(string $string): string", "random_bytes|random_bytes(int $length): string",
  499. "base64_encode|base64_encode(string $string): string", "base64_decode|base64_decode(string $string): string|false", "uniqid|uniqid(string $prefix = \"\"): string",
  500. "filter_var|filter_var(mixed $value, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed", "filter_input|filter_input(int $type, string $var_name, int $filter = FILTER_DEFAULT): mixed",
  501. "mail|mail(string $to, string $subject, string $message, array|string $additional_headers = []): bool", "function_exists|function_exists(string $function): bool", "method_exists|method_exists(object|string $object_or_class, string $method): bool",
  502. "class_exists|class_exists(string $class): bool", "define|define(string $constant_name, mixed $value): bool", "defined|defined(string $constant_name): bool", "compact|compact(array|string $var_name, ...): array",
  503. "extract|extract(array &$array): int", "ob_start|ob_start(): bool", "ob_get_clean|ob_get_clean(): string|false", "error_reporting|error_reporting(?int $error_level = null): int", "ini_set|ini_set(string $option, string|int|float|bool|null $value): string|false",
  504. "spl_autoload_register|spl_autoload_register(?callable $callback = null): bool", "curl_init|curl_init(?string $url = null): CurlHandle|false", "curl_setopt|curl_setopt(CurlHandle $handle, int $option, mixed $value): bool",
  505. "curl_exec|curl_exec(CurlHandle $handle): string|bool", "curl_close|curl_close(CurlHandle $handle): void", "mb_internal_encoding|mb_internal_encoding(?string $encoding = null): string|bool"
  506. ],
  507. ​
  508. phpVariables: ["$_GET", "$_POST", "$_SERVER", "$_SESSION", "$_COOKIE", "$_FILES", "$_REQUEST", "$_ENV", "$GLOBALS", "$this"],
  509. ​
  510. phpKeywords: ["abstract", "and", "array", "as", "break", "case", "catch", "class", "clone", "const", "continue", "declare", "default", "do",
  511. "else", "elseif", "enum", "extends", "false", "final", "finally", "fn", "for", "foreach", "function", "global", "if", "implements", "include",
  512. "include_once", "instanceof", "interface", "match", "namespace", "new", "null", "or", "private", "protected", "public", "readonly", "require",
  513. "require_once", "return", "static", "switch", "throw", "trait", "true", "try", "use", "while", "yield", "__DIR__", "__FILE__", "__LINE__",
  514. "PHP_EOL", "PHP_VERSION", "ENT_QUOTES", "FILTER_VALIDATE_EMAIL", "FILTER_VALIDATE_INT", "JSON_PRETTY_PRINT", "JSON_UNESCAPED_UNICODE", "PASSWORD_DEFAULT"]
  515. };
  516. })();