commit 97b1c25e76603fed572a8a14c13997a63360dc18 Author: Mats Bosson Date: Sat Apr 26 01:23:45 1986 +0300 Initial commit diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,2 @@ +{ +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c43cd57 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +dist/ +.tsdown/ +coverage/ +*.tsbuildinfo +.superpowers/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..619011b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 StayThree + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6fc5246 --- /dev/null +++ b/README.md @@ -0,0 +1,107 @@ +# PettyUI + +51 headless Web Components. Zero dependencies. ~5KB gzipped. + +Built on browser-native APIs — Popover, ``, Navigation API, View Transitions. No framework required. Works everywhere. + +## Install + +```bash +npm install pettyui +``` + +## Usage + +Import what you need. Each component registers itself as a Custom Element. + +```html + + + + + +

Hello

+

This is a native dialog with ARIA linking, focus trap, and Escape — all from the browser.

+ +
+
+``` + +## Components + +**Inputs** — Button, TextField, NumberField, Checkbox, Switch, RadioGroup, Slider, Toggle, ToggleGroup, Select, Combobox, Listbox, TagsInput, Form, DatePicker + +**Navigation** — Link, Breadcrumbs, Tabs, Accordion, Collapsible, Pagination, NavigationMenu, Wizard + +**Overlays** — Dialog, AlertDialog, Drawer, Popover, Tooltip, HoverCard, DropdownMenu, ContextMenu, CommandPalette + +**Feedback** — Alert, Toast, Progress, Meter, LoadingIndicator + +**Layout** — Avatar, Badge, Card, Image, Separator, Skeleton + +**Data** — Calendar, DataTable, VirtualList + +**Animation** — Typewriter, Counter, Stagger, Reveal, Parallax + +## Why + +- **Zero runtime** — 750-byte signals core. No virtual DOM, no framework overhead. +- **Browser-native** — Popover API for overlays, `` for modals, Navigation API for routing. No polyfills. +- **No Shadow DOM** — Style with plain CSS, Tailwind, or anything. No `::part()` needed. +- **AI-native** — Zod schemas for every component. MCP tools for agent integration. +- **Works everywhere** — React, Vue, Svelte, Astro, plain HTML. It's just Custom Elements. + +## Styling + +PettyUI is headless. Components use `data-state` and `data-part` attributes for styling hooks. + +```css +petty-tab[data-state="active"] { + border-bottom: 2px solid blue; +} + +petty-switch[data-state="on"] [data-part="thumb"] { + transform: translateX(18px); +} +``` + +Optional default theme and animations: + +```js +import "pettyui/theme"; +import "pettyui/animations"; +``` + +## Signals + +Built-in reactivity in ~30 lines (~500 bytes): + +```js +import { signal, effect } from "pettyui/signals"; + +const count = signal(0); +effect(() => console.log(count.get())); +count.set(1); // logs 1 +``` + +## Router + +SPA routing with the Navigation API (~15 lines): + +```js +import { initRouter } from "pettyui/router"; +initRouter(); +``` + +```html +About +
+``` + +## License + +MIT diff --git a/package.json b/package.json new file mode 100644 index 0000000..7305dc5 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "pettyui-monorepo", + "private": true, + "scripts": { + "build": "pnpm -r build", + "test": "pnpm -r test", + "typecheck": "pnpm -r typecheck" + }, + "devDependencies": { + "typescript": "^6.0.2" + } +} diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..375c446 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,77 @@ +{ + "name": "pettyui", + "version": "2.0.0-alpha.0", + "description": "Zero-dependency headless Web Components built on browser standards. AI-native.", + "type": "module", + "exports": { + "./signals": "./src/signals.ts", + "./router": "./src/router.ts", + "./theme": "./src/theme.css", + "./animations": "./src/animations.css", + "./counter": "./src/components/counter/index.ts", + "./accordion": "./src/components/accordion/index.ts", + "./alert": "./src/components/alert/index.ts", + "./alert-dialog": "./src/components/alert-dialog/index.ts", + "./avatar": "./src/components/avatar/index.ts", + "./badge": "./src/components/badge/index.ts", + "./breadcrumbs": "./src/components/breadcrumbs/index.ts", + "./button": "./src/components/button/index.ts", + "./calendar": "./src/components/calendar/index.ts", + "./card": "./src/components/card/index.ts", + "./checkbox": "./src/components/checkbox/index.ts", + "./collapsible": "./src/components/collapsible/index.ts", + "./combobox": "./src/components/combobox/index.ts", + "./command-palette": "./src/components/command-palette/index.ts", + "./context-menu": "./src/components/context-menu/index.ts", + "./data-table": "./src/components/data-table/index.ts", + "./date-picker": "./src/components/date-picker/index.ts", + "./dialog": "./src/components/dialog/index.ts", + "./drawer": "./src/components/drawer/index.ts", + "./dropdown-menu": "./src/components/dropdown-menu/index.ts", + "./form": "./src/components/form/index.ts", + "./hover-card": "./src/components/hover-card/index.ts", + "./image": "./src/components/image/index.ts", + "./link": "./src/components/link/index.ts", + "./loading-indicator": "./src/components/loading-indicator/index.ts", + "./listbox": "./src/components/listbox/index.ts", + "./meter": "./src/components/meter/index.ts", + "./navigation-menu": "./src/components/navigation-menu/index.ts", + "./number-field": "./src/components/number-field/index.ts", + "./pagination": "./src/components/pagination/index.ts", + "./popover": "./src/components/popover/index.ts", + "./progress": "./src/components/progress/index.ts", + "./radio-group": "./src/components/radio-group/index.ts", + "./select": "./src/components/select/index.ts", + "./separator": "./src/components/separator/index.ts", + "./skeleton": "./src/components/skeleton/index.ts", + "./slider": "./src/components/slider/index.ts", + "./switch": "./src/components/switch/index.ts", + "./tabs": "./src/components/tabs/index.ts", + "./text-field": "./src/components/text-field/index.ts", + "./toast": "./src/components/toast/index.ts", + "./toggle": "./src/components/toggle/index.ts", + "./toggle-group": "./src/components/toggle-group/index.ts", + "./tooltip": "./src/components/tooltip/index.ts", + "./virtual-list": "./src/components/virtual-list/index.ts", + "./tags-input": "./src/components/tags-input/index.ts", + "./typewriter": "./src/components/typewriter/index.ts", + "./stagger": "./src/components/stagger/index.ts", + "./reveal": "./src/components/reveal/index.ts", + "./parallax": "./src/components/parallax/index.ts", + "./wizard": "./src/components/wizard/index.ts" + }, + "scripts": { + "build": "tsdown", + "test": "vitest run", + "test:watch": "vitest", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "zod": "^4.3.6" + }, + "devDependencies": { + "tsdown": "^0.21.7", + "typescript": "^6.0.2", + "vitest": "^4.1.2" + } +} diff --git a/packages/core/src/animations.css b/packages/core/src/animations.css new file mode 100644 index 0000000..ab6ca42 --- /dev/null +++ b/packages/core/src/animations.css @@ -0,0 +1,122 @@ +/* PettyUI Animations — stagger, reveal, and transition CSS */ + +.petty-stagger-hidden { opacity: 0; } + +.petty-stagger-fade-up { + animation: pettyFadeUp 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-stagger-fade-down { + animation: pettyFadeDown 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-stagger-fade-left { + animation: pettyFadeLeft 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-stagger-fade-right { + animation: pettyFadeRight 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-stagger-scale { + animation: pettyScale 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-stagger-blur { + animation: pettyBlur 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} + +.petty-reveal-hidden { opacity: 0; } + +.petty-reveal-fade-up { + animation: pettyFadeUp 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-reveal-fade-down { + animation: pettyFadeDown 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-reveal-fade-left { + animation: pettyFadeLeft 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-reveal-fade-right { + animation: pettyFadeRight 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-reveal-scale { + animation: pettyScale 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} +.petty-reveal-blur { + animation: pettyBlur 0.5s cubic-bezier(0.2, 0, 0, 1) both; +} + +petty-typewriter.petty-typewriter-cursor::after { + content: "|"; + animation: pettyCursorBlink 0.8s step-end infinite; +} +petty-typewriter[data-state="done"].petty-typewriter-cursor::after { + animation: pettyCursorBlink 0.8s step-end 3; +} + +petty-counter { font-variant-numeric: tabular-nums; } + +@keyframes pettyFadeUp { + from { opacity: 0; transform: translateY(20px); } + to { opacity: 1; transform: translateY(0); } +} +@keyframes pettyFadeDown { + from { opacity: 0; transform: translateY(-20px); } + to { opacity: 1; transform: translateY(0); } +} +@keyframes pettyFadeLeft { + from { opacity: 0; transform: translateX(20px); } + to { opacity: 1; transform: translateX(0); } +} +@keyframes pettyFadeRight { + from { opacity: 0; transform: translateX(-20px); } + to { opacity: 1; transform: translateX(0); } +} +@keyframes pettyScale { + from { opacity: 0; transform: scale(0.9); } + to { opacity: 1; transform: scale(1); } +} +@keyframes pettyBlur { + from { opacity: 0; filter: blur(8px); transform: translateY(10px); } + to { opacity: 1; filter: blur(0); transform: translateY(0); } +} +@keyframes pettyCursorBlink { + 0%, 100% { opacity: 1; } + 50% { opacity: 0; } +} + +dialog[open] { + animation: pettyDialogIn 0.2s cubic-bezier(0.2, 0, 0, 1); +} +@keyframes pettyDialogIn { + from { opacity: 0; transform: translateY(8px) scale(0.98); } + to { opacity: 1; transform: translateY(0) scale(1); } +} + +[popover]:popover-open { + animation: pettyPopoverIn 0.15s cubic-bezier(0.2, 0, 0, 1); +} +@keyframes pettyPopoverIn { + from { opacity: 0; transform: translateY(-4px); } + to { opacity: 1; transform: translateY(0); } +} + +[data-part="toast"] { + animation: pettySlideIn 0.3s cubic-bezier(0.2, 0, 0, 1); +} +@keyframes pettySlideIn { + from { opacity: 0; transform: translateX(100%); } + to { opacity: 1; transform: translateX(0); } +} + +petty-loading-indicator { display: inline-flex; align-items: center; justify-content: center; position: relative; } +petty-loading-indicator [data-part="container"] { display: flex; align-items: center; justify-content: center; position: relative; } + +petty-loading-indicator [data-part="indicator"] { + border-radius: 50%; + border: 3px solid rgba(54, 192, 241, 0.12); + border-top-color: #36c0f1; + border-right-color: rgba(54, 192, 241, 0.4); + animation: pettyLoadSpin 0.9s linear infinite; +} + +@keyframes pettyLoadSpin { + to { rotate: 360deg; } +} + diff --git a/packages/core/src/components/accordion/accordion-item.ts b/packages/core/src/components/accordion/accordion-item.ts new file mode 100644 index 0000000..7a5edcc --- /dev/null +++ b/packages/core/src/components/accordion/accordion-item.ts @@ -0,0 +1,82 @@ +import { listen } from "../../shared/helpers"; + +/** + * PettyAccordionItem — wraps a single `
` element within a PettyAccordion. + * + * Usage: + * ```html + * + *
+ * Section 1 + *
Content 1
+ *
+ *
+ * ``` + * + * Manages data-state ("open" | "closed") and disabled behaviour on the + * underlying `
` and `` elements. + */ +export class PettyAccordionItem extends HTMLElement { + static observedAttributes = ["value", "disabled"]; + + /** The `
` element nested directly inside this item. */ + get detailsElement(): HTMLDetailsElement | null { + return this.querySelector("details"); + } + + /** Whether the item's details element is currently open. */ + get isOpen(): boolean { + return this.detailsElement?.open ?? false; + } + + /** The value attribute, falling back to summary text content. */ + get value(): string { + const explicit = this.getAttribute("value"); + if (explicit !== null) return explicit; + return this.querySelector("summary")?.textContent?.trim() ?? ""; + } + + #cleanup = (): void => {}; + + /** @internal */ + connectedCallback(): void { + this.#syncState(); + this.#applyDisabled(); + this.#cleanup = listen(this.detailsElement, [["toggle", this.#handleToggle]]); + } + + /** @internal */ + disconnectedCallback(): void { + this.#cleanup(); + } + + /** @internal */ + attributeChangedCallback(name: string): void { + if (name === "disabled") this.#applyDisabled(); + } + + #handleToggle = (): void => { + this.#syncState(); + }; + + #syncState(): void { + const details = this.detailsElement; + const state = details?.open ? "open" : "closed"; + this.setAttribute("data-state", state); + const summary = details?.querySelector("summary"); + if (summary) summary.setAttribute("aria-expanded", String(details?.open ?? false)); + } + + #applyDisabled(): void { + const disabled = this.hasAttribute("disabled"); + const summary = this.detailsElement?.querySelector("summary"); + if (!summary) return; + if (disabled) { + summary.setAttribute("aria-disabled", "true"); + summary.setAttribute("tabindex", "-1"); + } else { + summary.removeAttribute("aria-disabled"); + summary.removeAttribute("tabindex"); + } + } +} diff --git a/packages/core/src/components/accordion/accordion.schema.ts b/packages/core/src/components/accordion/accordion.schema.ts new file mode 100644 index 0000000..e8e9526 --- /dev/null +++ b/packages/core/src/components/accordion/accordion.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-accordion", description: "Headless accordion built on native
elements with single/multiple mode", tier: 1, attributes: [{ name: "type", type: "string", default: "single", description: "Accordion mode: single closes others on open, multiple allows many open" }], parts: [{ name: "content", element: "div", description: "Content area inside each details element" }], events: [{ name: "petty-change", detail: "{ value: string[] }", description: "Fires when open items change, detail contains array of open values" }], example: `
Section 1
Content 1
` }; diff --git a/packages/core/src/components/accordion/accordion.ts b/packages/core/src/components/accordion/accordion.ts new file mode 100644 index 0000000..c8d8b0c --- /dev/null +++ b/packages/core/src/components/accordion/accordion.ts @@ -0,0 +1,82 @@ +import { emit, listen } from "../../shared/helpers"; + +/** + * PettyAccordion — headless accordion built on native `
` elements. + * + * Usage: + * ```html + * + * + *
+ * Section 1 + *
Content 1
+ *
+ *
+ * + *
+ * Section 2 + *
Content 2
+ *
+ *
+ *
+ * ``` + * + * The browser handles: open/close toggle, keyboard navigation within summary. + * This element adds: single/multiple mode, petty-change event with open values. + */ +export class PettyAccordion extends HTMLElement { + static observedAttributes = ["type"]; + + /** The accordion mode: "single" closes others on open, "multiple" allows many open. */ + get type(): "single" | "multiple" { + const val = this.getAttribute("type"); + return val === "multiple" ? "multiple" : "single"; + } + + /** @internal */ + connectedCallback(): void { + this.addEventListener("toggle", this.#handleToggle, true); + } + + /** @internal */ + disconnectedCallback(): void { + this.removeEventListener("toggle", this.#handleToggle, true); + } + + #handleToggle = (event: Event): void => { + const target = event.target; + if (!(target instanceof HTMLDetailsElement)) return; + + if (this.type === "single" && target.open) { + this.#closeOthers(target); + } + + this.#dispatchChange(); + }; + + #closeOthers(opened: HTMLDetailsElement): void { + const items = this.querySelectorAll("details"); + items.forEach((details) => { + if (details !== opened && details.open) { + details.open = false; + } + }); + } + + #dispatchChange(): void { + const openValues = this.#collectOpenValues(); + emit(this, "change", { value: openValues }); + } + + #collectOpenValues(): string[] { + const items = this.querySelectorAll("petty-accordion-item"); + const values: string[] = []; + items.forEach((item) => { + const details = item.querySelector("details"); + if (!details?.open) return; + const val = item.getAttribute("value") ?? item.querySelector("summary")?.textContent?.trim() ?? ""; + if (val) values.push(val); + }); + return values; + } +} diff --git a/packages/core/src/components/accordion/index.ts b/packages/core/src/components/accordion/index.ts new file mode 100644 index 0000000..53b2216 --- /dev/null +++ b/packages/core/src/components/accordion/index.ts @@ -0,0 +1,8 @@ +import { PettyAccordion } from "./accordion"; +import { PettyAccordionItem } from "./accordion-item"; +export { PettyAccordion, PettyAccordionItem }; + +if (!customElements.get("petty-accordion")) { + customElements.define("petty-accordion", PettyAccordion); + customElements.define("petty-accordion-item", PettyAccordionItem); +} diff --git a/packages/core/src/components/alert-dialog/alert-dialog.schema.ts b/packages/core/src/components/alert-dialog/alert-dialog.schema.ts new file mode 100644 index 0000000..03516f5 --- /dev/null +++ b/packages/core/src/components/alert-dialog/alert-dialog.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-alert-dialog", description: "Confirmation dialog with role=alertdialog on native dialog element", tier: 3, attributes: [], parts: [], events: [{ name: "petty-close", detail: "{ value: string }", description: "Fires when dialog closes, detail contains the return value" }], example: `

Confirm

Are you sure?

` }; diff --git a/packages/core/src/components/alert-dialog/alert-dialog.ts b/packages/core/src/components/alert-dialog/alert-dialog.ts new file mode 100644 index 0000000..1749a4c --- /dev/null +++ b/packages/core/src/components/alert-dialog/alert-dialog.ts @@ -0,0 +1,59 @@ +import { emit, listen } from "../../shared/helpers"; +import { uniqueId } from "../../shared/aria"; + +/** PettyAlertDialog — confirmation dialog with role="alertdialog" on native dialog. */ +export class PettyAlertDialog extends HTMLElement { + #cleanup: (() => void) | null = null; + + get dialogElement(): HTMLDialogElement | null { + return this.querySelector("dialog"); + } + + get isOpen(): boolean { + return this.dialogElement?.open ?? false; + } + + /** Opens the alert dialog as a modal. */ + open(): void { + const dlg = this.dialogElement; + if (dlg && !dlg.open) dlg.showModal(); + } + + /** Closes the alert dialog with an optional return value. */ + close(returnValue?: string): void { + const dlg = this.dialogElement; + if (dlg?.open) dlg.close(returnValue); + } + + connectedCallback(): void { + const dlg = this.dialogElement; + if (!dlg) return; + dlg.setAttribute("role", "alertdialog"); + dlg.setAttribute("aria-modal", "true"); + this.#linkAria(dlg); + this.#cleanup = listen(dlg, [["close", this.#handleClose]]); + } + + disconnectedCallback(): void { + this.#cleanup?.(); + this.#cleanup = null; + } + + #handleClose = (): void => { + const dlg = this.dialogElement; + emit(this, "close", { value: dlg?.returnValue ?? "" }); + }; + + #linkAria(dlg: HTMLDialogElement): void { + const heading = dlg.querySelector("h1, h2, h3, h4, h5, h6"); + if (heading) { + if (!heading.id) heading.id = uniqueId("petty-adlg-title"); + dlg.setAttribute("aria-labelledby", heading.id); + } + const desc = dlg.querySelector("p"); + if (desc) { + if (!desc.id) desc.id = uniqueId("petty-adlg-desc"); + dlg.setAttribute("aria-describedby", desc.id); + } + } +} diff --git a/packages/core/src/components/alert-dialog/index.ts b/packages/core/src/components/alert-dialog/index.ts new file mode 100644 index 0000000..991ab69 --- /dev/null +++ b/packages/core/src/components/alert-dialog/index.ts @@ -0,0 +1,6 @@ +import { PettyAlertDialog } from "./alert-dialog"; +export { PettyAlertDialog }; + +if (!customElements.get("petty-alert-dialog")) { + customElements.define("petty-alert-dialog", PettyAlertDialog); +} diff --git a/packages/core/src/components/alert/alert.schema.ts b/packages/core/src/components/alert/alert.schema.ts new file mode 100644 index 0000000..24b2b91 --- /dev/null +++ b/packages/core/src/components/alert/alert.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-alert", description: "Inline status message with variant-driven ARIA role", tier: 1, attributes: [{ name: "variant", type: "string", default: "default", description: "Alert variant: default, error, warning, success, info. Error/warning sets role=alert" }], parts: [], events: [], example: `

Something went wrong.

` }; diff --git a/packages/core/src/components/alert/alert.ts b/packages/core/src/components/alert/alert.ts new file mode 100644 index 0000000..7e215dd --- /dev/null +++ b/packages/core/src/components/alert/alert.ts @@ -0,0 +1,23 @@ +/** PettyAlert — inline status message with variant-driven ARIA role. */ +export class PettyAlert extends HTMLElement { + static observedAttributes = ["variant"]; + + get variant(): string { + return this.getAttribute("variant") ?? "default"; + } + + connectedCallback(): void { + this.#sync(); + } + + attributeChangedCallback(): void { + this.#sync(); + } + + #sync(): void { + const v = this.variant; + this.dataset.variant = v; + const isUrgent = v === "error" || v === "warning"; + this.setAttribute("role", isUrgent ? "alert" : "status"); + } +} diff --git a/packages/core/src/components/alert/index.ts b/packages/core/src/components/alert/index.ts new file mode 100644 index 0000000..53aeb2c --- /dev/null +++ b/packages/core/src/components/alert/index.ts @@ -0,0 +1,6 @@ +import { PettyAlert } from "./alert"; +export { PettyAlert }; + +if (!customElements.get("petty-alert")) { + customElements.define("petty-alert", PettyAlert); +} diff --git a/packages/core/src/components/avatar/avatar.schema.ts b/packages/core/src/components/avatar/avatar.schema.ts new file mode 100644 index 0000000..4ac0c2d --- /dev/null +++ b/packages/core/src/components/avatar/avatar.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-avatar", description: "Image with automatic fallback display on load error", tier: 3, attributes: [], parts: [{ name: "fallback", element: "span", description: "Fallback content shown when image fails to load" }], events: [], example: `UserAB` }; diff --git a/packages/core/src/components/avatar/avatar.ts b/packages/core/src/components/avatar/avatar.ts new file mode 100644 index 0000000..6968af5 --- /dev/null +++ b/packages/core/src/components/avatar/avatar.ts @@ -0,0 +1,40 @@ +import { listen } from "../../shared/helpers"; + +/** PettyAvatar — image with automatic fallback on load error. */ +export class PettyAvatar extends HTMLElement { + connectedCallback(): void { + this.dataset.state = "loading"; + const img = this.querySelector("img"); + if (!img) { this.#showFallback(); return; } + img.addEventListener("load", this.#onLoad); + img.addEventListener("error", this.#onError); + if (img.complete && img.naturalWidth > 0) this.#onLoad(); + else if (img.complete) this.#onError(); + } + + disconnectedCallback(): void { + const img = this.querySelector("img"); + img?.removeEventListener("load", this.#onLoad); + img?.removeEventListener("error", this.#onError); + } + + #onLoad = (): void => { + this.dataset.state = "loaded"; + const img = this.querySelector("img"); + const fallback = this.querySelector("[data-part=fallback]") as HTMLElement | null; + if (img) img.style.display = ""; + if (fallback) fallback.style.display = "none"; + }; + + #onError = (): void => { + this.dataset.state = "error"; + this.#showFallback(); + }; + + #showFallback(): void { + const img = this.querySelector("img"); + const fallback = this.querySelector("[data-part=fallback]") as HTMLElement | null; + if (img) img.style.display = "none"; + if (fallback) fallback.style.display = ""; + } +} diff --git a/packages/core/src/components/avatar/index.ts b/packages/core/src/components/avatar/index.ts new file mode 100644 index 0000000..67c504c --- /dev/null +++ b/packages/core/src/components/avatar/index.ts @@ -0,0 +1,6 @@ +import { PettyAvatar } from "./avatar"; +export { PettyAvatar }; + +if (!customElements.get("petty-avatar")) { + customElements.define("petty-avatar", PettyAvatar); +} diff --git a/packages/core/src/components/badge/badge.schema.ts b/packages/core/src/components/badge/badge.schema.ts new file mode 100644 index 0000000..cfb769b --- /dev/null +++ b/packages/core/src/components/badge/badge.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-badge", description: "Display-only status indicator with variant support", tier: 3, attributes: [{ name: "variant", type: "string", default: "default", description: "Visual variant for styling" }], parts: [{ name: "badge", element: "span", description: "The badge element itself (set automatically)" }], events: [], example: `Active` }; diff --git a/packages/core/src/components/badge/badge.ts b/packages/core/src/components/badge/badge.ts new file mode 100644 index 0000000..63eeda2 --- /dev/null +++ b/packages/core/src/components/badge/badge.ts @@ -0,0 +1,17 @@ +/** PettyBadge — display-only status indicator with variant support. */ +export class PettyBadge extends HTMLElement { + static observedAttributes = ["variant"]; + + get variant(): string { + return this.getAttribute("variant") ?? "default"; + } + + connectedCallback(): void { + this.dataset.variant = this.variant; + this.dataset.part = "badge"; + } + + attributeChangedCallback(): void { + this.dataset.variant = this.variant; + } +} diff --git a/packages/core/src/components/badge/index.ts b/packages/core/src/components/badge/index.ts new file mode 100644 index 0000000..8cff55e --- /dev/null +++ b/packages/core/src/components/badge/index.ts @@ -0,0 +1,6 @@ +import { PettyBadge } from "./badge"; +export { PettyBadge }; + +if (!customElements.get("petty-badge")) { + customElements.define("petty-badge", PettyBadge); +} diff --git a/packages/core/src/components/breadcrumbs/breadcrumb-item.ts b/packages/core/src/components/breadcrumbs/breadcrumb-item.ts new file mode 100644 index 0000000..814cf79 --- /dev/null +++ b/packages/core/src/components/breadcrumbs/breadcrumb-item.ts @@ -0,0 +1,24 @@ +/** PettyBreadcrumbItem — single breadcrumb with current-page detection. */ +export class PettyBreadcrumbItem extends HTMLElement { + static observedAttributes = ["current"]; + + connectedCallback(): void { + this.dataset.part = "item"; + this.#sync(); + } + + attributeChangedCallback(): void { + this.#sync(); + } + + #sync(): void { + const isCurrent = this.hasAttribute("current"); + const target = this.querySelector("a") ?? this; + if (isCurrent) { + target.setAttribute("aria-current", "page"); + } else { + target.removeAttribute("aria-current"); + } + this.dataset.state = isCurrent ? "current" : "default"; + } +} diff --git a/packages/core/src/components/breadcrumbs/breadcrumbs.schema.ts b/packages/core/src/components/breadcrumbs/breadcrumbs.schema.ts new file mode 100644 index 0000000..eae828b --- /dev/null +++ b/packages/core/src/components/breadcrumbs/breadcrumbs.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-breadcrumbs", description: "Navigation breadcrumb trail with ARIA landmarks", tier: 3, attributes: [], parts: [{ name: "item", element: "li", description: "Individual breadcrumb item (on petty-breadcrumb-item)" }], events: [], example: `
    HomeDocs
` }; diff --git a/packages/core/src/components/breadcrumbs/breadcrumbs.ts b/packages/core/src/components/breadcrumbs/breadcrumbs.ts new file mode 100644 index 0000000..385ecf3 --- /dev/null +++ b/packages/core/src/components/breadcrumbs/breadcrumbs.ts @@ -0,0 +1,11 @@ +/** PettyBreadcrumbs — navigation breadcrumb trail with ARIA landmarks. */ +export class PettyBreadcrumbs extends HTMLElement { + connectedCallback(): void { + if (!this.querySelector("nav")) { + this.setAttribute("role", "navigation"); + } + this.setAttribute("aria-label", this.getAttribute("aria-label") ?? "Breadcrumb"); + const list = this.querySelector("ol, ul"); + if (list) list.setAttribute("role", "list"); + } +} diff --git a/packages/core/src/components/breadcrumbs/index.ts b/packages/core/src/components/breadcrumbs/index.ts new file mode 100644 index 0000000..bc28246 --- /dev/null +++ b/packages/core/src/components/breadcrumbs/index.ts @@ -0,0 +1,8 @@ +import { PettyBreadcrumbs } from "./breadcrumbs"; +import { PettyBreadcrumbItem } from "./breadcrumb-item"; +export { PettyBreadcrumbs, PettyBreadcrumbItem }; + +if (!customElements.get("petty-breadcrumbs")) { + customElements.define("petty-breadcrumbs", PettyBreadcrumbs); + customElements.define("petty-breadcrumb-item", PettyBreadcrumbItem); +} diff --git a/packages/core/src/components/button/button.schema.ts b/packages/core/src/components/button/button.schema.ts new file mode 100644 index 0000000..acaa7a7 --- /dev/null +++ b/packages/core/src/components/button/button.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-button", description: "Headless button wrapper with loading and disabled states", tier: 3, attributes: [{ name: "disabled", type: "boolean", description: "Disables the button" }, { name: "loading", type: "boolean", description: "Shows loading state, disables interaction" }], parts: [], events: [], example: `` }; diff --git a/packages/core/src/components/button/button.ts b/packages/core/src/components/button/button.ts new file mode 100644 index 0000000..0a4d986 --- /dev/null +++ b/packages/core/src/components/button/button.ts @@ -0,0 +1,53 @@ +/** + * PettyButton — headless button wrapper with loading and disabled states. + * + * Usage: + * ```html + * + * + * + * ``` + */ +export class PettyButton extends HTMLElement { + static observedAttributes = ["disabled", "loading"]; + + /** The child `
` }; diff --git a/packages/core/src/components/calendar/calendar.ts b/packages/core/src/components/calendar/calendar.ts new file mode 100644 index 0000000..47fbe53 --- /dev/null +++ b/packages/core/src/components/calendar/calendar.ts @@ -0,0 +1,93 @@ +import { signal, effect } from "../../signals"; +import { emit, listen } from "../../shared/helpers"; + +/** PettyCalendar — month grid with day selection and month navigation. */ +export class PettyCalendar extends HTMLElement { + static observedAttributes = ["value", "min", "max"]; + + readonly #month = signal(new Date().getMonth()); + readonly #year = signal(new Date().getFullYear()); + readonly #selected = signal(""); + #stopEffect: (() => void) | null = null; + + get value(): string { return this.#selected.get(); } + set value(v: string) { this.#selected.set(v); } + + connectedCallback(): void { + const init = this.getAttribute("value") ?? ""; + if (init) { this.#selected.set(init); this.#parseMonth(init); } + this.#stopEffect = effect(() => this.#render()); + this.querySelector("[data-part=prev-month]")?.addEventListener("click", this.#onPrev); + this.querySelector("[data-part=next-month]")?.addEventListener("click", this.#onNext); + this.addEventListener("click", this.#onDayClick); + } + + disconnectedCallback(): void { + this.#stopEffect = null; + this.querySelector("[data-part=prev-month]")?.removeEventListener("click", this.#onPrev); + this.querySelector("[data-part=next-month]")?.removeEventListener("click", this.#onNext); + this.removeEventListener("click", this.#onDayClick); + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next) { this.#selected.set(next); this.#parseMonth(next); } + } + + #parseMonth(dateStr: string): void { + const d = new Date(dateStr); + if (!Number.isNaN(d.getTime())) { this.#month.set(d.getMonth()); this.#year.set(d.getFullYear()); } + } + + #onPrev = (): void => { + if (this.#month.get() === 0) { this.#month.set(11); this.#year.set(this.#year.get() - 1); } + else this.#month.set(this.#month.get() - 1); + }; + + #onNext = (): void => { + if (this.#month.get() === 11) { this.#month.set(0); this.#year.set(this.#year.get() + 1); } + else this.#month.set(this.#month.get() + 1); + }; + + #onDayClick = (e: Event): void => { + const btn = (e.target as HTMLElement).closest("[data-date]"); + if (!btn || btn.hasAttribute("data-disabled")) return; + const date = (btn as HTMLElement).dataset.date ?? ""; + this.#selected.set(date); + emit(this, "change", { value: date }); + }; + + #createDayCell(day: number, iso: string, sel: string, today: string): HTMLTableCellElement { + const td = document.createElement("td"); + const btn = document.createElement("button"); + btn.dataset.date = iso; + btn.dataset.part = "day"; + btn.setAttribute("role", "gridcell"); + btn.textContent = String(day); + if (iso === sel) btn.dataset.state = "selected"; + if (iso === today) btn.dataset.state = btn.dataset.state ? `${btn.dataset.state} today` : "today"; + td.appendChild(btn); + return td; + } + + #render(): void { + const m = this.#month.get(); + const y = this.#year.get(); + const sel = this.#selected.get(); + const title = this.querySelector("[data-part=title]"); + if (title) title.textContent = `${new Date(y, m).toLocaleString("default", { month: "long" })} ${y}`; + const body = this.querySelector("[data-part=body]"); + if (!body) return; + const today = new Date().toISOString().slice(0, 10); + const firstDay = new Date(y, m, 1).getDay(); + const daysInMonth = new Date(y, m + 1, 0).getDate(); + body.replaceChildren(); + let row = document.createElement("tr"); + for (let i = 0; i < firstDay; i++) row.appendChild(document.createElement("td")); + for (let d = 1; d <= daysInMonth; d++) { + const iso = `${y}-${String(m + 1).padStart(2, "0")}-${String(d).padStart(2, "0")}`; + row.appendChild(this.#createDayCell(d, iso, sel, today)); + if ((firstDay + d) % 7 === 0) { body.appendChild(row); row = document.createElement("tr"); } + } + if (row.children.length > 0) body.appendChild(row); + } +} diff --git a/packages/core/src/components/calendar/index.ts b/packages/core/src/components/calendar/index.ts new file mode 100644 index 0000000..ce1fb0a --- /dev/null +++ b/packages/core/src/components/calendar/index.ts @@ -0,0 +1,6 @@ +import { PettyCalendar } from "./calendar"; +export { PettyCalendar }; + +if (!customElements.get("petty-calendar")) { + customElements.define("petty-calendar", PettyCalendar); +} diff --git a/packages/core/src/components/card/card-content.ts b/packages/core/src/components/card/card-content.ts new file mode 100644 index 0000000..58a61a2 --- /dev/null +++ b/packages/core/src/components/card/card-content.ts @@ -0,0 +1,6 @@ +/** PettyCardContent — structural body section within a card. */ +export class PettyCardContent extends HTMLElement { + connectedCallback(): void { + this.dataset.part = "content"; + } +} diff --git a/packages/core/src/components/card/card-footer.ts b/packages/core/src/components/card/card-footer.ts new file mode 100644 index 0000000..8db08f8 --- /dev/null +++ b/packages/core/src/components/card/card-footer.ts @@ -0,0 +1,6 @@ +/** PettyCardFooter — structural footer section within a card. */ +export class PettyCardFooter extends HTMLElement { + connectedCallback(): void { + this.dataset.part = "footer"; + } +} diff --git a/packages/core/src/components/card/card-header.ts b/packages/core/src/components/card/card-header.ts new file mode 100644 index 0000000..4b17d2c --- /dev/null +++ b/packages/core/src/components/card/card-header.ts @@ -0,0 +1,6 @@ +/** PettyCardHeader — structural header section within a card. */ +export class PettyCardHeader extends HTMLElement { + connectedCallback(): void { + this.dataset.part = "header"; + } +} diff --git a/packages/core/src/components/card/card.schema.ts b/packages/core/src/components/card/card.schema.ts new file mode 100644 index 0000000..98cb318 --- /dev/null +++ b/packages/core/src/components/card/card.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-card", description: "Structural container with optional heading-based ARIA labelling", tier: 3, attributes: [], parts: [{ name: "header", element: "div", description: "Card header section (petty-card-header)" }, { name: "content", element: "div", description: "Card body section (petty-card-content)" }, { name: "footer", element: "div", description: "Card footer section (petty-card-footer)" }], events: [], example: `

Title

Body text

` }; diff --git a/packages/core/src/components/card/card.ts b/packages/core/src/components/card/card.ts new file mode 100644 index 0000000..a3d2b7d --- /dev/null +++ b/packages/core/src/components/card/card.ts @@ -0,0 +1,13 @@ +import { uniqueId } from "../../shared/aria"; + +/** PettyCard — structural container with optional heading-based labelling. */ +export class PettyCard extends HTMLElement { + connectedCallback(): void { + const heading = this.querySelector("h1, h2, h3, h4, h5, h6"); + if (heading) { + this.setAttribute("role", "article"); + if (!heading.id) heading.id = uniqueId("petty-card-title"); + this.setAttribute("aria-labelledby", heading.id); + } + } +} diff --git a/packages/core/src/components/card/index.ts b/packages/core/src/components/card/index.ts new file mode 100644 index 0000000..9bd4973 --- /dev/null +++ b/packages/core/src/components/card/index.ts @@ -0,0 +1,12 @@ +import { PettyCard } from "./card"; +import { PettyCardHeader } from "./card-header"; +import { PettyCardContent } from "./card-content"; +import { PettyCardFooter } from "./card-footer"; +export { PettyCard, PettyCardHeader, PettyCardContent, PettyCardFooter }; + +if (!customElements.get("petty-card")) { + customElements.define("petty-card", PettyCard); + customElements.define("petty-card-header", PettyCardHeader); + customElements.define("petty-card-content", PettyCardContent); + customElements.define("petty-card-footer", PettyCardFooter); +} diff --git a/packages/core/src/components/checkbox/checkbox.schema.ts b/packages/core/src/components/checkbox/checkbox.schema.ts new file mode 100644 index 0000000..2a69e8a --- /dev/null +++ b/packages/core/src/components/checkbox/checkbox.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-checkbox", description: "Tri-state checkbox with label wiring and change events", tier: 3, attributes: [{ name: "checked", type: "boolean", description: "Whether the checkbox is checked" }, { name: "indeterminate", type: "boolean", description: "Whether the checkbox is in indeterminate state" }, { name: "disabled", type: "boolean", description: "Disables the checkbox" }, { name: "name", type: "string", description: "Form field name" }, { name: "value", type: "string", default: "on", description: "Value submitted when checked" }], parts: [{ name: "control", element: "input", description: "The native checkbox input element" }, { name: "label", element: "label", description: "Label element auto-linked to the control" }], events: [{ name: "petty-change", detail: "{ checked: boolean, indeterminate: boolean }", description: "Fires when checked state changes" }], example: `` }; diff --git a/packages/core/src/components/checkbox/checkbox.ts b/packages/core/src/components/checkbox/checkbox.ts new file mode 100644 index 0000000..fac8d83 --- /dev/null +++ b/packages/core/src/components/checkbox/checkbox.ts @@ -0,0 +1,62 @@ +import { signal } from "../../signals"; +import { emit, listen, part, wireLabel } from "../../shared/helpers"; + +/** PettyCheckbox — tri-state checkbox with label wiring and change events. */ +export class PettyCheckbox extends HTMLElement { + static observedAttributes = ["checked", "indeterminate", "disabled", "name", "value"]; + + readonly #checked = signal(false); + readonly #indeterminate = signal(false); + #cleanup = (): void => {}; + + get checked(): boolean { return this.#checked.get(); } + set checked(v: boolean) { this.#checked.set(v); this.#sync(); } + + get indeterminate(): boolean { return this.#indeterminate.get(); } + set indeterminate(v: boolean) { this.#indeterminate.set(v); this.#sync(); } + + connectedCallback(): void { + const input = this.#input(); + if (!input) return; + if (this.hasAttribute("checked")) this.#checked.set(true); + if (this.hasAttribute("indeterminate")) this.#indeterminate.set(true); + wireLabel(input, part(this, "label"), "petty-cb"); + this.#sync(); + this.#cleanup = listen(input, [["change", this.#handleChange]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "checked") this.#checked.set(next !== null); + if (name === "indeterminate") this.#indeterminate.set(next !== null); + this.#sync(); + } + + #input(): HTMLInputElement | null { + return part(this, "control"); + } + + #sync(): void { + const input = this.#input(); + if (!input) return; + input.checked = this.#checked.get(); + input.indeterminate = this.#indeterminate.get(); + input.disabled = this.hasAttribute("disabled"); + if (this.hasAttribute("name")) input.name = this.getAttribute("name") ?? ""; + if (this.hasAttribute("value")) input.value = this.getAttribute("value") ?? "on"; + const state = this.#indeterminate.get() ? "indeterminate" : this.#checked.get() ? "checked" : "unchecked"; + this.dataset.state = state; + } + + #handleChange = (): void => { + const input = this.#input(); + if (!input) return; + this.#checked.set(input.checked); + this.#indeterminate.set(false); + this.#sync(); + emit(this, "change", { checked: input.checked, indeterminate: false }); + }; +} diff --git a/packages/core/src/components/checkbox/index.ts b/packages/core/src/components/checkbox/index.ts new file mode 100644 index 0000000..9557cba --- /dev/null +++ b/packages/core/src/components/checkbox/index.ts @@ -0,0 +1,6 @@ +import { PettyCheckbox } from "./checkbox"; +export { PettyCheckbox }; + +if (!customElements.get("petty-checkbox")) { + customElements.define("petty-checkbox", PettyCheckbox); +} diff --git a/packages/core/src/components/collapsible/collapsible.schema.ts b/packages/core/src/components/collapsible/collapsible.schema.ts new file mode 100644 index 0000000..db611d3 --- /dev/null +++ b/packages/core/src/components/collapsible/collapsible.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-collapsible", description: "Single disclosure wrapper on native details element", tier: 1, attributes: [{ name: "disabled", type: "boolean", description: "Prevents opening the collapsible" }], parts: [], events: [{ name: "petty-toggle", detail: "{ open: boolean }", description: "Fires when the collapsible opens or closes" }], example: `
Toggle
Hidden content
` }; diff --git a/packages/core/src/components/collapsible/collapsible.ts b/packages/core/src/components/collapsible/collapsible.ts new file mode 100644 index 0000000..79d6145 --- /dev/null +++ b/packages/core/src/components/collapsible/collapsible.ts @@ -0,0 +1,77 @@ +import { emit, listen } from "../../shared/helpers"; + +/** PettyCollapsible — single disclosure wrapper on native details element. */ +export class PettyCollapsible extends HTMLElement { + static observedAttributes = ["disabled"]; + + #cleanup = (): void => {}; + + get detailsElement(): HTMLDetailsElement | null { + return this.querySelector("details"); + } + + get isOpen(): boolean { + return this.detailsElement?.open ?? false; + } + + /** Opens the collapsible. */ + open(): void { + const d = this.detailsElement; + if (d && !this.hasAttribute("disabled")) d.open = true; + } + + /** Closes the collapsible. */ + close(): void { + const d = this.detailsElement; + if (d) d.open = false; + } + + /** Toggles the collapsible open/closed state. */ + toggle(): void { + if (this.isOpen) this.close(); + else this.open(); + } + + connectedCallback(): void { + const d = this.detailsElement; + if (!d) return; + this.#syncState(); + this.#applyDisabled(); + this.#cleanup = listen(d, [["toggle", this.#handleToggle]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") this.#applyDisabled(); + } + + #handleToggle = (): void => { + this.#syncState(); + emit(this, "toggle", { open: this.isOpen }); + }; + + #syncState(): void { + const d = this.detailsElement; + this.dataset.state = d?.open ? "open" : "closed"; + const summary = d?.querySelector("summary"); + if (summary) summary.setAttribute("aria-expanded", String(d?.open ?? false)); + } + + #applyDisabled(): void { + const disabled = this.hasAttribute("disabled"); + const summary = this.detailsElement?.querySelector("summary"); + if (!summary) return; + if (disabled) { + summary.setAttribute("aria-disabled", "true"); + summary.addEventListener("click", this.#preventToggle); + } else { + summary.removeAttribute("aria-disabled"); + summary.removeEventListener("click", this.#preventToggle); + } + } + + #preventToggle = (e: Event): void => { e.preventDefault(); }; +} diff --git a/packages/core/src/components/collapsible/index.ts b/packages/core/src/components/collapsible/index.ts new file mode 100644 index 0000000..fd0dfd4 --- /dev/null +++ b/packages/core/src/components/collapsible/index.ts @@ -0,0 +1,6 @@ +import { PettyCollapsible } from "./collapsible"; +export { PettyCollapsible }; + +if (!customElements.get("petty-collapsible")) { + customElements.define("petty-collapsible", PettyCollapsible); +} diff --git a/packages/core/src/components/combobox/combobox-option.ts b/packages/core/src/components/combobox/combobox-option.ts new file mode 100644 index 0000000..e19998d --- /dev/null +++ b/packages/core/src/components/combobox/combobox-option.ts @@ -0,0 +1,18 @@ +/** PettyComboboxOption — single option within a combobox listbox. */ +export class PettyComboboxOption extends HTMLElement { + static observedAttributes = ["value", "disabled"]; + + get value(): string { return this.getAttribute("value") ?? this.textContent?.trim() ?? ""; } + get disabled(): boolean { return this.hasAttribute("disabled"); } + + connectedCallback(): void { + this.setAttribute("role", "option"); + this.setAttribute("tabindex", "-1"); + this.setAttribute("aria-selected", "false"); + if (this.disabled) this.setAttribute("aria-disabled", "true"); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") this.setAttribute("aria-disabled", String(this.disabled)); + } +} diff --git a/packages/core/src/components/combobox/combobox.schema.ts b/packages/core/src/components/combobox/combobox.schema.ts new file mode 100644 index 0000000..16609e1 --- /dev/null +++ b/packages/core/src/components/combobox/combobox.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-combobox", description: "Searchable select with popover listbox and keyboard navigation", tier: 2, attributes: [{ name: "value", type: "string", description: "Currently selected value" }, { name: "placeholder", type: "string", description: "Placeholder text for the input" }, { name: "disabled", type: "boolean", description: "Disables the combobox" }], parts: [{ name: "input", element: "input", description: "Text input for search filtering" }, { name: "listbox", element: "div", description: "Popover container for options" }], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires when an option is selected" }], example: `
One
` }; diff --git a/packages/core/src/components/combobox/combobox.ts b/packages/core/src/components/combobox/combobox.ts new file mode 100644 index 0000000..832a764 --- /dev/null +++ b/packages/core/src/components/combobox/combobox.ts @@ -0,0 +1,83 @@ +import { uniqueId } from "../../shared/aria"; +import { emit, listen } from "../../shared/helpers"; + +/** PettyCombobox — searchable select with popover listbox and keyboard nav. */ +export class PettyCombobox extends HTMLElement { + static observedAttributes = ["value", "placeholder", "disabled"]; + + #highlightIndex = -1; + + connectedCallback(): void { + const input = this.#input(); + const lb = this.#listbox(); + if (!input || !lb) return; + if (!lb.id) lb.id = uniqueId("petty-combo-lb"); + input.setAttribute("aria-controls", lb.id); + input.setAttribute("aria-expanded", "false"); + input.setAttribute("aria-autocomplete", "list"); + input.addEventListener("input", this.#onInput); + input.addEventListener("keydown", this.#onKeydown); + lb.addEventListener("click", this.#onClick); + } + + disconnectedCallback(): void { + this.#input()?.removeEventListener("input", this.#onInput); + this.#input()?.removeEventListener("keydown", this.#onKeydown); + this.#listbox()?.removeEventListener("click", this.#onClick); + } + + #input(): HTMLInputElement | null { return this.querySelector("input[data-part=input]"); } + #listbox(): HTMLElement | null { return this.querySelector("[data-part=listbox]"); } + + #options(): HTMLElement[] { + return Array.from(this.querySelectorAll("petty-combobox-option:not([disabled]):not([hidden])")); + } + + #onInput = (): void => { + const input = this.#input(); + const lb = this.#listbox(); + if (!input || !lb) return; + const query = input.value.toLowerCase(); + const all = this.querySelectorAll("petty-combobox-option"); + for (const opt of all) { + const match = (opt.textContent ?? "").toLowerCase().includes(query); + opt.toggleAttribute("hidden", !match); + } + if (!lb.matches(":popover-open")) lb.showPopover(); + input.setAttribute("aria-expanded", "true"); + this.#highlightIndex = -1; + }; + + #onKeydown = (e: KeyboardEvent): void => { + const items = this.#options(); + if (e.key === "ArrowDown") { e.preventDefault(); this.#highlight(Math.min(this.#highlightIndex + 1, items.length - 1), items); } + else if (e.key === "ArrowUp") { e.preventDefault(); this.#highlight(Math.max(this.#highlightIndex - 1, 0), items); } + else if (e.key === "Enter") { e.preventDefault(); this.#selectHighlighted(items); } + else if (e.key === "Escape") { this.#listbox()?.hidePopover(); this.#input()?.setAttribute("aria-expanded", "false"); } + }; + + #highlight(idx: number, items: HTMLElement[]): void { + for (const opt of items) opt.removeAttribute("data-highlighted"); + if (items[idx]) { items[idx].setAttribute("data-highlighted", ""); this.#input()?.setAttribute("aria-activedescendant", items[idx].id || ""); } + this.#highlightIndex = idx; + } + + #selectHighlighted(items: HTMLElement[]): void { + const opt = items[this.#highlightIndex]; + if (opt) this.#select(opt); + } + + #onClick = (e: MouseEvent): void => { + const opt = (e.target as HTMLElement).closest("petty-combobox-option"); + if (opt && !opt.hasAttribute("disabled")) this.#select(opt as HTMLElement); + }; + + #select(opt: HTMLElement): void { + const val = opt.getAttribute("value") ?? opt.textContent?.trim() ?? ""; + const input = this.#input(); + if (input) input.value = opt.textContent?.trim() ?? val; + this.#listbox()?.hidePopover(); + input?.setAttribute("aria-expanded", "false"); + emit(this, "change", { value: val }); + } +} diff --git a/packages/core/src/components/combobox/index.ts b/packages/core/src/components/combobox/index.ts new file mode 100644 index 0000000..42fda92 --- /dev/null +++ b/packages/core/src/components/combobox/index.ts @@ -0,0 +1,8 @@ +import { PettyCombobox } from "./combobox"; +import { PettyComboboxOption } from "./combobox-option"; +export { PettyCombobox, PettyComboboxOption }; + +if (!customElements.get("petty-combobox")) { + customElements.define("petty-combobox", PettyCombobox); + customElements.define("petty-combobox-option", PettyComboboxOption); +} diff --git a/packages/core/src/components/command-palette/command-palette-item.ts b/packages/core/src/components/command-palette/command-palette-item.ts new file mode 100644 index 0000000..0610c4f --- /dev/null +++ b/packages/core/src/components/command-palette/command-palette-item.ts @@ -0,0 +1,17 @@ +/** PettyCommandPaletteItem — single command option within the palette. */ +export class PettyCommandPaletteItem extends HTMLElement { + static observedAttributes = ["value", "disabled"]; + + get value(): string { return this.getAttribute("value") ?? this.textContent?.trim() ?? ""; } + get disabled(): boolean { return this.hasAttribute("disabled"); } + + connectedCallback(): void { + this.setAttribute("role", "option"); + this.setAttribute("tabindex", "-1"); + if (this.disabled) this.setAttribute("aria-disabled", "true"); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") this.setAttribute("aria-disabled", String(this.disabled)); + } +} diff --git a/packages/core/src/components/command-palette/command-palette.schema.ts b/packages/core/src/components/command-palette/command-palette.schema.ts new file mode 100644 index 0000000..cf0fe10 --- /dev/null +++ b/packages/core/src/components/command-palette/command-palette.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-command-palette", description: "Search-driven command menu using native dialog, opened with Cmd+K", tier: 2, attributes: [], parts: [{ name: "search", element: "input", description: "Search input for filtering commands" }, { name: "list", element: "div", description: "Container for command items" }], events: [{ name: "petty-select", detail: "{ value: string }", description: "Fires when a command item is selected" }], example: `
Save
` }; diff --git a/packages/core/src/components/command-palette/command-palette.ts b/packages/core/src/components/command-palette/command-palette.ts new file mode 100644 index 0000000..62193d5 --- /dev/null +++ b/packages/core/src/components/command-palette/command-palette.ts @@ -0,0 +1,79 @@ +import { emit, listen } from "../../shared/helpers"; + +/** PettyCommandPalette — search-driven command menu using native dialog. */ +export class PettyCommandPalette extends HTMLElement { + #highlightIndex = -1; + + /** Opens the command palette dialog. */ + open(): void { + const dlg = this.querySelector("dialog"); + if (dlg && !dlg.open) { dlg.showModal(); this.#search()?.focus(); } + } + + /** Closes the command palette dialog. */ + close(): void { + const dlg = this.querySelector("dialog"); + if (dlg?.open) dlg.close(); + } + + connectedCallback(): void { + document.addEventListener("keydown", this.#onGlobalKey); + this.#search()?.addEventListener("input", this.#onSearch); + this.#list()?.addEventListener("click", this.#onClick); + this.#list()?.addEventListener("keydown", this.#onListKey); + } + + disconnectedCallback(): void { + document.removeEventListener("keydown", this.#onGlobalKey); + this.#search()?.removeEventListener("input", this.#onSearch); + this.#list()?.removeEventListener("click", this.#onClick); + this.#list()?.removeEventListener("keydown", this.#onListKey); + } + + #search(): HTMLInputElement | null { return this.querySelector("input[data-part=search]"); } + #list(): HTMLElement | null { return this.querySelector("[data-part=list]"); } + + #visibleItems(): HTMLElement[] { + return Array.from(this.querySelectorAll("petty-command-palette-item:not([hidden]):not([disabled])")); + } + + #onGlobalKey = (e: KeyboardEvent): void => { + if ((e.metaKey || e.ctrlKey) && e.key === "k") { e.preventDefault(); this.open(); } + }; + + #onSearch = (): void => { + const query = (this.#search()?.value ?? "").toLowerCase(); + const all = this.querySelectorAll("petty-command-palette-item"); + for (const item of all) { + const match = (item.textContent ?? "").toLowerCase().includes(query); + item.toggleAttribute("hidden", !match); + } + this.#highlightIndex = -1; + }; + + #onListKey = (e: Event): void => { + const ke = e as KeyboardEvent; + const items = this.#visibleItems(); + if (ke.key === "ArrowDown") { ke.preventDefault(); this.#highlight(Math.min(this.#highlightIndex + 1, items.length - 1), items); } + else if (ke.key === "ArrowUp") { ke.preventDefault(); this.#highlight(Math.max(this.#highlightIndex - 1, 0), items); } + else if (ke.key === "Enter") { ke.preventDefault(); this.#selectItem(items[this.#highlightIndex]); } + }; + + #highlight(idx: number, items: HTMLElement[]): void { + for (const item of items) item.removeAttribute("data-highlighted"); + if (items[idx]) { items[idx].setAttribute("data-highlighted", ""); items[idx].focus(); } + this.#highlightIndex = idx; + } + + #onClick = (e: Event): void => { + const target = (e.target as HTMLElement).closest("petty-command-palette-item"); + if (target && !target.hasAttribute("disabled")) this.#selectItem(target as HTMLElement); + }; + + #selectItem(item: HTMLElement | undefined): void { + if (!item) return; + const val = item.getAttribute("value") ?? item.textContent?.trim() ?? ""; + emit(this, "select", { value: val }); + this.close(); + } +} diff --git a/packages/core/src/components/command-palette/index.ts b/packages/core/src/components/command-palette/index.ts new file mode 100644 index 0000000..2e5a28c --- /dev/null +++ b/packages/core/src/components/command-palette/index.ts @@ -0,0 +1,8 @@ +import { PettyCommandPalette } from "./command-palette"; +import { PettyCommandPaletteItem } from "./command-palette-item"; +export { PettyCommandPalette, PettyCommandPaletteItem }; + +if (!customElements.get("petty-command-palette")) { + customElements.define("petty-command-palette", PettyCommandPalette); + customElements.define("petty-command-palette-item", PettyCommandPaletteItem); +} diff --git a/packages/core/src/components/context-menu/context-menu-item.ts b/packages/core/src/components/context-menu/context-menu-item.ts new file mode 100644 index 0000000..2637d7e --- /dev/null +++ b/packages/core/src/components/context-menu/context-menu-item.ts @@ -0,0 +1,16 @@ +/** PettyContextMenuItem — single item within a context menu. */ +export class PettyContextMenuItem extends HTMLElement { + static observedAttributes = ["disabled"]; + + connectedCallback(): void { + this.setAttribute("role", "menuitem"); + this.setAttribute("tabindex", "-1"); + if (this.hasAttribute("disabled")) this.setAttribute("aria-disabled", "true"); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") { + this.setAttribute("aria-disabled", String(this.hasAttribute("disabled"))); + } + } +} diff --git a/packages/core/src/components/context-menu/context-menu.schema.ts b/packages/core/src/components/context-menu/context-menu.schema.ts new file mode 100644 index 0000000..4414925 --- /dev/null +++ b/packages/core/src/components/context-menu/context-menu.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-context-menu", description: "Right-click menu using Popover API with keyboard navigation", tier: 2, attributes: [], parts: [{ name: "trigger", element: "div", description: "Element that triggers the context menu on right-click" }, { name: "content", element: "div", description: "Popover container for menu items" }], events: [{ name: "petty-select", detail: "{ value: string }", description: "Fires when a menu item is selected" }], example: `
Right-click here
Copy
` }; diff --git a/packages/core/src/components/context-menu/context-menu.ts b/packages/core/src/components/context-menu/context-menu.ts new file mode 100644 index 0000000..04b05b6 --- /dev/null +++ b/packages/core/src/components/context-menu/context-menu.ts @@ -0,0 +1,63 @@ +import { emit, listen } from "../../shared/helpers"; + +/** PettyContextMenu — right-click menu using Popover API with keyboard nav. */ +export class PettyContextMenu extends HTMLElement { + connectedCallback(): void { + const trigger = this.querySelector("[data-part=trigger]"); + const content = this.#content(); + if (!trigger || !content) return; + trigger.addEventListener("contextmenu", this.#onContext); + content.addEventListener("keydown", this.#onKeydown); + content.addEventListener("click", this.#onClick); + } + + disconnectedCallback(): void { + const trigger = this.querySelector("[data-part=trigger]"); + const content = this.#content(); + trigger?.removeEventListener("contextmenu", this.#onContext); + content?.removeEventListener("keydown", this.#onKeydown); + content?.removeEventListener("click", this.#onClick); + } + + #content(): HTMLElement | null { return this.querySelector("[data-part=content]"); } + + #items(): HTMLElement[] { + return Array.from(this.querySelectorAll("petty-context-menu-item:not([disabled])")); + } + + #onContext = (e: Event): void => { + e.preventDefault(); + const me = e as MouseEvent; + const content = this.#content(); + if (!content) return; + content.style.setProperty("--petty-ctx-x", `${me.clientX}px`); + content.style.setProperty("--petty-ctx-y", `${me.clientY}px`); + content.showPopover(); + this.#items()[0]?.focus(); + }; + + #onKeydown = (e: KeyboardEvent): void => { + const items = this.#items(); + const active = document.activeElement as HTMLElement; + const idx = items.indexOf(active); + if (e.key === "ArrowDown") { + e.preventDefault(); + items[(idx + 1) % items.length]?.focus(); + } else if (e.key === "ArrowUp") { + e.preventDefault(); + items[(idx - 1 + items.length) % items.length]?.focus(); + } else if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + active?.click(); + } else if (e.key === "Escape") { + this.#content()?.hidePopover(); + } + }; + + #onClick = (e: MouseEvent): void => { + const item = (e.target as HTMLElement).closest("petty-context-menu-item"); + if (!item || item.hasAttribute("disabled")) return; + emit(this, "select", { value: item.getAttribute("value") ?? item.textContent?.trim() ?? "" }); + this.#content()?.hidePopover(); + }; +} diff --git a/packages/core/src/components/context-menu/index.ts b/packages/core/src/components/context-menu/index.ts new file mode 100644 index 0000000..1725125 --- /dev/null +++ b/packages/core/src/components/context-menu/index.ts @@ -0,0 +1,8 @@ +import { PettyContextMenu } from "./context-menu"; +import { PettyContextMenuItem } from "./context-menu-item"; +export { PettyContextMenu, PettyContextMenuItem }; + +if (!customElements.get("petty-context-menu")) { + customElements.define("petty-context-menu", PettyContextMenu); + customElements.define("petty-context-menu-item", PettyContextMenuItem); +} diff --git a/packages/core/src/components/counter/counter.ts b/packages/core/src/components/counter/counter.ts new file mode 100644 index 0000000..0c15bdd --- /dev/null +++ b/packages/core/src/components/counter/counter.ts @@ -0,0 +1,74 @@ +import { emit } from "../../shared/helpers"; + +/** PettyCounter — animates a number from start to end with easing. */ +export class PettyCounter extends HTMLElement { + static observedAttributes = ["from", "to", "duration", "delay", "decimals", "prefix", "suffix"]; + + #frame: ReturnType | null = null; + #startTime = 0; + #timer: ReturnType | null = null; + + get from(): number { return Number(this.getAttribute("from") ?? 0); } + get to(): number { return Number(this.getAttribute("to") ?? 100); } + get duration(): number { return Number(this.getAttribute("duration") ?? 2000); } + get delay(): number { return Number(this.getAttribute("delay") ?? 0); } + get decimals(): number { return Number(this.getAttribute("decimals") ?? 0); } + get prefix(): string { return this.getAttribute("prefix") ?? ""; } + get suffix(): string { return this.getAttribute("suffix") ?? ""; } + + /** Starts the counter animation. */ + start(): void { + this.#startTime = performance.now(); + this.dataset.state = "counting"; + this.#animate(this.#startTime); + } + + /** Resets the counter to its initial value. */ + reset(): void { + this.#stop(); + this.#render(this.from); + this.dataset.state = "idle"; + } + + connectedCallback(): void { + this.#render(this.from); + this.dataset.state = "idle"; + if (this.delay > 0) { + this.#timer = setTimeout(() => this.start(), this.delay); + } else { + this.start(); + } + } + + disconnectedCallback(): void { + this.#stop(); + } + + #stop(): void { + if (this.#frame) { cancelAnimationFrame(this.#frame); this.#frame = null; } + if (this.#timer) { clearTimeout(this.#timer); this.#timer = null; } + } + + #easeOut(t: number): number { + return 1 - (1 - t) ** 3; + } + + #animate = (now: number): void => { + const elapsed = now - this.#startTime; + const progress = Math.min(elapsed / this.duration, 1); + const eased = this.#easeOut(progress); + const current = this.from + (this.to - this.from) * eased; + this.#render(current); + if (progress < 1) { + this.#frame = requestAnimationFrame(this.#animate); + } else { + this.dataset.state = "done"; + emit(this, "complete", {}); + } + }; + + #render(value: number): void { + const formatted = value.toFixed(this.decimals); + this.textContent = `${this.prefix}${formatted}${this.suffix}`; + } +} diff --git a/packages/core/src/components/counter/index.ts b/packages/core/src/components/counter/index.ts new file mode 100644 index 0000000..77f7a0d --- /dev/null +++ b/packages/core/src/components/counter/index.ts @@ -0,0 +1,6 @@ +import { PettyCounter } from "./counter"; +export { PettyCounter }; + +if (!customElements.get("petty-counter")) { + customElements.define("petty-counter", PettyCounter); +} diff --git a/packages/core/src/components/data-table/data-table.schema.ts b/packages/core/src/components/data-table/data-table.schema.ts new file mode 100644 index 0000000..bae4bed --- /dev/null +++ b/packages/core/src/components/data-table/data-table.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-data-table", description: "Sortable table with click-to-sort column headers", tier: 3, attributes: [], parts: [{ name: "body", element: "tbody", description: "Table body containing sortable rows" }], events: [{ name: "petty-sort", detail: "{ column: string, direction: string }", description: "Fires when a column header is clicked, with column name and sort direction" }], example: `
NameAge
Alice30
` }; diff --git a/packages/core/src/components/data-table/data-table.ts b/packages/core/src/components/data-table/data-table.ts new file mode 100644 index 0000000..5dc44c0 --- /dev/null +++ b/packages/core/src/components/data-table/data-table.ts @@ -0,0 +1,54 @@ +import { emit } from "../../shared/helpers"; + +/** PettyDataTable — sortable table with click-to-sort column headers. */ +export class PettyDataTable extends HTMLElement { + connectedCallback(): void { + const headers = this.querySelectorAll("th[data-sort]"); + for (const th of headers) { + th.setAttribute("role", "columnheader"); + th.setAttribute("aria-sort", "none"); + th.style.cursor = "pointer"; + th.addEventListener("click", this.#onHeaderClick); + } + } + + disconnectedCallback(): void { + const headers = this.querySelectorAll("th[data-sort]"); + for (const th of headers) th.removeEventListener("click", this.#onHeaderClick); + } + + #onHeaderClick = (e: Event): void => { + const th = e.currentTarget as HTMLElement; + const column = th.dataset.sort ?? ""; + const current = th.getAttribute("aria-sort") ?? "none"; + const next = current === "ascending" ? "descending" : "ascending"; + this.#clearSorts(); + th.setAttribute("aria-sort", next); + th.dataset.state = next; + this.#sortBy(th, next === "ascending" ? 1 : -1); + emit(this, "sort", { column, direction: next }); + }; + + #clearSorts(): void { + const headers = this.querySelectorAll("th[data-sort]"); + for (const th of headers) { th.setAttribute("aria-sort", "none"); th.dataset.state = "none"; } + } + + #sortBy(th: HTMLElement, dir: number): void { + const tbody = this.querySelector("tbody[data-part=body]") ?? this.querySelector("tbody"); + if (!tbody) return; + const headerRow = th.parentElement; + if (!headerRow) return; + const colIdx = Array.from(headerRow.children).indexOf(th); + const rows = Array.from(tbody.querySelectorAll("tr")); + rows.sort((a, b) => { + const aText = a.children[colIdx]?.textContent?.trim() ?? ""; + const bText = b.children[colIdx]?.textContent?.trim() ?? ""; + const aNum = Number(aText); + const bNum = Number(bText); + if (!Number.isNaN(aNum) && !Number.isNaN(bNum)) return (aNum - bNum) * dir; + return aText.localeCompare(bText) * dir; + }); + for (const row of rows) tbody.appendChild(row); + } +} diff --git a/packages/core/src/components/data-table/index.ts b/packages/core/src/components/data-table/index.ts new file mode 100644 index 0000000..ad00ac0 --- /dev/null +++ b/packages/core/src/components/data-table/index.ts @@ -0,0 +1,6 @@ +import { PettyDataTable } from "./data-table"; +export { PettyDataTable }; + +if (!customElements.get("petty-data-table")) { + customElements.define("petty-data-table", PettyDataTable); +} diff --git a/packages/core/src/components/date-picker/date-picker.schema.ts b/packages/core/src/components/date-picker/date-picker.schema.ts new file mode 100644 index 0000000..729cc99 --- /dev/null +++ b/packages/core/src/components/date-picker/date-picker.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-date-picker", description: "Date input with calendar popover integration", tier: 2, attributes: [{ name: "value", type: "string", description: "Selected date in ISO format" }, { name: "min", type: "string", description: "Minimum selectable date" }, { name: "max", type: "string", description: "Maximum selectable date" }, { name: "disabled", type: "boolean", description: "Disables the date picker" }], parts: [{ name: "input", element: "input", description: "Text input for date entry" }, { name: "trigger", element: "button", description: "Button that opens the calendar popover" }, { name: "calendar", element: "div", description: "Popover container for the calendar" }], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires when a date is selected from input or calendar" }], example: `
` }; diff --git a/packages/core/src/components/date-picker/date-picker.ts b/packages/core/src/components/date-picker/date-picker.ts new file mode 100644 index 0000000..7772724 --- /dev/null +++ b/packages/core/src/components/date-picker/date-picker.ts @@ -0,0 +1,55 @@ +import { emit, listen } from "../../shared/helpers"; + +/** PettyDatePicker — date input with calendar popover integration. */ +export class PettyDatePicker extends HTMLElement { + static observedAttributes = ["value", "min", "max", "disabled"]; + + get value(): string { return this.#input()?.value ?? ""; } + set value(v: string) { const input = this.#input(); if (input) input.value = v; } + + connectedCallback(): void { + const trigger = this.querySelector("[data-part=trigger]"); + const input = this.#input(); + if (trigger) { + trigger.setAttribute("aria-haspopup", "dialog"); + trigger.setAttribute("aria-expanded", "false"); + } + input?.addEventListener("change", this.#onInputChange); + this.addEventListener("petty-change", this.#onCalendarSelect); + + const pop = this.querySelector("[data-part=calendar]"); + if (pop) pop.addEventListener("toggle", this.#onToggle as EventListener); + } + + disconnectedCallback(): void { + this.#input()?.removeEventListener("change", this.#onInputChange); + this.removeEventListener("petty-change", this.#onCalendarSelect); + const pop = this.querySelector("[data-part=calendar]"); + pop?.removeEventListener("toggle", this.#onToggle as EventListener); + } + + #input(): HTMLInputElement | null { return this.querySelector("input[data-part=input]"); } + + #onToggle = (e: ToggleEvent): void => { + const trigger = this.querySelector("[data-part=trigger]"); + if (trigger) trigger.setAttribute("aria-expanded", String(e.newState === "open")); + }; + + #onInputChange = (): void => { + const val = this.#input()?.value ?? ""; + emit(this, "change", { value: val, source: "input" }); + }; + + #onCalendarSelect = (e: Event): void => { + const ce = e as CustomEvent; + if (ce.detail?.source === "input") return; + const val = ce.detail?.value; + if (!val) return; + e.stopPropagation(); + const input = this.#input(); + if (input) input.value = val; + const cal = this.querySelector("[data-part=calendar]"); + if (cal instanceof HTMLElement && "hidePopover" in cal) cal.hidePopover(); + emit(this, "change", { value: val }); + }; +} diff --git a/packages/core/src/components/date-picker/index.ts b/packages/core/src/components/date-picker/index.ts new file mode 100644 index 0000000..bc37d74 --- /dev/null +++ b/packages/core/src/components/date-picker/index.ts @@ -0,0 +1,6 @@ +import { PettyDatePicker } from "./date-picker"; +export { PettyDatePicker }; + +if (!customElements.get("petty-date-picker")) { + customElements.define("petty-date-picker", PettyDatePicker); +} diff --git a/packages/core/src/components/dialog/dialog.schema.ts b/packages/core/src/components/dialog/dialog.schema.ts new file mode 100644 index 0000000..ea516ec --- /dev/null +++ b/packages/core/src/components/dialog/dialog.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-dialog", description: "Headless dialog built on native with ARIA linking and close events", tier: 1, attributes: [], parts: [], events: [{ name: "petty-close", detail: "{ value: string }", description: "Fires when the dialog closes, detail contains return value" }], example: `

Title

Content

` }; diff --git a/packages/core/src/components/dialog/dialog.ts b/packages/core/src/components/dialog/dialog.ts new file mode 100644 index 0000000..cce0d16 --- /dev/null +++ b/packages/core/src/components/dialog/dialog.ts @@ -0,0 +1,73 @@ +import { emit, listen } from "../../shared/helpers"; +import { uniqueId } from "../../shared/aria"; + +/** + * PettyDialog — headless dialog custom element built on native ``. + * + * Usage: + * ```html + * + * + * + *

Title

+ *

Content

+ * + *
+ *
+ * ``` + * + * The browser handles: modal behavior, backdrop, focus trap, Escape, Invoker Commands. + * This element adds: ARIA linking, close event with return value, programmatic API. + */ +export class PettyDialog extends HTMLElement { + #cleanup: (() => void) | null = null; + + /** Finds the first `` child element. */ + get dialogElement(): HTMLDialogElement | null { + return this.querySelector("dialog"); + } + + /** Whether the dialog is currently open. */ + get isOpen(): boolean { + return this.dialogElement?.open ?? false; + } + + /** Opens the dialog as a modal. */ + open(): void { + const dlg = this.dialogElement; + if (dlg && !dlg.open) dlg.showModal(); + } + + /** Closes the dialog with an optional return value. */ + close(returnValue?: string): void { + const dlg = this.dialogElement; + if (dlg?.open) dlg.close(returnValue); + } + + /** @internal */ + connectedCallback(): void { + const dlg = this.dialogElement; + if (!dlg) return; + + this.#linkAria(dlg); + this.#cleanup = listen(dlg, [["close", this.#handleClose]]); + } + + /** @internal */ + disconnectedCallback(): void { + this.#cleanup?.(); + this.#cleanup = null; + } + + #handleClose = (): void => { + const dlg = this.dialogElement; + emit(this, "close", { value: dlg?.returnValue ?? "" }); + }; + + #linkAria(dlg: HTMLDialogElement): void { + const heading = dlg.querySelector("h1, h2, h3, h4, h5, h6"); + if (!heading) return; + if (!heading.id) heading.id = uniqueId("petty-dlg-title"); + dlg.setAttribute("aria-labelledby", heading.id); + } +} diff --git a/packages/core/src/components/dialog/index.ts b/packages/core/src/components/dialog/index.ts new file mode 100644 index 0000000..8907c7c --- /dev/null +++ b/packages/core/src/components/dialog/index.ts @@ -0,0 +1,6 @@ +import { PettyDialog } from "./dialog"; +export { PettyDialog }; + +if (!customElements.get("petty-dialog")) { + customElements.define("petty-dialog", PettyDialog); +} diff --git a/packages/core/src/components/drawer/drawer.schema.ts b/packages/core/src/components/drawer/drawer.schema.ts new file mode 100644 index 0000000..6444416 --- /dev/null +++ b/packages/core/src/components/drawer/drawer.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-drawer", description: "Slide-in panel built on native dialog with side positioning", tier: 3, attributes: [{ name: "side", type: "string", default: "right", description: "Side the drawer slides from: left, right, top, bottom" }], parts: [], events: [{ name: "petty-close", detail: "{ value: string }", description: "Fires when the drawer closes, detail contains return value" }], example: `

Menu

` }; diff --git a/packages/core/src/components/drawer/drawer.ts b/packages/core/src/components/drawer/drawer.ts new file mode 100644 index 0000000..0b551c8 --- /dev/null +++ b/packages/core/src/components/drawer/drawer.ts @@ -0,0 +1,64 @@ +import { emit, listen } from "../../shared/helpers"; +import { uniqueId } from "../../shared/aria"; + +/** PettyDrawer — slide-in panel built on native dialog with side positioning. */ +export class PettyDrawer extends HTMLElement { + static observedAttributes = ["side"]; + #cleanup: (() => void) | null = null; + + get dialogElement(): HTMLDialogElement | null { + return this.querySelector("dialog"); + } + + get isOpen(): boolean { + return this.dialogElement?.open ?? false; + } + + /** Opens the drawer as a modal. */ + open(): void { + const dlg = this.dialogElement; + if (dlg && !dlg.open) dlg.showModal(); + } + + /** Closes the drawer with an optional return value. */ + close(returnValue?: string): void { + const dlg = this.dialogElement; + if (dlg?.open) dlg.close(returnValue); + } + + connectedCallback(): void { + const dlg = this.dialogElement; + if (!dlg) return; + this.#syncSide(); + this.#linkAria(dlg); + this.#cleanup = listen(dlg, [["close", this.#handleClose]]); + } + + disconnectedCallback(): void { + this.#cleanup?.(); + this.#cleanup = null; + } + + attributeChangedCallback(): void { + this.#syncSide(); + } + + #syncSide(): void { + const side = this.getAttribute("side") ?? "right"; + this.dataset.side = side; + const dlg = this.dialogElement; + if (dlg) dlg.dataset.side = side; + } + + #handleClose = (): void => { + const dlg = this.dialogElement; + emit(this, "close", { value: dlg?.returnValue ?? "" }); + }; + + #linkAria(dlg: HTMLDialogElement): void { + const heading = dlg.querySelector("h1, h2, h3, h4, h5, h6"); + if (!heading) return; + if (!heading.id) heading.id = uniqueId("petty-drawer-title"); + dlg.setAttribute("aria-labelledby", heading.id); + } +} diff --git a/packages/core/src/components/drawer/index.ts b/packages/core/src/components/drawer/index.ts new file mode 100644 index 0000000..efb4624 --- /dev/null +++ b/packages/core/src/components/drawer/index.ts @@ -0,0 +1,6 @@ +import { PettyDrawer } from "./drawer"; +export { PettyDrawer }; + +if (!customElements.get("petty-drawer")) { + customElements.define("petty-drawer", PettyDrawer); +} diff --git a/packages/core/src/components/dropdown-menu/dropdown-menu.schema.ts b/packages/core/src/components/dropdown-menu/dropdown-menu.schema.ts new file mode 100644 index 0000000..3f48dd7 --- /dev/null +++ b/packages/core/src/components/dropdown-menu/dropdown-menu.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-dropdown-menu", description: "Action menu built on the Popover API with keyboard navigation", tier: 2, attributes: [], parts: [{ name: "trigger", element: "button", description: "Button that opens the dropdown menu" }, { name: "content", element: "div", description: "Popover container for menu items" }], events: [{ name: "petty-select", detail: "{ value: string }", description: "Fires when a menu item is selected" }], example: `` }; diff --git a/packages/core/src/components/dropdown-menu/dropdown-menu.ts b/packages/core/src/components/dropdown-menu/dropdown-menu.ts new file mode 100644 index 0000000..14ae1e8 --- /dev/null +++ b/packages/core/src/components/dropdown-menu/dropdown-menu.ts @@ -0,0 +1,79 @@ +import { emit, listen } from "../../shared/helpers"; + +/** PettyDropdownMenu — action menu built on the Popover API. */ +export class PettyDropdownMenu extends HTMLElement { + /** The trigger button element. */ + get triggerElement(): HTMLElement | null { + return this.querySelector("[data-part=trigger]"); + } + + /** The menu content element. */ + get contentElement(): HTMLElement | null { + return this.querySelector("[data-part=content]"); + } + + /** @internal */ + connectedCallback(): void { + const trigger = this.triggerElement; + const content = this.contentElement; + if (!trigger || !content) return; + + trigger.setAttribute("aria-haspopup", "menu"); + trigger.setAttribute("aria-expanded", "false"); + if (content.id) trigger.setAttribute("aria-controls", content.id); + + content.addEventListener("toggle", this.#handleToggle as EventListener); + content.addEventListener("keydown", this.#handleKeyDown); + content.addEventListener("click", this.#handleClick); + } + + /** @internal */ + disconnectedCallback(): void { + const content = this.contentElement; + content?.removeEventListener("toggle", this.#handleToggle as EventListener); + content?.removeEventListener("keydown", this.#handleKeyDown); + content?.removeEventListener("click", this.#handleClick); + } + + #handleToggle = (e: ToggleEvent): void => { + const open = e.newState === "open"; + this.triggerElement?.setAttribute("aria-expanded", String(open)); + if (open) this.#focusFirst(); + }; + + #handleKeyDown = (e: KeyboardEvent): void => { + const items = this.#getItems(); + const active = document.activeElement; + if (!(active instanceof HTMLElement)) return; + const idx = items.indexOf(active); + + if (e.key === "ArrowDown") { + e.preventDefault(); + const next = idx < items.length - 1 ? idx + 1 : 0; + items[next]?.focus(); + } else if (e.key === "ArrowUp") { + e.preventDefault(); + const prev = idx > 0 ? idx - 1 : items.length - 1; + items[prev]?.focus(); + } else if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + active.click(); + } + }; + + #handleClick = (e: MouseEvent): void => { + const item = (e.target as HTMLElement).closest("petty-menu-item"); + if (!item || item.hasAttribute("disabled")) return; + emit(this, "select", { value: item.textContent?.trim() ?? "" }); + this.contentElement?.hidePopover(); + }; + + #focusFirst(): void { + const first = this.#getItems()[0]; + if (first) first.focus(); + } + + #getItems(): HTMLElement[] { + return Array.from(this.querySelectorAll("petty-menu-item:not([disabled])")); + } +} diff --git a/packages/core/src/components/dropdown-menu/index.ts b/packages/core/src/components/dropdown-menu/index.ts new file mode 100644 index 0000000..135bf5b --- /dev/null +++ b/packages/core/src/components/dropdown-menu/index.ts @@ -0,0 +1,8 @@ +import { PettyDropdownMenu } from "./dropdown-menu"; +import { PettyMenuItem } from "./menu-item"; +export { PettyDropdownMenu, PettyMenuItem }; + +if (!customElements.get("petty-dropdown-menu")) { + customElements.define("petty-dropdown-menu", PettyDropdownMenu); + customElements.define("petty-menu-item", PettyMenuItem); +} diff --git a/packages/core/src/components/dropdown-menu/menu-item.ts b/packages/core/src/components/dropdown-menu/menu-item.ts new file mode 100644 index 0000000..06845c0 --- /dev/null +++ b/packages/core/src/components/dropdown-menu/menu-item.ts @@ -0,0 +1,17 @@ +/** PettyMenuItem — a single actionable item within a dropdown menu. */ +export class PettyMenuItem extends HTMLElement { + /** @internal */ + connectedCallback(): void { + this.setAttribute("role", "menuitem"); + this.setAttribute("tabindex", "-1"); + } + + static get observedAttributes(): string[] { return ["disabled"]; } + + /** @internal */ + attributeChangedCallback(name: string): void { + if (name === "disabled") { + this.setAttribute("aria-disabled", this.hasAttribute("disabled") ? "true" : "false"); + } + } +} diff --git a/packages/core/src/components/form/form-field.ts b/packages/core/src/components/form/form-field.ts new file mode 100644 index 0000000..05dbe13 --- /dev/null +++ b/packages/core/src/components/form/form-field.ts @@ -0,0 +1,56 @@ +import { uniqueId } from "../../shared/aria"; + +/** + * PettyFormField — form field wrapper with label, control, and error linking. + * + * Usage: + * ```html + * + * + * + * + * + * ``` + * + * On connect, generates stable IDs and wires up aria-describedby, htmlFor, + * and the name attribute on the control. Call setError/clearError to manage + * inline validation state — or let petty-form do it automatically. + */ +export class PettyFormField extends HTMLElement { + static get observedAttributes(): string[] { return ["name"]; } + + /** @internal */ + connectedCallback(): void { + const name = this.getAttribute("name") ?? ""; + const controlId = uniqueId(`petty-field-${name}`); + const errorId = `${controlId}-error`; + + const label = this.querySelector("[data-part=label]"); + const control = this.querySelector("[data-part=control]"); + const error = this.querySelector("[data-part=error]"); + + if (control) { + control.id = controlId; + if (!control.getAttribute("name")) control.setAttribute("name", name); + control.setAttribute("aria-describedby", errorId); + } + if (label && control) (label as HTMLLabelElement).htmlFor = controlId; + if (error) error.id = errorId; + } + + /** Display an error message on this field. */ + setError(message: string): void { + const error = this.querySelector("[data-part=error]"); + const control = this.querySelector("[data-part=control]"); + if (error) error.textContent = message; + if (control) control.setAttribute("aria-invalid", "true"); + } + + /** Clear the error message on this field. */ + clearError(): void { + const error = this.querySelector("[data-part=error]"); + const control = this.querySelector("[data-part=control]"); + if (error) error.textContent = ""; + if (control) control.removeAttribute("aria-invalid"); + } +} diff --git a/packages/core/src/components/form/form.schema.ts b/packages/core/src/components/form/form.schema.ts new file mode 100644 index 0000000..90aa5f0 --- /dev/null +++ b/packages/core/src/components/form/form.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-form", description: "Form wrapper with Zod validation and accessible error display", tier: 3, attributes: [], parts: [], events: [{ name: "petty-submit", detail: "{ data: Record }", description: "Fires on valid form submission with form data" }, { name: "petty-invalid", detail: "{ errors: Array<{ path: Array, message: string }> }", description: "Fires when validation fails with error details" }], example: `
` }; diff --git a/packages/core/src/components/form/form.ts b/packages/core/src/components/form/form.ts new file mode 100644 index 0000000..aa2b406 --- /dev/null +++ b/packages/core/src/components/form/form.ts @@ -0,0 +1,94 @@ +import { emit, listen } from "../../shared/helpers"; + +interface SchemaLike { + safeParse: (data: unknown) => { + success: boolean; + error?: { issues: Array<{ path: Array; message: string }> }; + }; +} + +/** + * PettyForm — form wrapper with Zod validation and accessible error display. + * + * Usage: + * ```html + * + *
+ * + * + * + * + * + * + *
+ *
+ * ``` + * + * Set a Zod schema via `el.setSchema(z.object({...}))`. Listens for + * form submit, runs validation, and distributes error messages to + * petty-form-field elements via data-part selectors. Dispatches + * "petty-submit" on success or "petty-invalid" on failure. + */ +export class PettyForm extends HTMLElement { + #schema: SchemaLike | null = null; + + /** Set a Zod schema for validation. */ + setSchema(schema: SchemaLike | null): void { + this.#schema = schema; + } + + #cleanup = (): void => {}; + + /** @internal */ + connectedCallback(): void { + const form = this.querySelector("form"); + if (!form) return; + form.setAttribute("novalidate", ""); + this.#cleanup = listen(form, [["submit", this.#handleSubmit]]); + } + + /** @internal */ + disconnectedCallback(): void { + this.#cleanup(); + } + + #handleSubmit = (e: Event): void => { + e.preventDefault(); + const form = e.target as HTMLFormElement; + const data = Object.fromEntries(new FormData(form)); + this.#clearErrors(); + + if (this.#schema) { + const result = this.#schema.safeParse(data); + if (!result.success) { + const issues = result.error?.issues ?? []; + this.#showErrors(issues); + emit(this, "invalid", { errors: issues }); + return; + } + } + + emit(this, "submit", { data }); + }; + + #clearErrors(): void { + for (const el of Array.from(this.querySelectorAll("[data-part=error]"))) { + el.textContent = ""; + } + for (const el of Array.from(this.querySelectorAll("[data-part=control]"))) { + el.removeAttribute("aria-invalid"); + } + } + + #showErrors(issues: Array<{ path: Array; message: string }>): void { + for (const issue of issues) { + const name = String(issue.path[0] ?? ""); + const field = this.querySelector(`petty-form-field[name="${name}"]`); + if (!field) continue; + const errorEl = field.querySelector("[data-part=error]"); + if (errorEl) errorEl.textContent = issue.message; + const control = field.querySelector("[data-part=control]"); + if (control) control.setAttribute("aria-invalid", "true"); + } + } +} diff --git a/packages/core/src/components/form/index.ts b/packages/core/src/components/form/index.ts new file mode 100644 index 0000000..1bdbbfd --- /dev/null +++ b/packages/core/src/components/form/index.ts @@ -0,0 +1,8 @@ +import { PettyForm } from "./form"; +import { PettyFormField } from "./form-field"; +export { PettyForm, PettyFormField }; + +if (!customElements.get("petty-form")) { + customElements.define("petty-form", PettyForm); + customElements.define("petty-form-field", PettyFormField); +} diff --git a/packages/core/src/components/hover-card/hover-card.schema.ts b/packages/core/src/components/hover-card/hover-card.schema.ts new file mode 100644 index 0000000..9200c23 --- /dev/null +++ b/packages/core/src/components/hover-card/hover-card.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-hover-card", description: "Rich hover preview using Popover API with configurable open/close delays", tier: 2, attributes: [{ name: "open-delay", type: "number", default: "300", description: "Delay in ms before showing the card" }, { name: "close-delay", type: "number", default: "200", description: "Delay in ms before hiding the card" }], parts: [{ name: "trigger", element: "a", description: "Element that triggers the hover card on mouse enter/focus" }, { name: "content", element: "div", description: "Popover container for the card content" }], events: [{ name: "petty-toggle", detail: "{ open: boolean }", description: "Fires when the hover card opens or closes" }], example: `@user
User details here
` }; diff --git a/packages/core/src/components/hover-card/hover-card.ts b/packages/core/src/components/hover-card/hover-card.ts new file mode 100644 index 0000000..2f051bd --- /dev/null +++ b/packages/core/src/components/hover-card/hover-card.ts @@ -0,0 +1,62 @@ +import { uniqueId } from "../../shared/aria"; +import { emit, listen, part } from "../../shared/helpers"; + +/** PettyHoverCard — rich hover preview using Popover API with open/close delays. */ +export class PettyHoverCard extends HTMLElement { + static observedAttributes = ["open-delay", "close-delay"]; + + #showTimer: ReturnType | null = null; + #hideTimer: ReturnType | null = null; + #cleanupTrigger: (() => void) | null = null; + #cleanupContent: (() => void) | null = null; + + connectedCallback(): void { + const trigger = part(this, "trigger"); + const content = part(this, "content"); + if (!trigger || !content) return; + if (!content.id) content.id = uniqueId("petty-hc"); + trigger.setAttribute("aria-describedby", content.id); + this.#cleanupTrigger = listen(trigger, [ + ["mouseenter", this.#onEnter], + ["mouseleave", this.#onLeave], + ["focus", this.#onEnter], + ["blur", this.#onLeave], + ]); + this.#cleanupContent = listen(content, [ + ["mouseenter", this.#onContentEnter], + ["mouseleave", this.#onLeave], + ]); + } + + disconnectedCallback(): void { + this.#clearTimers(); + this.#cleanupTrigger?.(); + this.#cleanupTrigger = null; + this.#cleanupContent?.(); + this.#cleanupContent = null; + } + + #openDelay(): number { return Number(this.getAttribute("open-delay") ?? 300); } + #closeDelay(): number { return Number(this.getAttribute("close-delay") ?? 200); } + + #clearTimers(): void { + if (this.#showTimer) { clearTimeout(this.#showTimer); this.#showTimer = null; } + if (this.#hideTimer) { clearTimeout(this.#hideTimer); this.#hideTimer = null; } + } + + #show(): void { + const content = part(this, "content"); + if (content && !content.matches(":popover-open")) content.showPopover(); + emit(this, "toggle", { open: true }); + } + + #hide(): void { + const content = part(this, "content"); + if (content && content.matches(":popover-open")) content.hidePopover(); + emit(this, "toggle", { open: false }); + } + + #onEnter = (): void => { this.#clearTimers(); this.#showTimer = setTimeout(() => this.#show(), this.#openDelay()); }; + #onLeave = (): void => { this.#clearTimers(); this.#hideTimer = setTimeout(() => this.#hide(), this.#closeDelay()); }; + #onContentEnter = (): void => { this.#clearTimers(); }; +} diff --git a/packages/core/src/components/hover-card/index.ts b/packages/core/src/components/hover-card/index.ts new file mode 100644 index 0000000..4d17fce --- /dev/null +++ b/packages/core/src/components/hover-card/index.ts @@ -0,0 +1,6 @@ +import { PettyHoverCard } from "./hover-card"; +export { PettyHoverCard }; + +if (!customElements.get("petty-hover-card")) { + customElements.define("petty-hover-card", PettyHoverCard); +} diff --git a/packages/core/src/components/image/image.schema.ts b/packages/core/src/components/image/image.schema.ts new file mode 100644 index 0000000..0bace39 --- /dev/null +++ b/packages/core/src/components/image/image.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-image", description: "Image element with fallback display on load failure", tier: 3, attributes: [], parts: [{ name: "fallback", element: "div", description: "Fallback content shown when image fails to load" }], events: [], example: `Photo
Image unavailable
` }; diff --git a/packages/core/src/components/image/image.ts b/packages/core/src/components/image/image.ts new file mode 100644 index 0000000..7769166 --- /dev/null +++ b/packages/core/src/components/image/image.ts @@ -0,0 +1,40 @@ +import { listen } from "../../shared/helpers"; + +/** PettyImage — image element with fallback display on load failure. */ +export class PettyImage extends HTMLElement { + connectedCallback(): void { + this.dataset.state = "loading"; + const img = this.querySelector("img"); + if (!img) { this.#showFallback(); return; } + img.addEventListener("load", this.#onLoad); + img.addEventListener("error", this.#onError); + if (img.complete && img.naturalWidth > 0) this.#onLoad(); + else if (img.complete) this.#onError(); + } + + disconnectedCallback(): void { + const img = this.querySelector("img"); + img?.removeEventListener("load", this.#onLoad); + img?.removeEventListener("error", this.#onError); + } + + #onLoad = (): void => { + this.dataset.state = "loaded"; + const img = this.querySelector("img"); + const fallback = this.querySelector("[data-part=fallback]") as HTMLElement | null; + if (img) img.style.display = ""; + if (fallback) fallback.style.display = "none"; + }; + + #onError = (): void => { + this.dataset.state = "error"; + this.#showFallback(); + }; + + #showFallback(): void { + const img = this.querySelector("img"); + const fallback = this.querySelector("[data-part=fallback]") as HTMLElement | null; + if (img) img.style.display = "none"; + if (fallback) fallback.style.display = ""; + } +} diff --git a/packages/core/src/components/image/index.ts b/packages/core/src/components/image/index.ts new file mode 100644 index 0000000..68305b2 --- /dev/null +++ b/packages/core/src/components/image/index.ts @@ -0,0 +1,6 @@ +import { PettyImage } from "./image"; +export { PettyImage }; + +if (!customElements.get("petty-image")) { + customElements.define("petty-image", PettyImage); +} diff --git a/packages/core/src/components/link/index.ts b/packages/core/src/components/link/index.ts new file mode 100644 index 0000000..139f4af --- /dev/null +++ b/packages/core/src/components/link/index.ts @@ -0,0 +1,6 @@ +import { PettyLink } from "./link"; +export { PettyLink }; + +if (!customElements.get("petty-link")) { + customElements.define("petty-link", PettyLink); +} diff --git a/packages/core/src/components/link/link.schema.ts b/packages/core/src/components/link/link.schema.ts new file mode 100644 index 0000000..df7a5c6 --- /dev/null +++ b/packages/core/src/components/link/link.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-link", description: "Headless anchor wrapper with disabled and external link support", tier: 1, attributes: [{ name: "disabled", type: "boolean", description: "Disables the link and prevents navigation" }, { name: "external", type: "boolean", description: "Opens link in new tab with noopener noreferrer" }], parts: [], events: [], example: `Visit site` }; diff --git a/packages/core/src/components/link/link.ts b/packages/core/src/components/link/link.ts new file mode 100644 index 0000000..f9cbbd7 --- /dev/null +++ b/packages/core/src/components/link/link.ts @@ -0,0 +1,45 @@ +import { listen } from "../../shared/helpers"; + +/** PettyLink — headless anchor wrapper with disabled and external support. */ +export class PettyLink extends HTMLElement { + static observedAttributes = ["disabled", "external"]; + + get anchorElement(): HTMLAnchorElement | null { + return this.querySelector("a"); + } + + #cleanup = (): void => {}; + + connectedCallback(): void { + this.#sync(); + this.#cleanup = listen(this, [["click", this.#handleClick]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(): void { + this.#sync(); + } + + #sync(): void { + const a = this.anchorElement; + if (!a) return; + if (this.hasAttribute("external")) { + a.setAttribute("target", "_blank"); + a.setAttribute("rel", "noopener noreferrer"); + } + if (this.hasAttribute("disabled")) { + a.setAttribute("aria-disabled", "true"); + a.tabIndex = -1; + } else { + a.removeAttribute("aria-disabled"); + a.removeAttribute("tabindex"); + } + } + + #handleClick = (e: Event): void => { + if (this.hasAttribute("disabled")) e.preventDefault(); + }; +} diff --git a/packages/core/src/components/listbox/index.ts b/packages/core/src/components/listbox/index.ts new file mode 100644 index 0000000..891195d --- /dev/null +++ b/packages/core/src/components/listbox/index.ts @@ -0,0 +1,8 @@ +import { PettyListbox } from "./listbox"; +import { PettyListboxOption } from "./listbox-option"; +export { PettyListbox, PettyListboxOption }; + +if (!customElements.get("petty-listbox")) { + customElements.define("petty-listbox", PettyListbox); + customElements.define("petty-listbox-option", PettyListboxOption); +} diff --git a/packages/core/src/components/listbox/listbox-option.ts b/packages/core/src/components/listbox/listbox-option.ts new file mode 100644 index 0000000..af8feb1 --- /dev/null +++ b/packages/core/src/components/listbox/listbox-option.ts @@ -0,0 +1,20 @@ +/** PettyListboxOption — single option within a listbox. */ +export class PettyListboxOption extends HTMLElement { + static observedAttributes = ["value", "disabled"]; + + get value(): string { return this.getAttribute("value") ?? this.textContent?.trim() ?? ""; } + get disabled(): boolean { return this.hasAttribute("disabled"); } + + connectedCallback(): void { + this.setAttribute("role", "option"); + this.setAttribute("tabindex", "-1"); + this.setAttribute("aria-selected", "false"); + if (this.disabled) this.setAttribute("aria-disabled", "true"); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") { + this.setAttribute("aria-disabled", String(this.disabled)); + } + } +} diff --git a/packages/core/src/components/listbox/listbox.schema.ts b/packages/core/src/components/listbox/listbox.schema.ts new file mode 100644 index 0000000..a8c4984 --- /dev/null +++ b/packages/core/src/components/listbox/listbox.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-listbox", description: "Inline selectable list with single or multiple selection and keyboard navigation", tier: 3, attributes: [{ name: "value", type: "string", description: "Currently selected value (comma-separated for multiple)" }, { name: "default-value", type: "string", description: "Initial selected value" }, { name: "multiple", type: "boolean", description: "Allows selecting multiple options" }], parts: [], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires when selection changes" }], example: `AlphaBeta` }; diff --git a/packages/core/src/components/listbox/listbox.ts b/packages/core/src/components/listbox/listbox.ts new file mode 100644 index 0000000..5e78eb1 --- /dev/null +++ b/packages/core/src/components/listbox/listbox.ts @@ -0,0 +1,77 @@ +import { signal, effect } from "../../signals"; +import { emit, initialValue, listen } from "../../shared/helpers"; + +/** PettyListbox — inline selectable list with single or multiple selection. */ +export class PettyListbox extends HTMLElement { + static observedAttributes = ["value", "default-value", "multiple"]; + + readonly #value = signal(""); + #stopEffect: (() => void) | null = null; + + get value(): string { return this.#value.get(); } + set value(v: string) { this.#value.set(v); } + + get multiple(): boolean { return this.hasAttribute("multiple"); } + + /** Selects a value, toggling in multiple mode. */ + selectValue(v: string): void { + if (this.multiple) { + const current = this.#value.get().split(",").filter(Boolean); + const idx = current.indexOf(v); + if (idx >= 0) current.splice(idx, 1); + else current.push(v); + this.#value.set(current.join(",")); + } else { + this.#value.set(v); + } + emit(this, "change", { value: this.#value.get() }); + } + + #cleanup = (): void => {}; + + connectedCallback(): void { + const init = initialValue(this); + if (init) this.#value.set(init); + this.#stopEffect = effect(() => this.#syncChildren()); + this.#cleanup = listen(this, [["keydown", this.#onKeydown], ["click", this.#onClick]]); + } + + disconnectedCallback(): void { + this.#stopEffect = null; + this.#cleanup(); + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) this.#value.set(next); + } + + #options(): HTMLElement[] { + return Array.from(this.querySelectorAll("petty-listbox-option:not([disabled])")); + } + + #syncChildren(): void { + const selected = new Set(this.#value.get().split(",").filter(Boolean)); + const options = this.querySelectorAll("petty-listbox-option"); + for (const opt of options) { + const isSelected = selected.has(opt.getAttribute("value") ?? ""); + opt.dataset.state = isSelected ? "selected" : "unselected"; + opt.setAttribute("aria-selected", String(isSelected)); + } + } + + #onClick = (e: Event): void => { + const opt = (e.target as HTMLElement).closest("petty-listbox-option"); + if (!opt || opt.hasAttribute("disabled")) return; + this.selectValue(opt.getAttribute("value") ?? ""); + }; + + #onKeydown = (e: Event): void => { + const ke = e as KeyboardEvent; + const items = this.#options(); + const active = document.activeElement as HTMLElement; + const idx = items.indexOf(active); + if (ke.key === "ArrowDown") { ke.preventDefault(); items[(idx + 1) % items.length]?.focus(); } + else if (ke.key === "ArrowUp") { ke.preventDefault(); items[(idx - 1 + items.length) % items.length]?.focus(); } + else if (ke.key === "Enter" || ke.key === " ") { ke.preventDefault(); if (active) this.selectValue(active.getAttribute("value") ?? ""); } + }; +} diff --git a/packages/core/src/components/loading-indicator/index.ts b/packages/core/src/components/loading-indicator/index.ts new file mode 100644 index 0000000..1348cdb --- /dev/null +++ b/packages/core/src/components/loading-indicator/index.ts @@ -0,0 +1,6 @@ +import { PettyLoadingIndicator } from "./loading-indicator"; +export { PettyLoadingIndicator }; + +if (!customElements.get("petty-loading-indicator")) { + customElements.define("petty-loading-indicator", PettyLoadingIndicator); +} diff --git a/packages/core/src/components/loading-indicator/loading-indicator.ts b/packages/core/src/components/loading-indicator/loading-indicator.ts new file mode 100644 index 0000000..d615818 --- /dev/null +++ b/packages/core/src/components/loading-indicator/loading-indicator.ts @@ -0,0 +1,35 @@ +/** PettyLoadingIndicator — M3 Expressive shape-morphing loading animation. */ +export class PettyLoadingIndicator extends HTMLElement { + static observedAttributes = ["size", "contained"]; + + get size(): number { return Number(this.getAttribute("size") ?? 48); } + get contained(): boolean { return this.hasAttribute("contained"); } + + connectedCallback(): void { + this.setAttribute("role", "progressbar"); + this.setAttribute("aria-label", this.getAttribute("aria-label") ?? "Loading"); + this.#render(); + } + + attributeChangedCallback(): void { + this.#render(); + } + + #render(): void { + const px = `${this.size}px`; + const el = this.querySelector("[data-part=indicator]"); + if (el instanceof HTMLElement) { + el.style.width = px; + el.style.height = px; + return; + } + const container = document.createElement("div"); + container.dataset.part = "container"; + const indicator = document.createElement("div"); + indicator.dataset.part = "indicator"; + indicator.style.width = px; + indicator.style.height = px; + container.appendChild(indicator); + this.appendChild(container); + } +} diff --git a/packages/core/src/components/meter/index.ts b/packages/core/src/components/meter/index.ts new file mode 100644 index 0000000..1e32677 --- /dev/null +++ b/packages/core/src/components/meter/index.ts @@ -0,0 +1,6 @@ +import { PettyMeter } from "./meter"; +export { PettyMeter }; + +if (!customElements.get("petty-meter")) { + customElements.define("petty-meter", PettyMeter); +} diff --git a/packages/core/src/components/meter/meter.schema.ts b/packages/core/src/components/meter/meter.schema.ts new file mode 100644 index 0000000..c34fb86 --- /dev/null +++ b/packages/core/src/components/meter/meter.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-meter", description: "Value gauge with low/high/optimum state computation", tier: 3, attributes: [{ name: "value", type: "number", default: "0", description: "Current meter value" }, { name: "min", type: "number", default: "0", description: "Minimum value" }, { name: "max", type: "number", default: "100", description: "Maximum value" }, { name: "low", type: "number", description: "Low threshold value" }, { name: "high", type: "number", description: "High threshold value" }, { name: "optimum", type: "number", description: "Optimum value" }], parts: [{ name: "fill", element: "div", description: "Fill element sized via --petty-meter-value CSS custom property" }], events: [], example: `
` }; diff --git a/packages/core/src/components/meter/meter.ts b/packages/core/src/components/meter/meter.ts new file mode 100644 index 0000000..2badf5b --- /dev/null +++ b/packages/core/src/components/meter/meter.ts @@ -0,0 +1,47 @@ +/** PettyMeter — value gauge with low/high/optimum state computation. */ +export class PettyMeter extends HTMLElement { + static observedAttributes = ["value", "min", "max", "low", "high", "optimum"]; + + connectedCallback(): void { + this.setAttribute("role", "meter"); + this.#sync(); + } + + attributeChangedCallback(): void { + this.#sync(); + } + + #num(attr: string, fallback: number): number { + const v = this.getAttribute(attr); + return v !== null ? Number(v) : fallback; + } + + #computeState(val: number, low: number, high: number, optimum: number): string { + if (val <= low) return "low"; + if (val >= high) return "high"; + if (Math.abs(val - optimum) <= (high - low) * 0.1) return "optimum"; + return "medium"; + } + + #updateFill(fraction: number): void { + const fill = this.querySelector("[data-part=fill]"); + if (fill instanceof HTMLElement) fill.style.setProperty("--petty-meter-value", String(fraction)); + } + + #sync(): void { + const val = this.#num("value", 0); + const min = this.#num("min", 0); + const max = this.#num("max", 100); + const low = this.#num("low", min); + const high = this.#num("high", max); + const optimum = this.#num("optimum", (low + high) / 2); + + this.setAttribute("aria-valuenow", String(val)); + this.setAttribute("aria-valuemin", String(min)); + this.setAttribute("aria-valuemax", String(max)); + this.dataset.state = this.#computeState(val, low, high, optimum); + + const range = max - min; + this.#updateFill(range > 0 ? (val - min) / range : 0); + } +} diff --git a/packages/core/src/components/navigation-menu/index.ts b/packages/core/src/components/navigation-menu/index.ts new file mode 100644 index 0000000..8802a9c --- /dev/null +++ b/packages/core/src/components/navigation-menu/index.ts @@ -0,0 +1,8 @@ +import { PettyNavigationMenu } from "./navigation-menu"; +import { PettyNavigationMenuItem } from "./navigation-menu-item"; +export { PettyNavigationMenu, PettyNavigationMenuItem }; + +if (!customElements.get("petty-navigation-menu")) { + customElements.define("petty-navigation-menu", PettyNavigationMenu); + customElements.define("petty-navigation-menu-item", PettyNavigationMenuItem); +} diff --git a/packages/core/src/components/navigation-menu/navigation-menu-item.ts b/packages/core/src/components/navigation-menu/navigation-menu-item.ts new file mode 100644 index 0000000..9769162 --- /dev/null +++ b/packages/core/src/components/navigation-menu/navigation-menu-item.ts @@ -0,0 +1,52 @@ +import { listen } from "../../shared/helpers"; + +/** PettyNavigationMenuItem — nav item with optional popover content on hover. */ +export class PettyNavigationMenuItem extends HTMLElement { + #showTimer: ReturnType | null = null; + #hideTimer: ReturnType | null = null; + + connectedCallback(): void { + const trigger = this.querySelector("[data-part=trigger]"); + const content = this.querySelector("[data-part=content]"); + if (!trigger || !content) return; + trigger.addEventListener("mouseenter", this.#onEnter); + trigger.addEventListener("mouseleave", this.#onLeave); + content.addEventListener("mouseenter", this.#onContentEnter); + content.addEventListener("mouseleave", this.#onLeave); + } + + disconnectedCallback(): void { + this.#clearTimers(); + const trigger = this.querySelector("[data-part=trigger]"); + const content = this.querySelector("[data-part=content]"); + trigger?.removeEventListener("mouseenter", this.#onEnter); + trigger?.removeEventListener("mouseleave", this.#onLeave); + content?.removeEventListener("mouseenter", this.#onContentEnter); + content?.removeEventListener("mouseleave", this.#onLeave); + } + + #content(): HTMLElement | null { return this.querySelector("[data-part=content]"); } + + #clearTimers(): void { + if (this.#showTimer) { clearTimeout(this.#showTimer); this.#showTimer = null; } + if (this.#hideTimer) { clearTimeout(this.#hideTimer); this.#hideTimer = null; } + } + + #onEnter = (): void => { + this.#clearTimers(); + this.#showTimer = setTimeout(() => { + const c = this.#content(); + if (c && !c.matches(":popover-open")) c.showPopover(); + }, 100); + }; + + #onLeave = (): void => { + this.#clearTimers(); + this.#hideTimer = setTimeout(() => { + const c = this.#content(); + if (c && c.matches(":popover-open")) c.hidePopover(); + }, 200); + }; + + #onContentEnter = (): void => { this.#clearTimers(); }; +} diff --git a/packages/core/src/components/navigation-menu/navigation-menu.schema.ts b/packages/core/src/components/navigation-menu/navigation-menu.schema.ts new file mode 100644 index 0000000..210cc5b --- /dev/null +++ b/packages/core/src/components/navigation-menu/navigation-menu.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-navigation-menu", description: "Horizontal nav with optional popover dropdowns on hover", tier: 3, attributes: [{ name: "orientation", type: "string", default: "horizontal", description: "Layout orientation: horizontal or vertical" }], parts: [{ name: "trigger", element: "button", description: "Nav item trigger that shows content on hover (on petty-navigation-menu-item)" }, { name: "content", element: "div", description: "Popover dropdown content (on petty-navigation-menu-item)" }], events: [], example: `` }; diff --git a/packages/core/src/components/navigation-menu/navigation-menu.ts b/packages/core/src/components/navigation-menu/navigation-menu.ts new file mode 100644 index 0000000..72a246c --- /dev/null +++ b/packages/core/src/components/navigation-menu/navigation-menu.ts @@ -0,0 +1,13 @@ +/** PettyNavigationMenu — horizontal nav with optional popover dropdowns. */ +export class PettyNavigationMenu extends HTMLElement { + static observedAttributes = ["orientation"]; + + connectedCallback(): void { + if (!this.querySelector("nav")) this.setAttribute("role", "navigation"); + this.dataset.orientation = this.getAttribute("orientation") ?? "horizontal"; + } + + attributeChangedCallback(): void { + this.dataset.orientation = this.getAttribute("orientation") ?? "horizontal"; + } +} diff --git a/packages/core/src/components/number-field/index.ts b/packages/core/src/components/number-field/index.ts new file mode 100644 index 0000000..eb0acd0 --- /dev/null +++ b/packages/core/src/components/number-field/index.ts @@ -0,0 +1,6 @@ +import { PettyNumberField } from "./number-field"; +export { PettyNumberField }; + +if (!customElements.get("petty-number-field")) { + customElements.define("petty-number-field", PettyNumberField); +} diff --git a/packages/core/src/components/number-field/number-field.schema.ts b/packages/core/src/components/number-field/number-field.schema.ts new file mode 100644 index 0000000..bb768bb --- /dev/null +++ b/packages/core/src/components/number-field/number-field.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-number-field", description: "Numeric input with increment/decrement buttons and value clamping", tier: 3, attributes: [{ name: "min", type: "number", description: "Minimum allowed value" }, { name: "max", type: "number", description: "Maximum allowed value" }, { name: "step", type: "number", default: "1", description: "Step increment/decrement amount" }, { name: "value", type: "number", description: "Current numeric value" }, { name: "disabled", type: "boolean", description: "Disables the field" }, { name: "name", type: "string", description: "Form field name" }], parts: [{ name: "control", element: "input", description: "The numeric input element" }, { name: "label", element: "label", description: "Label auto-linked to the input" }, { name: "increment", element: "button", description: "Button to increase the value" }, { name: "decrement", element: "button", description: "Button to decrease the value" }], events: [{ name: "petty-change", detail: "{ value: number }", description: "Fires when the value changes" }], example: `` }; diff --git a/packages/core/src/components/number-field/number-field.ts b/packages/core/src/components/number-field/number-field.ts new file mode 100644 index 0000000..c8cb061 --- /dev/null +++ b/packages/core/src/components/number-field/number-field.ts @@ -0,0 +1,88 @@ +import { signal } from "../../signals"; +import { emit, listen, part } from "../../shared/helpers"; +import { uniqueId } from "../../shared/aria"; + +/** PettyNumberField — numeric input with increment/decrement buttons and clamping. */ +export class PettyNumberField extends HTMLElement { + static observedAttributes = ["min", "max", "step", "value", "disabled", "name"]; + + readonly #value = signal(0); + #cleanup = (): void => {}; + + get value(): number { return this.#value.get(); } + set value(v: number) { this.#applyValue(v); } + + connectedCallback(): void { + const input = this.#input(); + const init = this.getAttribute("value"); + if (init !== null) this.#value.set(Number(init)); + this.#syncInput(); + this.#wireLabel(); + + const c1 = listen(input, [["input", this.#onInput], ["keydown", this.#onKeydown as EventListener]]); + const c2 = listen(part(this, "increment"), [["click", this.#onIncrement]]); + const c3 = listen(part(this, "decrement"), [["click", this.#onDecrement]]); + this.#cleanup = () => { c1(); c2(); c3(); }; + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) this.#value.set(Number(next)); + this.#syncInput(); + } + + #input(): HTMLInputElement | null { + return this.querySelector("input[data-part=control]"); + } + + #wireLabel(): void { + const input = this.#input(); + const label = this.querySelector("[data-part=label]"); + if (input && label) { + if (!input.id) input.id = uniqueId("petty-nf"); + (label as HTMLLabelElement).htmlFor = input.id; + } + } + + #clamp(v: number): number { + const min = Number(this.getAttribute("min") ?? -Infinity); + const max = Number(this.getAttribute("max") ?? Infinity); + return Math.min(Math.max(v, min), max); + } + + #step(): number { + return Number(this.getAttribute("step") ?? 1); + } + + #applyValue(v: number): void { + const clamped = this.#clamp(v); + this.#value.set(clamped); + this.#syncInput(); + emit(this, "change", { value: clamped }); + } + + #syncInput(): void { + const input = this.#input(); + if (!input) return; + input.value = String(this.#value.get()); + input.disabled = this.hasAttribute("disabled"); + if (this.hasAttribute("name")) input.name = this.getAttribute("name") ?? ""; + } + + #onInput = (): void => { + const raw = Number(this.#input()?.value ?? 0); + if (!Number.isNaN(raw)) this.#applyValue(raw); + }; + + #onKeydown = (e: KeyboardEvent): void => { + if (e.key === "ArrowUp") { e.preventDefault(); this.#applyValue(this.#value.get() + this.#step()); } + if (e.key === "ArrowDown") { e.preventDefault(); this.#applyValue(this.#value.get() - this.#step()); } + }; + + #onIncrement = (): void => { if (!this.hasAttribute("disabled")) this.#applyValue(this.#value.get() + this.#step()); }; + #onDecrement = (): void => { if (!this.hasAttribute("disabled")) this.#applyValue(this.#value.get() - this.#step()); }; + +} diff --git a/packages/core/src/components/pagination/index.ts b/packages/core/src/components/pagination/index.ts new file mode 100644 index 0000000..f1c5c4b --- /dev/null +++ b/packages/core/src/components/pagination/index.ts @@ -0,0 +1,8 @@ +import { PettyPagination } from "./pagination"; +import { PettyPaginationItem } from "./pagination-item"; +export { PettyPagination, PettyPaginationItem }; + +if (!customElements.get("petty-pagination")) { + customElements.define("petty-pagination", PettyPagination); + customElements.define("petty-pagination-item", PettyPaginationItem); +} diff --git a/packages/core/src/components/pagination/pagination-item.ts b/packages/core/src/components/pagination/pagination-item.ts new file mode 100644 index 0000000..f09a4ad --- /dev/null +++ b/packages/core/src/components/pagination/pagination-item.ts @@ -0,0 +1,44 @@ +import { listen } from "../../shared/helpers"; + +/** PettyPaginationItem — single page button within a pagination component. */ +export class PettyPaginationItem extends HTMLElement { + static observedAttributes = ["value", "type", "disabled"]; + + #cleanup = (): void => {}; + + connectedCallback(): void { + this.setAttribute("role", "button"); + this.setAttribute("tabindex", "0"); + this.#cleanup = listen(this, [["click", this.#handleClick], ["keydown", this.#handleKeydown]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") { + this.setAttribute("aria-disabled", String(this.hasAttribute("disabled"))); + } + } + + #pagination(): { goToPage(n: number): void; currentPage: number } | null { + return this.closest("petty-pagination") as { goToPage(n: number): void; currentPage: number } | null; + } + + #activate(): void { + if (this.hasAttribute("disabled")) return; + const pag = this.#pagination(); + if (!pag) return; + const type = this.getAttribute("type"); + if (type === "prev") pag.goToPage(pag.currentPage - 1); + else if (type === "next") pag.goToPage(pag.currentPage + 1); + else pag.goToPage(Number(this.getAttribute("value") ?? 1)); + } + + #handleClick = (): void => { this.#activate(); }; + #handleKeydown = (e: Event): void => { + const ke = e as KeyboardEvent; + if (ke.key === "Enter" || ke.key === " ") { ke.preventDefault(); this.#activate(); } + }; +} diff --git a/packages/core/src/components/pagination/pagination.schema.ts b/packages/core/src/components/pagination/pagination.schema.ts new file mode 100644 index 0000000..34d6f73 --- /dev/null +++ b/packages/core/src/components/pagination/pagination.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-pagination", description: "Page navigation with prev/next and numbered page items", tier: 3, attributes: [{ name: "total", type: "number", description: "Total number of items" }, { name: "page-size", type: "number", default: "10", description: "Items per page" }, { name: "current-page", type: "number", default: "1", description: "Current active page number" }], parts: [], events: [{ name: "petty-change", detail: "{ page: number }", description: "Fires when the current page changes" }], example: `Prev12Next` }; diff --git a/packages/core/src/components/pagination/pagination.ts b/packages/core/src/components/pagination/pagination.ts new file mode 100644 index 0000000..1e73021 --- /dev/null +++ b/packages/core/src/components/pagination/pagination.ts @@ -0,0 +1,61 @@ +import { signal, effect } from "../../signals"; +import { emit } from "../../shared/helpers"; + +/** PettyPagination — page navigation with prev/next and numbered items. */ +export class PettyPagination extends HTMLElement { + static observedAttributes = ["total", "page-size", "current-page"]; + + readonly #page = signal(1); + #stopEffect: (() => void) | null = null; + + get totalPages(): number { + const total = Number(this.getAttribute("total") ?? 0); + const size = Number(this.getAttribute("page-size") ?? 10); + return Math.max(1, Math.ceil(total / size)); + } + + get currentPage(): number { return this.#page.get(); } + set currentPage(v: number) { this.goToPage(v); } + + /** Navigates to a specific page, clamped to valid range. */ + goToPage(n: number): void { + const clamped = Math.min(Math.max(1, n), this.totalPages); + if (this.#page.get() === clamped) return; + this.#page.set(clamped); + emit(this, "change", { page: clamped }); + } + + connectedCallback(): void { + const init = Number(this.getAttribute("current-page") ?? 1); + this.#page.set(init); + this.#stopEffect = effect(() => this.#syncChildren()); + } + + disconnectedCallback(): void { + this.#stopEffect = null; + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "current-page" && next !== null) this.#page.set(Number(next)); + } + + #syncChildren(): void { + const page = this.#page.get(); + const total = this.totalPages; + const items = this.querySelectorAll("petty-pagination-item"); + for (const item of items) { + const type = item.getAttribute("type"); + const val = Number(item.getAttribute("value") ?? 0); + if (type === "prev") { + item.toggleAttribute("disabled", page <= 1); + } else if (type === "next") { + item.toggleAttribute("disabled", page >= total); + } else { + const isActive = val === page; + item.dataset.state = isActive ? "active" : "inactive"; + if (isActive) item.setAttribute("aria-current", "page"); + else item.removeAttribute("aria-current"); + } + } + } +} diff --git a/packages/core/src/components/parallax/index.ts b/packages/core/src/components/parallax/index.ts new file mode 100644 index 0000000..68f80a6 --- /dev/null +++ b/packages/core/src/components/parallax/index.ts @@ -0,0 +1,6 @@ +import { PettyParallax } from "./parallax"; +export { PettyParallax }; + +if (!customElements.get("petty-parallax")) { + customElements.define("petty-parallax", PettyParallax); +} diff --git a/packages/core/src/components/parallax/parallax.ts b/packages/core/src/components/parallax/parallax.ts new file mode 100644 index 0000000..bfc28f0 --- /dev/null +++ b/packages/core/src/components/parallax/parallax.ts @@ -0,0 +1,39 @@ +/** PettyParallax — creates depth effect by translating element based on scroll position. */ +export class PettyParallax extends HTMLElement { + static observedAttributes = ["speed", "direction"]; + + #frame: ReturnType | null = null; + + get speed(): number { return Number(this.getAttribute("speed") ?? 0.5); } + get direction(): string { return this.getAttribute("direction") ?? "up"; } + + connectedCallback(): void { + this.style.willChange = "transform"; + window.addEventListener("scroll", this.#onScroll, { passive: true }); + this.#update(); + } + + disconnectedCallback(): void { + window.removeEventListener("scroll", this.#onScroll); + if (this.#frame) cancelAnimationFrame(this.#frame); + } + + #onScroll = (): void => { + if (this.#frame) return; + this.#frame = requestAnimationFrame(() => { + this.#update(); + this.#frame = null; + }); + }; + + #update(): void { + const rect = this.getBoundingClientRect(); + const viewH = window.innerHeight; + const center = rect.top + rect.height / 2; + const offset = (center - viewH / 2) * this.speed; + const dir = this.direction; + const x = dir === "left" ? -offset : dir === "right" ? offset : 0; + const y = dir === "up" ? -offset : dir === "down" ? offset : dir === "left" || dir === "right" ? 0 : -offset; + this.style.transform = `translate3d(${x}px, ${y}px, 0)`; + } +} diff --git a/packages/core/src/components/popover/index.ts b/packages/core/src/components/popover/index.ts new file mode 100644 index 0000000..163a200 --- /dev/null +++ b/packages/core/src/components/popover/index.ts @@ -0,0 +1,6 @@ +import { PettyPopover } from "./popover"; +export { PettyPopover }; + +if (!customElements.get("petty-popover")) { + customElements.define("petty-popover", PettyPopover); +} diff --git a/packages/core/src/components/popover/popover.schema.ts b/packages/core/src/components/popover/popover.schema.ts new file mode 100644 index 0000000..a83b545 --- /dev/null +++ b/packages/core/src/components/popover/popover.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-popover", description: "Headless popover built on the native Popover API with ARIA linking", tier: 2, attributes: [], parts: [{ name: "content", element: "div", description: "The popover content element (must have popover attribute)" }], events: [{ name: "petty-toggle", detail: "{ open: boolean }", description: "Fires when the popover opens or closes" }], example: `

Popover content

` }; diff --git a/packages/core/src/components/popover/popover.ts b/packages/core/src/components/popover/popover.ts new file mode 100644 index 0000000..636f13d --- /dev/null +++ b/packages/core/src/components/popover/popover.ts @@ -0,0 +1,81 @@ +import { emit, listen } from "../../shared/helpers"; +import { uniqueId } from "../../shared/aria"; + +/** + * PettyPopover — headless popover custom element built on the native Popover API. + * + * Usage: + * ```html + * + * + *
+ *

Popover content

+ *
+ *
+ * ``` + * + * The browser handles: open/close, light dismiss, Escape, top-layer. + * This element adds: ARIA linking (trigger aria-controls + aria-expanded), + * toggle event forwarding as petty-toggle CustomEvent. + */ +export class PettyPopover extends HTMLElement { + /** Finds the first child element that has the `popover` attribute. */ + get popoverElement(): HTMLElement | null { + return this.querySelector("[popover]"); + } + + /** Finds the first `
AppleBanana
` }; diff --git a/packages/core/src/components/select/select.ts b/packages/core/src/components/select/select.ts new file mode 100644 index 0000000..4377c67 --- /dev/null +++ b/packages/core/src/components/select/select.ts @@ -0,0 +1,185 @@ +import { signal } from "../../signals"; +import { part, emit, initialValue, listen } from "../../shared/helpers"; +import { uniqueId } from "../../shared/aria"; + +/** + * PettySelect — headless select custom element built on the native Popover API. + * + * Usage: + * ```html + * + * + *
+ * Apple + * Banana + *
+ * + *
+ * ``` + * + * The browser handles: open/close, light dismiss, Escape, top-layer. + * This element adds: value state, keyboard navigation, ARIA, hidden input sync. + */ +export class PettySelect extends HTMLElement { + static observedAttributes = ["value", "default-value", "placeholder"] as const; + + readonly #value = signal(""); + #highlightIndex = -1; + + /** The currently selected value. */ + get value(): string { + return this.#value.get(); + } + + /** Whether the listbox popover is currently open. */ + get isOpen(): boolean { + const lb = this.#listbox(); + return lb ? lb.matches(":popover-open") : false; + } + + /** Opens the listbox popover programmatically. */ + open(): void { + const lb = this.#listbox(); + if (lb && !this.isOpen) lb.showPopover(); + } + + /** Closes the listbox popover programmatically. */ + close(): void { + const lb = this.#listbox(); + if (lb && this.isOpen) lb.hidePopover(); + } + + /** @internal */ + connectedCallback(): void { + const trigger = this.#trigger(); + const lb = this.#listbox(); + if (!lb) return; + + if (!lb.id) lb.id = uniqueId("petty-select-lb"); + if (trigger) { + trigger.setAttribute("aria-haspopup", "listbox"); + trigger.setAttribute("aria-expanded", "false"); + trigger.setAttribute("aria-controls", lb.id); + } + + const init = initialValue(this); + if (init) this.#applyValue(init, false); + + lb.addEventListener("toggle", this.#onToggle); + lb.addEventListener("keydown", this.#onKeydown); + lb.addEventListener("click", this.#onOptionClick); + } + + /** @internal */ + disconnectedCallback(): void { + const lb = this.#listbox(); + lb?.removeEventListener("toggle", this.#onToggle); + lb?.removeEventListener("keydown", this.#onKeydown); + lb?.removeEventListener("click", this.#onOptionClick); + } + + /** @internal */ + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) this.#applyValue(next, false); + } + + #trigger(): HTMLButtonElement | null { + return this.querySelector("button[data-part='trigger']"); + } + + #listbox(): HTMLElement | null { + return this.querySelector("[data-part='listbox']"); + } + + #options(): NodeListOf { + return this.querySelectorAll("petty-select-option:not([disabled])"); + } + + #hiddenInput(): HTMLInputElement | null { + return this.querySelector("input[type='hidden']"); + } + + #applyValue(val: string, dispatch: boolean): void { + this.#value.set(val); + const trigger = this.#trigger(); + const input = this.#hiddenInput(); + const options = this.#options(); + + let label = this.getAttribute("placeholder") ?? ""; + options.forEach((opt) => { + const isSelected = opt.getAttribute("value") === val; + opt.setAttribute("aria-selected", String(isSelected)); + if (isSelected) label = opt.textContent?.trim() ?? val; + }); + + if (trigger) trigger.textContent = label || val; + if (input) input.value = val; + + if (dispatch) { + emit(this, "change", { value: val }); + } + } + + #setHighlight(index: number): void { + const options = Array.from(this.#options()); + options.forEach((opt, i) => { + if (i === index) { + opt.setAttribute("data-highlighted", ""); + opt.setAttribute("id", opt.id || `petty-opt-${i}`); + this.#listbox()?.setAttribute("aria-activedescendant", opt.id); + } else { + opt.removeAttribute("data-highlighted"); + } + }); + this.#highlightIndex = index; + } + + #onToggle = (event: Event): void => { + const toggleEvent = event as ToggleEvent; + const open = toggleEvent.newState === "open"; + const trigger = this.#trigger(); + if (trigger) trigger.setAttribute("aria-expanded", String(open)); + if (open) { + const options = Array.from(this.#options()); + const selectedIdx = options.findIndex( + (opt) => opt.getAttribute("value") === this.#value.get(), + ); + this.#setHighlight(selectedIdx >= 0 ? selectedIdx : 0); + this.#listbox()?.focus(); + } else { + this.#highlightIndex = -1; + this.#listbox()?.removeAttribute("aria-activedescendant"); + } + }; + + #onKeydown = (event: KeyboardEvent): void => { + const options = Array.from(this.#options()); + const len = options.length; + if (len === 0) return; + + if (event.key === "ArrowDown") { + event.preventDefault(); + this.#setHighlight((this.#highlightIndex + 1) % len); + } else if (event.key === "ArrowUp") { + event.preventDefault(); + this.#setHighlight((this.#highlightIndex - 1 + len) % len); + } else if (event.key === "Enter") { + event.preventDefault(); + const opt = options[this.#highlightIndex]; + if (opt) this.#selectOption(opt); + } else if (event.key === "Escape") { + this.close(); + } + }; + + #onOptionClick = (event: Event): void => { + const target = (event.target as Element).closest("petty-select-option"); + if (target && !target.hasAttribute("disabled")) this.#selectOption(target as HTMLElement); + }; + + #selectOption(opt: HTMLElement): void { + const val = opt.getAttribute("value") ?? opt.textContent?.trim() ?? ""; + this.#applyValue(val, true); + this.close(); + } +} diff --git a/packages/core/src/components/separator/index.ts b/packages/core/src/components/separator/index.ts new file mode 100644 index 0000000..f4f632b --- /dev/null +++ b/packages/core/src/components/separator/index.ts @@ -0,0 +1,6 @@ +import { PettySeparator } from "./separator"; +export { PettySeparator }; + +if (!customElements.get("petty-separator")) { + customElements.define("petty-separator", PettySeparator); +} diff --git a/packages/core/src/components/separator/separator.schema.ts b/packages/core/src/components/separator/separator.schema.ts new file mode 100644 index 0000000..d10a11b --- /dev/null +++ b/packages/core/src/components/separator/separator.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-separator", description: "Accessible divider with configurable orientation", tier: 1, attributes: [{ name: "orientation", type: "string", default: "horizontal", description: "Divider orientation: horizontal or vertical" }], parts: [], events: [], example: `` }; diff --git a/packages/core/src/components/separator/separator.ts b/packages/core/src/components/separator/separator.ts new file mode 100644 index 0000000..3a094ac --- /dev/null +++ b/packages/core/src/components/separator/separator.ts @@ -0,0 +1,19 @@ +/** PettySeparator — accessible divider with configurable orientation. */ +export class PettySeparator extends HTMLElement { + static observedAttributes = ["orientation"]; + + connectedCallback(): void { + this.setAttribute("role", "separator"); + this.#syncOrientation(); + } + + attributeChangedCallback(): void { + this.#syncOrientation(); + } + + #syncOrientation(): void { + const orientation = this.getAttribute("orientation") ?? "horizontal"; + this.setAttribute("aria-orientation", orientation); + this.dataset.orientation = orientation; + } +} diff --git a/packages/core/src/components/skeleton/index.ts b/packages/core/src/components/skeleton/index.ts new file mode 100644 index 0000000..368e766 --- /dev/null +++ b/packages/core/src/components/skeleton/index.ts @@ -0,0 +1,6 @@ +import { PettySkeleton } from "./skeleton"; +export { PettySkeleton }; + +if (!customElements.get("petty-skeleton")) { + customElements.define("petty-skeleton", PettySkeleton); +} diff --git a/packages/core/src/components/skeleton/skeleton.schema.ts b/packages/core/src/components/skeleton/skeleton.schema.ts new file mode 100644 index 0000000..e1055d7 --- /dev/null +++ b/packages/core/src/components/skeleton/skeleton.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-skeleton", description: "Loading placeholder with aria-busy and loaded state transitions", tier: 3, attributes: [{ name: "loaded", type: "boolean", description: "When set, transitions from loading to loaded state" }], parts: [], events: [], example: `Loading content...` }; diff --git a/packages/core/src/components/skeleton/skeleton.ts b/packages/core/src/components/skeleton/skeleton.ts new file mode 100644 index 0000000..e9c8fb6 --- /dev/null +++ b/packages/core/src/components/skeleton/skeleton.ts @@ -0,0 +1,19 @@ +/** PettySkeleton — loading placeholder with aria-busy and loaded state transitions. */ +export class PettySkeleton extends HTMLElement { + static observedAttributes = ["loaded"]; + + get loaded(): boolean { return this.hasAttribute("loaded"); } + + connectedCallback(): void { + this.setAttribute("role", "status"); + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-busy", "true"); + this.dataset.state = "loading"; + } + + attributeChangedCallback(): void { + const done = this.loaded; + this.setAttribute("aria-busy", String(!done)); + this.dataset.state = done ? "loaded" : "loading"; + } +} diff --git a/packages/core/src/components/slider/index.ts b/packages/core/src/components/slider/index.ts new file mode 100644 index 0000000..eacd644 --- /dev/null +++ b/packages/core/src/components/slider/index.ts @@ -0,0 +1,6 @@ +import { PettySlider } from "./slider"; +export { PettySlider }; + +if (!customElements.get("petty-slider")) { + customElements.define("petty-slider", PettySlider); +} diff --git a/packages/core/src/components/slider/slider.schema.ts b/packages/core/src/components/slider/slider.schema.ts new file mode 100644 index 0000000..070a6f1 --- /dev/null +++ b/packages/core/src/components/slider/slider.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-slider", description: "Range input wrapper with label, output display, and change events", tier: 3, attributes: [{ name: "min", type: "number", description: "Minimum slider value" }, { name: "max", type: "number", description: "Maximum slider value" }, { name: "step", type: "number", description: "Step increment" }, { name: "value", type: "number", description: "Current slider value" }, { name: "disabled", type: "boolean", description: "Disables the slider" }, { name: "name", type: "string", description: "Form field name" }, { name: "orientation", type: "string", default: "horizontal", description: "Slider orientation: horizontal or vertical" }], parts: [{ name: "control", element: "input", description: "The range input element" }, { name: "label", element: "label", description: "Label auto-linked to the input" }, { name: "output", element: "output", description: "Displays the current numeric value" }], events: [{ name: "petty-change", detail: "{ value: number }", description: "Fires when the slider value changes" }], example: `` }; diff --git a/packages/core/src/components/slider/slider.ts b/packages/core/src/components/slider/slider.ts new file mode 100644 index 0000000..633d3d6 --- /dev/null +++ b/packages/core/src/components/slider/slider.ts @@ -0,0 +1,63 @@ +import { emit, listen, part, wireLabel } from "../../shared/helpers"; + +/** PettySlider — range input wrapper with label, output, and change events. */ +export class PettySlider extends HTMLElement { + static observedAttributes = ["min", "max", "step", "value", "disabled", "name", "orientation"]; + + #cleanup = (): void => {}; + + get value(): number { + return Number(this.#input()?.value ?? 0); + } + + set value(v: number) { + const input = this.#input(); + if (input) { input.value = String(v); this.#syncOutput(); } + } + + connectedCallback(): void { + const input = this.#input(); + if (!input) return; + this.#syncAttrs(); + wireLabel(input, part(this, "label"), "petty-slider"); + this.#syncOutput(); + this.#cleanup = listen(input, [["input", this.#handleInput]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(): void { + this.#syncAttrs(); + this.#syncOutput(); + } + + #input(): HTMLInputElement | null { + return this.querySelector("input[data-part=control]"); + } + + #syncAttrs(): void { + const input = this.#input(); + if (!input) return; + for (const attr of ["min", "max", "step", "name"]) { + const val = this.getAttribute(attr); + if (val !== null) input.setAttribute(attr, val); + } + const v = this.getAttribute("value"); + if (v !== null) input.value = v; + input.disabled = this.hasAttribute("disabled"); + this.dataset.orientation = this.getAttribute("orientation") ?? "horizontal"; + } + + #syncOutput(): void { + const output = this.querySelector("[data-part=output]"); + if (output) output.textContent = String(this.value); + } + + #handleInput = (): void => { + this.#syncOutput(); + emit(this, "change", { value: this.value }); + }; + +} diff --git a/packages/core/src/components/stagger/index.ts b/packages/core/src/components/stagger/index.ts new file mode 100644 index 0000000..feba48b --- /dev/null +++ b/packages/core/src/components/stagger/index.ts @@ -0,0 +1,6 @@ +import { PettyStagger } from "./stagger"; +export { PettyStagger }; + +if (!customElements.get("petty-stagger")) { + customElements.define("petty-stagger", PettyStagger); +} diff --git a/packages/core/src/components/stagger/stagger.ts b/packages/core/src/components/stagger/stagger.ts new file mode 100644 index 0000000..e982dca --- /dev/null +++ b/packages/core/src/components/stagger/stagger.ts @@ -0,0 +1,35 @@ +import { emit } from "../../shared/helpers"; + +/** PettyStagger — animates children in sequence with configurable delay between each. */ +export class PettyStagger extends HTMLElement { + static observedAttributes = ["delay", "stagger", "animation"]; + + get delay(): number { return Number(this.getAttribute("delay") ?? 0); } + get stagger(): number { return Number(this.getAttribute("stagger") ?? 100); } + get animation(): string { return this.getAttribute("animation") ?? "fade-up"; } + + /** Triggers the stagger animation on all children. */ + start(): void { + const children = Array.from(this.children) as HTMLElement[]; + children.forEach((child, i) => { + child.style.animationDelay = `${this.delay + i * this.stagger}ms`; + child.classList.remove("petty-stagger-hidden"); + child.classList.add(`petty-stagger-${this.animation}`); + }); + this.dataset.state = "animating"; + const totalDuration = this.delay + children.length * this.stagger + 600; + setTimeout(() => { + this.dataset.state = "done"; + emit(this, "complete", {}); + }, totalDuration); + } + + connectedCallback(): void { + const children = Array.from(this.children) as HTMLElement[]; + for (const child of children) { + child.classList.add("petty-stagger-hidden"); + } + this.dataset.state = "idle"; + requestAnimationFrame(() => this.start()); + } +} diff --git a/packages/core/src/components/switch/index.ts b/packages/core/src/components/switch/index.ts new file mode 100644 index 0000000..38ba762 --- /dev/null +++ b/packages/core/src/components/switch/index.ts @@ -0,0 +1,6 @@ +import { PettySwitch } from "./switch"; +export { PettySwitch }; + +if (!customElements.get("petty-switch")) { + customElements.define("petty-switch", PettySwitch); +} diff --git a/packages/core/src/components/switch/switch.schema.ts b/packages/core/src/components/switch/switch.schema.ts new file mode 100644 index 0000000..2809d2c --- /dev/null +++ b/packages/core/src/components/switch/switch.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-switch", description: "On/off toggle built on a button with role=switch", tier: 3, attributes: [{ name: "checked", type: "boolean", description: "Whether the switch is on" }, { name: "disabled", type: "boolean", description: "Disables the switch" }, { name: "name", type: "string", description: "Form field name" }], parts: [{ name: "control", element: "button", description: "The toggle button with role=switch" }, { name: "label", element: "span", description: "Label linked via aria-labelledby" }], events: [{ name: "petty-change", detail: "{ checked: boolean }", description: "Fires when the switch is toggled" }], example: `Dark mode` }; diff --git a/packages/core/src/components/switch/switch.ts b/packages/core/src/components/switch/switch.ts new file mode 100644 index 0000000..882a782 --- /dev/null +++ b/packages/core/src/components/switch/switch.ts @@ -0,0 +1,61 @@ +import { signal } from "../../signals"; +import { emit, listen, part, wireLabel } from "../../shared/helpers"; + +/** PettySwitch — on/off toggle built on a button with role="switch". */ +export class PettySwitch extends HTMLElement { + static observedAttributes = ["checked", "disabled", "name"]; + + readonly #checked = signal(false); + #cleanup = (): void => {}; + + get checked(): boolean { return this.#checked.get(); } + set checked(v: boolean) { this.#checked.set(v); this.#sync(); } + + connectedCallback(): void { + const btn = this.#button(); + if (!btn) return; + if (this.hasAttribute("checked")) this.#checked.set(true); + btn.setAttribute("role", "switch"); + wireLabel(btn, part(this, "label"), "petty-sw"); + this.#sync(); + this.#cleanup = listen(btn, [ + ["click", this.#handleClick], + ["keydown", this.#handleKeydown], + ]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "checked") this.#checked.set(next !== null); + this.#sync(); + } + + #button(): HTMLButtonElement | null { + return part(this, "control"); + } + + #sync(): void { + const btn = this.#button(); + if (!btn) return; + const on = this.#checked.get(); + btn.setAttribute("aria-checked", String(on)); + btn.disabled = this.hasAttribute("disabled"); + this.dataset.state = on ? "on" : "off"; + } + + #toggle(): void { + if (this.hasAttribute("disabled")) return; + this.#checked.set(!this.#checked.get()); + this.#sync(); + emit(this, "change", { checked: this.#checked.get() }); + } + + #handleClick = (): void => { this.#toggle(); }; + #handleKeydown = (e: Event): void => { + const ke = e as KeyboardEvent; + if (ke.key === " " || ke.key === "Enter") { ke.preventDefault(); this.#toggle(); } + }; +} diff --git a/packages/core/src/components/tabs/index.ts b/packages/core/src/components/tabs/index.ts new file mode 100644 index 0000000..9a59739 --- /dev/null +++ b/packages/core/src/components/tabs/index.ts @@ -0,0 +1,10 @@ +import { PettyTabs } from "./tabs"; +import { PettyTab } from "./tab"; +import { PettyTabPanel } from "./tab-panel"; +export { PettyTabs, PettyTab, PettyTabPanel }; + +if (!customElements.get("petty-tabs")) { + customElements.define("petty-tabs", PettyTabs); + customElements.define("petty-tab", PettyTab); + customElements.define("petty-tab-panel", PettyTabPanel); +} diff --git a/packages/core/src/components/tabs/tab-panel.ts b/packages/core/src/components/tabs/tab-panel.ts new file mode 100644 index 0000000..fcf3d83 --- /dev/null +++ b/packages/core/src/components/tabs/tab-panel.ts @@ -0,0 +1,15 @@ +/** PettyTabPanel — tab content panel managed by a parent petty-tabs element. */ +export class PettyTabPanel extends HTMLElement { + static observedAttributes = ["value"]; + + /** The value identifying this panel, matched against petty-tab. */ + get value(): string { + return this.getAttribute("value") ?? ""; + } + + /** @internal */ + connectedCallback(): void { + this.setAttribute("role", "tabpanel"); + if (!this.dataset.state) this.setAttribute("hidden", ""); + } +} diff --git a/packages/core/src/components/tabs/tab.ts b/packages/core/src/components/tabs/tab.ts new file mode 100644 index 0000000..f2fe6c5 --- /dev/null +++ b/packages/core/src/components/tabs/tab.ts @@ -0,0 +1,78 @@ +import { listen } from "../../shared/helpers"; + +/** + * PettyTab — individual tab button within a petty-tabs component. + * + * Sets role="tab", manages tabIndex, and delegates activation to the + * nearest petty-tabs ancestor via selectTab(). Supports ArrowLeft/Right + * keyboard navigation between sibling petty-tab elements. + */ +export class PettyTab extends HTMLElement { + static observedAttributes = ["value", "disabled"]; + + /** The value identifying this tab, matched against petty-tab-panel. */ + get value(): string { + return this.getAttribute("value") ?? ""; + } + + /** Whether this tab is disabled. */ + get disabled(): boolean { + return this.hasAttribute("disabled"); + } + + /** @internal */ + #cleanup = (): void => {}; + + connectedCallback(): void { + this.setAttribute("role", "tab"); + this.setAttribute("tabindex", "-1"); + this.#cleanup = listen(this, [["click", this.#handleClick], ["keydown", this.#handleKeydown]]); + } + + /** @internal */ + disconnectedCallback(): void { + this.#cleanup(); + } + + /** @internal */ + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "disabled") { + this.setAttribute("aria-disabled", next !== null ? "true" : "false"); + } + } + + #handleClick = (): void => { + if (this.disabled) return; + const tabs = this.#siblingTabs(); + const host = this.#host(); + if (host) host.selectTab(this.value); + const active = tabs.find(t => t.value === this.value); + active?.focus(); + }; + + #handleKeydown = (e: Event): void => { + const ke = e as KeyboardEvent; + if (ke.key !== "ArrowLeft" && ke.key !== "ArrowRight") return; + const tabs = this.#siblingTabs().filter(t => !t.disabled); + const idx = tabs.indexOf(this); + if (idx === -1) return; + const nextIdx = ke.key === "ArrowRight" + ? (idx + 1) % tabs.length + : (idx - 1 + tabs.length) % tabs.length; + const next = tabs[nextIdx]; + if (!next) return; + const host = this.#host(); + if (host) host.selectTab(next.value); + next.focus(); + }; + + #siblingTabs(): PettyTab[] { + const list = this.closest("[role=tablist]") ?? this.closest("petty-tabs"); + if (!list) return []; + return Array.from(list.querySelectorAll("petty-tab")); + } + + #host(): { selectTab(v: string): void } | null { + return this.closest("petty-tabs") as { selectTab(v: string): void } | null; + } +} diff --git a/packages/core/src/components/tabs/tabs.schema.ts b/packages/core/src/components/tabs/tabs.schema.ts new file mode 100644 index 0000000..d14ce4d --- /dev/null +++ b/packages/core/src/components/tabs/tabs.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-tabs", description: "Headless tabbed interface with reactive tab/panel management", tier: 3, attributes: [{ name: "value", type: "string", description: "Currently active tab value" }, { name: "default-value", type: "string", description: "Initial active tab value" }], parts: [], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires when the active tab changes" }], example: `
Tab 1Tab 2
Content 1Content 2
` }; diff --git a/packages/core/src/components/tabs/tabs.ts b/packages/core/src/components/tabs/tabs.ts new file mode 100644 index 0000000..d72a9f6 --- /dev/null +++ b/packages/core/src/components/tabs/tabs.ts @@ -0,0 +1,85 @@ +import { signal, effect } from "../../signals"; +import { emit, initialValue } from "../../shared/helpers"; + +/** + * PettyTabs — headless tabbed interface custom element. + * + * Usage: + * ```html + * + *
+ * Tab 1 + * Tab 2 + *
+ * Content 1 + * Content 2 + *
+ * ``` + * + * Manages active-tab state via a reactive signal and syncs data-state, + * aria-selected, and hidden attributes to child petty-tab / petty-tab-panel + * elements. Dispatches "petty-change" when the active tab changes. + */ +export class PettyTabs extends HTMLElement { + static observedAttributes = ["value", "default-value"]; + + readonly #active = signal(""); + #stopEffect: (() => void) | null = null; + + /** The currently active tab value. */ + get value(): string { + return this.#active.get(); + } + + /** Set the active tab programmatically. */ + set value(v: string) { + this.#active.set(v); + } + + /** Activates a tab by value and fires "petty-change". */ + selectTab(v: string): void { + if (this.#active.get() === v) return; + this.#active.set(v); + emit(this, "change", { value: v }); + } + + /** @internal */ + connectedCallback(): void { + const initial = this.getAttribute("default-value") ?? ""; + this.#active.set(initial); + this.#stopEffect = effect(() => this.#syncChildren()); + } + + /** @internal */ + disconnectedCallback(): void { + this.#stopEffect = null; + } + + /** @internal */ + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) this.#active.set(next); + } + + #syncChildren(): void { + const active = this.#active.get(); + const tabs = this.querySelectorAll("petty-tab"); + const panels = this.querySelectorAll("petty-tab-panel"); + + for (const tab of tabs) { + const isActive = tab.getAttribute("value") === active; + tab.dataset.state = isActive ? "active" : "inactive"; + tab.setAttribute("aria-selected", String(isActive)); + tab.setAttribute("tabindex", isActive ? "0" : "-1"); + } + + for (const panel of panels) { + const isActive = panel.getAttribute("value") === active; + panel.dataset.state = isActive ? "active" : "inactive"; + if (isActive) { + panel.removeAttribute("hidden"); + } else { + panel.setAttribute("hidden", ""); + } + } + } +} diff --git a/packages/core/src/components/tags-input/index.ts b/packages/core/src/components/tags-input/index.ts new file mode 100644 index 0000000..6888938 --- /dev/null +++ b/packages/core/src/components/tags-input/index.ts @@ -0,0 +1,6 @@ +import { PettyTagsInput } from "./tags-input"; +export { PettyTagsInput }; + +if (!customElements.get("petty-tags-input")) { + customElements.define("petty-tags-input", PettyTagsInput); +} diff --git a/packages/core/src/components/tags-input/tags-input.schema.ts b/packages/core/src/components/tags-input/tags-input.schema.ts new file mode 100644 index 0000000..64d84dd --- /dev/null +++ b/packages/core/src/components/tags-input/tags-input.schema.ts @@ -0,0 +1,22 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { + tag: "petty-tags-input", + description: "Multi-value text input for tags, emails, or labels with add/remove and keyboard support", + tier: 3, + attributes: [ + { name: "value", type: "string", description: "Comma-separated initial tags" }, + { name: "max", type: "number", description: "Maximum number of tags allowed" }, + { name: "disabled", type: "boolean", description: "Disables adding and removing tags" }, + { name: "name", type: "string", description: "Form field name for the hidden input" }, + ], + parts: [ + { name: "tags", element: "div", description: "Container for rendered tag elements" }, + { name: "tag", element: "span", description: "Individual tag with data-value attribute" }, + { name: "tag-remove", element: "button", description: "Remove button within each tag" }, + { name: "input", element: "input", description: "Text input for typing new tags" }, + { name: "hidden", element: "input", description: "Hidden input synced with comma-separated values" }, + ], + events: [{ name: "petty-change", detail: "{ value: string[] }", description: "Fires when tags are added or removed" }], + example: `\n
\n \n \n
`, +}; diff --git a/packages/core/src/components/tags-input/tags-input.ts b/packages/core/src/components/tags-input/tags-input.ts new file mode 100644 index 0000000..f69b603 --- /dev/null +++ b/packages/core/src/components/tags-input/tags-input.ts @@ -0,0 +1,120 @@ +import { signal, effect } from "../../signals"; +import { emit, listen } from "../../shared/helpers"; + +/** PettyTagsInput — multi-value text input for tags, emails, or tokens. */ +export class PettyTagsInput extends HTMLElement { + static observedAttributes = ["value", "max", "disabled", "name"]; + + readonly #tags = signal([]); + #stopEffect: (() => void) | null = null; + + get value(): string[] { return [...this.#tags.get()]; } + set value(v: string[]) { this.#tags.set([...v]); } + + /** Adds a tag if not duplicate and under max limit. */ + addTag(tag: string): boolean { + const trimmed = tag.trim(); + if (!trimmed) return false; + const current = this.#tags.get(); + if (current.includes(trimmed)) return false; + const max = this.getAttribute("max"); + if (max && current.length >= Number(max)) return false; + this.#tags.set([...current, trimmed]); + this.#dispatch(); + return true; + } + + /** Removes a tag by value. */ + removeTag(tag: string): void { + const current = this.#tags.get(); + const idx = current.indexOf(tag); + if (idx === -1) return; + const next = [...current]; + next.splice(idx, 1); + this.#tags.set(next); + this.#dispatch(); + } + + /** Clears all tags. */ + clear(): void { + this.#tags.set([]); + this.#dispatch(); + } + + #cleanupInput = (): void => {}; + #cleanupSelf = (): void => {}; + + connectedCallback(): void { + const init = this.getAttribute("value"); + if (init) this.#tags.set(init.split(",").map(s => s.trim()).filter(Boolean)); + this.#stopEffect = effect(() => this.#render()); + this.#cleanupInput = listen(this.#input(), [["keydown", this.#onKeydown]]); + this.#cleanupSelf = listen(this, [["click", this.#onTagRemove]]); + } + + disconnectedCallback(): void { + this.#stopEffect = null; + this.#cleanupInput(); + this.#cleanupSelf(); + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) { + this.#tags.set(next.split(",").map(s => s.trim()).filter(Boolean)); + } + } + + #input(): HTMLInputElement | null { return this.querySelector("input[data-part=input]"); } + + #dispatch(): void { + this.#syncHidden(); + emit(this, "change", { value: this.#tags.get() }); + } + + #syncHidden(): void { + const hidden = this.querySelector("input[data-part=hidden]"); + if (hidden instanceof HTMLInputElement) hidden.value = this.#tags.get().join(","); + } + + #onKeydown = (e: Event): void => { + const ke = e as KeyboardEvent; + if (this.hasAttribute("disabled")) return; + const input = this.#input(); + if (!input) return; + if (ke.key === "Enter" || ke.key === ",") { + ke.preventDefault(); + if (this.addTag(input.value)) input.value = ""; + } else if (ke.key === "Backspace" && input.value === "") { + const tags = this.#tags.get(); + const last = tags[tags.length - 1]; + if (last) this.removeTag(last); + } + }; + + #onTagRemove = (e: Event): void => { + const btn = (e.target as HTMLElement).closest("[data-part=tag-remove]"); + if (!btn) return; + const tag = btn.closest("[data-part=tag]"); + if (tag instanceof HTMLElement) this.removeTag(tag.dataset.value ?? ""); + }; + + #render(): void { + const tags = this.#tags.get(); + const container = this.querySelector("[data-part=tags]"); + if (!container) return; + container.replaceChildren(); + for (const tag of tags) { + const el = document.createElement("span"); + el.dataset.part = "tag"; + el.dataset.value = tag; + el.textContent = tag; + const btn = document.createElement("button"); + btn.dataset.part = "tag-remove"; + btn.setAttribute("aria-label", `Remove ${tag}`); + btn.textContent = "×"; + btn.type = "button"; + el.appendChild(btn); + container.appendChild(el); + } + } +} diff --git a/packages/core/src/components/text-field/index.ts b/packages/core/src/components/text-field/index.ts new file mode 100644 index 0000000..9c666ee --- /dev/null +++ b/packages/core/src/components/text-field/index.ts @@ -0,0 +1,6 @@ +import { PettyTextField } from "./text-field"; +export { PettyTextField }; + +if (!customElements.get("petty-text-field")) { + customElements.define("petty-text-field", PettyTextField); +} diff --git a/packages/core/src/components/text-field/text-field.schema.ts b/packages/core/src/components/text-field/text-field.schema.ts new file mode 100644 index 0000000..5d5bfdc --- /dev/null +++ b/packages/core/src/components/text-field/text-field.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-text-field", description: "Labeled text input with description, error wiring, and change events", tier: 3, attributes: [{ name: "name", type: "string", description: "Form field name" }, { name: "disabled", type: "boolean", description: "Disables the input" }, { name: "required", type: "boolean", description: "Marks the field as required" }], parts: [{ name: "control", element: "input", description: "The text input element" }, { name: "label", element: "label", description: "Label auto-linked to the input" }, { name: "description", element: "span", description: "Help text linked via aria-describedby" }, { name: "error", element: "span", description: "Error message linked via aria-describedby" }], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires on input change" }], example: `Your email address` }; diff --git a/packages/core/src/components/text-field/text-field.ts b/packages/core/src/components/text-field/text-field.ts new file mode 100644 index 0000000..e9ec781 --- /dev/null +++ b/packages/core/src/components/text-field/text-field.ts @@ -0,0 +1,73 @@ +import { uniqueId } from "../../shared/aria"; +import { emit, listen, part } from "../../shared/helpers"; + +/** PettyTextField — labeled text input with description and error wiring. */ +export class PettyTextField extends HTMLElement { + static observedAttributes = ["name", "disabled", "required"]; + + #cleanup = (): void => {}; + + connectedCallback(): void { + const name = this.getAttribute("name") ?? ""; + const controlId = uniqueId(`petty-tf-${name}`); + const errorId = `${controlId}-error`; + const descId = `${controlId}-desc`; + + const label = part(this, "label"); + const control = this.#control(); + const desc = part(this, "description"); + const error = part(this, "error"); + + if (control) { + control.id = controlId; + if (!control.getAttribute("name")) control.setAttribute("name", name); + const describedBy = [desc ? descId : "", error ? errorId : ""].filter(Boolean).join(" "); + if (describedBy) control.setAttribute("aria-describedby", describedBy); + } + if (label && control) label.htmlFor = controlId; + if (desc) desc.id = descId; + if (error) error.id = errorId; + + this.#syncAttrs(); + this.#cleanup = listen(control, [["input", this.#handleInput]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(): void { + this.#syncAttrs(); + } + + /** Display an error message on this field. */ + setError(message: string): void { + const error = part(this, "error"); + const control = this.#control(); + if (error) error.textContent = message; + if (control) control.setAttribute("aria-invalid", "true"); + } + + /** Clear the error message on this field. */ + clearError(): void { + const error = part(this, "error"); + const control = this.#control(); + if (error) error.textContent = ""; + if (control) control.removeAttribute("aria-invalid"); + } + + #control(): HTMLInputElement | null { + return this.querySelector("input[data-part=control]"); + } + + #syncAttrs(): void { + const control = this.#control(); + if (!control) return; + control.disabled = this.hasAttribute("disabled"); + control.required = this.hasAttribute("required"); + } + + #handleInput = (): void => { + emit(this, "change", { value: this.#control()?.value ?? "" }); + }; +} diff --git a/packages/core/src/components/toast/index.ts b/packages/core/src/components/toast/index.ts new file mode 100644 index 0000000..2972056 --- /dev/null +++ b/packages/core/src/components/toast/index.ts @@ -0,0 +1,6 @@ +import { toast, PettyToastRegion } from "./toast"; +export { toast, PettyToastRegion }; + +if (!customElements.get("petty-toast-region")) { + customElements.define("petty-toast-region", PettyToastRegion); +} diff --git a/packages/core/src/components/toast/toast.schema.ts b/packages/core/src/components/toast/toast.schema.ts new file mode 100644 index 0000000..72cec21 --- /dev/null +++ b/packages/core/src/components/toast/toast.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-toast-region", description: "Container that renders active toast notifications with auto-dismiss", tier: 3, attributes: [{ name: "position", type: "string", description: "Position of the toast region on screen" }], parts: [{ name: "toast", element: "div", description: "Individual toast container" }, { name: "toast-title", element: "div", description: "Toast title text" }, { name: "toast-description", element: "div", description: "Toast description text" }, { name: "toast-close", element: "button", description: "Dismiss button for the toast" }], events: [], example: `` }; diff --git a/packages/core/src/components/toast/toast.ts b/packages/core/src/components/toast/toast.ts new file mode 100644 index 0000000..c0f1ad3 --- /dev/null +++ b/packages/core/src/components/toast/toast.ts @@ -0,0 +1,98 @@ +import { signal, effect } from "../../signals"; + +interface ToastData { + id: string; + title: string; + type: string; + description: string; + duration: number; +} + +const toasts = signal([]); +let nextId = 0; + +/** Creates a toast notification. Returns the toast ID. */ +export function toast(title: string, options?: { type?: string; description?: string; duration?: number }): string { + const id = `petty-toast-${nextId++}`; + const entry: ToastData = { + id, + title, + type: options?.type ?? "default", + description: options?.description ?? "", + duration: options?.duration ?? 5000, + }; + toasts.set([...toasts.get(), entry]); + setTimeout(() => { toast.dismiss(id); }, entry.duration); + return id; +} + +/** Creates a success toast. */ +toast.success = (title: string, options?: { description?: string; duration?: number }): string => + toast(title, { ...options, type: "success" }); + +/** Creates an error toast. */ +toast.error = (title: string, options?: { description?: string; duration?: number }): string => + toast(title, { ...options, type: "error" }); + +/** Dismisses a toast by ID. */ +toast.dismiss = (id: string): void => { + toasts.set(toasts.get().filter((t) => t.id !== id)); +}; + +/** PettyToastRegion — container that renders active toast notifications. */ +export class PettyToastRegion extends HTMLElement { + static get observedAttributes(): string[] { return ["position"]; } + + /** @internal */ + connectedCallback(): void { + this.setAttribute("role", "region"); + this.setAttribute("aria-live", "polite"); + this.setAttribute("aria-label", "Notifications"); + effect(() => { this.#render(toasts.get()); }); + } + + #createToastElement(item: ToastData): HTMLElement { + const el = document.createElement("div"); + el.dataset.toastId = item.id; + el.dataset.type = item.type; + el.setAttribute("role", "status"); + el.dataset.part = "toast"; + + const title = document.createElement("div"); + title.dataset.part = "toast-title"; + title.textContent = item.title; + el.appendChild(title); + + if (item.description) { + const desc = document.createElement("div"); + desc.dataset.part = "toast-description"; + desc.textContent = item.description; + el.appendChild(desc); + } + + const close = document.createElement("button"); + close.dataset.part = "toast-close"; + close.textContent = "×"; + close.setAttribute("aria-label", "Dismiss"); + close.addEventListener("click", () => { toast.dismiss(item.id); }); + el.appendChild(close); + + return el; + } + + #render(items: ToastData[]): void { + const existing = new Map(); + for (const child of Array.from(this.children)) { + const el = child as HTMLElement; + const id = el.dataset.toastId; + if (id) existing.set(id, el); + } + + for (const item of items) { + if (existing.has(item.id)) { existing.delete(item.id); continue; } + this.appendChild(this.#createToastElement(item)); + } + + for (const el of existing.values()) el.remove(); + } +} diff --git a/packages/core/src/components/toggle-group/index.ts b/packages/core/src/components/toggle-group/index.ts new file mode 100644 index 0000000..4b8a461 --- /dev/null +++ b/packages/core/src/components/toggle-group/index.ts @@ -0,0 +1,8 @@ +import { PettyToggleGroup } from "./toggle-group"; +import { PettyToggleGroupItem } from "./toggle-group-item"; +export { PettyToggleGroup, PettyToggleGroupItem }; + +if (!customElements.get("petty-toggle-group")) { + customElements.define("petty-toggle-group", PettyToggleGroup); + customElements.define("petty-toggle-group-item", PettyToggleGroupItem); +} diff --git a/packages/core/src/components/toggle-group/toggle-group-item.ts b/packages/core/src/components/toggle-group/toggle-group-item.ts new file mode 100644 index 0000000..4909569 --- /dev/null +++ b/packages/core/src/components/toggle-group/toggle-group-item.ts @@ -0,0 +1,61 @@ +import { wrapIndex } from "../../shared/keyboard"; +import { listen } from "../../shared/helpers"; + +/** PettyToggleGroupItem — single item within a toggle group. */ +export class PettyToggleGroupItem extends HTMLElement { + static observedAttributes = ["value", "disabled"]; + + get value(): string { return this.getAttribute("value") ?? ""; } + get disabled(): boolean { return this.hasAttribute("disabled"); } + + #cleanup = (): void => {}; + + connectedCallback(): void { + this.setAttribute("role", "button"); + this.setAttribute("tabindex", "0"); + if (this.disabled) this.setAttribute("aria-disabled", "true"); + this.#cleanup = listen(this, [["click", this.#handleClick], ["keydown", this.#handleKeydown]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(name: string): void { + if (name === "disabled") this.setAttribute("aria-disabled", String(this.disabled)); + } + + #group(): { toggleValue(v: string): void } | null { + return this.closest("petty-toggle-group") as { toggleValue(v: string): void } | null; + } + + #siblings(): PettyToggleGroupItem[] { + const group = this.closest("petty-toggle-group"); + if (!group) return []; + return Array.from(group.querySelectorAll("petty-toggle-group-item:not([disabled])")); + } + + #handleClick = (): void => { + if (this.disabled) return; + this.#group()?.toggleValue(this.value); + }; + + #handleKeydown = (e: Event): void => { + const ke = e as KeyboardEvent; + if (ke.key === " " || ke.key === "Enter") { + ke.preventDefault(); + this.#handleClick(); + return; + } + const isHorizontal = this.closest("petty-toggle-group")?.getAttribute("orientation") !== "vertical"; + const prev = isHorizontal ? "ArrowLeft" : "ArrowUp"; + const next = isHorizontal ? "ArrowRight" : "ArrowDown"; + if (ke.key !== prev && ke.key !== next) return; + ke.preventDefault(); + const items = this.#siblings(); + const idx = items.indexOf(this); + if (idx === -1) return; + const delta = ke.key === next ? 1 : -1; + items[wrapIndex(idx, delta, items.length)]?.focus(); + }; +} diff --git a/packages/core/src/components/toggle-group/toggle-group.schema.ts b/packages/core/src/components/toggle-group/toggle-group.schema.ts new file mode 100644 index 0000000..e315881 --- /dev/null +++ b/packages/core/src/components/toggle-group/toggle-group.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-toggle-group", description: "Single or multi-selection toggle group with keyboard navigation", tier: 3, attributes: [{ name: "type", type: "string", default: "single", description: "Selection mode: single or multiple" }, { name: "value", type: "string", description: "Active value (comma-separated for multiple)" }, { name: "default-value", type: "string", description: "Initial active value" }, { name: "orientation", type: "string", default: "horizontal", description: "Layout orientation: horizontal or vertical" }], parts: [], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires when the active toggle value changes" }], example: `LeftCenterRight` }; diff --git a/packages/core/src/components/toggle-group/toggle-group.ts b/packages/core/src/components/toggle-group/toggle-group.ts new file mode 100644 index 0000000..02c2be6 --- /dev/null +++ b/packages/core/src/components/toggle-group/toggle-group.ts @@ -0,0 +1,57 @@ +import { signal, effect } from "../../signals"; +import { emit, initialValue } from "../../shared/helpers"; + +/** PettyToggleGroup — single or multi-selection toggle group with keyboard nav. */ +export class PettyToggleGroup extends HTMLElement { + static observedAttributes = ["type", "value", "default-value", "orientation"]; + + readonly #value = signal(""); + #stopEffect: (() => void) | null = null; + + get type(): "single" | "multiple" { + return this.getAttribute("type") === "multiple" ? "multiple" : "single"; + } + + get value(): string { return this.#value.get(); } + set value(v: string) { this.#value.set(v); } + + /** Toggles a value: for single mode replaces, for multiple mode adds/removes. */ + toggleValue(v: string): void { + if (this.type === "single") { + this.#value.set(v); + } else { + const current = this.#value.get().split(",").filter(Boolean); + const idx = current.indexOf(v); + if (idx >= 0) current.splice(idx, 1); + else current.push(v); + this.#value.set(current.join(",")); + } + emit(this, "change", { value: this.#value.get() }); + } + + connectedCallback(): void { + this.setAttribute("role", "group"); + const init = initialValue(this); + if (init) this.#value.set(init); + this.#stopEffect = effect(() => this.#syncChildren()); + } + + disconnectedCallback(): void { + this.#stopEffect = null; + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) this.#value.set(next); + } + + #syncChildren(): void { + const active = this.#value.get(); + const activeSet = new Set(active.split(",").filter(Boolean)); + const items = this.querySelectorAll("petty-toggle-group-item"); + for (const item of items) { + const isOn = activeSet.has(item.getAttribute("value") ?? ""); + item.dataset.state = isOn ? "on" : "off"; + item.setAttribute("aria-pressed", String(isOn)); + } + } +} diff --git a/packages/core/src/components/toggle/index.ts b/packages/core/src/components/toggle/index.ts new file mode 100644 index 0000000..ed2413f --- /dev/null +++ b/packages/core/src/components/toggle/index.ts @@ -0,0 +1,6 @@ +import { PettyToggle } from "./toggle"; +export { PettyToggle }; + +if (!customElements.get("petty-toggle")) { + customElements.define("petty-toggle", PettyToggle); +} diff --git a/packages/core/src/components/toggle/toggle.schema.ts b/packages/core/src/components/toggle/toggle.schema.ts new file mode 100644 index 0000000..784bead --- /dev/null +++ b/packages/core/src/components/toggle/toggle.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-toggle", description: "Pressed/unpressed toggle button with aria-pressed", tier: 3, attributes: [{ name: "pressed", type: "boolean", description: "Whether the toggle is in pressed state" }, { name: "disabled", type: "boolean", description: "Disables the toggle" }], parts: [{ name: "control", element: "button", description: "The toggle button element" }], events: [{ name: "petty-change", detail: "{ pressed: boolean }", description: "Fires when the toggle state changes" }], example: `` }; diff --git a/packages/core/src/components/toggle/toggle.ts b/packages/core/src/components/toggle/toggle.ts new file mode 100644 index 0000000..a655be1 --- /dev/null +++ b/packages/core/src/components/toggle/toggle.ts @@ -0,0 +1,47 @@ +import { emit, listen, part } from "../../shared/helpers"; + +/** PettyToggle — pressed/unpressed toggle button with aria-pressed. */ +export class PettyToggle extends HTMLElement { + static observedAttributes = ["pressed", "disabled"]; + + #cleanup = (): void => {}; + + get pressed(): boolean { return this.hasAttribute("pressed"); } + set pressed(v: boolean) { + if (v) this.setAttribute("pressed", ""); + else this.removeAttribute("pressed"); + } + + connectedCallback(): void { + const btn = this.#button(); + if (!btn) return; + this.#sync(); + this.#cleanup = listen(btn, [["click", this.#handleClick]]); + } + + disconnectedCallback(): void { + this.#cleanup(); + } + + attributeChangedCallback(): void { + this.#sync(); + } + + #button(): HTMLButtonElement | null { + return part(this, "control"); + } + + #sync(): void { + const btn = this.#button(); + if (!btn) return; + btn.setAttribute("aria-pressed", String(this.pressed)); + btn.disabled = this.hasAttribute("disabled"); + this.dataset.state = this.pressed ? "on" : "off"; + } + + #handleClick = (): void => { + if (this.hasAttribute("disabled")) return; + this.pressed = !this.pressed; + emit(this, "change", { pressed: this.pressed }); + }; +} diff --git a/packages/core/src/components/tooltip/index.ts b/packages/core/src/components/tooltip/index.ts new file mode 100644 index 0000000..f8c3467 --- /dev/null +++ b/packages/core/src/components/tooltip/index.ts @@ -0,0 +1,6 @@ +import { PettyTooltip } from "./tooltip"; +export { PettyTooltip }; + +if (!customElements.get("petty-tooltip")) { + customElements.define("petty-tooltip", PettyTooltip); +} diff --git a/packages/core/src/components/tooltip/tooltip.schema.ts b/packages/core/src/components/tooltip/tooltip.schema.ts new file mode 100644 index 0000000..fe96251 --- /dev/null +++ b/packages/core/src/components/tooltip/tooltip.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-tooltip", description: "Hover/focus label using Popover API with configurable delay and ARIA linking", tier: 2, attributes: [{ name: "delay", type: "number", default: "200", description: "Delay in ms before showing the tooltip" }], parts: [{ name: "trigger", element: "button", description: "Element that triggers the tooltip on hover/focus" }, { name: "content", element: "div", description: "Popover tooltip content linked via aria-describedby" }], events: [{ name: "petty-toggle", detail: "{ open: boolean }", description: "Fires when the tooltip opens or closes" }], example: `
Tooltip text
` }; diff --git a/packages/core/src/components/tooltip/tooltip.ts b/packages/core/src/components/tooltip/tooltip.ts new file mode 100644 index 0000000..97bb815 --- /dev/null +++ b/packages/core/src/components/tooltip/tooltip.ts @@ -0,0 +1,58 @@ +import { uniqueId } from "../../shared/aria"; +import { emit, listen, part } from "../../shared/helpers"; + +/** PettyTooltip — hover/focus label using Popover API with delay and ARIA linking. */ +export class PettyTooltip extends HTMLElement { + static observedAttributes = ["delay"]; + + #showTimer: ReturnType | null = null; + #hideTimer: ReturnType | null = null; + #cleanup: (() => void) | null = null; + + connectedCallback(): void { + const trigger = part(this, "trigger"); + const content = part(this, "content"); + if (!trigger || !content) return; + if (!content.id) content.id = uniqueId("petty-tooltip"); + trigger.setAttribute("aria-describedby", content.id); + this.#cleanup = listen(trigger, [ + ["mouseenter", this.#onEnter], + ["mouseleave", this.#onLeave], + ["focus", this.#onEnter], + ["blur", this.#onLeave], + ]); + } + + disconnectedCallback(): void { + this.#cleanup?.(); + this.#cleanup = null; + this.#clearTimers(); + } + + #delay(): number { + return Number(this.getAttribute("delay") ?? 200); + } + + #clearTimers(): void { + if (this.#showTimer) { clearTimeout(this.#showTimer); this.#showTimer = null; } + if (this.#hideTimer) { clearTimeout(this.#hideTimer); this.#hideTimer = null; } + } + + #onEnter = (): void => { + this.#clearTimers(); + this.#showTimer = setTimeout(() => { + const content = part(this, "content"); + if (content && !content.matches(":popover-open")) content.showPopover(); + emit(this, "toggle", { open: true }); + }, this.#delay()); + }; + + #onLeave = (): void => { + this.#clearTimers(); + this.#hideTimer = setTimeout(() => { + const content = part(this, "content"); + if (content && content.matches(":popover-open")) content.hidePopover(); + emit(this, "toggle", { open: false }); + }, 100); + }; +} diff --git a/packages/core/src/components/typewriter/index.ts b/packages/core/src/components/typewriter/index.ts new file mode 100644 index 0000000..2460cb2 --- /dev/null +++ b/packages/core/src/components/typewriter/index.ts @@ -0,0 +1,6 @@ +import { PettyTypewriter } from "./typewriter"; +export { PettyTypewriter }; + +if (!customElements.get("petty-typewriter")) { + customElements.define("petty-typewriter", PettyTypewriter); +} diff --git a/packages/core/src/components/typewriter/typewriter.ts b/packages/core/src/components/typewriter/typewriter.ts new file mode 100644 index 0000000..414bade --- /dev/null +++ b/packages/core/src/components/typewriter/typewriter.ts @@ -0,0 +1,63 @@ +import { emit } from "../../shared/helpers"; + +/** PettyTypewriter — reveals text character by character with configurable speed. */ +export class PettyTypewriter extends HTMLElement { + static observedAttributes = ["speed", "delay", "cursor"]; + + #text = ""; + #index = 0; + #timer: ReturnType | null = null; + + get speed(): number { return Number(this.getAttribute("speed") ?? 50); } + get delay(): number { return Number(this.getAttribute("delay") ?? 0); } + + /** Starts the typewriter animation from the beginning. */ + start(): void { + this.#index = 0; + this.#tick(); + } + + /** Resets to empty and stops animation. */ + reset(): void { + this.#stop(); + this.#index = 0; + this.#updateDisplay(); + } + + connectedCallback(): void { + this.#text = this.textContent?.trim() ?? ""; + this.textContent = ""; + this.dataset.state = "idle"; + if (this.hasAttribute("cursor")) this.classList.add("petty-typewriter-cursor"); + const startDelay = this.delay; + if (startDelay > 0) { + this.#timer = setTimeout(() => this.start(), startDelay); + } else { + this.start(); + } + } + + disconnectedCallback(): void { + this.#stop(); + } + + #stop(): void { + if (this.#timer) { clearTimeout(this.#timer); this.#timer = null; } + } + + #tick(): void { + this.dataset.state = "typing"; + if (this.#index <= this.#text.length) { + this.#updateDisplay(); + this.#index++; + this.#timer = setTimeout(() => this.#tick(), this.speed); + } else { + this.dataset.state = "done"; + emit(this, "complete", {}); + } + } + + #updateDisplay(): void { + this.textContent = this.#text.slice(0, this.#index); + } +} diff --git a/packages/core/src/components/virtual-list/index.ts b/packages/core/src/components/virtual-list/index.ts new file mode 100644 index 0000000..a49b086 --- /dev/null +++ b/packages/core/src/components/virtual-list/index.ts @@ -0,0 +1,6 @@ +import { PettyVirtualList } from "./virtual-list"; +export { PettyVirtualList }; + +if (!customElements.get("petty-virtual-list")) { + customElements.define("petty-virtual-list", PettyVirtualList); +} diff --git a/packages/core/src/components/virtual-list/virtual-list.schema.ts b/packages/core/src/components/virtual-list/virtual-list.schema.ts new file mode 100644 index 0000000..f209da1 --- /dev/null +++ b/packages/core/src/components/virtual-list/virtual-list.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-virtual-list", description: "Windowed scroll rendering only visible items plus overscan for performance", tier: 3, attributes: [{ name: "item-height", type: "number", default: "40", description: "Fixed height in pixels for each item row" }, { name: "overscan", type: "number", default: "5", description: "Number of extra items to render above and below the visible area" }], parts: [], events: [{ name: "petty-scroll", detail: "{ startIndex: number, endIndex: number }", description: "Fires on scroll with the range of currently rendered item indices" }], example: `` }; diff --git a/packages/core/src/components/virtual-list/virtual-list.ts b/packages/core/src/components/virtual-list/virtual-list.ts new file mode 100644 index 0000000..7213960 --- /dev/null +++ b/packages/core/src/components/virtual-list/virtual-list.ts @@ -0,0 +1,66 @@ +import { emit, listen } from "../../shared/helpers"; + +/** PettyVirtualList — windowed scroll rendering only visible items plus overscan. */ +export class PettyVirtualList extends HTMLElement { + static observedAttributes = ["item-height", "overscan"]; + + #items: unknown[] = []; + #renderFn: ((item: unknown, index: number) => HTMLElement) | null = null; + #spacer: HTMLDivElement | null = null; + #viewport: HTMLDivElement | null = null; + + /** Sets the data items and render function, then triggers a render. */ + setItems(items: unknown[], renderItem: (item: unknown, index: number) => HTMLElement): void { + this.#items = items; + this.#renderFn = renderItem; + this.#update(); + } + + connectedCallback(): void { + this.setAttribute("role", "list"); + this.style.overflow = "auto"; + this.style.position = "relative"; + this.#spacer = document.createElement("div"); + this.#spacer.style.position = "relative"; + this.appendChild(this.#spacer); + this.#viewport = document.createElement("div"); + const vpStyle = this.#viewport.style; + vpStyle.position = "absolute"; + vpStyle.top = "0"; + vpStyle.left = "0"; + vpStyle.right = "0"; + this.appendChild(this.#viewport); + this.addEventListener("scroll", this.#onScroll); + } + + disconnectedCallback(): void { + this.removeEventListener("scroll", this.#onScroll); + } + + #itemHeight(): number { return Number(this.getAttribute("item-height") ?? 40); } + #overscan(): number { return Number(this.getAttribute("overscan") ?? 5); } + + #onScroll = (): void => { this.#update(); }; + + #update(): void { + const spacer = this.#spacer; + const viewport = this.#viewport; + if (!spacer || !viewport || !this.#renderFn) return; + const ih = this.#itemHeight(); + const total = this.#items.length; + spacer.style.height = `${total * ih}px`; + const overscan = this.#overscan(); + const startIdx = Math.max(0, Math.floor(this.scrollTop / ih) - overscan); + const endIdx = Math.min(total, Math.ceil((this.scrollTop + this.clientHeight) / ih) + overscan); + viewport.style.top = `${startIdx * ih}px`; + const fragment = document.createDocumentFragment(); + for (let i = startIdx; i < endIdx; i++) { + const el = this.#renderFn(this.#items[i], i); + el.setAttribute("role", "listitem"); + el.style.height = `${ih}px`; + fragment.appendChild(el); + } + viewport.replaceChildren(fragment); + emit(this, "scroll", { startIndex: startIdx, endIndex: endIdx }); + } +} diff --git a/packages/core/src/components/wizard/index.ts b/packages/core/src/components/wizard/index.ts new file mode 100644 index 0000000..11d031a --- /dev/null +++ b/packages/core/src/components/wizard/index.ts @@ -0,0 +1,8 @@ +import { PettyWizard } from "./wizard"; +import { PettyWizardStep } from "./wizard-step"; +export { PettyWizard, PettyWizardStep }; + +if (!customElements.get("petty-wizard")) { + customElements.define("petty-wizard", PettyWizard); + customElements.define("petty-wizard-step", PettyWizardStep); +} diff --git a/packages/core/src/components/wizard/wizard-step.ts b/packages/core/src/components/wizard/wizard-step.ts new file mode 100644 index 0000000..421d13f --- /dev/null +++ b/packages/core/src/components/wizard/wizard-step.ts @@ -0,0 +1,17 @@ +/** PettyWizardStep — single step within a wizard flow. */ +export class PettyWizardStep extends HTMLElement { + static observedAttributes = ["value", "label", "disabled"]; + + get value(): string { return this.getAttribute("value") ?? ""; } + get label(): string { return this.getAttribute("label") ?? ""; } + + connectedCallback(): void { + this.setAttribute("role", "tabpanel"); + if (this.label) this.setAttribute("aria-label", this.label); + this.setAttribute("hidden", ""); + } + + attributeChangedCallback(name: string): void { + if (name === "label" && this.label) this.setAttribute("aria-label", this.label); + } +} diff --git a/packages/core/src/components/wizard/wizard.schema.ts b/packages/core/src/components/wizard/wizard.schema.ts new file mode 100644 index 0000000..7d1e1c2 --- /dev/null +++ b/packages/core/src/components/wizard/wizard.schema.ts @@ -0,0 +1,3 @@ +import type { ComponentMeta } from "../../schema"; + +export const schema: ComponentMeta = { tag: "petty-wizard", description: "Multi-step flow with navigation between sequential steps", tier: 3, attributes: [{ name: "value", type: "string", description: "Currently active step value" }, { name: "default-value", type: "string", description: "Initial active step value" }], parts: [], events: [{ name: "petty-change", detail: "{ value: string }", description: "Fires when the active step changes" }], example: `Step 1 contentStep 2 content` }; diff --git a/packages/core/src/components/wizard/wizard.ts b/packages/core/src/components/wizard/wizard.ts new file mode 100644 index 0000000..2055578 --- /dev/null +++ b/packages/core/src/components/wizard/wizard.ts @@ -0,0 +1,73 @@ +import { signal, effect } from "../../signals"; +import { emit, initialValue } from "../../shared/helpers"; + +/** PettyWizard — multi-step flow with navigation between steps. */ +export class PettyWizard extends HTMLElement { + static observedAttributes = ["value", "default-value"]; + + readonly #current = signal(""); + #stopEffect: (() => void) | null = null; + + get value(): string { return this.#current.get(); } + set value(v: string) { this.#current.set(v); } + + /** Navigates to the next step. */ + next(): void { + const steps = this.#steps(); + const idx = steps.findIndex(s => s.getAttribute("value") === this.#current.get()); + const nextStep = steps[idx + 1]; + if (idx < steps.length - 1 && nextStep) this.#goTo(nextStep.getAttribute("value") ?? ""); + } + + /** Navigates to the previous step. */ + prev(): void { + const steps = this.#steps(); + const idx = steps.findIndex(s => s.getAttribute("value") === this.#current.get()); + const prevStep = steps[idx - 1]; + if (idx > 0 && prevStep) this.#goTo(prevStep.getAttribute("value") ?? ""); + } + + /** Navigates to a specific step by value. */ + goTo(v: string): void { this.#goTo(v); } + + connectedCallback(): void { + const init = initialValue(this); + if (init) this.#current.set(init); + else { + const first = this.#steps()[0]; + if (first) this.#current.set(first.getAttribute("value") ?? ""); + } + this.#stopEffect = effect(() => this.#syncSteps()); + } + + disconnectedCallback(): void { + this.#stopEffect = null; + } + + attributeChangedCallback(name: string, _old: string | null, next: string | null): void { + if (name === "value" && next !== null) this.#current.set(next); + } + + #steps(): HTMLElement[] { + return Array.from(this.querySelectorAll("petty-wizard-step")); + } + + #goTo(v: string): void { + this.#current.set(v); + emit(this, "change", { value: v }); + } + + #syncSteps(): void { + const active = this.#current.get(); + const steps = this.#steps(); + let foundActive = false; + for (const step of steps) { + const val = step.getAttribute("value") ?? ""; + const isActive = val === active; + if (isActive) foundActive = true; + step.dataset.state = isActive ? "active" : foundActive ? "upcoming" : "complete"; + if (isActive) step.removeAttribute("hidden"); + else step.setAttribute("hidden", ""); + } + } +} diff --git a/packages/core/src/router.ts b/packages/core/src/router.ts new file mode 100644 index 0000000..48892b6 --- /dev/null +++ b/packages/core/src/router.ts @@ -0,0 +1,46 @@ +/** Options for configuring the PettyUI SPA router. */ +export interface RouterOptions { + /** CSS selector for the outlet element where page content is swapped. */ + outlet?: string; + /** Header sent with partial requests so the server can return fragments. */ + partialHeader?: string; +} + +/** Safely replaces an element's children with parsed HTML from a trusted same-origin response. */ +function replaceChildren(outlet: Element, html: string): void { + const parser = new DOMParser(); + const doc = parser.parseFromString(html, "text/html"); + outlet.replaceChildren(...Array.from(doc.body.childNodes)); +} + +/** Swaps outlet content, using View Transitions if available. */ +function swapContent(outlet: Element, html: string): void { + if (document.startViewTransition) { + document.startViewTransition(() => replaceChildren(outlet, html)); + } else { + replaceChildren(outlet, html); + } +} + +/** Initializes SPA routing using the Navigation API and View Transitions. */ +export function initRouter(options?: RouterOptions): void { + const selector = options?.outlet ?? "[data-petty-outlet]"; + const header = options?.partialHeader ?? "X-Partial"; + + navigation.addEventListener("navigate", (event: NavigateEvent) => { + const url = new URL(event.destination.url); + if (url.origin !== location.origin) return; + if (event.hashChange) return; + if (event.downloadRequest) return; + + event.intercept({ + async handler() { + const res = await fetch(url.pathname + url.search, { headers: { [header]: "true" } }); + const html = await res.text(); + const outlet = document.querySelector(selector); + if (!outlet) return; + swapContent(outlet, html); + }, + }); + }); +} diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.ts new file mode 100644 index 0000000..3aa94fe --- /dev/null +++ b/packages/core/src/schema.ts @@ -0,0 +1,10 @@ +import { z } from "zod/v4"; + +const strLit = (...vals: string[]) => vals.length === 1 ? z.literal(vals[0]!) : z.union(vals.map(v => z.literal(v)) as [z.ZodLiteral, z.ZodLiteral, ...z.ZodLiteral[]]); + +export const attributeSchema = z.object({ name: z.string(), type: strLit("string", "boolean", "number"), default: z.string().optional(), description: z.string() }); +export const partSchema = z.object({ name: z.string(), element: z.string(), description: z.string() }); +export const eventSchema = z.object({ name: z.string(), detail: z.string(), description: z.string() }); +export const componentSchema = z.object({ tag: z.string(), description: z.string(), tier: z.union([z.literal(1), z.literal(2), z.literal(3)]), attributes: z.array(attributeSchema), parts: z.array(partSchema), events: z.array(eventSchema), example: z.string() }); + +export type ComponentMeta = z.infer; diff --git a/packages/core/src/shared/aria.ts b/packages/core/src/shared/aria.ts new file mode 100644 index 0000000..a9f76a1 --- /dev/null +++ b/packages/core/src/shared/aria.ts @@ -0,0 +1,18 @@ +let counter = 0; + +/** Generates a unique ID with the given prefix. */ +export function uniqueId(prefix: string): string { + return `${prefix}-${counter++}`; +} + +/** Links an element to a label element via aria-labelledby. */ +export function linkLabel(element: HTMLElement, labelElement: HTMLElement): void { + if (!labelElement.id) labelElement.id = uniqueId("petty-label"); + element.setAttribute("aria-labelledby", labelElement.id); +} + +/** Links an element to a description element via aria-describedby. */ +export function linkDescription(element: HTMLElement, descElement: HTMLElement): void { + if (!descElement.id) descElement.id = uniqueId("petty-desc"); + element.setAttribute("aria-describedby", descElement.id); +} diff --git a/packages/core/src/shared/helpers.ts b/packages/core/src/shared/helpers.ts new file mode 100644 index 0000000..e5940d1 --- /dev/null +++ b/packages/core/src/shared/helpers.ts @@ -0,0 +1,33 @@ +/** Queries a child element by data-part attribute. */ +export function part(host: HTMLElement, name: string): T | null { + return host.querySelector(`[data-part="${name}"]`); +} + +/** Dispatches a bubbling petty-prefixed CustomEvent. */ +export function emit(host: HTMLElement, name: string, detail: Record): void { + host.dispatchEvent(new CustomEvent(`petty-${name}`, { bubbles: true, detail })); +} + +/** Reads default-value or value attribute, returning empty string if neither set. */ +export function initialValue(host: HTMLElement): string { + return host.getAttribute("default-value") ?? host.getAttribute("value") ?? ""; +} + +/** Attaches event listeners and returns a cleanup function that removes them all. */ +export function listen( + el: EventTarget | null, + pairs: Array<[string, EventListenerOrEventListenerObject]>, +): () => void { + if (!el) return () => {}; + for (const [evt, fn] of pairs) el.addEventListener(evt, fn); + return () => { for (const [evt, fn] of pairs) el.removeEventListener(evt, fn); }; +} + +/** Wires a label element's htmlFor to a control's id, generating an id if needed. */ +export function wireLabel(control: HTMLElement, label: HTMLElement | null, prefix: string): void { + if (!label) return; + if (!control.id) control.id = `${prefix}-${wireLabel.n++}`; + if ("htmlFor" in label) (label as HTMLLabelElement).htmlFor = control.id; + else label.setAttribute("aria-labelledby", control.id); +} +wireLabel.n = 0; diff --git a/packages/core/src/shared/keyboard.ts b/packages/core/src/shared/keyboard.ts new file mode 100644 index 0000000..f1d3140 --- /dev/null +++ b/packages/core/src/shared/keyboard.ts @@ -0,0 +1,38 @@ +/** Wraps an index circularly within a range. */ +export function wrapIndex(current: number, delta: number, length: number): number { + return ((current + delta) % length + length) % length; +} + +/** Moves focus between items on Arrow/Home/End keys. */ +export function handleArrowNav( + e: KeyboardEvent, + items: HTMLElement[], + opts?: { orientation?: "horizontal" | "vertical"; loop?: boolean }, +): void { + const len = items.length; + if (len === 0) return; + + const orientation = opts?.orientation ?? "horizontal"; + const loop = opts?.loop ?? true; + const prev = orientation === "horizontal" ? "ArrowLeft" : "ArrowUp"; + const next = orientation === "horizontal" ? "ArrowRight" : "ArrowDown"; + + let idx = items.indexOf(document.activeElement as HTMLElement); + if (idx === -1) idx = 0; + + if (e.key === next) { + e.preventDefault(); + const target = loop ? wrapIndex(idx, 1, len) : Math.min(idx + 1, len - 1); + items[target]?.focus(); + } else if (e.key === prev) { + e.preventDefault(); + const target = loop ? wrapIndex(idx, -1, len) : Math.max(idx - 1, 0); + items[target]?.focus(); + } else if (e.key === "Home") { + e.preventDefault(); + items[0]?.focus(); + } else if (e.key === "End") { + e.preventDefault(); + items[len - 1]?.focus(); + } +} diff --git a/packages/core/src/signals.ts b/packages/core/src/signals.ts new file mode 100644 index 0000000..4448dde --- /dev/null +++ b/packages/core/src/signals.ts @@ -0,0 +1,26 @@ +/** Current effect being tracked for automatic dependency subscription. */ +let current: (() => void) | null = null; + +/** Reactive signal that notifies subscribers when its value changes. */ +export interface Signal { + /** Read the current value. Auto-subscribes the active effect. */ + get(): T; + /** Write a new value. Notifies all subscribed effects. */ + set(value: T): void; +} + +/** Creates a reactive signal with an initial value. */ +export function signal(initial: T): Signal { + const subs = new Set<() => void>(); + let value = initial; + const get = (): T => { if (current) subs.add(current); return value; }; + const set = (v: T): void => { if (v === value) return; value = v; for (const fn of subs) fn(); }; + return { get, set }; +} + +/** Runs a function and re-runs it whenever its signal dependencies change. */ +export function effect(fn: () => void): () => void { + const run = (): void => { const prev = current; current = run; fn(); current = prev; }; + run(); + return run; +} diff --git a/packages/core/src/theme.css b/packages/core/src/theme.css new file mode 100644 index 0000000..acc4149 --- /dev/null +++ b/packages/core/src/theme.css @@ -0,0 +1,289 @@ +/* PettyUI default theme — import once, style everything via custom properties. */ + +:root { + --petty-primary: #2563eb; + --petty-primary-hover: #1d4ed8; + --petty-danger: #dc2626; + --petty-success: #16a34a; + --petty-surface: #ffffff; + --petty-surface-raised: #f9fafb; + --petty-border: #e5e7eb; + --petty-border-focus: #2563eb; + --petty-text: #111827; + --petty-text-muted: #6b7280; + --petty-radius: 0.375rem; + --petty-radius-lg: 0.5rem; + --petty-shadow: 0 4px 16px rgba(0 0 0 / 0.12); + --petty-shadow-sm: 0 1px 4px rgba(0 0 0 / 0.08); + --petty-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + --petty-duration: 150ms; +} + +*, *::before, *::after { box-sizing: border-box; } + +petty-dialog, +petty-select, +petty-tabs, +petty-accordion, +petty-dropdown-menu, +petty-popover, +petty-toast-region, +petty-form, +petty-form-field { display: contents; font-family: var(--petty-font); } + +/* ── Dialog ─────────────────────────────────────────────────────────────── */ + +dialog { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + color: var(--petty-text); + max-width: min(90vw, 32rem); + padding: 1.5rem; + width: 100%; +} + +dialog::backdrop { + background: rgba(0 0 0 / 0.4); +} + +/* ── Select ─────────────────────────────────────────────────────────────── */ + +[data-part="trigger"] { + align-items: center; + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius); + color: var(--petty-text); + cursor: pointer; + display: inline-flex; + font-family: inherit; + font-size: 0.875rem; + gap: 0.5rem; + padding: 0.5rem 0.75rem; + transition: border-color var(--petty-duration); +} + +[data-part="trigger"]:hover { border-color: var(--petty-primary); } +[data-part="trigger"]:focus-visible { outline: 2px solid var(--petty-border-focus); outline-offset: 2px; } + +[data-part="listbox"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + min-width: 10rem; + overflow: hidden; + padding: 0.25rem; +} + +petty-select-option { + border-radius: calc(var(--petty-radius) - 2px); + color: var(--petty-text); + cursor: pointer; + display: block; + font-size: 0.875rem; + padding: 0.5rem 0.75rem; + transition: background var(--petty-duration); +} + +petty-select-option[data-highlighted], +petty-select-option:hover { background: var(--petty-surface-raised); } +petty-select-option[aria-selected="true"] { color: var(--petty-primary); font-weight: 500; } +petty-select-option[disabled] { color: var(--petty-text-muted); cursor: not-allowed; opacity: 0.5; } + +/* ── Tabs ───────────────────────────────────────────────────────────────── */ + +[role="tablist"] { + border-bottom: 1px solid var(--petty-border); + display: flex; + gap: 0.125rem; +} + +petty-tab { + background: transparent; + border: none; + border-bottom: 2px solid transparent; + color: var(--petty-text-muted); + cursor: pointer; + display: inline-block; + font-family: inherit; + font-size: 0.875rem; + font-weight: 500; + margin-bottom: -1px; + padding: 0.625rem 1rem; + transition: color var(--petty-duration), border-color var(--petty-duration); +} + +petty-tab[data-state="active"] { border-bottom-color: var(--petty-primary); color: var(--petty-primary); } +petty-tab:focus-visible { outline: 2px solid var(--petty-border-focus); outline-offset: -2px; } + +petty-tab-panel { display: block; padding: 1rem 0; } +petty-tab-panel[hidden] { display: none; } + +/* ── Accordion ──────────────────────────────────────────────────────────── */ + +petty-accordion { display: flex; flex-direction: column; } + +petty-accordion-item { + border-bottom: 1px solid var(--petty-border); + display: block; +} + +petty-accordion-item details > summary { + color: var(--petty-text); + cursor: pointer; + font-size: 0.9375rem; + font-weight: 500; + list-style: none; + padding: 1rem 0; + transition: color var(--petty-duration); + user-select: none; +} + +petty-accordion-item details > summary::-webkit-details-marker { display: none; } +petty-accordion-item details[open] > summary { color: var(--petty-primary); } +petty-accordion-item details > summary:focus-visible { outline: 2px solid var(--petty-border-focus); outline-offset: 2px; } + +petty-accordion-item [data-part="content"] { + color: var(--petty-text-muted); + font-size: 0.875rem; + line-height: 1.6; + padding-bottom: 1rem; +} + +/* ── Dropdown Menu ──────────────────────────────────────────────────────── */ + +[data-part="content"][popover] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + min-width: 10rem; + padding: 0.25rem; +} + +petty-menu-item { + border-radius: calc(var(--petty-radius) - 2px); + color: var(--petty-text); + cursor: pointer; + display: block; + font-size: 0.875rem; + padding: 0.5rem 0.75rem; + transition: background var(--petty-duration); +} + +petty-menu-item:hover, +petty-menu-item:focus-visible { background: var(--petty-surface-raised); outline: none; } +petty-menu-item[disabled] { color: var(--petty-text-muted); cursor: not-allowed; opacity: 0.5; } + +/* ── Popover ────────────────────────────────────────────────────────────── */ + +[popover][data-part="content"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + color: var(--petty-text); + font-size: 0.875rem; + max-width: 20rem; + padding: 0.75rem 1rem; +} + +/* ── Toast ──────────────────────────────────────────────────────────────── */ + +petty-toast-region { + bottom: 1.5rem; + display: flex; + flex-direction: column; + gap: 0.5rem; + max-width: 24rem; + pointer-events: none; + position: fixed; + right: 1.5rem; + width: 100%; + z-index: 9999; +} + +[data-part="toast"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-left: 4px solid var(--petty-text-muted); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + display: grid; + gap: 0.25rem; + grid-template-columns: 1fr auto; + padding: 0.875rem 1rem; + pointer-events: auto; +} + +[data-part="toast"][data-type="success"] { border-left-color: var(--petty-success); } +[data-part="toast"][data-type="error"] { border-left-color: var(--petty-danger); } + +[data-part="toast-title"] { font-size: 0.875rem; font-weight: 500; } +[data-part="toast-description"] { color: var(--petty-text-muted); font-size: 0.8125rem; } + +[data-part="toast-close"] { + align-self: start; + background: none; + border: none; + color: var(--petty-text-muted); + cursor: pointer; + font-size: 1rem; + line-height: 1; + padding: 0.5rem; + min-width: 2.75rem; + min-height: 2.75rem; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: var(--petty-radius); +} + +[data-part="toast-close"]:hover { color: var(--petty-text); } + +/* ── Form fields ────────────────────────────────────────────────────────── */ + +petty-form-field { + display: flex; + flex-direction: column; + gap: 0.375rem; +} + +[data-part="label"] { + color: var(--petty-text); + font-size: 0.875rem; + font-weight: 500; +} + +[data-part="control"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius); + color: var(--petty-text); + font-family: inherit; + font-size: 0.875rem; + padding: 0.5rem 0.75rem; + transition: border-color var(--petty-duration), box-shadow var(--petty-duration); + width: 100%; +} + +[data-part="control"]:focus-visible { + border-color: var(--petty-border-focus); + box-shadow: 0 0 0 3px rgba(37 99 235 / 0.15); + outline: 2px solid var(--petty-border-focus); + outline-offset: 2px; +} + +[data-part="control"][aria-invalid="true"] { + border-color: var(--petty-danger); + box-shadow: 0 0 0 3px rgba(220 38 38 / 0.12); +} + +[data-part="error"] { + color: var(--petty-danger); + font-size: 0.8125rem; + min-height: 1.25rem; +} diff --git a/packages/core/tests/accordion.test.ts b/packages/core/tests/accordion.test.ts new file mode 100644 index 0000000..fd4e711 --- /dev/null +++ b/packages/core/tests/accordion.test.ts @@ -0,0 +1,51 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import "../src/components/accordion/index"; +import { h } from "./helpers"; + +describe("petty-accordion", () => { + let el: HTMLElement; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-accordion"); + const itemA = h("petty-accordion-item", { value: "a" }, + h("details", {}, + h("summary", {}, "Section A"), + h("div", { "data-part": "content" }, "Content A"), + ), + ); + const itemB = h("petty-accordion-item", { value: "b" }, + h("details", {}, + h("summary", {}, "Section B"), + h("div", { "data-part": "content" }, "Content B"), + ), + ); + el.appendChild(itemA); + el.appendChild(itemB); + document.body.appendChild(el); + }); + + it("registers the custom elements", () => { + expect(customElements.get("petty-accordion")).toBeDefined(); + expect(customElements.get("petty-accordion-item")).toBeDefined(); + }); + + it("defaults to single type", () => { + expect((el as HTMLElement & { type: string }).type).toBe("single"); + }); + + it("accordion-item sets data-state closed on connect", () => { + const item = el.querySelector("petty-accordion-item")!; + expect(item.getAttribute("data-state")).toBe("closed"); + }); + + it("accordion-item sets aria-expanded false on summary", () => { + const summary = el.querySelector("summary")!; + expect(summary.getAttribute("aria-expanded")).toBe("false"); + }); + + it("supports multiple type attribute", () => { + el.setAttribute("type", "multiple"); + expect((el as HTMLElement & { type: string }).type).toBe("multiple"); + }); +}); diff --git a/packages/core/tests/button.test.ts b/packages/core/tests/button.test.ts new file mode 100644 index 0000000..2f103d8 --- /dev/null +++ b/packages/core/tests/button.test.ts @@ -0,0 +1,43 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import "../src/components/button/index"; +import { h } from "./helpers"; + +describe("petty-button", () => { + let el: HTMLElement; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-button"); + el.appendChild(h("button", {}, "Click")); + document.body.appendChild(el); + }); + + it("registers the custom element", () => { + expect(customElements.get("petty-button")).toBeDefined(); + }); + + it("syncs disabled state to child button", () => { + el.setAttribute("disabled", ""); + const btn = el.querySelector("button")!; + expect(btn.disabled).toBe(true); + expect(btn.getAttribute("aria-disabled")).toBe("true"); + expect(el.dataset.state).toBe("disabled"); + }); + + it("syncs loading state to child button", () => { + el.setAttribute("loading", ""); + const btn = el.querySelector("button")!; + expect(btn.disabled).toBe(true); + expect(btn.getAttribute("aria-busy")).toBe("true"); + expect(el.dataset.state).toBe("loading"); + }); + + it("clears loading and disabled state", () => { + el.setAttribute("loading", ""); + el.removeAttribute("loading"); + const btn = el.querySelector("button")!; + expect(btn.disabled).toBe(false); + expect(btn.getAttribute("aria-busy")).toBeNull(); + expect(el.dataset.state).toBe("idle"); + }); +}); diff --git a/packages/core/tests/checkbox.test.ts b/packages/core/tests/checkbox.test.ts new file mode 100644 index 0000000..6c03679 --- /dev/null +++ b/packages/core/tests/checkbox.test.ts @@ -0,0 +1,47 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyCheckbox } from "../src/components/checkbox/index"; +import { h } from "./helpers"; + +describe("petty-checkbox", () => { + let el: PettyCheckbox; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-checkbox") as PettyCheckbox; + const input = h("input", { type: "checkbox", "data-part": "control" }); + const label = h("label", { "data-part": "label" }, "Accept"); + el.appendChild(input); + el.appendChild(label); + document.body.appendChild(el); + }); + + it("registers the custom element", () => { + expect(customElements.get("petty-checkbox")).toBe(PettyCheckbox); + }); + + it("defaults to unchecked state", () => { + expect(el.checked).toBe(false); + expect(el.dataset.state).toBe("unchecked"); + }); + + it("sets checked state via property", () => { + el.checked = true; + const input = el.querySelector("input") as HTMLInputElement; + expect(input.checked).toBe(true); + expect(el.dataset.state).toBe("checked"); + }); + + it("sets indeterminate state", () => { + el.indeterminate = true; + const input = el.querySelector("input") as HTMLInputElement; + expect(input.indeterminate).toBe(true); + expect(el.dataset.state).toBe("indeterminate"); + }); + + it("wires label htmlFor to input id", () => { + const input = el.querySelector("input") as HTMLInputElement; + const label = el.querySelector("label") as HTMLLabelElement; + expect(input.id).not.toBe(""); + expect(label.htmlFor).toBe(input.id); + }); +}); diff --git a/packages/core/tests/collapsible.test.ts b/packages/core/tests/collapsible.test.ts new file mode 100644 index 0000000..f7e31e5 --- /dev/null +++ b/packages/core/tests/collapsible.test.ts @@ -0,0 +1,98 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyCollapsible } from "../src/components/collapsible/index"; +import { PettyProgress } from "../src/components/progress/index"; +import "../src/components/alert/index"; +describe("petty-collapsible", () => { + let el: PettyCollapsible; + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-collapsible") as PettyCollapsible; + const d = document.createElement("details"); + const s = document.createElement("summary"); + s.textContent = "Toggle"; + const c = document.createElement("div"); + c.setAttribute("data-part", "content"); + c.textContent = "Content"; + d.appendChild(s); + d.appendChild(c); + el.appendChild(d); + document.body.appendChild(el); + }); + it("registers and defaults to closed", () => { + expect(customElements.get("petty-collapsible")).toBe(PettyCollapsible); + expect(el.isOpen).toBe(false); + }); + it("open/close/toggle lifecycle", () => { + el.open(); + expect(el.detailsElement!.open).toBe(true); + el.close(); + expect(el.detailsElement!.open).toBe(false); + el.toggle(); + expect(el.detailsElement!.open).toBe(true); + }); + it("blocks open when disabled", () => { + el.setAttribute("disabled", ""); + el.open(); + expect(el.detailsElement!.open).toBe(false); + el.removeAttribute("disabled"); + el.open(); + expect(el.detailsElement!.open).toBe(true); + }); +}); +describe("petty-alert", () => { + let el: HTMLElement; + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-alert"); + el.appendChild(document.createTextNode("msg")); + document.body.appendChild(el); + }); + it("defaults to status role", () => { + expect(el.getAttribute("role")).toBe("status"); + }); + it("error and warning get alert role", () => { + el.setAttribute("variant", "error"); + expect(el.getAttribute("role")).toBe("alert"); + el.setAttribute("variant", "warning"); + expect(el.getAttribute("role")).toBe("alert"); + }); + it("info gets status role then reverts on removal", () => { + el.setAttribute("variant", "info"); + expect(el.getAttribute("role")).toBe("status"); + el.removeAttribute("variant"); + expect(el.getAttribute("role")).toBe("status"); + }); +}); +describe("petty-progress", () => { + let el: PettyProgress; + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-progress") as PettyProgress; + const fill = document.createElement("div"); + fill.setAttribute("data-part", "fill"); + const label = document.createElement("span"); + label.setAttribute("data-part", "label"); + el.appendChild(fill); + el.appendChild(label); + document.body.appendChild(el); + }); + it("sets progressbar ARIA", () => { + expect(el.getAttribute("role")).toBe("progressbar"); + expect(el.getAttribute("aria-valuemin")).toBe("0"); + }); + it("tracks value and max", () => { + el.setAttribute("value", "50"); + el.setAttribute("max", "200"); + expect(el.value).toBe(50); + expect(el.dataset.state).toBe("loading"); + }); + it("complete state at max", () => { + el.setAttribute("value", "100"); + expect(el.dataset.state).toBe("complete"); + }); + it("returns to indeterminate when value removed", () => { + el.setAttribute("value", "50"); + el.removeAttribute("value"); + expect(el.dataset.state).toBe("indeterminate"); + }); +}); diff --git a/packages/core/tests/dialog.test.ts b/packages/core/tests/dialog.test.ts new file mode 100644 index 0000000..d9fa0bc --- /dev/null +++ b/packages/core/tests/dialog.test.ts @@ -0,0 +1,36 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyDialog } from "../src/components/dialog/index"; +import { h } from "./helpers"; + +describe("petty-dialog", () => { + let el: PettyDialog; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-dialog") as PettyDialog; + const heading = h("h2", {}, "Title"); + const dlg = document.createElement("dialog"); + dlg.appendChild(heading); + el.appendChild(dlg); + document.body.appendChild(el); + }); + + it("registers the custom element", () => { + expect(customElements.get("petty-dialog")).toBe(PettyDialog); + }); + + it("links aria-labelledby to heading", () => { + const dlg = el.querySelector("dialog")!; + const heading = el.querySelector("h2")!; + expect(heading.id).not.toBe(""); + expect(dlg.getAttribute("aria-labelledby")).toBe(heading.id); + }); + + it("exposes isOpen as false by default", () => { + expect(el.isOpen).toBe(false); + }); + + it("returns dialogElement", () => { + expect(el.dialogElement).toBeInstanceOf(HTMLDialogElement); + }); +}); diff --git a/packages/core/tests/form.test.ts b/packages/core/tests/form.test.ts new file mode 100644 index 0000000..a330020 --- /dev/null +++ b/packages/core/tests/form.test.ts @@ -0,0 +1,61 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyForm } from "../src/components/form/index"; +import { h } from "./helpers"; + +describe("petty-form", () => { + let el: PettyForm; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-form") as PettyForm; + const label = h("label", { "data-part": "label" }, "Email"); + const input = h("input", { "data-part": "control", type: "email", name: "email" }); + const error = h("span", { "data-part": "error" }); + const field = h("petty-form-field", { name: "email" }, label, input, error); + const submit = h("button", { type: "submit" }, "Submit"); + const form = h("form", {}, field, submit); + el.appendChild(form); + document.body.appendChild(el); + }); + + it("registers the custom elements", () => { + expect(customElements.get("petty-form")).toBe(PettyForm); + expect(customElements.get("petty-form-field")).toBeDefined(); + }); + + it("sets novalidate on the form", () => { + const form = el.querySelector("form")!; + expect(form.hasAttribute("novalidate")).toBe(true); + }); + + it("dispatches petty-submit with form data when no schema set", () => { + let detail: { data: Record } | null = null; + el.addEventListener("petty-submit", ((e: CustomEvent) => { + detail = e.detail; + }) as EventListener); + const input = el.querySelector("input") as HTMLInputElement; + input.value = "test@example.com"; + const form = el.querySelector("form")!; + form.dispatchEvent(new Event("submit", { cancelable: true })); + expect(detail!.data.email).toBe("test@example.com"); + }); + + it("dispatches petty-invalid on schema failure and shows error", () => { + const mockSchema = { + safeParse: () => ({ + success: false, + error: { issues: [{ path: ["email"], message: "Invalid email" }] }, + }), + }; + el.setSchema(mockSchema); + let detail: { errors: Array<{ path: Array; message: string }> } | null = null; + el.addEventListener("petty-invalid", ((e: CustomEvent) => { + detail = e.detail; + }) as EventListener); + const form = el.querySelector("form")!; + form.dispatchEvent(new Event("submit", { cancelable: true })); + expect(detail!.errors[0].message).toBe("Invalid email"); + expect(el.querySelector("[data-part=error]")!.textContent).toBe("Invalid email"); + expect(el.querySelector("[data-part=control]")!.getAttribute("aria-invalid")).toBe("true"); + }); +}); diff --git a/packages/core/tests/helpers.test.ts b/packages/core/tests/helpers.test.ts new file mode 100644 index 0000000..4118327 --- /dev/null +++ b/packages/core/tests/helpers.test.ts @@ -0,0 +1,65 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { part, emit, initialValue, listen, wireLabel } from "../src/shared/helpers"; + +describe("shared helpers", () => { + beforeEach(() => { document.body.replaceChildren(); }); + + it("part() finds child by data-part attribute", () => { + const host = document.createElement("div"); + const child = document.createElement("input"); + child.dataset.part = "control"; + host.appendChild(child); + expect(part(host, "control")).toBe(child); + expect(part(host, "missing")).toBeNull(); + }); + + it("emit() dispatches a bubbling petty-prefixed event", () => { + const el = document.createElement("div"); + document.body.appendChild(el); + let received: { value: unknown } | null = null; + document.body.addEventListener("petty-change", (e) => { received = (e as CustomEvent).detail; }); + emit(el, "change", { value: "test" }); + expect(received).toEqual({ value: "test" }); + }); + + it("initialValue() reads default-value then value then empty", () => { + const el = document.createElement("div"); + expect(initialValue(el)).toBe(""); + el.setAttribute("value", "v"); + expect(initialValue(el)).toBe("v"); + el.setAttribute("default-value", "dv"); + expect(initialValue(el)).toBe("dv"); + }); + + it("listen() attaches and cleanup removes listeners", () => { + const el = document.createElement("button"); + let count = 0; + const handler = () => { count++; }; + const cleanup = listen(el, [["click", handler]]); + el.click(); + expect(count).toBe(1); + cleanup(); + el.click(); + expect(count).toBe(1); + }); + + it("listen() returns noop for null element", () => { + const cleanup = listen(null, [["click", () => {}]]); + expect(typeof cleanup).toBe("function"); + cleanup(); + }); + + it("wireLabel() connects label htmlFor to control id", () => { + const control = document.createElement("input"); + const label = document.createElement("label"); + wireLabel(control, label, "test"); + expect(control.id).toMatch(/^test-/); + expect(label.htmlFor).toBe(control.id); + }); + + it("wireLabel() does nothing with null label", () => { + const control = document.createElement("input"); + wireLabel(control, null, "test"); + expect(control.id).toBe(""); + }); +}); diff --git a/packages/core/tests/helpers.ts b/packages/core/tests/helpers.ts new file mode 100644 index 0000000..fa5ee1c --- /dev/null +++ b/packages/core/tests/helpers.ts @@ -0,0 +1,69 @@ +/** + * Creates an element with optional attributes and children. + * Avoids innerHTML to satisfy SEC-12. + */ +export function h( + tag: string, + attrs?: Record, + ...children: Array +): HTMLElement { + const el = document.createElement(tag); + if (attrs) { + for (const [key, val] of Object.entries(attrs)) { + el.setAttribute(key, val); + } + } + for (const child of children) { + if (typeof child === "string") { + el.appendChild(document.createTextNode(child)); + } else { + el.appendChild(child); + } + } + return el; +} + +/** Clears the body and appends an element, returning it typed as T. */ +export function mount(el: T): T { + document.body.textContent = ""; + document.body.appendChild(el); + return el; +} + +/** Creates and mounts a petty-collapsible with a details/summary structure. */ +export function createCollapsible(): HTMLElement { + const el = document.createElement("petty-collapsible"); + const d = document.createElement("details"); + d.appendChild(h("summary", {}, "Toggle")); + d.appendChild(h("div", { "data-part": "content" }, "Content")); + el.appendChild(d); + return mount(el); +} + +/** Creates and mounts a petty-alert with text content. */ +export function createAlert(text = "msg"): HTMLElement { + const el = document.createElement("petty-alert"); + el.appendChild(document.createTextNode(text)); + return mount(el); +} + +/** Creates and mounts a petty-progress with fill and label parts. */ +export function createProgress(): HTMLElement { + const el = document.createElement("petty-progress"); + el.appendChild(h("div", { "data-part": "fill" })); + el.appendChild(h("span", { "data-part": "label" })); + return mount(el); +} + +/** Creates and mounts a petty-pagination with prev/next and numbered items. */ +export function createPagination(total = "50", pageSize = "10"): HTMLElement { + const el = document.createElement("petty-pagination"); + el.setAttribute("total", total); + el.setAttribute("page-size", pageSize); + el.appendChild(h("petty-pagination-item", { type: "prev" }, "Prev")); + el.appendChild(h("petty-pagination-item", { value: "1" }, "1")); + el.appendChild(h("petty-pagination-item", { value: "2" }, "2")); + el.appendChild(h("petty-pagination-item", { value: "3" }, "3")); + el.appendChild(h("petty-pagination-item", { type: "next" }, "Next")); + return mount(el); +} diff --git a/packages/core/tests/pagination.test.ts b/packages/core/tests/pagination.test.ts new file mode 100644 index 0000000..575f8fd --- /dev/null +++ b/packages/core/tests/pagination.test.ts @@ -0,0 +1,56 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyPagination } from "../src/components/pagination/index"; +import { h } from "./helpers"; + +describe("petty-pagination", () => { + let el: PettyPagination; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-pagination") as PettyPagination; + el.setAttribute("total", "50"); + el.setAttribute("page-size", "10"); + el.appendChild(h("petty-pagination-item", { type: "prev" }, "Prev")); + el.appendChild(h("petty-pagination-item", { value: "1" }, "1")); + el.appendChild(h("petty-pagination-item", { value: "2" }, "2")); + el.appendChild(h("petty-pagination-item", { value: "3" }, "3")); + el.appendChild(h("petty-pagination-item", { type: "next" }, "Next")); + document.body.appendChild(el); + }); + + it("registers and calculates totalPages", () => { + expect(customElements.get("petty-pagination")).toBe(PettyPagination); + expect(el.totalPages).toBe(5); + expect(el.currentPage).toBe(1); + }); + + it("marks page 1 as active with aria-current", () => { + const item1 = el.querySelector("[value='1']")!; + expect(item1.getAttribute("data-state")).toBe("active"); + expect(item1.getAttribute("aria-current")).toBe("page"); + }); + + it("disables prev on first page", () => { + expect(el.querySelector("[type=prev]")!.hasAttribute("disabled")).toBe(true); + }); + + it("clamps goToPage to valid range", () => { + el.goToPage(0); + expect(el.currentPage).toBe(1); + el.goToPage(999); + expect(el.currentPage).toBe(5); + }); + + it("fires petty-change on goToPage", () => { + let detail: { page: number } | null = null; + el.addEventListener("petty-change", ((e: CustomEvent) => { detail = e.detail; }) as EventListener); + el.goToPage(3); + expect(detail).toEqual({ page: 3 }); + expect(el.currentPage).toBe(3); + }); + + it("disables next on last page", () => { + el.goToPage(5); + expect(el.querySelector("[type=next]")!.hasAttribute("disabled")).toBe(true); + }); +}); diff --git a/packages/core/tests/progress.test.ts b/packages/core/tests/progress.test.ts new file mode 100644 index 0000000..3e476cc --- /dev/null +++ b/packages/core/tests/progress.test.ts @@ -0,0 +1,47 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyProgress } from "../src/components/progress/index"; +describe("petty-progress", () => { + let el: PettyProgress; + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-progress") as PettyProgress; + const fill = document.createElement("div"); + fill.setAttribute("data-part", "fill"); + const label = document.createElement("span"); + label.setAttribute("data-part", "label"); + el.appendChild(fill); + el.appendChild(label); + document.body.appendChild(el); + }); + it("registers as petty-progress", () => { + expect(customElements.get("petty-progress")).toBe(PettyProgress); + }); + it("sets progressbar ARIA on connect", () => { + expect(el.getAttribute("role")).toBe("progressbar"); + expect(el.getAttribute("aria-valuemin")).toBe("0"); + expect(el.getAttribute("aria-valuemax")).toBe("100"); + }); + it("is indeterminate without value", () => { + expect(el.value).toBeNull(); + expect(el.dataset.state).toBe("indeterminate"); + expect(el.hasAttribute("aria-valuenow")).toBe(false); + }); + it("tracks value and max attributes", () => { + el.setAttribute("value", "50"); + el.setAttribute("max", "200"); + expect(el.value).toBe(50); + expect(el.max).toBe(200); + expect(el.getAttribute("aria-valuenow")).toBe("50"); + expect(el.dataset.state).toBe("loading"); + }); + it("sets complete state at max", () => { + el.setAttribute("value", "100"); + expect(el.dataset.state).toBe("complete"); + }); + it("returns to indeterminate when value removed", () => { + el.setAttribute("value", "50"); + el.removeAttribute("value"); + expect(el.dataset.state).toBe("indeterminate"); + expect(el.hasAttribute("aria-valuenow")).toBe(false); + }); +}); diff --git a/packages/core/tests/radio-group.test.ts b/packages/core/tests/radio-group.test.ts new file mode 100644 index 0000000..3061f68 --- /dev/null +++ b/packages/core/tests/radio-group.test.ts @@ -0,0 +1,47 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyRadioGroup } from "../src/components/radio-group/index"; +import { h } from "./helpers"; + +describe("petty-radio-group", () => { + let el: PettyRadioGroup; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-radio-group") as PettyRadioGroup; + el.setAttribute("default-value", "a"); + el.appendChild(h("petty-radio-item", { value: "a" }, "Option A")); + el.appendChild(h("petty-radio-item", { value: "b" }, "Option B")); + el.appendChild(h("petty-radio-item", { value: "c" }, "Option C")); + document.body.appendChild(el); + }); + + it("registers the custom elements", () => { + expect(customElements.get("petty-radio-group")).toBe(PettyRadioGroup); + expect(customElements.get("petty-radio-item")).toBeDefined(); + }); + + it("sets role radiogroup on connect", () => { + expect(el.getAttribute("role")).toBe("radiogroup"); + }); + + it("initializes with default-value", () => { + expect(el.value).toBe("a"); + }); + + it("syncs aria-checked on radio items", () => { + const itemA = el.querySelector("[value=a]")!; + const itemB = el.querySelector("[value=b]")!; + expect(itemA.getAttribute("aria-checked")).toBe("true"); + expect(itemB.getAttribute("aria-checked")).toBe("false"); + }); + + it("fires petty-change on selectValue", () => { + let detail: { value: string } | null = null; + el.addEventListener("petty-change", ((e: CustomEvent) => { + detail = e.detail; + }) as EventListener); + el.selectValue("b"); + expect(detail).toEqual({ value: "b" }); + expect(el.value).toBe("b"); + }); +}); diff --git a/packages/core/tests/select.test.ts b/packages/core/tests/select.test.ts new file mode 100644 index 0000000..85cc98d --- /dev/null +++ b/packages/core/tests/select.test.ts @@ -0,0 +1,49 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettySelect } from "../src/components/select/index"; +import { h } from "./helpers"; + +describe("petty-select", () => { + let el: PettySelect; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-select") as PettySelect; + el.setAttribute("default-value", "apple"); + const trigger = h("button", { "data-part": "trigger" }, "Pick a fruit"); + const opt1 = h("petty-select-option", { value: "apple" }, "Apple"); + const opt2 = h("petty-select-option", { value: "banana" }, "Banana"); + const listbox = h("div", { id: "fruit-list", popover: "", "data-part": "listbox", role: "listbox" }, opt1, opt2); + const hidden = h("input", { type: "hidden", name: "fruit" }); + el.appendChild(trigger); + el.appendChild(listbox); + el.appendChild(hidden); + document.body.appendChild(el); + }); + + it("registers the custom elements", () => { + expect(customElements.get("petty-select")).toBe(PettySelect); + expect(customElements.get("petty-select-option")).toBeDefined(); + }); + + it("initializes with default-value", () => { + expect(el.value).toBe("apple"); + }); + + it("sets aria-haspopup on trigger", () => { + const trigger = el.querySelector("[data-part=trigger]")!; + expect(trigger.getAttribute("aria-haspopup")).toBe("listbox"); + expect(trigger.getAttribute("aria-expanded")).toBe("false"); + }); + + it("syncs hidden input value", () => { + const input = el.querySelector("input[type=hidden]") as HTMLInputElement; + expect(input.value).toBe("apple"); + }); + + it("marks selected option with aria-selected true", () => { + const apple = el.querySelector("[value=apple]")!; + const banana = el.querySelector("[value=banana]")!; + expect(apple.getAttribute("aria-selected")).toBe("true"); + expect(banana.getAttribute("aria-selected")).toBe("false"); + }); +}); diff --git a/packages/core/tests/switch.test.ts b/packages/core/tests/switch.test.ts new file mode 100644 index 0000000..b32a7cf --- /dev/null +++ b/packages/core/tests/switch.test.ts @@ -0,0 +1,49 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettySwitch } from "../src/components/switch/index"; +import { h } from "./helpers"; + +describe("petty-switch", () => { + let el: PettySwitch; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-switch") as PettySwitch; + const btn = h("button", { "data-part": "control", type: "button" }, "Toggle"); + const label = h("span", { "data-part": "label" }, "Dark mode"); + el.appendChild(btn); + el.appendChild(label); + document.body.appendChild(el); + }); + + it("registers the custom element", () => { + expect(customElements.get("petty-switch")).toBe(PettySwitch); + }); + + it("sets role switch on button", () => { + const btn = el.querySelector("button")!; + expect(btn.getAttribute("role")).toBe("switch"); + }); + + it("defaults to off state with aria-checked false", () => { + expect(el.checked).toBe(false); + expect(el.dataset.state).toBe("off"); + expect(el.querySelector("button")!.getAttribute("aria-checked")).toBe("false"); + }); + + it("toggles on click and fires petty-change", () => { + let detail: { checked: boolean } | null = null; + el.addEventListener("petty-change", ((e: CustomEvent) => { + detail = e.detail; + }) as EventListener); + el.querySelector("button")!.click(); + expect(el.checked).toBe(true); + expect(el.dataset.state).toBe("on"); + expect(detail).toEqual({ checked: true }); + }); + + it("does not toggle when disabled", () => { + el.setAttribute("disabled", ""); + el.querySelector("button")!.click(); + expect(el.checked).toBe(false); + }); +}); diff --git a/packages/core/tests/tabs.test.ts b/packages/core/tests/tabs.test.ts new file mode 100644 index 0000000..a8f6bce --- /dev/null +++ b/packages/core/tests/tabs.test.ts @@ -0,0 +1,53 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyTabs } from "../src/components/tabs/index"; +import { h } from "./helpers"; + +describe("petty-tabs", () => { + let el: PettyTabs; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-tabs") as PettyTabs; + el.setAttribute("default-value", "one"); + const tab1 = h("petty-tab", { value: "one" }, "Tab 1"); + const tab2 = h("petty-tab", { value: "two" }, "Tab 2"); + const tablist = h("div", { role: "tablist" }, tab1, tab2); + const panel1 = h("petty-tab-panel", { value: "one" }, "Content 1"); + const panel2 = h("petty-tab-panel", { value: "two" }, "Content 2"); + el.appendChild(tablist); + el.appendChild(panel1); + el.appendChild(panel2); + document.body.appendChild(el); + }); + + it("registers the custom elements", () => { + expect(customElements.get("petty-tabs")).toBe(PettyTabs); + }); + + it("initializes with default-value", () => { + expect(el.value).toBe("one"); + }); + + it("sets data-state and aria-selected on active tab", () => { + const tab1 = el.querySelector("petty-tab[value='one']")!; + const tab2 = el.querySelector("petty-tab[value='two']")!; + expect(tab1.getAttribute("data-state")).toBe("active"); + expect(tab1.getAttribute("aria-selected")).toBe("true"); + expect(tab2.getAttribute("data-state")).toBe("inactive"); + }); + + it("hides inactive panels", () => { + const panel2 = el.querySelector("petty-tab-panel[value='two']")!; + expect(panel2.hasAttribute("hidden")).toBe(true); + }); + + it("fires petty-change on selectTab", () => { + let detail: { value: string } | null = null; + el.addEventListener("petty-change", ((e: CustomEvent) => { + detail = e.detail; + }) as EventListener); + el.selectTab("two"); + expect(detail).toEqual({ value: "two" }); + expect(el.value).toBe("two"); + }); +}); diff --git a/packages/core/tests/text-field.test.ts b/packages/core/tests/text-field.test.ts new file mode 100644 index 0000000..fa7bb9f --- /dev/null +++ b/packages/core/tests/text-field.test.ts @@ -0,0 +1,52 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyTextField } from "../src/components/text-field/index"; +import { h } from "./helpers"; + +describe("petty-text-field", () => { + let el: PettyTextField; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-text-field") as PettyTextField; + el.setAttribute("name", "email"); + el.appendChild(h("label", { "data-part": "label" }, "Email")); + el.appendChild(h("input", { "data-part": "control", type: "email" })); + el.appendChild(h("span", { "data-part": "description" }, "Enter your email")); + el.appendChild(h("span", { "data-part": "error" })); + document.body.appendChild(el); + }); + + it("registers the custom element", () => { + expect(customElements.get("petty-text-field")).toBe(PettyTextField); + }); + + it("wires label htmlFor to control id", () => { + const label = el.querySelector("label") as HTMLLabelElement; + const input = el.querySelector("input") as HTMLInputElement; + expect(input.id).not.toBe(""); + expect(label.htmlFor).toBe(input.id); + }); + + it("sets aria-describedby on control", () => { + const input = el.querySelector("input") as HTMLInputElement; + const describedBy = input.getAttribute("aria-describedby")!; + expect(describedBy.length).toBeGreaterThan(0); + }); + + it("setError marks control as aria-invalid", () => { + el.setError("Required field"); + const input = el.querySelector("input") as HTMLInputElement; + const error = el.querySelector("[data-part=error]")!; + expect(input.getAttribute("aria-invalid")).toBe("true"); + expect(error.textContent).toBe("Required field"); + }); + + it("clearError removes invalid state", () => { + el.setError("Required"); + el.clearError(); + const input = el.querySelector("input") as HTMLInputElement; + const error = el.querySelector("[data-part=error]")!; + expect(input.hasAttribute("aria-invalid")).toBe(false); + expect(error.textContent).toBe(""); + }); +}); diff --git a/packages/core/tests/toggle.test.ts b/packages/core/tests/toggle.test.ts new file mode 100644 index 0000000..5ef65ab --- /dev/null +++ b/packages/core/tests/toggle.test.ts @@ -0,0 +1,47 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { PettyToggle } from "../src/components/toggle/index"; +import { h } from "./helpers"; + +describe("petty-toggle", () => { + let el: PettyToggle; + + beforeEach(() => { + document.body.textContent = ""; + el = document.createElement("petty-toggle") as PettyToggle; + el.appendChild(h("button", { "data-part": "control", type: "button" }, "Bold")); + document.body.appendChild(el); + }); + + it("registers the custom element", () => { + expect(customElements.get("petty-toggle")).toBe(PettyToggle); + }); + + it("defaults to unpressed with aria-pressed false", () => { + expect(el.pressed).toBe(false); + expect(el.dataset.state).toBe("off"); + expect(el.querySelector("button")!.getAttribute("aria-pressed")).toBe("false"); + }); + + it("sets pressed via property", () => { + el.pressed = true; + expect(el.hasAttribute("pressed")).toBe(true); + expect(el.querySelector("button")!.getAttribute("aria-pressed")).toBe("true"); + expect(el.dataset.state).toBe("on"); + }); + + it("toggles on click and fires petty-change", () => { + let detail: { pressed: boolean } | null = null; + el.addEventListener("petty-change", ((e: CustomEvent) => { + detail = e.detail; + }) as EventListener); + el.querySelector("button")!.click(); + expect(el.pressed).toBe(true); + expect(detail).toEqual({ pressed: true }); + }); + + it("does not toggle when disabled", () => { + el.setAttribute("disabled", ""); + el.querySelector("button")!.click(); + expect(el.pressed).toBe(false); + }); +}); diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000..2836b08 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "baseUrl": ".", + "lib": ["ES2020", "DOM", "DOM.Iterable"] + }, + "include": ["src"], + "exclude": ["node_modules", "dist", "tests"] +} diff --git a/packages/core/tsdown.config.ts b/packages/core/tsdown.config.ts new file mode 100644 index 0000000..285964f --- /dev/null +++ b/packages/core/tsdown.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from "tsdown"; + +const components = [ + "accordion", "alert", "alert-dialog", "avatar", "badge", "breadcrumbs", "button", + "calendar", "card", "checkbox", "collapsible", "combobox", "command-palette", + "context-menu", "data-table", "date-picker", "dialog", "drawer", "dropdown-menu", + "form", "hover-card", "image", "link", "listbox", "meter", "navigation-menu", + "number-field", "pagination", "popover", "progress", "radio-group", "select", + "separator", "skeleton", "slider", "switch", "tabs", "text-field", "toast", + "tags-input", "toggle", "toggle-group", "tooltip", "virtual-list", "wizard", +]; + +const entry: Record = { signals: "src/signals.ts", router: "src/router.ts" }; +for (const c of components) entry[`${c}/index`] = `src/components/${c}/index.ts`; + +export default defineConfig({ entry, format: ["esm", "cjs"], dts: true, clean: true, sourcemap: true, external: ["zod", "zod/v4"] }); diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts new file mode 100644 index 0000000..d806e23 --- /dev/null +++ b/packages/core/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + environment: "jsdom", + include: ["tests/**/*.test.ts"], + }, +}); diff --git a/packages/docs/package.json b/packages/docs/package.json new file mode 100644 index 0000000..4c02d98 --- /dev/null +++ b/packages/docs/package.json @@ -0,0 +1,13 @@ +{ + "name": "@pettyui/docs", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "build": "node src/build.js", + "dev": "node src/build.js --watch" + }, + "dependencies": { + "marked": "^15.0.0" + } +} diff --git a/packages/docs/src/build.js b/packages/docs/src/build.js new file mode 100644 index 0000000..4d3ebed --- /dev/null +++ b/packages/docs/src/build.js @@ -0,0 +1,76 @@ +import { readFileSync, writeFileSync, mkdirSync, readdirSync, existsSync } from "node:fs"; +import { join, basename } from "node:path"; +import { Marked } from "marked"; + +const marked = new Marked(); +const ROOT = new URL("../", import.meta.url).pathname; +const CONTENT = join(ROOT, "src/content"); +const DIST = join(ROOT, "dist"); +const TEMPLATE = readFileSync(join(ROOT, "src/templates/page.html"), "utf8"); + +function buildNav(files) { + const categories = {}; + for (const f of files) { + const md = readFileSync(join(CONTENT, f), "utf8"); + const meta = parseFrontmatter(md); + const cat = meta.category || "other"; + if (!categories[cat]) categories[cat] = []; + categories[cat].push({ slug: f.replace(".md", ""), title: meta.title || f.replace(".md", "") }); + } + const order = ["getting-started", "inputs", "navigation", "overlays", "feedback", "layout", "data", "animation", "api"]; + let html = ""; + for (const cat of order) { + const items = categories[cat]; + if (!items) continue; + const label = cat === "getting-started" ? "Getting Started" : cat === "api" ? "API" : cat.charAt(0).toUpperCase() + cat.slice(1); + html += ``; + } + return html; +} + +function parseFrontmatter(md) { + if (!md.startsWith("---")) return { body: md }; + const end = md.indexOf("---", 3); + if (end === -1) return { body: md }; + const front = md.slice(3, end).trim(); + const body = md.slice(end + 3).trim(); + const meta = { body }; + for (const line of front.split("\n")) { + const [key, ...rest] = line.split(":"); + if (key && rest.length) meta[key.trim()] = rest.join(":").trim(); + } + return meta; +} + +// Build +mkdirSync(DIST, { recursive: true }); + +const files = readdirSync(CONTENT).filter(f => f.endsWith(".md")); +const nav = buildNav(files); + +for (const file of files) { + const md = readFileSync(join(CONTENT, file), "utf8"); + const meta = parseFrontmatter(md); + const html = marked.parse(meta.body); + const title = meta.title || file.replace(".md", ""); + const slug = file.replace(".md", ""); + + const page = TEMPLATE + .replace("{{title}}", title) + .replace("{{nav}}", nav) + .replace("{{content}}", html) + .replace("{{slug}}", slug); + + const outDir = join(DIST, slug); + mkdirSync(outDir, { recursive: true }); + writeFileSync(join(outDir, "index.html"), page); +} + +// Index redirect +writeFileSync(join(DIST, "index.html"), ``); + +console.log(`Built ${files.length} doc pages`); diff --git a/packages/docs/src/content/accordion.md b/packages/docs/src/content/accordion.md new file mode 100644 index 0000000..8b3167a --- /dev/null +++ b/packages/docs/src/content/accordion.md @@ -0,0 +1,13 @@ +--- +title: Accordion +category: layout +--- + +# petty-accordion + + + +```js +import "pettyui/accordion"; +``` + diff --git a/packages/docs/src/content/alert-dialog.md b/packages/docs/src/content/alert-dialog.md new file mode 100644 index 0000000..b07ddd4 --- /dev/null +++ b/packages/docs/src/content/alert-dialog.md @@ -0,0 +1,13 @@ +--- +title: Alert Dialog +category: overlays +--- + +# petty-alert-dialog + + + +```js +import "pettyui/alert-dialog"; +``` + diff --git a/packages/docs/src/content/alert.md b/packages/docs/src/content/alert.md new file mode 100644 index 0000000..5e9c6d0 --- /dev/null +++ b/packages/docs/src/content/alert.md @@ -0,0 +1,27 @@ +--- +title: Alert +category: feedback +--- + +# petty-alert + +Inline status message with variant-driven ARIA role + +```js +import "pettyui/alert"; +``` + +## Example + +```html + +

Something went wrong.

+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `variant` | string | default | Visual variant: default, error, warning, success, info | + diff --git a/packages/docs/src/content/avatar.md b/packages/docs/src/content/avatar.md new file mode 100644 index 0000000..be22573 --- /dev/null +++ b/packages/docs/src/content/avatar.md @@ -0,0 +1,30 @@ +--- +title: Avatar +category: layout +--- + +# petty-avatar + +Image with automatic fallback on load error + +```js +import "pettyui/avatar"; +``` + +## Example + +```html + + \"User\" + JD + +``` + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `fallback` | `span` | Fallback content shown on image error | + diff --git a/packages/docs/src/content/badge.md b/packages/docs/src/content/badge.md new file mode 100644 index 0000000..513b036 --- /dev/null +++ b/packages/docs/src/content/badge.md @@ -0,0 +1,25 @@ +--- +title: Badge +category: layout +--- + +# petty-badge + +Display-only status indicator with variant support + +```js +import "pettyui/badge"; +``` + +## Example + +```html +Active +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `variant` | string | default | Visual variant | + diff --git a/packages/docs/src/content/breadcrumbs.md b/packages/docs/src/content/breadcrumbs.md new file mode 100644 index 0000000..fddb786 --- /dev/null +++ b/packages/docs/src/content/breadcrumbs.md @@ -0,0 +1,25 @@ +--- +title: Breadcrumbs +category: navigation +--- + +# petty-breadcrumbs + +Navigation breadcrumb trail with ARIA landmarks + +```js +import "pettyui/breadcrumbs"; +``` + +## Example + +```html + +
    +
  1. Home
  2. +
  3. Docs
  4. +
  5. Current
  6. +
+
+``` + diff --git a/packages/docs/src/content/button.md b/packages/docs/src/content/button.md new file mode 100644 index 0000000..9f027eb --- /dev/null +++ b/packages/docs/src/content/button.md @@ -0,0 +1,36 @@ +--- +title: Button +category: inputs +--- + +# petty-button + +Headless button wrapper with loading and disabled states + +```js +import "pettyui/button"; +``` + +## Example + +```html + + + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `disabled` | boolean | — | Disables the button | +| `loading` | boolean | — | Shows loading state, disables interaction | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `button` | `button` | The native button element | + diff --git a/packages/docs/src/content/calendar.md b/packages/docs/src/content/calendar.md new file mode 100644 index 0000000..6a52521 --- /dev/null +++ b/packages/docs/src/content/calendar.md @@ -0,0 +1,33 @@ +--- +title: Calendar +category: data +--- + +# petty-calendar + +Month grid with day selection and month navigation + +```js +import "pettyui/calendar"; +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | Selected date in ISO format | +| `min` | string | — | Earliest selectable date | +| `max` | string | — | Latest selectable date | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `title` | `span` | Month/year heading | +| `body` | `tbody` | Day grid body | +| `prev-month` | `button` | Previous month nav | +| `next-month` | `button` | Next month nav | +| `day` | `button` | Individual day cell | + diff --git a/packages/docs/src/content/card.md b/packages/docs/src/content/card.md new file mode 100644 index 0000000..046878f --- /dev/null +++ b/packages/docs/src/content/card.md @@ -0,0 +1,22 @@ +--- +title: Card +category: layout +--- + +# petty-card + +Structural container with optional heading-based labelling + +```js +import "pettyui/card"; +``` + +## Example + +```html + +

Card Title

+

Card content goes here.

+
+``` + diff --git a/packages/docs/src/content/change.md b/packages/docs/src/content/change.md new file mode 100644 index 0000000..e7e86e5 --- /dev/null +++ b/packages/docs/src/content/change.md @@ -0,0 +1,24 @@ +--- +title: Change +category: navigation +--- + +# petty-change + +{ page: number } + +```js +import "pettyui/change"; +``` + +## Example + +```html + + Prev + 1 + 2 + Next + +``` + diff --git a/packages/docs/src/content/checkbox.md b/packages/docs/src/content/checkbox.md new file mode 100644 index 0000000..186b148 --- /dev/null +++ b/packages/docs/src/content/checkbox.md @@ -0,0 +1,47 @@ +--- +title: Checkbox +category: inputs +--- + +# petty-checkbox + +Tri-state checkbox with label wiring and change events + +```js +import "pettyui/checkbox"; +``` + +## Example + +```html + + + + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `checked` | boolean | — | Whether checked | +| `indeterminate` | boolean | — | Indeterminate state | +| `disabled` | boolean | — | Disables | +| `name` | string | — | Form name | +| `value` | string | on | Form value | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `control` | `input[type=checkbox]` | The native checkbox | +| `label` | `label` | Label wired to checkbox | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ checked: boolean, indeterminate: boolean }` | Fires on check change | + diff --git a/packages/docs/src/content/close.md b/packages/docs/src/content/close.md new file mode 100644 index 0000000..f38cd93 --- /dev/null +++ b/packages/docs/src/content/close.md @@ -0,0 +1,40 @@ +--- +title: Close +category: overlays +--- + +# petty-close + +{ value: string } + +```js +import "pettyui/close"; +``` + +## Example + +```html + + + +

Title

+

Content

+ +
+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `side` | string | right | Slide-in direction | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-close` | `{ value: string }` | Fires when closed with return value | +| `petty-toggle` | `{ open: boolean }` | Fires on open/close | +| `petty-close` | `{ value: string }` | Fires when drawer closes | + diff --git a/packages/docs/src/content/collapsible.md b/packages/docs/src/content/collapsible.md new file mode 100644 index 0000000..3b9b927 --- /dev/null +++ b/packages/docs/src/content/collapsible.md @@ -0,0 +1,19 @@ +--- +title: Collapsible +category: layout +--- + +# petty-collapsible + +Single disclosure wrapper on native details element + +```js +import "pettyui/collapsible"; +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `disabled` | boolean | — | Prevents open/close interaction | + diff --git a/packages/docs/src/content/combobox.md b/packages/docs/src/content/combobox.md new file mode 100644 index 0000000..2101d66 --- /dev/null +++ b/packages/docs/src/content/combobox.md @@ -0,0 +1,47 @@ +--- +title: Combobox +category: inputs +--- + +# petty-combobox + +Searchable select with popover listbox and keyboard nav + +```js +import "pettyui/combobox"; +``` + +## Example + +```html + + +
+ A +
+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | Selected value | +| `placeholder` | string | — | Placeholder | +| `disabled` | boolean | — | Disables | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `input` | `input` | Search input | +| `listbox` | `div[popover]` | Popover listbox | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: string }` | Fires on select | + diff --git a/packages/docs/src/content/command-palette.md b/packages/docs/src/content/command-palette.md new file mode 100644 index 0000000..c5aff04 --- /dev/null +++ b/packages/docs/src/content/command-palette.md @@ -0,0 +1,13 @@ +--- +title: Command Palette +category: overlays +--- + +# petty-command-palette + + + +```js +import "pettyui/command-palette"; +``` + diff --git a/packages/docs/src/content/context-menu.md b/packages/docs/src/content/context-menu.md new file mode 100644 index 0000000..6c3866f --- /dev/null +++ b/packages/docs/src/content/context-menu.md @@ -0,0 +1,13 @@ +--- +title: Context Menu +category: overlays +--- + +# petty-context-menu + + + +```js +import "pettyui/context-menu"; +``` + diff --git a/packages/docs/src/content/data-table.md b/packages/docs/src/content/data-table.md new file mode 100644 index 0000000..fbf2274 --- /dev/null +++ b/packages/docs/src/content/data-table.md @@ -0,0 +1,21 @@ +--- +title: Data Table +category: data +--- + +# petty-data-table + +Sortable table with click-to-sort column headers + +```js +import "pettyui/data-table"; +``` + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `body` | `tbody` | Table body containing sortable rows | + diff --git a/packages/docs/src/content/date-picker.md b/packages/docs/src/content/date-picker.md new file mode 100644 index 0000000..8b34145 --- /dev/null +++ b/packages/docs/src/content/date-picker.md @@ -0,0 +1,48 @@ +--- +title: Date Picker +category: inputs +--- + +# petty-date-picker + +Date input with calendar popover integration + +```js +import "pettyui/date-picker"; +``` + +## Example + +```html + + + +
+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | ISO date | +| `min` | string | — | Earliest date | +| `max` | string | — | Latest date | +| `disabled` | boolean | — | Disables | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `input` | `input` | Date text input | +| `trigger` | `button` | Calendar toggle | +| `calendar` | `div[popover]` | Calendar popover | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: string }` | Fires on date select | + diff --git a/packages/docs/src/content/dialog.md b/packages/docs/src/content/dialog.md new file mode 100644 index 0000000..e279c35 --- /dev/null +++ b/packages/docs/src/content/dialog.md @@ -0,0 +1,13 @@ +--- +title: Dialog +category: overlays +--- + +# petty-dialog + +Headless dialog on native dialog element with ARIA linking + +```js +import "pettyui/dialog"; +``` + diff --git a/packages/docs/src/content/drawer.md b/packages/docs/src/content/drawer.md new file mode 100644 index 0000000..aff79da --- /dev/null +++ b/packages/docs/src/content/drawer.md @@ -0,0 +1,13 @@ +--- +title: Drawer +category: overlays +--- + +# petty-drawer + + + +```js +import "pettyui/drawer"; +``` + diff --git a/packages/docs/src/content/dropdown-menu.md b/packages/docs/src/content/dropdown-menu.md new file mode 100644 index 0000000..76e9ff7 --- /dev/null +++ b/packages/docs/src/content/dropdown-menu.md @@ -0,0 +1,22 @@ +--- +title: Dropdown Menu +category: overlays +--- + +# petty-dropdown-menu + +Action menu built on the Popover API + +```js +import "pettyui/dropdown-menu"; +``` + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `trigger` | `button` | Menu trigger button | +| `content` | `div[popover]` | Menu content popover | + diff --git a/packages/docs/src/content/form.md b/packages/docs/src/content/form.md new file mode 100644 index 0000000..42dfcfc --- /dev/null +++ b/packages/docs/src/content/form.md @@ -0,0 +1,13 @@ +--- +title: Form +category: inputs +--- + +# petty-form + +Form wrapper with Zod validation and accessible error display + +```js +import "pettyui/form"; +``` + diff --git a/packages/docs/src/content/hover-card.md b/packages/docs/src/content/hover-card.md new file mode 100644 index 0000000..e031b15 --- /dev/null +++ b/packages/docs/src/content/hover-card.md @@ -0,0 +1,13 @@ +--- +title: Hover Card +category: overlays +--- + +# petty-hover-card + + + +```js +import "pettyui/hover-card"; +``` + diff --git a/packages/docs/src/content/image.md b/packages/docs/src/content/image.md new file mode 100644 index 0000000..ed52da7 --- /dev/null +++ b/packages/docs/src/content/image.md @@ -0,0 +1,30 @@ +--- +title: Image +category: layout +--- + +# petty-image + +Image element with fallback display on load failure + +```js +import "pettyui/image"; +``` + +## Example + +```html + + \"Photo\" + No image + +``` + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `fallback` | `span` | Fallback shown on error | + diff --git a/packages/docs/src/content/introduction.md b/packages/docs/src/content/introduction.md new file mode 100644 index 0000000..f341638 --- /dev/null +++ b/packages/docs/src/content/introduction.md @@ -0,0 +1,73 @@ +--- +title: Introduction +category: getting-started +--- + +# Introduction + +PettyUI is 45 headless Web Components built on native browser APIs. Zero dependencies. ~750 bytes of signals runtime. + +## Install + +```bash +npm install pettyui +``` + +## Use a component + +Import the component, write the HTML. + +```html + + + + + +``` + +Each component is a Custom Element. Import it once and use it anywhere on the page. + +## Styling + +PettyUI is headless. Components expose `data-part` and `data-state` attributes for styling. No Shadow DOM. + +```css +/* Style the control part of any form field */ +[data-part="control"] { + border: 1px solid #e5e7eb; + border-radius: 0.375rem; + padding: 0.5rem 0.75rem; +} + +/* Style active tab */ +petty-tab[data-state="active"] { + color: #2563eb; + border-bottom-color: #2563eb; +} +``` + +Or import the optional default theme: + +```js +import "pettyui/theme"; +``` + +## MCP + +PettyUI has an MCP server your AI coding agent can use. It discovers components, inspects APIs, composes markup, and validates output. + +```bash +claude mcp add pettyui --transport http https://petty.staythree.com/mcp +``` + +## Browser APIs + +PettyUI builds on: + +- `` for modals with focus trapping +- Popover API for dropdowns, tooltips, popovers +- `commandfor` / `command` (Invoker Commands) for declarative triggers +- Navigation API + View Transitions for SPA routing +- Custom Elements for component registration diff --git a/packages/docs/src/content/invalid.md b/packages/docs/src/content/invalid.md new file mode 100644 index 0000000..203e608 --- /dev/null +++ b/packages/docs/src/content/invalid.md @@ -0,0 +1,28 @@ +--- +title: Invalid +category: inputs +--- + +# petty-invalid + +{ errors: Array<{ path, message }> } + +```js +import "pettyui/invalid"; +``` + +## Example + +```html + +
+ + + + + + +
+
+``` + diff --git a/packages/docs/src/content/link.md b/packages/docs/src/content/link.md new file mode 100644 index 0000000..2f87013 --- /dev/null +++ b/packages/docs/src/content/link.md @@ -0,0 +1,28 @@ +--- +title: Link +category: navigation +--- + +# petty-link + +Headless anchor wrapper with disabled and external support + +```js +import "pettyui/link"; +``` + +## Example + +```html + + External Link + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `disabled` | boolean | — | Prevents navigation | +| `external` | boolean | — | Opens in new tab with noopener | + diff --git a/packages/docs/src/content/listbox.md b/packages/docs/src/content/listbox.md new file mode 100644 index 0000000..9f9a108 --- /dev/null +++ b/packages/docs/src/content/listbox.md @@ -0,0 +1,36 @@ +--- +title: Listbox +category: inputs +--- + +# petty-listbox + +Inline selectable list with single or multiple selection + +```js +import "pettyui/listbox"; +``` + +## Example + +```html + + Alpha + Beta + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | Selected value(s) | +| `default-value` | string | — | Initial value | +| `multiple` | boolean | — | Multi-select mode | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: string }` | Fires on selection change | + diff --git a/packages/docs/src/content/meter.md b/packages/docs/src/content/meter.md new file mode 100644 index 0000000..6e01d3e --- /dev/null +++ b/packages/docs/src/content/meter.md @@ -0,0 +1,40 @@ +--- +title: Meter +category: feedback +--- + +# petty-meter + +Value gauge with low/high/optimum state computation + +```js +import "pettyui/meter"; +``` + +## Example + +```html + +
+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | Current value | +| `min` | string | 0 | Minimum | +| `max` | string | 100 | Maximum | +| `low` | string | — | Low threshold | +| `high` | string | — | High threshold | +| `optimum` | string | — | Optimal value | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `fill` | `div` | Fill bar, receives --petty-meter-value CSS var | + diff --git a/packages/docs/src/content/navigation-menu.md b/packages/docs/src/content/navigation-menu.md new file mode 100644 index 0000000..a005c7e --- /dev/null +++ b/packages/docs/src/content/navigation-menu.md @@ -0,0 +1,30 @@ +--- +title: Navigation Menu +category: navigation +--- + +# petty-navigation-menu + +Horizontal nav with optional popover dropdowns + +```js +import "pettyui/navigation-menu"; +``` + +## Example + +```html + + + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `orientation` | string | horizontal | Layout orientation | + diff --git a/packages/docs/src/content/number-field.md b/packages/docs/src/content/number-field.md new file mode 100644 index 0000000..d0987c1 --- /dev/null +++ b/packages/docs/src/content/number-field.md @@ -0,0 +1,52 @@ +--- +title: Number Field +category: inputs +--- + +# petty-number-field + +Numeric input with increment/decrement and clamping + +```js +import "pettyui/number-field"; +``` + +## Example + +```html + + + + + + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `min` | string | — | Minimum | +| `max` | string | — | Maximum | +| `step` | string | 1 | Step | +| `value` | string | — | Current value | +| `disabled` | boolean | — | Disables | +| `name` | string | — | Form name | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `control` | `input` | Numeric input | +| `label` | `label` | Label | +| `increment` | `button` | Increment | +| `decrement` | `button` | Decrement | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: number }` | Fires on change | + diff --git a/packages/docs/src/content/pagination.md b/packages/docs/src/content/pagination.md new file mode 100644 index 0000000..fec8370 --- /dev/null +++ b/packages/docs/src/content/pagination.md @@ -0,0 +1,21 @@ +--- +title: Pagination +category: navigation +--- + +# petty-pagination + +Page navigation with prev/next and numbered items + +```js +import "pettyui/pagination"; +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `total` | string | — | Total number of items | +| `page-size` | string | 10 | Items per page | +| `current-page` | string | 1 | Active page number | + diff --git a/packages/docs/src/content/popover.md b/packages/docs/src/content/popover.md new file mode 100644 index 0000000..d59d23e --- /dev/null +++ b/packages/docs/src/content/popover.md @@ -0,0 +1,13 @@ +--- +title: Popover +category: overlays +--- + +# petty-popover + +Headless popover on native Popover API with ARIA linking + +```js +import "pettyui/popover"; +``` + diff --git a/packages/docs/src/content/progress.md b/packages/docs/src/content/progress.md new file mode 100644 index 0000000..ec3b991 --- /dev/null +++ b/packages/docs/src/content/progress.md @@ -0,0 +1,38 @@ +--- +title: Progress +category: feedback +--- + +# petty-progress + +Accessible progress bar with indeterminate state support + +```js +import "pettyui/progress"; +``` + +## Example + +```html + +
+ 60% +
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | Current progress value (omit for indeterminate) | +| `max` | string | 100 | Maximum value | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `fill` | `div` | Fill bar, receives --petty-progress CSS var | +| `label` | `span` | Percentage text label | + diff --git a/packages/docs/src/content/radio-group.md b/packages/docs/src/content/radio-group.md new file mode 100644 index 0000000..d0c6360 --- /dev/null +++ b/packages/docs/src/content/radio-group.md @@ -0,0 +1,37 @@ +--- +title: Radio Group +category: inputs +--- + +# petty-radio-group + +Mutually exclusive selection group with keyboard navigation + +```js +import "pettyui/radio-group"; +``` + +## Example + +```html + + Option A + Option B + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `name` | string | — | Form name | +| `value` | string | — | Selected value | +| `default-value` | string | — | Initial value | +| `orientation` | string | vertical | Layout orientation | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: string }` | Fires on selection change | + diff --git a/packages/docs/src/content/router.md b/packages/docs/src/content/router.md new file mode 100644 index 0000000..7eb619c --- /dev/null +++ b/packages/docs/src/content/router.md @@ -0,0 +1,63 @@ +--- +title: Router +category: api +--- + +# Router + +SPA router using Navigation API and View Transitions. ~400 bytes. + +```js +import { initRouter } from "pettyui/router"; +``` + +## Setup + +Add an outlet element and call `initRouter()` once. + +```html + + +
+ +
+ + +``` + +## How it works + +1. Intercepts same-origin link clicks via the Navigation API +2. Fetches the target URL with an `X-Partial` header +3. Your server returns only the page content (not the full shell) +4. Swaps the outlet content +5. Uses View Transitions API if the browser supports it + +## Options + +```js +initRouter({ + outlet: "[data-petty-outlet]", // CSS selector for content area + partialHeader: "X-Partial", // header sent to server +}); +``` + +## Server side + +When your server sees the `X-Partial` header, return only the content fragment instead of the full HTML page. + +```js +// Express example +app.get("/about", (req, res) => { + if (req.headers["x-partial"]) { + return res.send("

About

Page content here.

"); + } + res.send(fullPageHTML); +}); +``` diff --git a/packages/docs/src/content/scroll.md b/packages/docs/src/content/scroll.md new file mode 100644 index 0000000..16da9b7 --- /dev/null +++ b/packages/docs/src/content/scroll.md @@ -0,0 +1,19 @@ +--- +title: Scroll +category: data +--- + +# petty-scroll + +{ startIndex: number, endIndex: number } + +```js +import "pettyui/scroll"; +``` + +## Example + +```html + +``` + diff --git a/packages/docs/src/content/select.md b/packages/docs/src/content/select.md new file mode 100644 index 0000000..89e621e --- /dev/null +++ b/packages/docs/src/content/select.md @@ -0,0 +1,43 @@ +--- +title: Select +category: overlays +--- + +# petty-select + +{ value: string } + +```js +import "pettyui/select"; +``` + +## Example + +```html + + +
+ Edit + Delete +
+
+``` + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `trigger` | `div` | Right-click target area | +| `content` | `div[popover]` | Context menu popover | +| `search` | `input` | Search input field | +| `list` | `div` | Command items container | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-select` | `{ value: string }` | Fires when an item is selected | +| `petty-select` | `{ value: string }` | Fires when a command is selected | + diff --git a/packages/docs/src/content/separator.md b/packages/docs/src/content/separator.md new file mode 100644 index 0000000..fb6020c --- /dev/null +++ b/packages/docs/src/content/separator.md @@ -0,0 +1,25 @@ +--- +title: Separator +category: layout +--- + +# petty-separator + +Accessible divider with configurable orientation + +```js +import "pettyui/separator"; +``` + +## Example + +```html + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `orientation` | string | horizontal | Visual orientation | + diff --git a/packages/docs/src/content/signals.md b/packages/docs/src/content/signals.md new file mode 100644 index 0000000..2069649 --- /dev/null +++ b/packages/docs/src/content/signals.md @@ -0,0 +1,64 @@ +--- +title: Signals +category: api +--- + +# Signals + +Reactive state management in ~500 bytes. Automatic dependency tracking. + +```js +import { signal, effect } from "pettyui/signals"; +``` + +## signal(initial) + +Creates a reactive value. + +```js +const count = signal(0); +count.get(); // 0 +count.set(5); // updates all effects reading count +``` + +## effect(fn) + +Runs `fn` immediately, then re-runs it whenever any signal it reads changes. + +```js +const name = signal("world"); + +effect(() => { + console.log("Hello", name.get()); +}); +// logs "Hello world" + +name.set("PettyUI"); +// logs "Hello PettyUI" +``` + +Returns the effect function for manual re-execution. + +## Usage in a Custom Element + +```js +import { signal, effect } from "pettyui/signals"; + +class MyCounter extends HTMLElement { + connectedCallback() { + this.count = signal(0); + const span = this.querySelector("span"); + const btn = this.querySelector("button"); + + effect(() => { + span.textContent = String(this.count.get()); + }); + + btn.addEventListener("click", () => { + this.count.set(this.count.get() + 1); + }); + } +} + +customElements.define("my-counter", MyCounter); +``` diff --git a/packages/docs/src/content/skeleton.md b/packages/docs/src/content/skeleton.md new file mode 100644 index 0000000..855f751 --- /dev/null +++ b/packages/docs/src/content/skeleton.md @@ -0,0 +1,27 @@ +--- +title: Skeleton +category: layout +--- + +# petty-skeleton + +Loading placeholder with aria-busy and loaded state transitions + +```js +import "pettyui/skeleton"; +``` + +## Example + +```html + +
+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `loaded` | boolean | — | Switches from loading to loaded state | + diff --git a/packages/docs/src/content/slider.md b/packages/docs/src/content/slider.md new file mode 100644 index 0000000..914ca1a --- /dev/null +++ b/packages/docs/src/content/slider.md @@ -0,0 +1,51 @@ +--- +title: Slider +category: inputs +--- + +# petty-slider + +Range input wrapper with label, output, and change events + +```js +import "pettyui/slider"; +``` + +## Example + +```html + + + + 50 + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `min` | string | — | Minimum | +| `max` | string | — | Maximum | +| `step` | string | — | Step | +| `value` | string | — | Current value | +| `disabled` | boolean | — | Disables | +| `name` | string | — | Form name | +| `orientation` | string | horizontal | Orientation | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `control` | `input[type=range]` | Range input | +| `label` | `label` | Label | +| `output` | `span` | Value display | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: number }` | Fires on change | + diff --git a/packages/docs/src/content/sort.md b/packages/docs/src/content/sort.md new file mode 100644 index 0000000..e168ba7 --- /dev/null +++ b/packages/docs/src/content/sort.md @@ -0,0 +1,29 @@ +--- +title: Sort +category: data +--- + +# petty-sort + +{ column: string, direction: string } + +```js +import "pettyui/sort"; +``` + +## Example + +```html + + + + + + + + + +
NameAge
Alice30
+
+``` + diff --git a/packages/docs/src/content/submit.md b/packages/docs/src/content/submit.md new file mode 100644 index 0000000..2dd9dc7 --- /dev/null +++ b/packages/docs/src/content/submit.md @@ -0,0 +1,13 @@ +--- +title: Submit +category: inputs +--- + +# petty-submit + +{ data: Record } + +```js +import "pettyui/submit"; +``` + diff --git a/packages/docs/src/content/switch.md b/packages/docs/src/content/switch.md new file mode 100644 index 0000000..667f68a --- /dev/null +++ b/packages/docs/src/content/switch.md @@ -0,0 +1,45 @@ +--- +title: Switch +category: inputs +--- + +# petty-switch + +On/off toggle built on a button with role=switch + +```js +import "pettyui/switch"; +``` + +## Example + +```html + + Dark mode + + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `checked` | boolean | — | Whether on | +| `disabled` | boolean | — | Disables | +| `name` | string | — | Form name | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `control` | `button` | Button with role=switch | +| `label` | `span` | Label via aria-labelledby | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ checked: boolean }` | Fires on toggle | + diff --git a/packages/docs/src/content/tabs.md b/packages/docs/src/content/tabs.md new file mode 100644 index 0000000..fa72981 --- /dev/null +++ b/packages/docs/src/content/tabs.md @@ -0,0 +1,20 @@ +--- +title: Tabs +category: layout +--- + +# petty-tabs + +Headless tabbed interface with reactive tab/panel sync + +```js +import "pettyui/tabs"; +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `value` | string | — | Active tab value | +| `default-value` | string | — | Initial active tab | + diff --git a/packages/docs/src/content/text-field.md b/packages/docs/src/content/text-field.md new file mode 100644 index 0000000..aa37ed1 --- /dev/null +++ b/packages/docs/src/content/text-field.md @@ -0,0 +1,49 @@ +--- +title: Text Field +category: inputs +--- + +# petty-text-field + +Labeled text input with description and error wiring + +```js +import "pettyui/text-field"; +``` + +## Example + +```html + + + + Your email + + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `name` | string | — | Form name | +| `disabled` | boolean | — | Disables input | +| `required` | boolean | — | Marks required | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `label` | `label` | Label wired via htmlFor | +| `control` | `input` | The text input | +| `description` | `span` | Help text | +| `error` | `span` | Error message | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: string }` | Fires on input | + diff --git a/packages/docs/src/content/theme.md b/packages/docs/src/content/theme.md new file mode 100644 index 0000000..1ad50e4 --- /dev/null +++ b/packages/docs/src/content/theme.md @@ -0,0 +1,77 @@ +--- +title: Theme +category: getting-started +--- + +# Theme + +PettyUI ships an optional default theme. Import it to style all components at once. + +```js +import "pettyui/theme"; +``` + +## Tokens + +Override any `--petty-*` variable to customize the theme. + +```css +:root { + --petty-primary: #2563eb; + --petty-primary-hover: #1d4ed8; + --petty-danger: #dc2626; + --petty-success: #16a34a; + --petty-surface: #ffffff; + --petty-surface-raised: #f9fafb; + --petty-border: #e5e7eb; + --petty-border-focus: #2563eb; + --petty-text: #111827; + --petty-text-muted: #6b7280; + --petty-radius: 0.375rem; + --petty-radius-lg: 0.5rem; + --petty-shadow: 0 4px 16px rgba(0 0 0 / 0.12); + --petty-shadow-sm: 0 1px 4px rgba(0 0 0 / 0.08); + --petty-font: system-ui, -apple-system, sans-serif; + --petty-duration: 150ms; +} +``` + +## Dark mode + +Override the tokens in a media query or class. + +```css +@media (prefers-color-scheme: dark) { + :root { + --petty-surface: #0f172a; + --petty-surface-raised: #1e293b; + --petty-border: #334155; + --petty-text: #f1f5f9; + --petty-text-muted: #94a3b8; + } +} +``` + +## Styling without the theme + +PettyUI components use `data-part` and `data-state` attributes. Style them directly. + +```css +/* All form controls */ +[data-part="control"] { + border: 1px solid #ccc; + padding: 8px 12px; + border-radius: 6px; +} + +/* Active state */ +petty-tab[data-state="active"] { + color: blue; + border-bottom: 2px solid blue; +} + +/* Switch when on */ +petty-switch[data-state="on"] [data-part="control"] { + background: blue; +} +``` diff --git a/packages/docs/src/content/toast-region.md b/packages/docs/src/content/toast-region.md new file mode 100644 index 0000000..340ddea --- /dev/null +++ b/packages/docs/src/content/toast-region.md @@ -0,0 +1,36 @@ +--- +title: Toast Region +category: feedback +--- + +# petty-toast-region + +Container that renders active toast notifications + +```js +import "pettyui/toast-region"; +``` + +## Example + +```html + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `position` | string | — | Screen position for toasts | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `toast` | `div` | Individual toast element | +| `toast-title` | `div` | Toast title | +| `toast-description` | `div` | Toast description | +| `toast-close` | `button` | Dismiss button | + diff --git a/packages/docs/src/content/toggle-group.md b/packages/docs/src/content/toggle-group.md new file mode 100644 index 0000000..29871f5 --- /dev/null +++ b/packages/docs/src/content/toggle-group.md @@ -0,0 +1,37 @@ +--- +title: Toggle Group +category: inputs +--- + +# petty-toggle-group + +Single or multi-selection toggle group + +```js +import "pettyui/toggle-group"; +``` + +## Example + +```html + + Left + Right + +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `type` | string | single | Mode: single|multiple | +| `value` | string | — | Selected value(s) | +| `default-value` | string | — | Initial value | +| `orientation` | string | — | Orientation | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-change` | `{ value: string }` | Fires on change | + diff --git a/packages/docs/src/content/toggle.md b/packages/docs/src/content/toggle.md new file mode 100644 index 0000000..9a02024 --- /dev/null +++ b/packages/docs/src/content/toggle.md @@ -0,0 +1,52 @@ +--- +title: Toggle +category: overlays +--- + +# petty-toggle + +{ open: boolean } + +```js +import "pettyui/toggle"; +``` + +## Example + +```html + + +
+

Popover content

+
+
+``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `side` | string | right | Slide-in direction | +| `delay` | string | 200 | Show delay in ms | +| `open-delay` | string | 300 | Delay before showing in ms | +| `close-delay` | string | 200 | Delay before hiding in ms | + +## Parts + +Style these with `[data-part="name"]` selectors. + +| Part | Element | Description | +| --- | --- | --- | +| `trigger` | `span` | Element that triggers tooltip | +| `content` | `div[popover]` | Tooltip content popover | +| `trigger` | `span` | Hover trigger element | +| `content` | `div[popover]` | Card content popover | + +## Events + +| Event | Detail | Description | +| --- | --- | --- | +| `petty-close` | `{ value: string }` | Fires when drawer closes | +| `petty-toggle` | `{ open: boolean }` | Fires on show/hide | +| `petty-toggle` | `{ open: boolean }` | Fires on show/hide | + diff --git a/packages/docs/src/content/tooltip.md b/packages/docs/src/content/tooltip.md new file mode 100644 index 0000000..39b0c7d --- /dev/null +++ b/packages/docs/src/content/tooltip.md @@ -0,0 +1,13 @@ +--- +title: Tooltip +category: overlays +--- + +# petty-tooltip + + + +```js +import "pettyui/tooltip"; +``` + diff --git a/packages/docs/src/content/virtual-list.md b/packages/docs/src/content/virtual-list.md new file mode 100644 index 0000000..70163fe --- /dev/null +++ b/packages/docs/src/content/virtual-list.md @@ -0,0 +1,20 @@ +--- +title: Virtual List +category: data +--- + +# petty-virtual-list + +Windowed scroll rendering only visible items plus overscan + +```js +import "pettyui/virtual-list"; +``` + +## Attributes + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `item-height` | string | 40 | Height of each item in px | +| `overscan` | string | 5 | Extra items rendered above/below viewport | + diff --git a/packages/docs/src/content/wizard.md b/packages/docs/src/content/wizard.md new file mode 100644 index 0000000..7644f57 --- /dev/null +++ b/packages/docs/src/content/wizard.md @@ -0,0 +1,13 @@ +--- +title: Wizard +category: layout +--- + +# petty-wizard + + + +```js +import "pettyui/wizard"; +``` + diff --git a/packages/docs/src/generate.js b/packages/docs/src/generate.js new file mode 100644 index 0000000..ae9dc74 --- /dev/null +++ b/packages/docs/src/generate.js @@ -0,0 +1,112 @@ +// Generate component markdown docs by reading the MCP data files as plain text +import { readFileSync, writeFileSync, readdirSync } from "node:fs"; +import { join } from "node:path"; + +const ROOT = new URL("../", import.meta.url).pathname; +const CONTENT = join(ROOT, "src/content"); +const DATA_DIR = join(ROOT, "../mcp/src/data"); + +// Parse component objects from TypeScript source files +function extractComponents(filepath) { + const src = readFileSync(filepath, "utf8"); + const components = []; + + // Find all function calls that create components: input(...), layout(...), etc. + // Each has: tag, description, tier, attributes[], parts[], events[], example + const tagRegex = /"(petty-[a-z-]+)"/g; + const tags = [...src.matchAll(tagRegex)].map(m => m[1]); + + // Split by tag to get each component's block + for (let i = 0; i < tags.length; i++) { + const tag = tags[i]; + const startIdx = src.indexOf(`"${tag}"`); + const endIdx = i < tags.length - 1 ? src.indexOf(`"${tags[i + 1]}"`) : src.length; + const block = src.slice(startIdx, endIdx); + + // Extract description (second quoted string after tag) + const descMatch = block.match(/^"[^"]+",\s*"([^"]+)"/); + const description = descMatch ? descMatch[1] : ""; + + // Extract category from filename + const filename = filepath.split("/").pop().replace(".ts", ""); + + // Extract attributes + const attrs = []; + const attrMatches = [...block.matchAll(/attr\$?\d*\("([^"]+)",\s*"([^"]+)",\s*"([^"]+)"(?:,\s*"([^"]+)")?\)/g)]; + for (const m of attrMatches) { + attrs.push({ name: m[1], type: m[2], description: m[3], default: m[4] }); + } + + // Extract parts + const parts = []; + const partMatches = [...block.matchAll(/part\$?\d*\("([^"]+)",\s*"([^"]+)",\s*"([^"]+)"\)/g)]; + for (const m of partMatches) { + parts.push({ name: m[1], element: m[2], description: m[3] }); + } + + // Extract events + const events = []; + const evtMatches = [...block.matchAll(/evt\$?\d*\("([^"]+)",\s*"([^"]+)",\s*"([^"]+)"\)/g)]; + const changeMatches = [...block.matchAll(/change\("([^"]+)",\s*"([^"]+)"\)/g)]; + for (const m of evtMatches) events.push({ name: m[1], detail: m[2], description: m[3] }); + for (const m of changeMatches) events.push({ name: "petty-change", detail: m[1], description: m[2] }); + + // Extract example (last string in the block, multi-line with \n) + const exampleMatch = block.match(/,\s*"( f.endsWith(".ts")); +let count = 0; + +for (const file of dataFiles) { + const components = extractComponents(join(DATA_DIR, file)); + + for (const c of components) { + const slug = c.tag.replace("petty-", ""); + const title = slug.split("-").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(" "); + + let md = `---\ntitle: ${title}\ncategory: ${c.category}\n---\n\n`; + md += `# ${c.tag}\n\n`; + md += `${c.description}\n\n`; + md += `\`\`\`js\nimport "pettyui/${slug}";\n\`\`\`\n\n`; + + if (c.example) { + md += `## Example\n\n\`\`\`html\n${c.example}\n\`\`\`\n\n`; + } + + if (c.attributes.length > 0) { + md += `## Attributes\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n`; + for (const a of c.attributes) { + md += `| \`${a.name}\` | ${a.type} | ${a.default || "—"} | ${a.description} |\n`; + } + md += `\n`; + } + + if (c.parts.length > 0) { + md += `## Parts\n\nStyle these with \`[data-part="name"]\` selectors.\n\n| Part | Element | Description |\n| --- | --- | --- |\n`; + for (const p of c.parts) { + md += `| \`${p.name}\` | \`${p.element}\` | ${p.description} |\n`; + } + md += `\n`; + } + + if (c.events.length > 0) { + md += `## Events\n\n| Event | Detail | Description |\n| --- | --- | --- |\n`; + for (const e of c.events) { + md += `| \`${e.name}\` | \`${e.detail}\` | ${e.description} |\n`; + } + md += `\n`; + } + + writeFileSync(join(CONTENT, `${slug}.md`), md); + count++; + } +} + +console.log(`Generated ${count} component docs`); diff --git a/packages/docs/src/templates/page.html b/packages/docs/src/templates/page.html new file mode 100644 index 0000000..9dede15 --- /dev/null +++ b/packages/docs/src/templates/page.html @@ -0,0 +1,214 @@ + + + + + +{{title}} — PettyUI Docs + + + + + +
+ +
+ {{content}} +
+
+ + diff --git a/packages/mcp/deploy/Caddyfile b/packages/mcp/deploy/Caddyfile new file mode 100644 index 0000000..03c77c5 --- /dev/null +++ b/packages/mcp/deploy/Caddyfile @@ -0,0 +1,8 @@ +mcp.staythree.com { + handle /petty/* { + uri strip_prefix /petty + reverse_proxy pettyui-mcp:3001 + } + + respond "not found" 404 +} diff --git a/packages/mcp/deploy/Dockerfile b/packages/mcp/deploy/Dockerfile new file mode 100644 index 0000000..35d669c --- /dev/null +++ b/packages/mcp/deploy/Dockerfile @@ -0,0 +1,9 @@ +FROM node:22-alpine +WORKDIR /app +COPY dist/ dist/ +COPY node_modules/@modelcontextprotocol/ node_modules/@modelcontextprotocol/ +COPY node_modules/zod/ node_modules/zod/ +COPY node_modules/@hono/ node_modules/@hono/ +ENV PORT=3001 HOST=0.0.0.0 NODE_ENV=production +EXPOSE 3001 +CMD ["node", "dist/http.mjs"] diff --git a/packages/mcp/deploy/docker-compose.yml b/packages/mcp/deploy/docker-compose.yml new file mode 100644 index 0000000..fec4aa0 --- /dev/null +++ b/packages/mcp/deploy/docker-compose.yml @@ -0,0 +1,21 @@ +services: + pettyui-mcp: + build: . + restart: always + expose: + - "3001" + + caddy: + image: caddy:2-alpine + restart: always + ports: + - "80:80" + - "443:443" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + - caddy_data:/data + - caddy_config:/config + +volumes: + caddy_data: + caddy_config: diff --git a/packages/mcp/ecosystem.config.cjs b/packages/mcp/ecosystem.config.cjs new file mode 100644 index 0000000..ae17e3c --- /dev/null +++ b/packages/mcp/ecosystem.config.cjs @@ -0,0 +1,14 @@ +module.exports = { + apps: [{ + name: "pettyui-mcp", + script: "dist/http.mjs", + env: { + PORT: 3001, + HOST: "127.0.0.1", + NODE_ENV: "production", + }, + instances: 1, + autorestart: true, + max_memory_restart: "100M", + }], +}; diff --git a/packages/mcp/package.json b/packages/mcp/package.json new file mode 100644 index 0000000..4c15678 --- /dev/null +++ b/packages/mcp/package.json @@ -0,0 +1,20 @@ +{ + "name": "@pettyui/mcp", + "version": "2.0.0-alpha.0", + "type": "module", + "main": "dist/index.mjs", + "scripts": { + "build": "tsdown src/index.ts src/http.ts", + "start": "node dist/index.mjs", + "start:http": "node dist/http.mjs" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0", + "pettyui": "workspace:*", + "zod": "^4.3.6" + }, + "devDependencies": { + "tsdown": "^0.21.7", + "typescript": "^6.0.2" + } +} diff --git a/packages/mcp/src/component-info.ts b/packages/mcp/src/component-info.ts new file mode 100644 index 0000000..4ab8f37 --- /dev/null +++ b/packages/mcp/src/component-info.ts @@ -0,0 +1,16 @@ +/** Full metadata for a PettyUI web component, used by MCP tools to describe, compose, and validate. */ +export interface ComponentInfo { + tag: string; + description: string; + tier: 1 | 2 | 3; + category: "inputs" | "layout" | "navigation" | "overlays" | "feedback" | "data"; + attributes: Array<{ name: string; type: string; description: string; default?: string }>; + parts: Array<{ name: string; element: string; description: string }>; + events: Array<{ name: string; detail: string; description: string }>; + example: string; +} + +/** Creates a ComponentInfo with defaults for empty arrays. */ +export function defineComponent(info: ComponentInfo): ComponentInfo { + return info; +} diff --git a/packages/mcp/src/data/data.ts b/packages/mcp/src/data/data.ts new file mode 100644 index 0000000..34a0983 --- /dev/null +++ b/packages/mcp/src/data/data.ts @@ -0,0 +1,43 @@ +import type { ComponentInfo } from "../component-info.js"; + +type Tier = 1 | 2 | 3; +type Attr = ComponentInfo["attributes"][number]; +type Part = ComponentInfo["parts"][number]; +type Evt = ComponentInfo["events"][number]; + +function attr(name: string, type: string, description: string, def?: string): Attr { + const a: Attr = { name, type, description }; + if (def !== undefined) a.default = def; + return a; +} + +function part(name: string, element: string, description: string): Part { + return { name, element, description }; +} + +function evt(name: string, detail: string, description: string): Evt { + return { name, detail, description }; +} + +function data(tag: string, description: string, tier: Tier, attributes: Attr[], parts: Part[], events: Evt[], example: string): ComponentInfo { + return { tag, description, tier, category: "data", attributes, parts, events, example }; +} + +/** All data-category component definitions for the MCP registry. */ +export const dataComponents: ComponentInfo[] = [ + data("petty-data-table", "Sortable table with click-to-sort column headers", 2, + [], + [part("body", "tbody", "Table body containing sortable rows")], + [evt("petty-sort", "{ column: string, direction: string }", "Fires when a column sort changes")], + "\n \n \n \n \n \n \n \n \n
NameAge
Alice30
\n
"), + data("petty-calendar", "Month grid with day selection and month navigation", 2, + [attr("value", "string", "Selected date in ISO format"), attr("min", "string", "Earliest selectable date"), attr("max", "string", "Latest selectable date")], + [part("title", "span", "Month/year heading"), part("body", "tbody", "Day grid body"), part("prev-month", "button", "Previous month nav"), part("next-month", "button", "Next month nav"), part("day", "button", "Individual day cell")], + [evt("petty-change", "{ value: string }", "Fires when a day is selected")], + "\n \n \n \n
\n
"), + data("petty-virtual-list", "Windowed scroll rendering only visible items plus overscan", 3, + [attr("item-height", "string", "Height of each item in px", "40"), attr("overscan", "string", "Extra items rendered above/below viewport", "5")], + [], + [evt("petty-scroll", "{ startIndex: number, endIndex: number }", "Fires on scroll with visible range")], + ""), +]; diff --git a/packages/mcp/src/data/feedback.ts b/packages/mcp/src/data/feedback.ts new file mode 100644 index 0000000..9c5fdee --- /dev/null +++ b/packages/mcp/src/data/feedback.ts @@ -0,0 +1,47 @@ +import type { ComponentInfo } from "../component-info.js"; + +type Tier = 1 | 2 | 3; +type Attr = ComponentInfo["attributes"][number]; +type Part = ComponentInfo["parts"][number]; +type Evt = ComponentInfo["events"][number]; + +function attr(name: string, type: string, description: string, def?: string): Attr { + const a: Attr = { name, type, description }; + if (def !== undefined) a.default = def; + return a; +} + +function part(name: string, element: string, description: string): Part { + return { name, element, description }; +} + +function evt(name: string, detail: string, description: string): Evt { + return { name, detail, description }; +} + +function feedback(tag: string, description: string, tier: Tier, attributes: Attr[], parts: Part[], events: Evt[], example: string): ComponentInfo { + return { tag, description, tier, category: "feedback", attributes, parts, events, example }; +} + +/** All feedback-category component definitions for the MCP registry. */ +export const feedbackComponents: ComponentInfo[] = [ + feedback("petty-alert", "Inline status message with variant-driven ARIA role", 1, + [attr("variant", "string", "Visual variant: default, error, warning, success, info", "default")], + [], [], + "\n

Something went wrong.

\n
"), + feedback("petty-progress", "Accessible progress bar with indeterminate state support", 1, + [attr("value", "string", "Current progress value (omit for indeterminate)"), attr("max", "string", "Maximum value", "100")], + [part("fill", "div", "Fill bar, receives --petty-progress CSS var"), part("label", "span", "Percentage text label")], + [], + "\n
\n 60%\n
"), + feedback("petty-meter", "Value gauge with low/high/optimum state computation", 2, + [attr("value", "string", "Current value"), attr("min", "string", "Minimum", "0"), attr("max", "string", "Maximum", "100"), attr("low", "string", "Low threshold"), attr("high", "string", "High threshold"), attr("optimum", "string", "Optimal value")], + [part("fill", "div", "Fill bar, receives --petty-meter-value CSS var")], + [], + "\n
\n
"), + feedback("petty-toast-region", "Container that renders active toast notifications", 2, + [attr("position", "string", "Screen position for toasts")], + [part("toast", "div", "Individual toast element"), part("toast-title", "div", "Toast title"), part("toast-description", "div", "Toast description"), part("toast-close", "button", "Dismiss button")], + [], + ""), +]; diff --git a/packages/mcp/src/data/inputs.ts b/packages/mcp/src/data/inputs.ts new file mode 100644 index 0000000..41a767b --- /dev/null +++ b/packages/mcp/src/data/inputs.ts @@ -0,0 +1,95 @@ +import type { ComponentInfo } from "../component-info.js"; + +type Tier = 1 | 2 | 3; +type Attr = ComponentInfo["attributes"][number]; +type Part = ComponentInfo["parts"][number]; +type Evt = ComponentInfo["events"][number]; + +function attr(name: string, type: string, description: string, def?: string): Attr { + const a: Attr = { name, type, description }; + if (def !== undefined) a.default = def; + return a; +} + +function part(name: string, element: string, description: string): Part { + return { name, element, description }; +} + +function evt(name: string, detail: string, description: string): Evt { + return { name, detail, description }; +} + +function input(tag: string, description: string, tier: Tier, attributes: Attr[], parts: Part[], events: Evt[], example: string): ComponentInfo { + return { tag, description, tier, category: "inputs", attributes, parts, events, example }; +} + +const change = (detail: string, desc: string) => evt("petty-change", detail, desc); + +/** All input-category component definitions for the MCP registry. */ +export const inputComponents: ComponentInfo[] = [ + input("petty-button", "Headless button wrapper with loading and disabled states", 1, + [attr("disabled", "boolean", "Disables the button"), attr("loading", "boolean", "Shows loading state, disables interaction")], + [part("button", "button", "The native button element")], [], + "\n \n"), + input("petty-checkbox", "Tri-state checkbox with label wiring and change events", 1, + [attr("checked", "boolean", "Whether checked"), attr("indeterminate", "boolean", "Indeterminate state"), attr("disabled", "boolean", "Disables"), attr("name", "string", "Form name"), attr("value", "string", "Form value", "on")], + [part("control", "input[type=checkbox]", "The native checkbox"), part("label", "label", "Label wired to checkbox")], + [change("{ checked: boolean, indeterminate: boolean }", "Fires on check change")], + "\n \n \n"), + input("petty-switch", "On/off toggle built on a button with role=switch", 1, + [attr("checked", "boolean", "Whether on"), attr("disabled", "boolean", "Disables"), attr("name", "string", "Form name")], + [part("control", "button", "Button with role=switch"), part("label", "span", "Label via aria-labelledby")], + [change("{ checked: boolean }", "Fires on toggle")], + "\n Dark mode\n \n"), + input("petty-radio-group", "Mutually exclusive selection group with keyboard navigation", 1, + [attr("name", "string", "Form name"), attr("value", "string", "Selected value"), attr("default-value", "string", "Initial value"), attr("orientation", "string", "Layout orientation", "vertical")], + [], [change("{ value: string }", "Fires on selection change")], + "\n Option A\n Option B\n"), + input("petty-text-field", "Labeled text input with description and error wiring", 1, + [attr("name", "string", "Form name"), attr("disabled", "boolean", "Disables input"), attr("required", "boolean", "Marks required")], + [part("label", "label", "Label wired via htmlFor"), part("control", "input", "The text input"), part("description", "span", "Help text"), part("error", "span", "Error message")], + [change("{ value: string }", "Fires on input")], + "\n \n \n Your email\n \n"), + input("petty-select", "Headless select built on Popover API with keyboard nav", 1, + [attr("value", "string", "Selected value"), attr("default-value", "string", "Initial value"), attr("placeholder", "string", "Trigger placeholder")], + [part("trigger", "button", "Opens the listbox popover"), part("listbox", "div[popover]", "Popover with role=listbox")], + [change("{ value: string }", "Fires on selection change")], + "\n \n
\n A\n
\n
"), + input("petty-toggle", "Pressed/unpressed toggle button with aria-pressed", 1, + [attr("pressed", "boolean", "Whether pressed"), attr("disabled", "boolean", "Disables toggle")], + [part("control", "button", "The toggle button")], + [change("{ pressed: boolean }", "Fires on press change")], + "\n \n"), + input("petty-slider", "Range input wrapper with label, output, and change events", 2, + [attr("min", "string", "Minimum"), attr("max", "string", "Maximum"), attr("step", "string", "Step"), attr("value", "string", "Current value"), attr("disabled", "boolean", "Disables"), attr("name", "string", "Form name"), attr("orientation", "string", "Orientation", "horizontal")], + [part("control", "input[type=range]", "Range input"), part("label", "label", "Label"), part("output", "span", "Value display")], + [change("{ value: number }", "Fires on change")], + "\n \n \n 50\n"), + input("petty-number-field", "Numeric input with increment/decrement and clamping", 2, + [attr("min", "string", "Minimum"), attr("max", "string", "Maximum"), attr("step", "string", "Step", "1"), attr("value", "string", "Current value"), attr("disabled", "boolean", "Disables"), attr("name", "string", "Form name")], + [part("control", "input", "Numeric input"), part("label", "label", "Label"), part("increment", "button", "Increment"), part("decrement", "button", "Decrement")], + [change("{ value: number }", "Fires on change")], + "\n \n \n \n \n"), + input("petty-combobox", "Searchable select with popover listbox and keyboard nav", 2, + [attr("value", "string", "Selected value"), attr("placeholder", "string", "Placeholder"), attr("disabled", "boolean", "Disables")], + [part("input", "input", "Search input"), part("listbox", "div[popover]", "Popover listbox")], + [change("{ value: string }", "Fires on select")], + "\n \n
\n A\n
\n
"), + input("petty-listbox", "Inline selectable list with single or multiple selection", 2, + [attr("value", "string", "Selected value(s)"), attr("default-value", "string", "Initial value"), attr("multiple", "boolean", "Multi-select mode")], + [], [change("{ value: string }", "Fires on selection change")], + "\n Alpha\n Beta\n"), + input("petty-toggle-group", "Single or multi-selection toggle group", 2, + [attr("type", "string", "Mode: single|multiple", "single"), attr("value", "string", "Selected value(s)"), attr("default-value", "string", "Initial value"), attr("orientation", "string", "Orientation")], + [], [change("{ value: string }", "Fires on change")], + "\n Left\n Right\n"), + input("petty-date-picker", "Date input with calendar popover integration", 2, + [attr("value", "string", "ISO date"), attr("min", "string", "Earliest date"), attr("max", "string", "Latest date"), attr("disabled", "boolean", "Disables")], + [part("input", "input", "Date text input"), part("trigger", "button", "Calendar toggle"), part("calendar", "div[popover]", "Calendar popover")], + [change("{ value: string }", "Fires on date select")], + "\n \n \n
\n
"), + input("petty-form", "Form wrapper with Zod validation and accessible error display", 1, + [], [], + [evt("petty-submit", "{ data: Record }", "Fires on valid submit"), evt("petty-invalid", "{ errors: Array<{ path, message }> }", "Fires on validation failure")], + "\n
\n \n \n \n \n \n \n
\n
"), +]; diff --git a/packages/mcp/src/data/layout.ts b/packages/mcp/src/data/layout.ts new file mode 100644 index 0000000..cc2a71c --- /dev/null +++ b/packages/mcp/src/data/layout.ts @@ -0,0 +1,66 @@ +import type { ComponentInfo } from "../component-info.js"; + +type Tier = 1 | 2 | 3; +type Attr = ComponentInfo["attributes"][number]; +type Part = ComponentInfo["parts"][number]; +type Evt = ComponentInfo["events"][number]; + +function attr(name: string, type: string, description: string, def?: string): Attr { + const a: Attr = { name, type, description }; + if (def !== undefined) a.default = def; + return a; +} + +function part(name: string, element: string, description: string): Part { + return { name, element, description }; +} + +function evt(name: string, detail: string, description: string): Evt { + return { name, detail, description }; +} + +function layout(tag: string, description: string, tier: Tier, attributes: Attr[], parts: Part[], events: Evt[], example: string): ComponentInfo { + return { tag, description, tier, category: "layout", attributes, parts, events, example }; +} + +/** All layout-category component definitions for the MCP registry. */ +export const layoutComponents: ComponentInfo[] = [ + layout("petty-tabs", "Headless tabbed interface with reactive tab/panel sync", 1, + [attr("value", "string", "Active tab value"), attr("default-value", "string", "Initial active tab")], + [], [evt("petty-change", "{ value: string }", "Fires when active tab changes")], + "\n
\n Tab 1\n Tab 2\n
\n Content 1\n Content 2\n
"), + layout("petty-accordion", "Headless accordion built on native details elements", 1, + [attr("type", "string", "Mode: single closes others, multiple allows many", "single")], + [part("content", "div", "Accordion item content area")], + [evt("petty-change", "{ value: string[] }", "Fires with array of open item values")], + "\n \n
\n Section 1\n
Content 1
\n
\n
\n
"), + layout("petty-collapsible", "Single disclosure wrapper on native details element", 1, + [attr("disabled", "boolean", "Prevents open/close interaction")], + [], [evt("petty-toggle", "{ open: boolean }", "Fires on open/close toggle")], + "\n
\n Toggle\n
Hidden content
\n
\n
"), + layout("petty-card", "Structural container with optional heading-based labelling", 2, + [], [], [], + "\n

Card Title

\n

Card content goes here.

\n
"), + layout("petty-separator", "Accessible divider with configurable orientation", 2, + [attr("orientation", "string", "Visual orientation", "horizontal")], + [], [], + ""), + layout("petty-skeleton", "Loading placeholder with aria-busy and loaded state transitions", 2, + [attr("loaded", "boolean", "Switches from loading to loaded state")], + [], [], + "\n
\n
"), + layout("petty-badge", "Display-only status indicator with variant support", 2, + [attr("variant", "string", "Visual variant", "default")], + [], [], + "Active"), + layout("petty-avatar", "Image with automatic fallback on load error", 2, + [], [part("fallback", "span", "Fallback content shown on image error")], [], + "\n \"User\"\n JD\n"), + layout("petty-image", "Image element with fallback display on load failure", 3, + [], [part("fallback", "span", "Fallback shown on error")], [], + "\n \"Photo\"\n No image\n"), + layout("petty-wizard", "Multi-step flow with navigation between steps", 2, + [attr("value", "string", "Active step value"), attr("default-value", "string", "Initial step")], + [], [evt("petty-change", "{ value: string }", "Fires when step changes")], + "\n Step 1 content\n Step 2 content\n"), +]; diff --git a/packages/mcp/src/data/navigation.ts b/packages/mcp/src/data/navigation.ts new file mode 100644 index 0000000..f0ec4ff --- /dev/null +++ b/packages/mcp/src/data/navigation.ts @@ -0,0 +1,44 @@ +import type { ComponentInfo } from "../component-info.js"; + +type Tier = 1 | 2 | 3; +type Attr = ComponentInfo["attributes"][number]; +type Part = ComponentInfo["parts"][number]; +type Evt = ComponentInfo["events"][number]; + +function attr(name: string, type: string, description: string, def?: string): Attr { + const a: Attr = { name, type, description }; + if (def !== undefined) a.default = def; + return a; +} + +function part(name: string, element: string, description: string): Part { + return { name, element, description }; +} + +function evt(name: string, detail: string, description: string): Evt { + return { name, detail, description }; +} + +function nav(tag: string, description: string, tier: Tier, attributes: Attr[], parts: Part[], events: Evt[], example: string): ComponentInfo { + return { tag, description, tier, category: "navigation", attributes, parts, events, example }; +} + +/** All navigation-category component definitions for the MCP registry. */ +export const navigationComponents: ComponentInfo[] = [ + nav("petty-breadcrumbs", "Navigation breadcrumb trail with ARIA landmarks", 2, + [], [], [], + "\n
    \n
  1. Home
  2. \n
  3. Docs
  4. \n
  5. Current
  6. \n
\n
"), + nav("petty-pagination", "Page navigation with prev/next and numbered items", 1, + [attr("total", "string", "Total number of items"), attr("page-size", "string", "Items per page", "10"), attr("current-page", "string", "Active page number", "1")], + [], + [evt("petty-change", "{ page: number }", "Fires when page changes")], + "\n Prev\n 1\n 2\n Next\n"), + nav("petty-navigation-menu", "Horizontal nav with optional popover dropdowns", 2, + [attr("orientation", "string", "Layout orientation", "horizontal")], + [], [], + "\n \n"), + nav("petty-link", "Headless anchor wrapper with disabled and external support", 2, + [attr("disabled", "boolean", "Prevents navigation"), attr("external", "boolean", "Opens in new tab with noopener")], + [], [], + "\n External Link\n"), +]; diff --git a/packages/mcp/src/data/overlays.ts b/packages/mcp/src/data/overlays.ts new file mode 100644 index 0000000..f2ad0e9 --- /dev/null +++ b/packages/mcp/src/data/overlays.ts @@ -0,0 +1,70 @@ +import type { ComponentInfo } from "../component-info.js"; + +type Tier = 1 | 2 | 3; +type Attr = ComponentInfo["attributes"][number]; +type Part = ComponentInfo["parts"][number]; +type Evt = ComponentInfo["events"][number]; + +function attr(name: string, type: string, description: string, def?: string): Attr { + const a: Attr = { name, type, description }; + if (def !== undefined) a.default = def; + return a; +} + +function part(name: string, element: string, description: string): Part { + return { name, element, description }; +} + +function evt(name: string, detail: string, description: string): Evt { + return { name, detail, description }; +} + +function overlay(tag: string, description: string, tier: Tier, attributes: Attr[], parts: Part[], events: Evt[], example: string): ComponentInfo { + return { tag, description, tier, category: "overlays", attributes, parts, events, example }; +} + +/** All overlay-category component definitions for the MCP registry. */ +export const overlayComponents: ComponentInfo[] = [ + overlay("petty-dialog", "Headless dialog on native dialog element with ARIA linking", 1, + [], [], + [evt("petty-close", "{ value: string }", "Fires when dialog closes with return value")], + "\n \n \n

Title

\n

Content

\n \n
\n
"), + overlay("petty-alert-dialog", "Confirmation dialog with role=alertdialog on native dialog", 1, + [], [], + [evt("petty-close", "{ value: string }", "Fires when closed with return value")], + "\n \n \n

Confirm

\n

Are you sure?

\n \n \n
\n
"), + overlay("petty-popover", "Headless popover on native Popover API with ARIA linking", 1, + [], [], + [evt("petty-toggle", "{ open: boolean }", "Fires on open/close")], + "\n \n
\n

Popover content

\n
\n
"), + overlay("petty-drawer", "Slide-in panel built on native dialog with side positioning", 2, + [attr("side", "string", "Slide-in direction", "right")], + [], + [evt("petty-close", "{ value: string }", "Fires when drawer closes")], + "\n \n \n

Drawer Title

\n

Drawer content

\n
\n
"), + overlay("petty-tooltip", "Hover/focus label using Popover API with delay and ARIA linking", 2, + [attr("delay", "string", "Show delay in ms", "200")], + [part("trigger", "span", "Element that triggers tooltip"), part("content", "div[popover]", "Tooltip content popover")], + [evt("petty-toggle", "{ open: boolean }", "Fires on show/hide")], + "\n Hover me\n
Tooltip text
\n
"), + overlay("petty-hover-card", "Rich hover preview using Popover API with open/close delays", 3, + [attr("open-delay", "string", "Delay before showing in ms", "300"), attr("close-delay", "string", "Delay before hiding in ms", "200")], + [part("trigger", "span", "Hover trigger element"), part("content", "div[popover]", "Card content popover")], + [evt("petty-toggle", "{ open: boolean }", "Fires on show/hide")], + "\n Hover for preview\n
\n

Rich preview content

\n
\n
"), + overlay("petty-dropdown-menu", "Action menu built on the Popover API", 1, + [], + [part("trigger", "button", "Menu trigger button"), part("content", "div[popover]", "Menu content popover")], + [evt("petty-select", "{ value: string }", "Fires when a menu item is selected")], + "\n \n
\n Edit\n Delete\n
\n
"), + overlay("petty-context-menu", "Right-click menu using Popover API with keyboard nav", 2, + [], + [part("trigger", "div", "Right-click target area"), part("content", "div[popover]", "Context menu popover")], + [evt("petty-select", "{ value: string }", "Fires when an item is selected")], + "\n
Right-click here
\n
\n Copy\n Paste\n
\n
"), + overlay("petty-command-palette", "Search-driven command menu using native dialog", 2, + [], + [part("search", "input", "Search input field"), part("list", "div", "Command items container")], + [evt("petty-select", "{ value: string }", "Fires when a command is selected")], + "\n \n \n
\n Save\n
\n
\n
"), +]; diff --git a/packages/mcp/src/http.ts b/packages/mcp/src/http.ts new file mode 100644 index 0000000..6e312a4 --- /dev/null +++ b/packages/mcp/src/http.ts @@ -0,0 +1,47 @@ +import { createServer as createHttpServer } from "node:http"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import { createServer } from "./server.js"; + +const PORT = parseInt(process.env["PORT"] ?? "3001", 10); +const HOST = process.env["HOST"] ?? "0.0.0.0"; + +const httpServer = createHttpServer(async (req, res) => { + // CORS + res.setHeader("Access-Control-Allow-Origin", "*"); + res.setHeader("Access-Control-Allow-Methods", "POST, GET, DELETE, OPTIONS"); + res.setHeader("Access-Control-Allow-Headers", "Content-Type, mcp-session-id"); + + if (req.method === "OPTIONS") { + res.writeHead(204); + res.end(); + return; + } + + if (req.url === "/mcp" && req.method === "POST") { + const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined }); + const server = createServer(); + await server.connect(transport); + await transport.handleRequest(req, res); + return; + } + + if (req.url === "/mcp" && req.method === "GET") { + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({ name: "pettyui", version: "2.0.0-alpha.0", status: "ok", endpoint: "POST /mcp" })); + return; + } + + // Health check + if (req.url === "/health") { + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({ status: "ok", server: "pettyui-mcp" })); + return; + } + + res.writeHead(404); + res.end("Not found"); +}); + +httpServer.listen(PORT, HOST, () => { + console.log(`PettyUI MCP server listening on http://${HOST}:${PORT}/mcp`); +}); diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.ts new file mode 100644 index 0000000..0668baf --- /dev/null +++ b/packages/mcp/src/index.ts @@ -0,0 +1,13 @@ +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import { createServer } from "./server.js"; + +export { createServer } from "./server.js"; + +/** Starts the MCP server on stdio transport. */ +export async function main(): Promise { + const server = createServer(); + const transport = new StdioServerTransport(); + await server.connect(transport); +} + +main(); diff --git a/packages/mcp/src/registry.ts b/packages/mcp/src/registry.ts new file mode 100644 index 0000000..ea7912b --- /dev/null +++ b/packages/mcp/src/registry.ts @@ -0,0 +1,33 @@ +import type { ComponentInfo } from "./component-info.js"; +import { inputComponents } from "./data/inputs.js"; +import { layoutComponents } from "./data/layout.js"; +import { overlayComponents } from "./data/overlays.js"; +import { feedbackComponents } from "./data/feedback.js"; +import { navigationComponents } from "./data/navigation.js"; +import { dataComponents } from "./data/data.js"; + +const registry = new Map(); +const allSources = [inputComponents, layoutComponents, overlayComponents, feedbackComponents, navigationComponents, dataComponents]; +for (const source of allSources) { + for (const component of source) { registry.set(component.tag, component); } +} + +/** Returns all registered components. */ +export function getAllComponents(): ComponentInfo[] { + return Array.from(registry.values()); +} + +/** Finds a component by its tag name, or returns undefined. */ +export function getComponent(tag: string): ComponentInfo | undefined { + return registry.get(tag); +} + +/** Returns all components matching the given category. */ +export function getComponentsByCategory(category: string): ComponentInfo[] { + return getAllComponents().filter((c) => c.category === category); +} + +/** Returns the set of all known tag names. */ +export function getTagNames(): Set { + return new Set(registry.keys()); +} diff --git a/packages/mcp/src/server.ts b/packages/mcp/src/server.ts new file mode 100644 index 0000000..f75b3c5 --- /dev/null +++ b/packages/mcp/src/server.ts @@ -0,0 +1,47 @@ +import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js"; +import { z } from "zod"; +import { discoverInput, handleDiscover } from "./tools/discover.js"; +import { inspectInput, handleInspect } from "./tools/inspect.js"; +import { composeInput, handleCompose } from "./tools/compose.js"; +import { validateInput, handleValidate } from "./tools/validate.js"; +import { patternsInput, handlePatterns } from "./tools/patterns.js"; +import { stylingInput, handleStyling } from "./tools/styling.js"; +import { resourcesInput, handleResources } from "./tools/resources.js"; + +const TOOLS = [ + { name: "pettyui_discover", description: "List available PettyUI components, optionally filtered by category", inputSchema: z.toJSONSchema(discoverInput) }, + { name: "pettyui_inspect", description: "Get full details for a PettyUI component: attributes, data-parts, events, and example HTML", inputSchema: z.toJSONSchema(inspectInput) }, + { name: "pettyui_compose", description: "Generate valid HTML for a PettyUI component with attributes and content", inputSchema: z.toJSONSchema(composeInput) }, + { name: "pettyui_validate", description: "Validate HTML against a PettyUI component schema, checking parts, attributes, and nesting", inputSchema: z.toJSONSchema(validateInput) }, + { name: "pettyui_patterns", description: "Get multi-component composition patterns: login-form, signup-form, settings-form, dialog-confirm, dialog-form, tabbed-content, select-field, data-entry, feedback, navigation", inputSchema: z.toJSONSchema(patternsInput) }, + { name: "pettyui_styling", description: "Get CSS guidance: design tokens, data-part selectors, data-state selectors, or per-component CSS. Topics: tokens, data-parts, data-states, petty-select, petty-tabs, petty-switch, petty-dialog, petty-toast-region", inputSchema: z.toJSONSchema(stylingInput) }, + { name: "pettyui_resources", description: "Get full source for PettyUI APIs: theme-css, signals-api, router-api, animations-css", inputSchema: z.toJSONSchema(resourcesInput) }, +]; + +type Handler = (args: Record) => unknown; +const handlers: Record = { + pettyui_discover: (args) => handleDiscover(discoverInput.parse(args)), + pettyui_inspect: (args) => handleInspect(inspectInput.parse(args)), + pettyui_compose: (args) => handleCompose(composeInput.parse(args)), + pettyui_validate: (args) => handleValidate(validateInput.parse(args)), + pettyui_patterns: (args) => handlePatterns(patternsInput.parse(args)), + pettyui_styling: (args) => handleStyling(stylingInput.parse(args)), + pettyui_resources: (args) => handleResources(resourcesInput.parse(args)), +}; + +function dispatchTool(name: string, args: Record): unknown { + const handler = handlers[name]; + if (!handler) throw new Error(`Unknown tool: ${name}`); + return handler(args); +} + +export function createServer(): Server { + const server = new Server({ name: "pettyui", version: "2.0.0-alpha.0" }, { capabilities: { tools: {} } }); + server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: TOOLS })); + server.setRequestHandler(CallToolRequestSchema, (request) => { + const result = dispatchTool(request.params.name, (request.params.arguments ?? {}) as Record); + return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] }; + }); + return server; +} diff --git a/packages/mcp/src/tools/compose.ts b/packages/mcp/src/tools/compose.ts new file mode 100644 index 0000000..1144478 --- /dev/null +++ b/packages/mcp/src/tools/compose.ts @@ -0,0 +1,35 @@ +import { z } from "zod"; +import { getComponent } from "../registry.js"; + +/** Zod schema for the compose tool input. */ +export const composeInput = z.object({ + tag: z.string().describe("The component tag name, e.g. petty-button"), + attributes: z.record(z.string(), z.string()).optional().describe("Attribute key-value pairs to set"), + content: z.string().optional().describe("Inner HTML content to place inside the component"), +}); + +function buildAttrString(attrs: Record): string { + const pairs: string[] = []; + for (const [key, val] of Object.entries(attrs)) { + if (val === "" || val === "true") pairs.push(key); + else pairs.push(`${key}="${val}"`); + } + return pairs.length > 0 ? " " + pairs.join(" ") : ""; +} + +function indentLines(text: string, spaces: number): string { + const pad = " ".repeat(spaces); + return text.split("\n").map((line) => (line.trim() ? pad + line : line)).join("\n"); +} + +/** Generates valid HTML for a PettyUI component with attributes and content. */ +export function handleCompose(input: z.infer): { html: string } | { error: string } { + const info = getComponent(input.tag); + if (!info) return { error: `Unknown component: ${input.tag}` }; + const attrStr = input.attributes ? buildAttrString(input.attributes) : ""; + const inner = input.content ?? indentLines(info.example.split("\n").slice(1, -1).join("\n"), 0).trim(); + const openTag = `<${info.tag}${attrStr}>`; + const closeTag = ``; + if (!inner) return { html: `${openTag}${closeTag}` }; + return { html: `${openTag}\n${indentLines(inner, 2)}\n${closeTag}` }; +} diff --git a/packages/mcp/src/tools/discover.ts b/packages/mcp/src/tools/discover.ts new file mode 100644 index 0000000..91a14eb --- /dev/null +++ b/packages/mcp/src/tools/discover.ts @@ -0,0 +1,13 @@ +import { z } from "zod"; +import { getAllComponents, getComponentsByCategory } from "../registry.js"; + +/** Zod schema for the discover tool input. */ +export const discoverInput = z.object({ + category: z.string().optional().describe("Filter: inputs, layout, navigation, overlays, feedback, data"), +}); + +/** Lists available PettyUI components, optionally filtered by category. */ +export function handleDiscover(input: z.infer): { tag: string; description: string; tier: number; category: string }[] { + const source = input.category ? getComponentsByCategory(input.category) : getAllComponents(); + return source.map((c) => ({ tag: c.tag, description: c.description, tier: c.tier, category: c.category })); +} diff --git a/packages/mcp/src/tools/inspect.ts b/packages/mcp/src/tools/inspect.ts new file mode 100644 index 0000000..849a52b --- /dev/null +++ b/packages/mcp/src/tools/inspect.ts @@ -0,0 +1,19 @@ +import { z } from "zod"; +import { getComponent, getTagNames } from "../registry.js"; +import type { ComponentInfo } from "../component-info.js"; + +/** Zod schema for the inspect tool input. */ +export const inspectInput = z.object({ + tag: z.string().describe("The component tag name, e.g. petty-button"), +}); + +/** Returns full component details or an error for unknown tags, with suggestions for near-misses. */ +export function handleInspect(input: z.infer): ComponentInfo | { error: string; suggestions?: string[] } { + const info = getComponent(input.tag); + if (info) return info; + const allTags = Array.from(getTagNames()); + const needle = input.tag.toLowerCase(); + const suggestions = allTags.filter((t) => t.includes(needle) || needle.includes(t.replace("petty-", ""))); + if (suggestions.length > 0) return { error: `Unknown component: ${input.tag}`, suggestions }; + return { error: `Unknown component: ${input.tag}. Use pettyui_discover to list all available components.` }; +} diff --git a/packages/mcp/src/tools/patterns.ts b/packages/mcp/src/tools/patterns.ts new file mode 100644 index 0000000..cc5fbf7 --- /dev/null +++ b/packages/mcp/src/tools/patterns.ts @@ -0,0 +1,298 @@ +import { z } from "zod"; + +export const patternsInput = z.object({ + pattern: z.string().optional().describe("Filter by pattern name: login-form, signup-form, settings-form, dialog-confirm, dialog-form, tabbed-content, select-field, data-entry, feedback, navigation"), +}); + +interface Pattern { + name: string; + description: string; + components: string[]; + html: string; +} + +const patterns: Pattern[] = [ + { + name: "login-form", + description: "Login form with email, password, remember me, and validation", + components: ["petty-form", "petty-form-field", "petty-text-field", "petty-checkbox", "petty-button"], + html: ` +
+ + + + + + + + + + + + + + + + + + + + +
+
`, + }, + { + name: "signup-form", + description: "Registration form with name, email, password, terms checkbox", + components: ["petty-form", "petty-form-field", "petty-text-field", "petty-checkbox", "petty-button"], + html: ` +
+ + + + + + + + + + + + + + + + At least 8 characters + + + + + + + + + + + +
+
`, + }, + { + name: "settings-form", + description: "Settings page with text fields, toggles, select, and save button", + components: ["petty-form", "petty-form-field", "petty-text-field", "petty-switch", "petty-select", "petty-button", "petty-separator"], + html: ` +
+ + + + + + + + + + + + + + + + + Email notifications + + + + + Dark mode + + + + + + +
+ English + Svenska + Japanese +
+
+ + + + +
+
`, + }, + { + name: "dialog-confirm", + description: "Confirmation dialog with cancel and confirm buttons", + components: ["petty-alert-dialog", "petty-button"], + html: ` + + +

Delete this item?

+

This action cannot be undone.

+
+ + + + + + +
+
+
`, + }, + { + name: "dialog-form", + description: "Dialog containing a form with fields and submit", + components: ["petty-dialog", "petty-form", "petty-form-field", "petty-text-field", "petty-button"], + html: ` + + +

New item

+ +
+ + + + + + + + + + +
+ + + + + + +
+
+
+
+
`, + }, + { + name: "tabbed-content", + description: "Tabbed interface with multiple panels", + components: ["petty-tabs", "petty-tab", "petty-tab-panel"], + html: ` +
+ General + Security + Billing +
+ General settings content here. + Security settings content here. + Billing information content here. +
`, + }, + { + name: "select-field", + description: "Labeled select dropdown with popover listbox", + components: ["petty-select", "petty-select-option"], + html: ` + +
+ TypeScript + Rust + Go + Python +
+
`, + }, + { + name: "data-entry", + description: "Data entry row with number field, slider, and tags input", + components: ["petty-number-field", "petty-slider", "petty-tags-input"], + html: ` + + + + + + + + + + 50 + + + + + + +`, + }, + { + name: "feedback", + description: "Alert, progress bar, and toast trigger", + components: ["petty-alert", "petty-progress", "petty-button", "petty-toast-region"], + html: ` +
+
Deployed successfully
+
Your changes are live.
+
+
+ + +
+
+ + + + + + + +`, + }, + { + name: "navigation", + description: "Breadcrumbs, pagination, and accordion", + components: ["petty-breadcrumbs", "petty-breadcrumb-item", "petty-pagination", "petty-accordion", "petty-accordion-item"], + html: ` +
    + Home + Docs + Button +
+
+ + + +
+ How do I install PettyUI? +

npm install pettyui

+
+
+ +
+ Does it need a build step? +

No. Import the components and use them directly.

+
+
+
`, + }, +]; + +export function handlePatterns(input: z.infer): Pattern[] | Pattern | { error: string } { + if (!input.pattern) return patterns.map((p) => ({ name: p.name, description: p.description, components: p.components, html: p.html })); + const found = patterns.find((p) => p.name === input.pattern); + if (found) return found; + return { error: `Unknown pattern: ${input.pattern}. Available: ${patterns.map((p) => p.name).join(", ")}` }; +} diff --git a/packages/mcp/src/tools/resources.ts b/packages/mcp/src/tools/resources.ts new file mode 100644 index 0000000..449718f --- /dev/null +++ b/packages/mcp/src/tools/resources.ts @@ -0,0 +1,134 @@ +import { z } from "zod"; + +export const resourcesInput = z.object({ + resource: z.string().describe("Resource name: theme-css, signals-api, router-api, animations-css"), +}); + +const themeCss = `/* PettyUI default theme — import with: import "pettyui/theme" */ +/* Override any --petty-* variable to customize all components at once. */ + +:root { + --petty-primary: #2563eb; + --petty-primary-hover: #1d4ed8; + --petty-danger: #dc2626; + --petty-success: #16a34a; + --petty-surface: #ffffff; + --petty-surface-raised: #f9fafb; + --petty-border: #e5e7eb; + --petty-border-focus: #2563eb; + --petty-text: #111827; + --petty-text-muted: #6b7280; + --petty-radius: 0.375rem; + --petty-radius-lg: 0.5rem; + --petty-shadow: 0 4px 16px rgba(0 0 0 / 0.12); + --petty-shadow-sm: 0 1px 4px rgba(0 0 0 / 0.08); + --petty-font: system-ui, -apple-system, sans-serif; + --petty-duration: 150ms; +} + +/* Dark mode example: */ +/* @media (prefers-color-scheme: dark) { + :root { + --petty-surface: #0f172a; + --petty-surface-raised: #1e293b; + --petty-border: #334155; + --petty-text: #f1f5f9; + --petty-text-muted: #94a3b8; + } +} */`; + +const signalsApi = `// PettyUI Signals — import with: import { signal, effect } from "pettyui/signals" +// ~500 bytes. No framework. Automatic dependency tracking. + +interface Signal { + get(): T; // Read value. Auto-subscribes the active effect. + set(value: T): void; // Write value. Re-runs all subscribed effects. +} + +function signal(initial: T): Signal +// Create a reactive signal with an initial value. +// Example: +// const count = signal(0); +// count.get(); // 0 +// count.set(1); // triggers any effects reading count + +function effect(fn: () => void): () => void +// Run fn immediately, then re-run whenever any signal read inside fn changes. +// Returns the effect function (useful as cleanup/re-run reference). +// Example: +// const name = signal("world"); +// effect(() => console.log("Hello", name.get())); +// // logs "Hello world" +// name.set("PettyUI"); +// // logs "Hello PettyUI" + +// Usage in a Custom Element: +// connectedCallback() { +// this._count = signal(0); +// effect(() => { +// this.querySelector("span").textContent = String(this._count.get()); +// }); +// }`; + +const routerApi = `// PettyUI Router — import with: import { initRouter } from "pettyui/router" +// SPA router using Navigation API + View Transitions. ~400 bytes. + +interface RouterOptions { + outlet?: string; // CSS selector for content swap. Default: "[data-petty-outlet]" + partialHeader?: string; // Header sent to server. Default: "X-Partial" +} + +function initRouter(options?: RouterOptions): void +// Intercepts same-origin link navigations via the Navigation API. +// Fetches the target URL with a partial header, swaps the outlet content. +// Uses View Transitions API if available for animated page transitions. + +// Setup: +// 1. Add an outlet element:
...
+// 2. Call initRouter() once on page load. +// 3. Your server should return only the partial content when it sees the X-Partial header. + +// Example: +// import { initRouter } from "pettyui/router"; +// initRouter(); +// // Now all links do SPA navigation with view transitions.`; + +const animationsCss = `/* PettyUI Animations — import with: import "pettyui/animations" */ +/* Provides CSS keyframes for reveal, stagger, dialog, popover, and toast animations. */ + +/* Available animation attributes for petty-reveal and petty-stagger: */ +/* animation="fade-up" — translateY(20px) to 0 */ +/* animation="fade-down" — translateY(-20px) to 0 */ +/* animation="fade-left" — translateX(20px) to 0 */ +/* animation="fade-right" — translateX(-20px) to 0 */ +/* animation="scale" — scale(0.9) to 1 */ +/* animation="blur" — blur(8px) to 0 */ + +/* Attributes: */ +/* delay="200" — delay in ms before animation starts */ +/* duration="500" — animation duration in ms */ +/* once — only animate once (when first visible) */ + +/* Example: */ +/* */ +/*

This fades up on scroll

*/ +/*
*/ + +/* */ +/*
Item 1
*/ +/*
Item 2
*/ +/*
Item 3
*/ +/*
*/`; + +const resources: Record = { + "theme-css": themeCss, + "signals-api": signalsApi, + "router-api": routerApi, + "animations-css": animationsCss, +}; + +export function handleResources(input: z.infer): { resource: string; content: string } | { error: string } { + const content = resources[input.resource]; + if (content) return { resource: input.resource, content }; + return { error: `Unknown resource: ${input.resource}. Available: ${Object.keys(resources).join(", ")}` }; +} diff --git a/packages/mcp/src/tools/styling.ts b/packages/mcp/src/tools/styling.ts new file mode 100644 index 0000000..78389e1 --- /dev/null +++ b/packages/mcp/src/tools/styling.ts @@ -0,0 +1,196 @@ +import { z } from "zod"; + +export const stylingInput = z.object({ + topic: z.string().optional().describe("Filter: tokens, data-parts, data-states, or a component tag like petty-select"), +}); + +const tokens = `/* PettyUI CSS custom properties — override these to theme all components */ +:root { + --petty-primary: #2563eb; + --petty-primary-hover: #1d4ed8; + --petty-danger: #dc2626; + --petty-success: #16a34a; + --petty-surface: #ffffff; + --petty-surface-raised: #f9fafb; + --petty-border: #e5e7eb; + --petty-border-focus: #2563eb; + --petty-text: #111827; + --petty-text-muted: #6b7280; + --petty-radius: 0.375rem; + --petty-radius-lg: 0.5rem; + --petty-shadow: 0 4px 16px rgba(0 0 0 / 0.12); + --petty-shadow-sm: 0 1px 4px rgba(0 0 0 / 0.08); + --petty-font: system-ui, -apple-system, sans-serif; + --petty-duration: 150ms; +}`; + +interface PartInfo { + selector: string; + element: string; + usedBy: string[]; + css: string; +} + +const parts: PartInfo[] = [ + { selector: '[data-part="control"]', element: "input/button", usedBy: ["text-field", "checkbox", "switch", "slider", "number-field"], css: "background: var(--petty-surface); border: 1px solid var(--petty-border); border-radius: var(--petty-radius); padding: 0.5rem 0.75rem; width: 100%; transition: border-color var(--petty-duration);" }, + { selector: '[data-part="label"]', element: "label/span", usedBy: ["all form fields"], css: "color: var(--petty-text); font-size: 0.875rem; font-weight: 500;" }, + { selector: '[data-part="trigger"]', element: "button", usedBy: ["select", "popover", "dropdown-menu", "date-picker"], css: "background: var(--petty-surface); border: 1px solid var(--petty-border); border-radius: var(--petty-radius); cursor: pointer; display: inline-flex; padding: 0.5rem 0.75rem;" }, + { selector: '[data-part="listbox"]', element: "div[popover]", usedBy: ["select", "combobox"], css: "background: var(--petty-surface); border: 1px solid var(--petty-border); border-radius: var(--petty-radius-lg); box-shadow: var(--petty-shadow); min-width: 10rem; padding: 0.25rem;" }, + { selector: '[data-part="content"]', element: "div", usedBy: ["popover", "tooltip", "dropdown-menu", "accordion", "alert"], css: "background: var(--petty-surface); border: 1px solid var(--petty-border); border-radius: var(--petty-radius-lg); box-shadow: var(--petty-shadow); padding: 0.75rem 1rem;" }, + { selector: '[data-part="error"]', element: "span", usedBy: ["form-field", "text-field"], css: "color: var(--petty-danger); font-size: 0.8125rem; min-height: 1.25rem;" }, + { selector: '[data-part="description"]', element: "span", usedBy: ["form-field", "text-field"], css: "color: var(--petty-text-muted); font-size: 0.875rem;" }, + { selector: '[data-part="title"]', element: "div", usedBy: ["alert", "toast"], css: "font-weight: 500; font-size: 0.875rem;" }, + { selector: '[data-part="track"]', element: "div", usedBy: ["progress", "meter"], css: "background: var(--petty-surface-raised); border-radius: var(--petty-radius); height: 0.5rem; overflow: hidden;" }, + { selector: '[data-part="fill"]', element: "div", usedBy: ["progress", "meter"], css: "height: 100%; background: var(--petty-primary); border-radius: inherit; transition: width 0.3s;" }, + { selector: '[data-part="thumb"]', element: "span", usedBy: ["switch"], css: "display: block; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: white; transition: transform var(--petty-duration);" }, + { selector: '[data-part="toast"]', element: "div", usedBy: ["toast-region"], css: "background: var(--petty-surface); border: 1px solid var(--petty-border); border-left: 4px solid var(--petty-text-muted); border-radius: var(--petty-radius-lg); box-shadow: var(--petty-shadow); padding: 0.875rem 1rem;" }, + { selector: '[data-part="tag"]', element: "span", usedBy: ["tags-input"], css: "background: var(--petty-surface-raised); border: 1px solid var(--petty-border); border-radius: var(--petty-radius); padding: 0.375rem 0.5rem; font-size: 0.8125rem;" }, + { selector: '[data-part="fallback"]', element: "span", usedBy: ["avatar"], css: "display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--petty-surface-raised);" }, +]; + +interface StateInfo { + value: string; + usedBy: string[]; + css: string; +} + +const states: StateInfo[] = [ + { value: "active", usedBy: ["petty-tab", "petty-accordion-item", "petty-pagination-item", "petty-toggle-group-item"], css: "petty-tab[data-state=\"active\"] { border-bottom-color: var(--petty-primary); color: var(--petty-primary); }" }, + { value: "checked", usedBy: ["petty-radio-item"], css: "petty-radio-item[data-state=\"checked\"] { color: var(--petty-primary); }" }, + { value: "on", usedBy: ["petty-switch", "petty-toggle"], css: "petty-switch[data-state=\"on\"] [data-part=\"control\"] { background: var(--petty-primary); }\npetty-switch[data-state=\"on\"] [data-part=\"thumb\"] { transform: translateX(100%); }" }, + { value: "selected", usedBy: ["petty-select-option", "petty-calendar day"], css: "petty-select-option[data-state=\"selected\"] { color: var(--petty-primary); font-weight: 500; }" }, + { value: "current", usedBy: ["petty-breadcrumb-item", "petty-pagination-item"], css: "petty-breadcrumb-item[data-state=\"current\"] { color: var(--petty-text); font-weight: 500; }" }, + { value: "loading", usedBy: ["petty-button"], css: "petty-button[data-state=\"loading\"] { opacity: 0.7; pointer-events: none; }" }, + { value: "disabled", usedBy: ["petty-button"], css: "petty-button[data-state=\"disabled\"] { opacity: 0.5; pointer-events: none; }" }, + { value: "low", usedBy: ["petty-meter"], css: "petty-meter[data-state=\"low\"] [data-part=\"fill\"] { background: var(--petty-danger); }" }, + { value: "high", usedBy: ["petty-meter"], css: "petty-meter[data-state=\"high\"] [data-part=\"fill\"] { background: var(--petty-success); }" }, +]; + +const componentStyling: Record = { + "petty-select": `/* Select styling */ +petty-select { display: contents; } + +[data-part="trigger"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius); + cursor: pointer; + display: inline-flex; + align-items: center; + gap: 0.5rem; + padding: 0.5rem 0.75rem; + font-size: 0.875rem; +} +[data-part="trigger"]:hover { border-color: var(--petty-primary); } + +[data-part="listbox"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + min-width: 10rem; + padding: 0.25rem; +} + +petty-select-option { + padding: 0.5rem 0.75rem; + cursor: pointer; + border-radius: calc(var(--petty-radius) - 2px); +} +petty-select-option:hover { background: var(--petty-surface-raised); } +petty-select-option[aria-selected="true"] { color: var(--petty-primary); font-weight: 500; }`, + + "petty-tabs": `/* Tabs styling */ +[role="tablist"] { + display: flex; + gap: 0.125rem; + border-bottom: 1px solid var(--petty-border); +} + +petty-tab { + background: transparent; + border: none; + border-bottom: 2px solid transparent; + color: var(--petty-text-muted); + cursor: pointer; + font-size: 0.875rem; + font-weight: 500; + padding: 0.625rem 1rem; + margin-bottom: -1px; +} +petty-tab[data-state="active"] { border-bottom-color: var(--petty-primary); color: var(--petty-primary); } + +petty-tab-panel { display: block; padding: 1rem 0; } +petty-tab-panel[hidden] { display: none; }`, + + "petty-switch": `/* Switch styling */ +petty-switch { display: inline-flex; align-items: center; gap: 0.75rem; } + +petty-switch [data-part="control"] { + width: 2.75rem; + height: 1.5rem; + border-radius: 0.75rem; + background: var(--petty-border); + border: none; + cursor: pointer; + padding: 0.125rem; + transition: background var(--petty-duration); +} +petty-switch[data-state="on"] [data-part="control"] { background: var(--petty-primary); } + +[data-part="thumb"] { + display: block; + width: 1.25rem; + height: 1.25rem; + border-radius: 50%; + background: white; + transition: transform var(--petty-duration); +} +petty-switch[data-state="on"] [data-part="thumb"] { transform: translateX(1.25rem); }`, + + "petty-dialog": `/* Dialog styling */ +dialog { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + color: var(--petty-text); + max-width: min(90vw, 32rem); + padding: 1.5rem; +} +dialog::backdrop { background: rgba(0 0 0 / 0.4); }`, + + "petty-toast-region": `/* Toast styling */ +petty-toast-region { + position: fixed; + bottom: 1.5rem; + right: 1.5rem; + display: flex; + flex-direction: column; + gap: 0.5rem; + max-width: 24rem; + z-index: 9999; + pointer-events: none; +} + +[data-part="toast"] { + background: var(--petty-surface); + border: 1px solid var(--petty-border); + border-left: 4px solid var(--petty-text-muted); + border-radius: var(--petty-radius-lg); + box-shadow: var(--petty-shadow); + padding: 0.875rem 1rem; + pointer-events: auto; +} +[data-part="toast"][data-type="success"] { border-left-color: var(--petty-success); } +[data-part="toast"][data-type="error"] { border-left-color: var(--petty-danger); }`, +}; + +export function handleStyling(input: z.infer): unknown { + if (!input.topic) return { tokens, parts: parts.length, states: states.length, topics: ["tokens", "data-parts", "data-states", ...Object.keys(componentStyling)] }; + if (input.topic === "tokens") return { css: tokens }; + if (input.topic === "data-parts") return { parts }; + if (input.topic === "data-states") return { states }; + if (componentStyling[input.topic]) return { component: input.topic, css: componentStyling[input.topic] }; + return { error: `Unknown topic: ${input.topic}. Available: tokens, data-parts, data-states, ${Object.keys(componentStyling).join(", ")}` }; +} diff --git a/packages/mcp/src/tools/validate.ts b/packages/mcp/src/tools/validate.ts new file mode 100644 index 0000000..89d28fe --- /dev/null +++ b/packages/mcp/src/tools/validate.ts @@ -0,0 +1,60 @@ +import { z } from "zod"; +import { getComponent } from "../registry.js"; +import type { ComponentInfo } from "../component-info.js"; + +/** Zod schema for the validate tool input. */ +export const validateInput = z.object({ + tag: z.string().describe("The component tag name, e.g. petty-button"), + html: z.string().describe("The HTML string to validate against the component schema"), +}); + +function checkAttributes(html: string, info: ComponentInfo): string[] { + const errors: string[] = []; + const attrPattern = /\s([a-z][a-z0-9-]*)(?:=|[\s>])/g; + const foundAttrs = new Set(); + let match = attrPattern.exec(html); + while (match !== null) { + const name = match[1]; + if (name) foundAttrs.add(name); + match = attrPattern.exec(html); + } + const knownAttrs = new Set(info.attributes.map((a) => a.name)); + const reserved = new Set(["id", "class", "style", "slot", "data-part", "data-state", "role", "aria-label", "aria-labelledby", "aria-describedby", "hidden", "tabindex", "popover", "popovertarget", "commandfor", "command", "type", "name", "value", "placeholder", "href", "src", "alt", "for", "disabled", "checked", "required"]); + for (const found of foundAttrs) { + if (!knownAttrs.has(found) && !reserved.has(found) && !found.startsWith("aria-") && !found.startsWith("data-")) { + errors.push(`Unknown attribute "${found}" on <${info.tag}>`); + } + } + return errors; +} + +function checkParts(html: string, info: ComponentInfo): string[] { + const errors: string[] = []; + for (const part of info.parts) { + const partPattern = `data-part="${part.name}"`; + if (!html.includes(partPattern) && !html.includes(`data-part='${part.name}'`)) { + errors.push(`Missing required part "${part.name}" (${part.element}) — add data-part="${part.name}"`); + } + } + return errors; +} + +function checkNesting(html: string, info: ComponentInfo): string[] { + const errors: string[] = []; + if (!html.includes(`<${info.tag}`) || !html.includes(``)) { + errors.push(`HTML must contain a <${info.tag}> element with a closing tag`); + } + return errors; +} + +/** Validates HTML against a PettyUI component schema, checking parts, attributes, and nesting. */ +export function handleValidate(input: z.infer): { valid: boolean; errors: string[] } { + const info = getComponent(input.tag); + if (!info) return { valid: false, errors: [`Unknown component: ${input.tag}`] }; + const errors = [ + ...checkNesting(input.html, info), + ...checkParts(input.html, info), + ...checkAttributes(input.html, info), + ]; + return { valid: errors.length === 0, errors }; +} diff --git a/packages/mcp/tsconfig.json b/packages/mcp/tsconfig.json new file mode 100644 index 0000000..5285d28 --- /dev/null +++ b/packages/mcp/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"] +} diff --git a/packages/showcase/index.html b/packages/showcase/index.html new file mode 100644 index 0000000..7a98b7a --- /dev/null +++ b/packages/showcase/index.html @@ -0,0 +1,116 @@ + + + + + + + PromptMutator + + + + + + + +
+
+
+

Prompt mutation workbench

+

PromptMutator

+

Generate provider-aware prompt variants, inspect the mutation logic, and refine prompts for OpenAI, Anthropic, Google, Groq, Mistral, and local models.

+
+
+
+ Providers + 6 +
+
+ Strategies + 0 +
+
+ Engine + Rust + Tauri +
+
+
+ +
+
+
+
+

Input

+

Base prompt

+
+ Local-first +
+ + + + +

Short task summary used to frame mutations.

+
+ + + + +
+
+ + + +
+ Anthropic + OpenAI + Google + Groq + Mistral + Local / Ollama +
+ +
+
+ + + + +

Optional target model identifier.

+
+
+ +
+ + +
+
+ +
+
+
+

Mutation logic

+

Strategies

+
+ 0 selected +
+
+
+
+ +
+
+
+

Output

+

Mutated prompts

+
+
+ 0 variants + +
+
+ +
+
+
+
+ + diff --git a/packages/showcase/package.json b/packages/showcase/package.json new file mode 100644 index 0000000..4f16230 --- /dev/null +++ b/packages/showcase/package.json @@ -0,0 +1,20 @@ +{ + "name": "@pettyui/showcase", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "tauri:dev": "tauri dev", + "tauri:build": "tauri build" + }, + "dependencies": { + "@tauri-apps/api": "^2.10.1", + "pettyui": "workspace:*" + }, + "devDependencies": { + "@tauri-apps/cli": "^2.10.1", + "vite": "^6.3.5" + } +} diff --git a/packages/showcase/src-tauri/.gitignore b/packages/showcase/src-tauri/.gitignore new file mode 100644 index 0000000..502406b --- /dev/null +++ b/packages/showcase/src-tauri/.gitignore @@ -0,0 +1,4 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ +/gen/schemas diff --git a/packages/showcase/src-tauri/Cargo.lock b/packages/showcase/src-tauri/Cargo.lock new file mode 100644 index 0000000..dc91fa0 --- /dev/null +++ b/packages/showcase/src-tauri/Cargo.lock @@ -0,0 +1,5274 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_log-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" + +[[package]] +name = "android_logger" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb4e440d04be07da1f1bf44fb4495ebd58669372fe0cffa6e48595ac5bd88a3" +dependencies = [ + "android_log-sys", + "env_filter", + "log", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "app" +version = "0.1.0" +dependencies = [ + "log", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-log", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "borsh" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" +dependencies = [ + "once_cell", + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "brotli" +version = "8.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "byte-unit" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6d47a4e2961fb8721bcfc54feae6455f2f64e7054f9bc67e875f0e77f4c58d" +dependencies = [ + "rust_decimal", + "schemars 1.2.1", + "serde", + "utf8-width", +] + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.11.0", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "cargo_toml" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +dependencies = [ + "serde", + "toml 0.9.12+spec-1.1.0", +] + +[[package]] +name = "cc" +version = "1.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a4d3ec6524d28a329fc53654bbadc9bdd7b0431f5d65f1a56ffb28a1ee5283" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link 0.2.1", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.11.0", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.11.0", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.29.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.10.1", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf 0.13.1", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.117", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.11.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dom_query" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" +dependencies = [ + "bit-set", + "cssparser 0.36.0", + "foldhash 0.2.0", + "html5ever 0.38.0", + "precomputed-hash", + "selectors 0.36.1", + "tendril 0.5.0", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "embed-resource" +version = "3.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63a1d0de4f2249aa0ff5884d7080814f446bb241a559af6c170a41e878ed2d45" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 0.9.12+spec-1.1.0", + "vswhom", + "winreg", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "env_filter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "fern" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" +dependencies = [ + "log", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.11.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" +dependencies = [ + "log", + "mac", + "markup5ever 0.14.1", + "match_token", +] + +[[package]] +name = "html5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" +dependencies = [ + "log", + "markup5ever 0.38.0", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +dependencies = [ + "cfb", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "js-sys" +version = "0.3.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.11.0", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kuchikiki" +version = "0.8.8-speedreader" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" +dependencies = [ + "cssparser 0.29.6", + "html5ever 0.29.1", + "indexmap 2.13.1", + "selectors 0.24.0", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.184" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +dependencies = [ + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +dependencies = [ + "value-bag", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18" +dependencies = [ + "log", + "phf 0.11.3", + "phf_codegen 0.11.3", + "string_cache 0.8.9", + "string_cache_codegen 0.5.4", + "tendril 0.4.3", +] + +[[package]] +name = "markup5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" +dependencies = [ + "log", + "tendril 0.5.0", + "web_atoms", +] + +[[package]] +name = "match_token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", +] + +[[package]] +name = "muda" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c9fec5a4e89860383d778d10563a605838f8f0b2f9303868937e5ff32e86177" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.18", + "windows-sys 0.60.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.11.0", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.11.0", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.11.0", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.11.0", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.11.0", + "block2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.11.0", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.11.0", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.11.0", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.11.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_shared 0.8.0", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros 0.13.1", + "phf_shared 0.13.1", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.2", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher 1.0.2", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plist" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" +dependencies = [ + "base64 0.22.1", + "indexmap 2.13.1", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.10+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quick-xml" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 2.0.18", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "rkyv" +version = "0.7.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust_decimal" +version = "1.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce901f9a19d251159075a4c37af514c3b8ef99c22e02dd8c19161cf397ee94a" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", + "wasm-bindgen", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.117", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "selectors" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416" +dependencies = [ + "bitflags 1.3.2", + "cssparser 0.29.6", + "derive_more 0.99.20", + "fxhash", + "log", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc 0.2.0", + "smallvec", +] + +[[package]] +name = "selectors" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" +dependencies = [ + "bitflags 2.11.0", + "cssparser 0.36.0", + "derive_more 2.1.1", + "log", + "new_debug_unreachable", + "phf 0.13.1", + "phf_codegen 0.13.1", + "precomputed-hash", + "rustc-hash", + "servo_arc 0.4.3", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_with" +version = "3.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.13.1", + "schemars 0.9.0", + "schemars 1.2.1", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "servo_arc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.11.3", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.13.1", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "swift-rs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.34.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9103edf55f2da3c82aea4c7fab7c4241032bfeea0e71fa557d98e00e7ce7cc20" +dependencies = [ + "bitflags 2.11.0", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "parking_lot", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da77cc00fb9028caf5b5d4650f75e31f1ef3693459dfca7f7e506d1ecef0ba2d" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "jni", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.18", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows", +] + +[[package]] +name = "tauri-build" +version = "2.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bbc990d1dbf57a8e1c7fa2327f2a614d8b757805603c1b9ba5c81bade09fd4d" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "toml 0.9.12+spec-1.1.0", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a24476afd977c5d5d169f72425868613d82747916dd29e0a357c84c4bd6d29" +dependencies = [ + "base64 0.22.1", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "syn 2.0.117", + "tauri-utils", + "thiserror 2.0.18", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d39b349a98dadaffebb73f0a40dcd1f23c999211e5a2e744403db384d0c33de7" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddde7d51c907b940fb573006cdda9a642d6a7c8153657e88f8a5c3c9290cd4aa" +dependencies = [ + "anyhow", + "glob", + "plist", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri-utils", + "toml 0.9.12+spec-1.1.0", + "walkdir", +] + +[[package]] +name = "tauri-plugin-log" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7545bd67f070a4500432c826e2e0682146a1d6712aee22a2786490156b574d93" +dependencies = [ + "android_logger", + "byte-unit", + "fern", + "log", + "objc2", + "objc2-foundation", + "serde", + "serde_json", + "serde_repr", + "swift-rs", + "tauri", + "tauri-plugin", + "thiserror 2.0.18", + "time", +] + +[[package]] +name = "tauri-runtime" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.18", + "url", + "webkit2gtk", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e" +dependencies = [ + "gtk", + "http", + "jni", + "log", + "objc2", + "objc2-app-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219a1f983a2af3653f75b5747f76733b0da7ff03069c7a41901a5eb3ace4557d" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dunce", + "glob", + "html5ever 0.29.1", + "http", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.3", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.18", + "toml 0.9.12+spec-1.1.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1087b111fe2b005e42dbdc1990fc18593234238d47453b0c99b7de1c9ab2c1e0" +dependencies = [ + "dunce", + "embed-resource", + "toml 0.9.12+spec-1.1.0", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "tendril" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24" +dependencies = [ + "new_debug_unreachable", + "utf-8", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap 2.13.1", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.13.1", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.13.1", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.10+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82418ca169e235e6c399a84e395ab6debeb3bc90edc959bf0f48647c6a32d1b" +dependencies = [ + "indexmap 2.13.1", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.1", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.1", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags 2.11.0", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tray-icon" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e85aa143ceb072062fc4d6356c1b520a51d636e7bc8e77ec94be3608e5e80c" +dependencies = [ + "crossbeam-channel", + "dirs", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.18", + "windows-sys 0.60.2", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlpattern" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "value-bag" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.13.1", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.11.0", + "hashbrown 0.15.5", + "indexmap 2.13.1", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a9779e9f04d2ac1ce317aee707aa2f6b773afba7b931222bff6983843b1576" +dependencies = [ + "phf 0.13.1", + "phf_codegen 0.13.1", + "string_cache 0.9.0", + "string_cache_codegen 0.6.1", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-core 0.61.2", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" +dependencies = [ + "thiserror 2.0.18", + "windows", + "windows-core 0.61.2", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "raw-window-handle", + "windows-sys 0.59.0", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" + +[[package]] +name = "winnow" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.55.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +dependencies = [ + "cfg-if", + "windows-sys 0.59.0", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck 0.5.0", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck 0.5.0", + "indexmap 2.13.1", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "indexmap 2.13.1", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.13.1", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "wry" +version = "0.54.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc" +dependencies = [ + "base64 0.22.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "gtk", + "http", + "javascriptcore-rs", + "jni", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2", + "soup3", + "tao-macros", + "thiserror 2.0.18", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/packages/showcase/src-tauri/Cargo.toml b/packages/showcase/src-tauri/Cargo.toml new file mode 100644 index 0000000..533f014 --- /dev/null +++ b/packages/showcase/src-tauri/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "app" +version = "0.1.0" +description = "A Tauri App" +authors = ["you"] +license = "" +repository = "" +edition = "2021" + +rust-version = "1.77.2" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +name = "app_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { version = "2.5.6" } + +[dependencies] +serde_json = "1.0" +serde = { version = "1.0", features = ["derive"] } +log = "0.4" +tauri = { version = "2.10.3" } +tauri-plugin-log = "2" diff --git a/packages/showcase/src-tauri/build.rs b/packages/showcase/src-tauri/build.rs new file mode 100644 index 0000000..795b9b7 --- /dev/null +++ b/packages/showcase/src-tauri/build.rs @@ -0,0 +1,3 @@ +fn main() { + tauri_build::build() +} diff --git a/packages/showcase/src-tauri/capabilities/default.json b/packages/showcase/src-tauri/capabilities/default.json new file mode 100644 index 0000000..c135d7f --- /dev/null +++ b/packages/showcase/src-tauri/capabilities/default.json @@ -0,0 +1,11 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "enables the default permissions", + "windows": [ + "main" + ], + "permissions": [ + "core:default" + ] +} diff --git a/packages/showcase/src-tauri/icons/128x128.png b/packages/showcase/src-tauri/icons/128x128.png new file mode 100644 index 0000000..77e7d23 Binary files /dev/null and b/packages/showcase/src-tauri/icons/128x128.png differ diff --git a/packages/showcase/src-tauri/icons/128x128@2x.png b/packages/showcase/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..0f7976f Binary files /dev/null and b/packages/showcase/src-tauri/icons/128x128@2x.png differ diff --git a/packages/showcase/src-tauri/icons/32x32.png b/packages/showcase/src-tauri/icons/32x32.png new file mode 100644 index 0000000..98fda06 Binary files /dev/null and b/packages/showcase/src-tauri/icons/32x32.png differ diff --git a/packages/showcase/src-tauri/icons/Square107x107Logo.png b/packages/showcase/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..f35d84f Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square107x107Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square142x142Logo.png b/packages/showcase/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..1823bb2 Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square142x142Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square150x150Logo.png b/packages/showcase/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..dc2b22c Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square150x150Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square284x284Logo.png b/packages/showcase/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..0ed3984 Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square284x284Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square30x30Logo.png b/packages/showcase/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..60bf0ea Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square30x30Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square310x310Logo.png b/packages/showcase/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..c8ca0ad Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square310x310Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square44x44Logo.png b/packages/showcase/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..8756459 Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square44x44Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square71x71Logo.png b/packages/showcase/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..2c8023c Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square71x71Logo.png differ diff --git a/packages/showcase/src-tauri/icons/Square89x89Logo.png b/packages/showcase/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..2c5e603 Binary files /dev/null and b/packages/showcase/src-tauri/icons/Square89x89Logo.png differ diff --git a/packages/showcase/src-tauri/icons/StoreLogo.png b/packages/showcase/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..17d142c Binary files /dev/null and b/packages/showcase/src-tauri/icons/StoreLogo.png differ diff --git a/packages/showcase/src-tauri/icons/icon.icns b/packages/showcase/src-tauri/icons/icon.icns new file mode 100644 index 0000000..a2993ad Binary files /dev/null and b/packages/showcase/src-tauri/icons/icon.icns differ diff --git a/packages/showcase/src-tauri/icons/icon.ico b/packages/showcase/src-tauri/icons/icon.ico new file mode 100644 index 0000000..06c23c8 Binary files /dev/null and b/packages/showcase/src-tauri/icons/icon.ico differ diff --git a/packages/showcase/src-tauri/icons/icon.png b/packages/showcase/src-tauri/icons/icon.png new file mode 100644 index 0000000..d1756ce Binary files /dev/null and b/packages/showcase/src-tauri/icons/icon.png differ diff --git a/packages/showcase/src-tauri/src/lib.rs b/packages/showcase/src-tauri/src/lib.rs new file mode 100644 index 0000000..634265c --- /dev/null +++ b/packages/showcase/src-tauri/src/lib.rs @@ -0,0 +1,277 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct Strategy { + id: String, + name: String, + description: String, + rationale: String, + selected: bool, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +enum ProviderId { + Anthropic, + Openai, + Google, + Groq, + Mistral, + Local, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +struct MutationRequest { + prompt: String, + task: Option, + provider: ProviderId, + model: Option, + enabled_strategy_ids: Option>, +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct MutationVariant { + id: String, + title: String, + strategy_id: String, + strategy_label: String, + provider: String, + mutated_prompt: String, + why_it_may_help: String, + score: u8, +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct MutationResponse { + provider: String, + model: Option, + provider_guidance: String, + evaluation_rubric: Vec, + variants: Vec, +} + +fn strategies() -> Vec { + vec![ + Strategy { + id: "clarify-goal".into(), + name: "Clarify goal and deliverable".into(), + description: "Turns vague asks into explicit task, audience, tone, and output instructions.".into(), + rationale: "Most models improve when the expected artifact, audience, and boundary conditions are concrete.".into(), + selected: true, + }, + Strategy { + id: "provider-format".into(), + name: "Provider-aware formatting".into(), + description: "Applies structure aligned with the target provider’s common prompting patterns.".into(), + rationale: "Anthropic tends to respond well to structured context and clear XML-like sections; other providers often prefer concise instruction blocks.".into(), + selected: true, + }, + Strategy { + id: "rubric-injection".into(), + name: "Add success rubric".into(), + description: "Defines quality criteria the model should optimize for before answering.".into(), + rationale: "A built-in rubric nudges the model toward measurable quality rather than generic completion.".into(), + selected: true, + }, + Strategy { + id: "constraint-hardening".into(), + name: "Harden constraints".into(), + description: "Extracts limits, disallowed behaviors, and safety constraints into direct instructions.".into(), + rationale: "Explicit constraints reduce drift, verbosity, and unsupported assumptions.".into(), + selected: false, + }, + Strategy { + id: "few-shot-frame".into(), + name: "Add lightweight examples".into(), + description: "Wraps the task in compact positive guidance without overfitting a single answer.".into(), + rationale: "A small exemplar frame often improves adherence while staying reusable.".into(), + selected: false, + }, + ] +} + +fn provider_name(provider: &ProviderId) -> &'static str { + match provider { + ProviderId::Anthropic => "Anthropic", + ProviderId::Openai => "OpenAI", + ProviderId::Google => "Google", + ProviderId::Groq => "Groq", + ProviderId::Mistral => "Mistral", + ProviderId::Local => "Local / Ollama", + } +} + +fn provider_guidance(provider: &ProviderId) -> (&'static str, Vec<&'static str>) { + match provider { + ProviderId::Anthropic => ( + "Prefer clearly separated sections, explicit task framing, and XML-style tags when structure matters.", + vec!["Strong context framing", "Clear role and task separation", "Well-bounded output format"], + ), + ProviderId::Openai => ( + "Prefer direct instructions, explicit output schema, and concise guardrails close to the ask.", + vec!["Instruction clarity", "Reliable formatting", "Low ambiguity"], + ), + ProviderId::Google => ( + "Prefer well-scaffolded prompts with explicit criteria, reasoning boundaries, and evaluation signals.", + vec!["Task decomposition", "Grounded reasoning", "Complete answer coverage"], + ), + ProviderId::Groq => ( + "Optimize for concise, high-signal prompts that work well with fast inference and open-weight chat models.", + vec!["Compactness", "Instruction salience", "Consistent style"], + ), + ProviderId::Mistral => ( + "Use direct, compact tasking with strong formatting constraints and explicit role context.", + vec!["Concision", "Formatting adherence", "Task specificity"], + ), + ProviderId::Local => ( + "Keep prompts short, deterministic, and explicit about format to avoid drift on smaller local models.", + vec!["Lower token load", "Simple structure", "High determinism"], + ), + } +} + +fn provider_wrapper(provider: &ProviderId, body: &str) -> String { + match provider { + ProviderId::Anthropic => format!( + "\n{body}\n\n\nThink carefully about the user goal, then produce only the requested deliverable.\n" + ), + ProviderId::Openai => format!( + "System intent: Follow the task exactly and optimize for usefulness.\n\nTask:\n{body}" + ), + ProviderId::Google => format!( + "Context:\n{body}\n\nQuality bar:\nBe correct, complete, and well-structured." + ), + ProviderId::Groq => format!( + "Instruction block:\n{body}\n\nReturn a direct answer with minimal filler." + ), + ProviderId::Mistral => format!( + "Role: precise assistant\nTask:\n{body}\n\nOutput only the requested artifact." + ), + ProviderId::Local => format!( + "Task:\n{body}\n\nRules:\n- Be concise\n- Avoid unsupported claims\n- Follow the requested format exactly" + ), + } +} + +fn build_variant(request: &MutationRequest, id: &str) -> MutationVariant { + let provider = provider_name(&request.provider).to_string(); + let task = request.task.clone().unwrap_or_else(|| "Complete the user’s request well.".into()); + let base = request.prompt.trim(); + + match id { + "clarify-goal" => MutationVariant { + id: id.into(), + title: "Explicit deliverable".into(), + strategy_id: id.into(), + strategy_label: "Clarify goal and deliverable".into(), + provider, + mutated_prompt: format!( + "Task: {task}\nAudience: developers evaluating a new tool\nGoal: produce a launch announcement that is credible, concise, and specific.\n\nRequirements:\n- lead with the product value\n- explain what problem it solves\n- avoid hype and vague claims\n- include a clear CTA\n\nSource prompt:\n{base}" + ), + why_it_may_help: "Makes the artifact, audience, and quality target concrete before generation.".into(), + score: 88, + }, + "provider-format" => MutationVariant { + id: id.into(), + title: "Provider-tuned structure".into(), + strategy_id: id.into(), + strategy_label: "Provider-aware formatting".into(), + provider: provider.clone(), + mutated_prompt: provider_wrapper( + &request.provider, + &format!( + "User goal: {task}\nOriginal prompt: {base}\nRequired output: one polished answer plus three alternate phrasings." + ), + ), + why_it_may_help: "Applies structure likely to fit the target provider’s instruction-following style.".into(), + score: 91, + }, + "rubric-injection" => MutationVariant { + id: id.into(), + title: "Rubric-backed prompt".into(), + strategy_id: id.into(), + strategy_label: "Add success rubric".into(), + provider, + mutated_prompt: format!( + "{base}\n\nBefore answering, optimize for this rubric:\n1. Specific and concrete\n2. Faithful to the requested tone\n3. Structured for easy reading\n4. No filler or marketing fluff\n5. Includes the most important action for the reader\n\nReturn the final answer only." + ), + why_it_may_help: "Gives the model internal quality criteria that often improve specificity and usefulness.".into(), + score: 90, + }, + "constraint-hardening" => MutationVariant { + id: id.into(), + title: "Constraint-first rewrite".into(), + strategy_id: id.into(), + strategy_label: "Harden constraints".into(), + provider, + mutated_prompt: format!( + "You must follow these constraints:\n- do not invent product details\n- avoid exaggerated claims\n- keep the answer under 180 words\n- write for technical readers\n- if information is missing, use neutral language\n\nTask: {task}\n\nOriginal request:\n{base}" + ), + why_it_may_help: "Reduces drift and unsupported details by front-loading the non-negotiable rules.".into(), + score: 84, + }, + "few-shot-frame" => MutationVariant { + id: id.into(), + title: "Patterned exemplar frame".into(), + strategy_id: id.into(), + strategy_label: "Add lightweight examples".into(), + provider, + mutated_prompt: format!( + "Write the response in this pattern:\n- Opening: one sentence on what it is\n- Value: one sentence on why it matters\n- Details: two concise supporting points\n- CTA: one sentence\n\nNow perform this task:\n{task}\n\nUser prompt:\n{base}" + ), + why_it_may_help: "Adds a reusable answer shape without constraining the exact wording too hard.".into(), + score: 82, + }, + _ => MutationVariant { + id: "fallback".into(), + title: "Original prompt".into(), + strategy_id: "fallback".into(), + strategy_label: "Fallback".into(), + provider, + mutated_prompt: base.into(), + why_it_may_help: "Baseline for comparison.".into(), + score: 50, + }, + } +} + +#[tauri::command] +fn list_strategies() -> Vec { + strategies() +} + +#[tauri::command] +fn mutate_prompt(request: MutationRequest) -> MutationResponse { + let available = strategies(); + let active_ids = request + .enabled_strategy_ids + .clone() + .unwrap_or_else(|| available.iter().filter(|s| s.selected).map(|s| s.id.clone()).collect()); + + let (guidance, rubric) = provider_guidance(&request.provider); + let variants = active_ids + .iter() + .map(|id| build_variant(&request, id)) + .collect::>(); + + MutationResponse { + provider: provider_name(&request.provider).into(), + model: request.model.clone(), + provider_guidance: guidance.into(), + evaluation_rubric: rubric.into_iter().map(String::from).collect(), + variants, + } +} + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_log::Builder::default().level(log::LevelFilter::Info).build()) + .invoke_handler(tauri::generate_handler![list_strategies, mutate_prompt]) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/packages/showcase/src-tauri/src/main.rs b/packages/showcase/src-tauri/src/main.rs new file mode 100644 index 0000000..ad5fe83 --- /dev/null +++ b/packages/showcase/src-tauri/src/main.rs @@ -0,0 +1,6 @@ +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + app_lib::run(); +} diff --git a/packages/showcase/src-tauri/tauri.conf.json b/packages/showcase/src-tauri/tauri.conf.json new file mode 100644 index 0000000..6d30f63 --- /dev/null +++ b/packages/showcase/src-tauri/tauri.conf.json @@ -0,0 +1,39 @@ +{ + "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", + "productName": "PromptMutator", + "version": "0.1.0", + "identifier": "com.staythree.promptmutator", + "build": { + "frontendDist": "../dist", + "devUrl": "http://localhost:1420", + "beforeDevCommand": "pnpm dev -- --host 0.0.0.0 --port 1420", + "beforeBuildCommand": "pnpm build" + }, + "app": { + "windows": [ + { + "title": "PromptMutator", + "width": 1480, + "height": 980, + "minWidth": 1180, + "minHeight": 820, + "resizable": true, + "fullscreen": false + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": "all", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } +} diff --git a/packages/showcase/src/main.ts b/packages/showcase/src/main.ts new file mode 100644 index 0000000..39495de --- /dev/null +++ b/packages/showcase/src/main.ts @@ -0,0 +1,201 @@ +import "pettyui/button"; +import "pettyui/badge"; +import "pettyui/text-field"; +import "pettyui/select"; +import { invoke } from "@tauri-apps/api/core"; + +type ProviderId = "anthropic" | "openai" | "google" | "groq" | "mistral" | "local"; + +type Strategy = { + id: string; + name: string; + description: string; + rationale: string; + selected: boolean; +}; + +type MutationRequest = { + prompt: string; + task?: string | null; + provider: ProviderId; + model?: string | null; + enabled_strategy_ids?: string[] | null; +}; + +type MutationVariant = { + id: string; + title: string; + strategy_id: string; + strategy_label: string; + provider: string; + mutated_prompt: string; + why_it_may_help: string; + score: number; +}; + +type MutationResponse = { + provider: string; + model: string | null; + provider_guidance: string; + evaluation_rubric: string[]; + variants: MutationVariant[]; +}; + +const samplePrompt = `You are helping me write a launch announcement for a developer tool. Write something good about it.`; +const sampleTask = `Write a launch announcement that sounds credible, sharp, and useful to developers.`; + +const strategyList = document.querySelector("#strategy-list")!; +const promptInput = document.querySelector("#prompt-input")!; +const taskInput = document.querySelector("#task-input")!; +const modelInput = document.querySelector("#model-input")!; +const providerInput = document.querySelector("input[name='provider']")!; +const providerSelect = document.querySelector("#provider-select")!; +const generateBtn = document.querySelector("#generate-btn")!; +const sampleBtn = document.querySelector("#sample-btn")!; +const copyBestBtn = document.querySelector("#copy-best-btn")!; +const resultsGrid = document.querySelector("#results-grid")!; +const resultCount = document.querySelector("#result-count")!; +const selectedStrategyCount = document.querySelector("#selected-strategy-count")!; +const strategyCount = document.querySelector("#strategy-count")!; +const summaryStrip = document.querySelector("#summary-strip")!; + +let strategies: Strategy[] = []; +let latestResponse: MutationResponse | null = null; + +function escapeHtml(value: string): string { + return value + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """) + .replaceAll("'", "'"); +} + +function selectedIds(): string[] { + return strategies.filter((strategy) => strategy.selected).map((strategy) => strategy.id); +} + +function renderStrategies(): void { + strategyList.innerHTML = strategies.map((strategy) => ` + + `).join(""); + + selectedStrategyCount.textContent = `${selectedIds().length} selected`; + strategyCount.textContent = String(strategies.length); +} + +function renderSummary(response: MutationResponse): void { + summaryStrip.innerHTML = ` +
+ Provider guidance +

${escapeHtml(response.provider_guidance)}

+
+
+ Evaluation rubric +
    ${response.evaluation_rubric.map((item) => `
  • ${escapeHtml(item)}
  • `).join("")}
+
+ `; +} + +function renderResults(response: MutationResponse): void { + const sorted = [...response.variants].sort((a, b) => b.score - a.score); + resultsGrid.innerHTML = sorted.map((variant, index) => ` +
+
+
+

${index === 0 ? "Best candidate" : `Rank ${index + 1}`}

+

${escapeHtml(variant.title)}

+
+
${variant.score}/100
+
+
+ ${escapeHtml(variant.strategy_label)} + ${escapeHtml(variant.provider)} +
+

${escapeHtml(variant.why_it_may_help)}

+
${escapeHtml(variant.mutated_prompt)}
+
+ `).join(""); + + resultCount.textContent = `${response.variants.length} variants`; +} + +async function loadStrategies(): Promise { + strategies = await invoke("list_strategies"); + renderStrategies(); +} + +async function generateMutations(): Promise { + const prompt = promptInput.value.trim(); + if (!prompt) return; + + generateBtn.setAttribute("loading", ""); + try { + const response = await invoke("mutate_prompt", { + request: { + prompt, + task: taskInput.value.trim() || null, + provider: providerInput.value as ProviderId, + model: modelInput.value.trim() || null, + enabled_strategy_ids: selectedIds(), + } satisfies MutationRequest, + }); + latestResponse = response; + renderSummary(response); + renderResults(response); + } finally { + generateBtn.removeAttribute("loading"); + } +} + +function loadSample(): void { + promptInput.value = samplePrompt; + taskInput.value = sampleTask; +} + +async function copyBest(): Promise { + const best = latestResponse?.variants.slice().sort((a, b) => b.score - a.score)[0]; + if (!best) return; + await navigator.clipboard.writeText(best.mutated_prompt); + const button = copyBestBtn.querySelector("button"); + if (!button) return; + const old = button.textContent; + button.textContent = "Copied"; + window.setTimeout(() => { button.textContent = old ?? "Copy best"; }, 1500); +} + +strategyList.addEventListener("change", (event) => { + const target = event.target as HTMLInputElement | null; + if (!target?.matches("input[data-strategy-id]")) return; + strategies = strategies.map((strategy) => strategy.id === target.dataset.strategyId ? { ...strategy, selected: target.checked } : strategy); + renderStrategies(); +}); + +generateBtn.addEventListener("click", () => { void generateMutations(); }); +sampleBtn.addEventListener("click", loadSample); +copyBestBtn.addEventListener("click", () => { void copyBest(); }); +providerSelect.addEventListener("petty-change", () => { + const provider = providerInput.value as ProviderId; + const defaults: Record = { + anthropic: "claude-3-7-sonnet", + openai: "gpt-4.1", + google: "gemini-2.5-pro", + groq: "llama-3.3-70b-versatile", + mistral: "mistral-large", + local: "llama3.2", + }; + modelInput.value = defaults[provider]; +}); + +loadSample(); +void loadStrategies().then(() => generateMutations()); diff --git a/packages/showcase/style.css b/packages/showcase/style.css new file mode 100644 index 0000000..ce4600e --- /dev/null +++ b/packages/showcase/style.css @@ -0,0 +1,241 @@ +:root { + color-scheme: dark; + --bg: #0a0d12; + --panel: rgba(17, 24, 39, 0.84); + --panel-border: rgba(148, 163, 184, 0.16); + --text: #e5eefb; + --muted: #94a3b8; + --accent: #7c3aed; + --accent-soft: rgba(124, 58, 237, 0.18); + --good: #22c55e; + --shadow: 0 24px 60px rgba(0, 0, 0, 0.35); + font-family: "Inter", system-ui, sans-serif; +} + +* { box-sizing: border-box; } +body { + margin: 0; + min-height: 100vh; + color: var(--text); + background: + radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 30%), + radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 24%), + var(--bg); +} +button, input, textarea { font: inherit; } +pre { + margin: 0; + white-space: pre-wrap; + font-family: "JetBrains Mono", monospace; + font-size: 0.92rem; + line-height: 1.55; +} + +.app-shell { + width: min(1480px, calc(100vw - 32px)); + margin: 0 auto; + padding: 24px 0 40px; +} +.surface { + background: var(--panel); + border: 1px solid var(--panel-border); + box-shadow: var(--shadow); + border-radius: 24px; + backdrop-filter: blur(20px); +} +.hero-panel { + display: flex; + justify-content: space-between; + gap: 24px; + padding: 28px; + margin-bottom: 20px; +} +.eyebrow, .section-kicker, .result-rank, .stat-label { + text-transform: uppercase; + letter-spacing: 0.12em; + color: var(--muted); + font-size: 0.75rem; +} +h1, h2, h3, p { margin: 0; } +h1 { font-size: clamp(2rem, 3vw, 3.4rem); margin-bottom: 12px; } +.lede { max-width: 760px; color: #c5d3eb; line-height: 1.6; } +.hero-stats { + display: grid; + grid-template-columns: repeat(3, minmax(130px, 1fr)); + gap: 12px; + align-self: start; +} +.stat-card { + padding: 18px; + border-radius: 18px; + background: rgba(15, 23, 42, 0.74); + border: 1px solid rgba(148, 163, 184, 0.14); +} +.stat-card strong { display: block; margin-top: 8px; font-size: 1.2rem; } +.stat-card.accent { background: var(--accent-soft); } +.workspace-grid { + display: grid; + grid-template-columns: 1.35fr 1fr; + gap: 20px; + margin-bottom: 20px; +} +.control-panel, .strategy-panel, .output-panel { padding: 24px; } +.section-header, .output-header { + display: flex; + align-items: start; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; +} +.field-group, +#provider-select, +.prompt-editor, +.summary-card, +.result-card, +.strategy-card { + border-radius: 18px; + border: 1px solid rgba(148, 163, 184, 0.14); + background: rgba(15, 23, 42, 0.72); +} +.field-group { + display: block; + padding: 14px; +} +.field-group label, +.textarea-label, +.select-label { display: block; margin-bottom: 10px; color: #c5d3eb; font-weight: 600; } +.field-group input, +.prompt-editor { + width: 100%; + color: var(--text); + background: transparent; + border: none; + outline: none; +} +.field-group p { margin-top: 8px; color: var(--muted); font-size: 0.88rem; } +.prompt-editor { + min-height: 270px; + resize: vertical; + padding: 16px; + line-height: 1.6; + margin-bottom: 18px; +} +.config-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; +} +#provider-select { display: block; padding: 14px; } +#provider-select [data-part="trigger"] { + width: 100%; + text-align: left; + background: transparent; + color: var(--text); + border: none; + padding: 0; +} +#provider-select [data-part="listbox"] { + width: min(320px, 90vw); + padding: 8px; + color: var(--text); + background: #0f172a; + border: 1px solid rgba(148, 163, 184, 0.22); + border-radius: 16px; +} +petty-select-option { + display: block; + cursor: pointer; + padding: 10px 12px; + border-radius: 12px; +} +petty-select-option[data-highlighted], +petty-select-option[aria-selected="true"] { background: rgba(124, 58, 237, 0.22); } +.actions-row, .toolbar { + display: flex; + gap: 12px; + align-items: center; + margin-top: 18px; +} +petty-button button { + cursor: pointer; + border: none; + color: white; + border-radius: 14px; + padding: 12px 18px; + background: linear-gradient(135deg, #8b5cf6, #6d28d9); +} +#sample-btn button, #copy-best-btn button { + color: var(--text); + background: rgba(148, 163, 184, 0.14); +} +.strategy-list, .results-grid, .summary-strip { + display: grid; + gap: 14px; +} +.strategy-card { + display: grid; + grid-template-columns: 18px 1fr; + gap: 14px; + padding: 16px; + cursor: pointer; +} +.strategy-card.is-selected { border-color: rgba(124, 58, 237, 0.7); box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.4); } +.strategy-card input { margin-top: 2px; } +.strategy-title-row { + display: flex; + justify-content: space-between; + gap: 12px; + margin-bottom: 8px; +} +.strategy-card p { color: #d9e3f4; margin-bottom: 8px; line-height: 1.5; } +.strategy-card small { color: var(--muted); line-height: 1.5; } +.summary-strip { + grid-template-columns: 1.1fr 1fr; + margin-bottom: 18px; +} +.summary-card { + padding: 16px; +} +.summary-card span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 0.82rem; } +.summary-card ul { margin: 0; padding-left: 18px; color: #dce8fb; } +.results-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} +.result-card { + padding: 18px; +} +.best-variant { border-color: rgba(34, 197, 94, 0.52); } +.result-header, .result-meta { + display: flex; + justify-content: space-between; + gap: 12px; +} +.result-header { margin-bottom: 12px; } +.result-meta { + margin-bottom: 14px; + color: var(--muted); + font-size: 0.88rem; +} +.score-pill { + min-width: 74px; + text-align: center; + padding: 10px 12px; + border-radius: 999px; + background: rgba(34, 197, 94, 0.16); + color: #bbf7d0; + font-weight: 700; +} +.result-why { + margin-bottom: 14px; + color: #c5d3eb; + line-height: 1.55; +} +petty-badge { + display: inline-flex; + padding: 8px 10px; + border-radius: 999px; + background: rgba(148, 163, 184, 0.12); +} +@media (max-width: 1100px) { + .workspace-grid, .summary-strip, .results-grid, .hero-panel { grid-template-columns: 1fr; display: grid; } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..d12dc3a --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2942 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + typescript: + specifier: ^6.0.2 + version: 6.0.2 + + packages/core: + dependencies: + zod: + specifier: ^4.3.6 + version: 4.3.6 + devDependencies: + tsdown: + specifier: ^0.21.7 + version: 0.21.7(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(typescript@6.0.2) + typescript: + specifier: ^6.0.2 + version: 6.0.2 + vitest: + specifier: ^4.1.2 + version: 4.1.2(@types/node@25.5.0)(jsdom@26.1.0)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1)) + + packages/docs: + dependencies: + marked: + specifier: ^15.0.0 + version: 15.0.12 + + packages/mcp: + dependencies: + '@modelcontextprotocol/sdk': + specifier: ^1.0.0 + version: 1.28.0(zod@4.3.6) + pettyui: + specifier: workspace:* + version: link:../core + zod: + specifier: ^4.3.6 + version: 4.3.6 + devDependencies: + tsdown: + specifier: ^0.21.7 + version: 0.21.7(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(typescript@6.0.2) + typescript: + specifier: ^6.0.2 + version: 6.0.2 + + packages/showcase: + dependencies: + '@tauri-apps/api': + specifier: ^2.10.1 + version: 2.10.1 + pettyui: + specifier: workspace:* + version: link:../core + devDependencies: + '@tauri-apps/cli': + specifier: ^2.10.1 + version: 2.10.1 + vite: + specifier: ^6.3.5 + version: 6.4.1(@types/node@25.5.0)(jiti@2.6.1)(lightningcss@1.32.0) + +packages: + + '@asamuzakjp/css-color@3.2.0': + resolution: {integrity: sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==} + + '@babel/generator@8.0.0-rc.3': + resolution: {integrity: sha512-em37/13/nR320G4jab/nIIHZgc2Wz2y/D39lxnTyxB4/D/omPQncl/lSdlnJY1OhQcRGugTSIF2l/69o31C9dA==} + engines: {node: ^20.19.0 || >=22.12.0} + + '@babel/helper-string-parser@8.0.0-rc.3': + resolution: {integrity: sha512-AmwWFx1m8G/a5cXkxLxTiWl+YEoWuoFLUCwqMlNuWO1tqAYITQAbCRPUkyBHv1VOFgfjVOqEj6L3u15J5ZCzTA==} + engines: {node: ^20.19.0 || >=22.12.0} + + '@babel/helper-validator-identifier@8.0.0-rc.3': + resolution: {integrity: sha512-8AWCJ2VJJyDFlGBep5GpaaQ9AAaE/FjAcrqI7jyssYhtL7WGV0DOKpJsQqM037xDbpRLHXsY8TwU7zDma7coOw==} + engines: {node: ^20.19.0 || >=22.12.0} + + '@babel/parser@8.0.0-rc.3': + resolution: {integrity: sha512-B20dvP3MfNc/XS5KKCHy/oyWl5IA6Cn9YjXRdDlCjNmUFrjvLXMNUfQq/QUy9fnG2gYkKKcrto2YaF9B32ToOQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + '@babel/types@8.0.0-rc.3': + resolution: {integrity: sha512-mOm5ZrYmphGfqVWoH5YYMTITb3cDXsFgmvFlvkvWDMsR9X8RFnt7a0Wb6yNIdoFsiMO9WjYLq+U/FMtqIYAF8Q==} + engines: {node: ^20.19.0 || >=22.12.0} + + '@csstools/color-helpers@5.1.0': + resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==} + engines: {node: '>=18'} + + '@csstools/css-calc@2.1.4': + resolution: {integrity: sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 + + '@csstools/css-color-parser@3.1.0': + resolution: {integrity: sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 + + '@csstools/css-parser-algorithms@3.0.5': + resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-tokenizer': ^3.0.4 + + '@csstools/css-tokenizer@3.0.4': + resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} + engines: {node: '>=18'} + + '@emnapi/core@1.9.1': + resolution: {integrity: sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==} + + '@emnapi/runtime@1.9.1': + resolution: {integrity: sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==} + + '@emnapi/wasi-threads@1.2.0': + resolution: {integrity: sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==} + + '@esbuild/aix-ppc64@0.25.12': + resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.25.12': + resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.25.12': + resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.25.12': + resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.25.12': + resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.25.12': + resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.25.12': + resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.25.12': + resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.25.12': + resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.25.12': + resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.25.12': + resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.25.12': + resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.25.12': + resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.25.12': + resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.25.12': + resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.25.12': + resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.25.12': + resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.12': + resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.25.12': + resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.25.12': + resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.25.12': + resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.25.12': + resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.25.12': + resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.25.12': + resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.25.12': + resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.25.12': + resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@hono/node-server@1.19.11': + resolution: {integrity: sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==} + engines: {node: '>=18.14.1'} + peerDependencies: + hono: ^4 + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@modelcontextprotocol/sdk@1.28.0': + resolution: {integrity: sha512-gmloF+i+flI8ouQK7MWW4mOwuMh4RePBuPFAEPC6+pdqyWOUMDOixb6qZ69owLJpz6XmyllCouc4t8YWO+E2Nw==} + engines: {node: '>=18'} + peerDependencies: + '@cfworker/json-schema': ^4.1.1 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + '@cfworker/json-schema': + optional: true + + '@napi-rs/wasm-runtime@1.1.2': + resolution: {integrity: sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + + '@oxc-project/types@0.122.0': + resolution: {integrity: sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==} + + '@quansync/fs@1.0.0': + resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} + + '@rolldown/binding-android-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.12': + resolution: {integrity: sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-rc.12': + resolution: {integrity: sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12': + resolution: {integrity: sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12': + resolution: {integrity: sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.12': + resolution: {integrity: sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.12': + resolution: {integrity: sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12': + resolution: {integrity: sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12': + resolution: {integrity: sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-rc.12': + resolution: {integrity: sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==} + + '@rollup/rollup-android-arm-eabi@4.60.1': + resolution: {integrity: sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.60.1': + resolution: {integrity: sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.60.1': + resolution: {integrity: sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.60.1': + resolution: {integrity: sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.60.1': + resolution: {integrity: sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.60.1': + resolution: {integrity: sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.60.1': + resolution: {integrity: sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm-musleabihf@4.60.1': + resolution: {integrity: sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==} + cpu: [arm] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.60.1': + resolution: {integrity: sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.60.1': + resolution: {integrity: sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loong64-gnu@4.60.1': + resolution: {integrity: sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==} + cpu: [loong64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-loong64-musl@4.60.1': + resolution: {integrity: sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==} + cpu: [loong64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-ppc64-gnu@4.60.1': + resolution: {integrity: sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-ppc64-musl@4.60.1': + resolution: {integrity: sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==} + cpu: [ppc64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-riscv64-gnu@4.60.1': + resolution: {integrity: sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-musl@4.60.1': + resolution: {integrity: sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.60.1': + resolution: {integrity: sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-gnu@4.60.1': + resolution: {integrity: sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-musl@4.60.1': + resolution: {integrity: sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rollup/rollup-openbsd-x64@4.60.1': + resolution: {integrity: sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.60.1': + resolution: {integrity: sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.60.1': + resolution: {integrity: sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.60.1': + resolution: {integrity: sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.60.1': + resolution: {integrity: sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.60.1': + resolution: {integrity: sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==} + cpu: [x64] + os: [win32] + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@tauri-apps/api@2.10.1': + resolution: {integrity: sha512-hKL/jWf293UDSUN09rR69hrToyIXBb8CjGaWC7gfinvnQrBVvnLr08FeFi38gxtugAVyVcTa5/FD/Xnkb1siBw==} + + '@tauri-apps/cli-darwin-arm64@2.10.1': + resolution: {integrity: sha512-Z2OjCXiZ+fbYZy7PmP3WRnOpM9+Fy+oonKDEmUE6MwN4IGaYqgceTjwHucc/kEEYZos5GICve35f7ZiizgqEnQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@tauri-apps/cli-darwin-x64@2.10.1': + resolution: {integrity: sha512-V/irQVvjPMGOTQqNj55PnQPVuH4VJP8vZCN7ajnj+ZS8Kom1tEM2hR3qbbIRoS3dBKs5mbG8yg1WC+97dq17Pw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@tauri-apps/cli-linux-arm-gnueabihf@2.10.1': + resolution: {integrity: sha512-Hyzwsb4VnCWKGfTw+wSt15Z2pLw2f0JdFBfq2vHBOBhvg7oi6uhKiF87hmbXOBXUZaGkyRDkCHsdzJcIfoJC2w==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@tauri-apps/cli-linux-arm64-gnu@2.10.1': + resolution: {integrity: sha512-OyOYs2t5GkBIvyWjA1+h4CZxTcdz1OZPCWAPz5DYEfB0cnWHERTnQ/SLayQzncrT0kwRoSfSz9KxenkyJoTelA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-arm64-musl@2.10.1': + resolution: {integrity: sha512-MIj78PDDGjkg3NqGptDOGgfXks7SYJwhiMh8SBoZS+vfdz7yP5jN18bNaLnDhsVIPARcAhE1TlsZe/8Yxo2zqg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@tauri-apps/cli-linux-riscv64-gnu@2.10.1': + resolution: {integrity: sha512-X0lvOVUg8PCVaoEtEAnpxmnkwlE1gcMDTqfhbefICKDnOTJ5Est3qL0SrWxizDackIOKBcvtpejrSiVpuJI1kw==} + engines: {node: '>= 10'} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-x64-gnu@2.10.1': + resolution: {integrity: sha512-2/12bEzsJS9fAKybxgicCDFxYD1WEI9kO+tlDwX5znWG2GwMBaiWcmhGlZ8fi+DMe9CXlcVarMTYc0L3REIRxw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-x64-musl@2.10.1': + resolution: {integrity: sha512-Y8J0ZzswPz50UcGOFuXGEMrxbjwKSPgXftx5qnkuMs2rmwQB5ssvLb6tn54wDSYxe7S6vlLob9vt0VKuNOaCIQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@tauri-apps/cli-win32-arm64-msvc@2.10.1': + resolution: {integrity: sha512-iSt5B86jHYAPJa/IlYw++SXtFPGnWtFJriHn7X0NFBVunF6zu9+/zOn8OgqIWSl8RgzhLGXQEEtGBdR4wzpVgg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@tauri-apps/cli-win32-ia32-msvc@2.10.1': + resolution: {integrity: sha512-gXyxgEzsFegmnWywYU5pEBURkcFN/Oo45EAwvZrHMh+zUSEAvO5E8TXsgPADYm31d1u7OQU3O3HsYfVBf2moHw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@tauri-apps/cli-win32-x64-msvc@2.10.1': + resolution: {integrity: sha512-6Cn7YpPFwzChy0ERz6djKEmUehWrYlM+xTaNzGPgZocw3BD7OfwfWHKVWxXzdjEW2KfKkHddfdxK1XXTYqBRLg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@tauri-apps/cli@2.10.1': + resolution: {integrity: sha512-jQNGF/5quwORdZSSLtTluyKQ+o6SMa/AUICfhf4egCGFdMHqWssApVgYSbg+jmrZoc8e1DscNvjTnXtlHLS11g==} + engines: {node: '>= 10'} + hasBin: true + + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/jsesc@2.5.1': + resolution: {integrity: sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==} + + '@types/node@25.5.0': + resolution: {integrity: sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==} + + '@vitest/expect@4.1.2': + resolution: {integrity: sha512-gbu+7B0YgUJ2nkdsRJrFFW6X7NTP44WlhiclHniUhxADQJH5Szt9mZ9hWnJPJ8YwOK5zUOSSlSvyzRf0u1DSBQ==} + + '@vitest/mocker@4.1.2': + resolution: {integrity: sha512-Ize4iQtEALHDttPRCmN+FKqOl2vxTiNUhzobQFFt/BM1lRUTG7zRCLOykG/6Vo4E4hnUdfVLo5/eqKPukcWW7Q==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@4.1.2': + resolution: {integrity: sha512-dwQga8aejqeuB+TvXCMzSQemvV9hNEtDDpgUKDzOmNQayl2OG241PSWeJwKRH3CiC+sESrmoFd49rfnq7T4RnA==} + + '@vitest/runner@4.1.2': + resolution: {integrity: sha512-Gr+FQan34CdiYAwpGJmQG8PgkyFVmARK8/xSijia3eTFgVfpcpztWLuP6FttGNfPLJhaZVP/euvujeNYar36OQ==} + + '@vitest/snapshot@4.1.2': + resolution: {integrity: sha512-g7yfUmxYS4mNxk31qbOYsSt2F4m1E02LFqO53Xpzg3zKMhLAPZAjjfyl9e6z7HrW6LvUdTwAQR3HHfLjpko16A==} + + '@vitest/spy@4.1.2': + resolution: {integrity: sha512-DU4fBnbVCJGNBwVA6xSToNXrkZNSiw59H8tcuUspVMsBDBST4nfvsPsEHDHGtWRRnqBERBQu7TrTKskmjqTXKA==} + + '@vitest/utils@4.1.2': + resolution: {integrity: sha512-xw2/TiX82lQHA06cgbqRKFb5lCAy3axQ4H4SoUFhUsg+wztiet+co86IAMDtF6Vm1hc7J6j09oh/rgDn+JdKIQ==} + + accepts@2.0.0: + resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} + engines: {node: '>= 0.6'} + + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} + engines: {node: '>= 14'} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + + ansis@4.2.0: + resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} + engines: {node: '>=14'} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + ast-kit@3.0.0-beta.1: + resolution: {integrity: sha512-trmleAnZ2PxN/loHWVhhx1qeOHSRXq4TDsBBxq3GqeJitfk3+jTQ+v/C1km/KYq9M7wKqCewMh+/NAvVH7m+bw==} + engines: {node: '>=20.19.0'} + + birpc@4.0.0: + resolution: {integrity: sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==} + + body-parser@2.2.2: + resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} + engines: {node: '>=18'} + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + cac@7.0.0: + resolution: {integrity: sha512-tixWYgm5ZoOD+3g6UTea91eow5z6AAHaho3g0V9CNSNb45gM8SmflpAc+GRd1InC4AqN/07Unrgp56Y94N9hJQ==} + engines: {node: '>=20.19.0'} + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} + engines: {node: '>=18'} + + content-disposition@1.0.1: + resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} + engines: {node: '>=18'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + cookie-signature@1.2.2: + resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} + engines: {node: '>=6.6.0'} + + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + + cors@2.8.6: + resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} + engines: {node: '>= 0.10'} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + cssstyle@4.6.0: + resolution: {integrity: sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==} + engines: {node: '>=18'} + + data-urls@5.0.0: + resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} + engines: {node: '>=18'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dts-resolver@2.1.3: + resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==} + engines: {node: '>=20.19.0'} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + empathic@2.0.0: + resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==} + engines: {node: '>=14'} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + entities@6.0.1: + resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} + engines: {node: '>=0.12'} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-module-lexer@2.0.0: + resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + esbuild@0.25.12: + resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + engines: {node: '>=18'} + hasBin: true + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + eventsource-parser@3.0.6: + resolution: {integrity: sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==} + engines: {node: '>=18.0.0'} + + eventsource@3.0.7: + resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} + engines: {node: '>=18.0.0'} + + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + engines: {node: '>=12.0.0'} + + express-rate-limit@8.3.1: + resolution: {integrity: sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw==} + engines: {node: '>= 16'} + peerDependencies: + express: '>= 4.11' + + express@5.2.1: + resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} + engines: {node: '>= 18'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-uri@3.1.0: + resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + finalhandler@2.1.1: + resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} + engines: {node: '>= 18.0.0'} + + forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + + fresh@2.0.0: + resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} + engines: {node: '>= 0.8'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + get-tsconfig@4.13.7: + resolution: {integrity: sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + hono@4.12.9: + resolution: {integrity: sha512-wy3T8Zm2bsEvxKZM5w21VdHDDcwVS1yUFFY6i8UobSsKfFceT7TOwhbhfKsDyx7tYQlmRM5FLpIuYvNFyjctiA==} + engines: {node: '>=16.9.0'} + + hookable@6.1.0: + resolution: {integrity: sha512-ZoKZSJgu8voGK2geJS+6YtYjvIzu9AOM/KZXsBxr83uhLL++e9pEv/dlgwgy3dvHg06kTz6JOh1hk3C8Ceiymw==} + + html-encoding-sniffer@4.0.0: + resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} + engines: {node: '>=18'} + + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} + engines: {node: '>= 0.8'} + + http-proxy-agent@7.0.2: + resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} + engines: {node: '>= 14'} + + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} + engines: {node: '>= 14'} + + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + + iconv-lite@0.7.2: + resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} + engines: {node: '>=0.10.0'} + + import-without-cache@0.2.5: + resolution: {integrity: sha512-B6Lc2s6yApwnD2/pMzFh/d5AVjdsDXjgkeJ766FmFuJELIGHNycKRj+l3A39yZPM4CchqNCB4RITEAYB1KUM6A==} + engines: {node: '>=20.19.0'} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + ip-address@10.1.0: + resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==} + engines: {node: '>= 12'} + + ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + + is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + + is-promise@4.0.0: + resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} + hasBin: true + + jose@6.2.2: + resolution: {integrity: sha512-d7kPDd34KO/YnzaDOlikGpOurfF0ByC2sEV4cANCtdqLlTfBlw2p14O/5d/zv40gJPbIQxfES3nSx1/oYNyuZQ==} + + jsdom@26.1.0: + resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==} + engines: {node: '>=18'} + peerDependencies: + canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-schema-typed@8.0.2: + resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} + + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + marked@15.0.12: + resolution: {integrity: sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==} + engines: {node: '>= 18'} + hasBin: true + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + media-typer@1.1.0: + resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} + engines: {node: '>= 0.8'} + + merge-descriptors@2.0.0: + resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} + engines: {node: '>=18'} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + negotiator@1.0.0: + resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} + engines: {node: '>= 0.6'} + + nwsapi@2.2.23: + resolution: {integrity: sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + obug@2.1.1: + resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + parse5@7.3.0: + resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-to-regexp@8.4.0: + resolution: {integrity: sha512-PuseHIvAnz3bjrM2rGJtSgo1zjgxapTLZ7x2pjhzWwlp4SJQgK3f3iZIQwkpEnBaKz6seKBADpM4B4ySkuYypg==} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + + pkce-challenge@5.0.1: + resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} + engines: {node: '>=16.20.0'} + + postcss@8.5.8: + resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} + engines: {node: ^10 || ^12 || >=14} + + proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + qs@6.15.0: + resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} + engines: {node: '>=0.6'} + + quansync@1.0.0: + resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + raw-body@3.0.2: + resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} + engines: {node: '>= 0.10'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + rolldown-plugin-dts@0.23.2: + resolution: {integrity: sha512-PbSqLawLgZBGcOGT3yqWBGn4cX+wh2nt5FuBGdcMHyOhoukmjbhYAl8NT9sE4U38Cm9tqLOIQeOrvzeayM0DLQ==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@ts-macro/tsc': ^0.3.6 + '@typescript/native-preview': '>=7.0.0-dev.20260325.1' + rolldown: ^1.0.0-rc.12 + typescript: ^5.0.0 || ^6.0.0 + vue-tsc: ~3.2.0 + peerDependenciesMeta: + '@ts-macro/tsc': + optional: true + '@typescript/native-preview': + optional: true + typescript: + optional: true + vue-tsc: + optional: true + + rolldown@1.0.0-rc.12: + resolution: {integrity: sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + rollup@4.60.1: + resolution: {integrity: sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + router@2.2.0: + resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} + engines: {node: '>= 18'} + + rrweb-cssom@0.8.0: + resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + engines: {node: '>=10'} + hasBin: true + + send@1.2.1: + resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} + engines: {node: '>= 18'} + + serve-static@2.2.1: + resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} + engines: {node: '>= 18'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + std-env@4.0.0: + resolution: {integrity: sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==} + + symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@1.0.4: + resolution: {integrity: sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==} + engines: {node: '>=18'} + + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + tinyrainbow@3.1.0: + resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + engines: {node: '>=14.0.0'} + + tldts-core@6.1.86: + resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} + + tldts@6.1.86: + resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} + hasBin: true + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + tough-cookie@5.1.2: + resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} + engines: {node: '>=16'} + + tr46@5.1.1: + resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==} + engines: {node: '>=18'} + + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + tsdown@0.21.7: + resolution: {integrity: sha512-ukKIxKQzngkWvOYJAyptudclkm4VQqbjq+9HF5K5qDO8GJsYtMh8gIRwicbnZEnvFPr6mquFwYAVZ8JKt3rY2g==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + '@arethetypeswrong/core': ^0.18.1 + '@tsdown/css': 0.21.7 + '@tsdown/exe': 0.21.7 + '@vitejs/devtools': '*' + publint: ^0.3.0 + typescript: ^5.0.0 || ^6.0.0 + unplugin-unused: ^0.5.0 + peerDependenciesMeta: + '@arethetypeswrong/core': + optional: true + '@tsdown/css': + optional: true + '@tsdown/exe': + optional: true + '@vitejs/devtools': + optional: true + publint: + optional: true + typescript: + optional: true + unplugin-unused: + optional: true + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-is@2.0.1: + resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} + engines: {node: '>= 0.6'} + + typescript@6.0.2: + resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==} + engines: {node: '>=14.17'} + hasBin: true + + unconfig-core@7.5.0: + resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==} + + undici-types@7.18.2: + resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + unrun@0.2.34: + resolution: {integrity: sha512-LyaghRBR++r7svhDK6tnDz2XaYHWdneBOA0jbS8wnRsHerI9MFljX4fIiTgbbNbEVzZ0C9P1OjWLLe1OqoaaEw==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + vite@6.4.1: + resolution: {integrity: sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vite@8.0.3: + resolution: {integrity: sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.1.0 + esbuild: ^0.27.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@4.1.2: + resolution: {integrity: sha512-xjR1dMTVHlFLh98JE3i/f/WePqJsah4A0FK9cc8Ehp9Udk0AZk6ccpIZhh1qJ/yxVWRZ+Q54ocnD8TXmkhspGg==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.2 + '@vitest/browser-preview': 4.1.2 + '@vitest/browser-webdriverio': 4.1.2 + '@vitest/ui': 4.1.2 + happy-dom: '*' + jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + w3c-xmlserializer@5.0.0: + resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} + engines: {node: '>=18'} + + webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + + whatwg-encoding@3.1.1: + resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==} + engines: {node: '>=18'} + deprecated: Use @exodus/bytes instead for a more spec-conformant and faster implementation + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + + whatwg-url@14.2.0: + resolution: {integrity: sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==} + engines: {node: '>=18'} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + ws@8.20.0: + resolution: {integrity: sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} + + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + + zod-to-json-schema@3.25.2: + resolution: {integrity: sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==} + peerDependencies: + zod: ^3.25.28 || ^4 + + zod@4.3.6: + resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} + +snapshots: + + '@asamuzakjp/css-color@3.2.0': + dependencies: + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-color-parser': 3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + lru-cache: 10.4.3 + optional: true + + '@babel/generator@8.0.0-rc.3': + dependencies: + '@babel/parser': 8.0.0-rc.3 + '@babel/types': 8.0.0-rc.3 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + '@types/jsesc': 2.5.1 + jsesc: 3.1.0 + + '@babel/helper-string-parser@8.0.0-rc.3': {} + + '@babel/helper-validator-identifier@8.0.0-rc.3': {} + + '@babel/parser@8.0.0-rc.3': + dependencies: + '@babel/types': 8.0.0-rc.3 + + '@babel/types@8.0.0-rc.3': + dependencies: + '@babel/helper-string-parser': 8.0.0-rc.3 + '@babel/helper-validator-identifier': 8.0.0-rc.3 + + '@csstools/color-helpers@5.1.0': + optional: true + + '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + optional: true + + '@csstools/css-color-parser@3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': + dependencies: + '@csstools/color-helpers': 5.1.0 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + optional: true + + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': + dependencies: + '@csstools/css-tokenizer': 3.0.4 + optional: true + + '@csstools/css-tokenizer@3.0.4': + optional: true + + '@emnapi/core@1.9.1': + dependencies: + '@emnapi/wasi-threads': 1.2.0 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.9.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.0': + dependencies: + tslib: 2.8.1 + optional: true + + '@esbuild/aix-ppc64@0.25.12': + optional: true + + '@esbuild/android-arm64@0.25.12': + optional: true + + '@esbuild/android-arm@0.25.12': + optional: true + + '@esbuild/android-x64@0.25.12': + optional: true + + '@esbuild/darwin-arm64@0.25.12': + optional: true + + '@esbuild/darwin-x64@0.25.12': + optional: true + + '@esbuild/freebsd-arm64@0.25.12': + optional: true + + '@esbuild/freebsd-x64@0.25.12': + optional: true + + '@esbuild/linux-arm64@0.25.12': + optional: true + + '@esbuild/linux-arm@0.25.12': + optional: true + + '@esbuild/linux-ia32@0.25.12': + optional: true + + '@esbuild/linux-loong64@0.25.12': + optional: true + + '@esbuild/linux-mips64el@0.25.12': + optional: true + + '@esbuild/linux-ppc64@0.25.12': + optional: true + + '@esbuild/linux-riscv64@0.25.12': + optional: true + + '@esbuild/linux-s390x@0.25.12': + optional: true + + '@esbuild/linux-x64@0.25.12': + optional: true + + '@esbuild/netbsd-arm64@0.25.12': + optional: true + + '@esbuild/netbsd-x64@0.25.12': + optional: true + + '@esbuild/openbsd-arm64@0.25.12': + optional: true + + '@esbuild/openbsd-x64@0.25.12': + optional: true + + '@esbuild/openharmony-arm64@0.25.12': + optional: true + + '@esbuild/sunos-x64@0.25.12': + optional: true + + '@esbuild/win32-arm64@0.25.12': + optional: true + + '@esbuild/win32-ia32@0.25.12': + optional: true + + '@esbuild/win32-x64@0.25.12': + optional: true + + '@hono/node-server@1.19.11(hono@4.12.9)': + dependencies: + hono: 4.12.9 + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@modelcontextprotocol/sdk@1.28.0(zod@4.3.6)': + dependencies: + '@hono/node-server': 1.19.11(hono@4.12.9) + ajv: 8.18.0 + ajv-formats: 3.0.1(ajv@8.18.0) + content-type: 1.0.5 + cors: 2.8.6 + cross-spawn: 7.0.6 + eventsource: 3.0.7 + eventsource-parser: 3.0.6 + express: 5.2.1 + express-rate-limit: 8.3.1(express@5.2.1) + hono: 4.12.9 + jose: 6.2.2 + json-schema-typed: 8.0.2 + pkce-challenge: 5.0.1 + raw-body: 3.0.2 + zod: 4.3.6 + zod-to-json-schema: 3.25.2(zod@4.3.6) + transitivePeerDependencies: + - supports-color + + '@napi-rs/wasm-runtime@1.1.2(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)': + dependencies: + '@emnapi/core': 1.9.1 + '@emnapi/runtime': 1.9.1 + '@tybys/wasm-util': 0.10.1 + optional: true + + '@oxc-project/types@0.122.0': {} + + '@quansync/fs@1.0.0': + dependencies: + quansync: 1.0.0 + + '@rolldown/binding-android-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.12': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)': + dependencies: + '@napi-rs/wasm-runtime': 1.1.2(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12': + optional: true + + '@rolldown/pluginutils@1.0.0-rc.12': {} + + '@rollup/rollup-android-arm-eabi@4.60.1': + optional: true + + '@rollup/rollup-android-arm64@4.60.1': + optional: true + + '@rollup/rollup-darwin-arm64@4.60.1': + optional: true + + '@rollup/rollup-darwin-x64@4.60.1': + optional: true + + '@rollup/rollup-freebsd-arm64@4.60.1': + optional: true + + '@rollup/rollup-freebsd-x64@4.60.1': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.60.1': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.60.1': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.60.1': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.60.1': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.60.1': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.60.1': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.60.1': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.60.1': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.60.1': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.60.1': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.60.1': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.60.1': + optional: true + + '@rollup/rollup-linux-x64-musl@4.60.1': + optional: true + + '@rollup/rollup-openbsd-x64@4.60.1': + optional: true + + '@rollup/rollup-openharmony-arm64@4.60.1': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.60.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.60.1': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.60.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.60.1': + optional: true + + '@standard-schema/spec@1.1.0': {} + + '@tauri-apps/api@2.10.1': {} + + '@tauri-apps/cli-darwin-arm64@2.10.1': + optional: true + + '@tauri-apps/cli-darwin-x64@2.10.1': + optional: true + + '@tauri-apps/cli-linux-arm-gnueabihf@2.10.1': + optional: true + + '@tauri-apps/cli-linux-arm64-gnu@2.10.1': + optional: true + + '@tauri-apps/cli-linux-arm64-musl@2.10.1': + optional: true + + '@tauri-apps/cli-linux-riscv64-gnu@2.10.1': + optional: true + + '@tauri-apps/cli-linux-x64-gnu@2.10.1': + optional: true + + '@tauri-apps/cli-linux-x64-musl@2.10.1': + optional: true + + '@tauri-apps/cli-win32-arm64-msvc@2.10.1': + optional: true + + '@tauri-apps/cli-win32-ia32-msvc@2.10.1': + optional: true + + '@tauri-apps/cli-win32-x64-msvc@2.10.1': + optional: true + + '@tauri-apps/cli@2.10.1': + optionalDependencies: + '@tauri-apps/cli-darwin-arm64': 2.10.1 + '@tauri-apps/cli-darwin-x64': 2.10.1 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.10.1 + '@tauri-apps/cli-linux-arm64-gnu': 2.10.1 + '@tauri-apps/cli-linux-arm64-musl': 2.10.1 + '@tauri-apps/cli-linux-riscv64-gnu': 2.10.1 + '@tauri-apps/cli-linux-x64-gnu': 2.10.1 + '@tauri-apps/cli-linux-x64-musl': 2.10.1 + '@tauri-apps/cli-win32-arm64-msvc': 2.10.1 + '@tauri-apps/cli-win32-ia32-msvc': 2.10.1 + '@tauri-apps/cli-win32-x64-msvc': 2.10.1 + + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.8': {} + + '@types/jsesc@2.5.1': {} + + '@types/node@25.5.0': + dependencies: + undici-types: 7.18.2 + optional: true + + '@vitest/expect@4.1.2': + dependencies: + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.1.2 + '@vitest/utils': 4.1.2 + chai: 6.2.2 + tinyrainbow: 3.1.0 + + '@vitest/mocker@4.1.2(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1))': + dependencies: + '@vitest/spy': 4.1.2 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1) + + '@vitest/pretty-format@4.1.2': + dependencies: + tinyrainbow: 3.1.0 + + '@vitest/runner@4.1.2': + dependencies: + '@vitest/utils': 4.1.2 + pathe: 2.0.3 + + '@vitest/snapshot@4.1.2': + dependencies: + '@vitest/pretty-format': 4.1.2 + '@vitest/utils': 4.1.2 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@4.1.2': {} + + '@vitest/utils@4.1.2': + dependencies: + '@vitest/pretty-format': 4.1.2 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.0 + + accepts@2.0.0: + dependencies: + mime-types: 3.0.2 + negotiator: 1.0.0 + + agent-base@7.1.4: + optional: true + + ajv-formats@3.0.1(ajv@8.18.0): + optionalDependencies: + ajv: 8.18.0 + + ajv@8.18.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.0 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansis@4.2.0: {} + + assertion-error@2.0.1: {} + + ast-kit@3.0.0-beta.1: + dependencies: + '@babel/parser': 8.0.0-rc.3 + estree-walker: 3.0.3 + pathe: 2.0.3 + + birpc@4.0.0: {} + + body-parser@2.2.2: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 4.4.3 + http-errors: 2.0.1 + iconv-lite: 0.7.2 + on-finished: 2.4.1 + qs: 6.15.0 + raw-body: 3.0.2 + type-is: 2.0.1 + transitivePeerDependencies: + - supports-color + + bytes@3.1.2: {} + + cac@7.0.0: {} + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + + chai@6.2.2: {} + + content-disposition@1.0.1: {} + + content-type@1.0.5: {} + + convert-source-map@2.0.0: {} + + cookie-signature@1.2.2: {} + + cookie@0.7.2: {} + + cors@2.8.6: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + cssstyle@4.6.0: + dependencies: + '@asamuzakjp/css-color': 3.2.0 + rrweb-cssom: 0.8.0 + optional: true + + data-urls@5.0.0: + dependencies: + whatwg-mimetype: 4.0.0 + whatwg-url: 14.2.0 + optional: true + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + decimal.js@10.6.0: + optional: true + + defu@6.1.4: {} + + depd@2.0.0: {} + + detect-libc@2.1.2: {} + + dts-resolver@2.1.3: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + ee-first@1.1.1: {} + + empathic@2.0.0: {} + + encodeurl@2.0.0: {} + + entities@6.0.1: + optional: true + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-module-lexer@2.0.0: {} + + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + esbuild@0.25.12: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.12 + '@esbuild/android-arm': 0.25.12 + '@esbuild/android-arm64': 0.25.12 + '@esbuild/android-x64': 0.25.12 + '@esbuild/darwin-arm64': 0.25.12 + '@esbuild/darwin-x64': 0.25.12 + '@esbuild/freebsd-arm64': 0.25.12 + '@esbuild/freebsd-x64': 0.25.12 + '@esbuild/linux-arm': 0.25.12 + '@esbuild/linux-arm64': 0.25.12 + '@esbuild/linux-ia32': 0.25.12 + '@esbuild/linux-loong64': 0.25.12 + '@esbuild/linux-mips64el': 0.25.12 + '@esbuild/linux-ppc64': 0.25.12 + '@esbuild/linux-riscv64': 0.25.12 + '@esbuild/linux-s390x': 0.25.12 + '@esbuild/linux-x64': 0.25.12 + '@esbuild/netbsd-arm64': 0.25.12 + '@esbuild/netbsd-x64': 0.25.12 + '@esbuild/openbsd-arm64': 0.25.12 + '@esbuild/openbsd-x64': 0.25.12 + '@esbuild/openharmony-arm64': 0.25.12 + '@esbuild/sunos-x64': 0.25.12 + '@esbuild/win32-arm64': 0.25.12 + '@esbuild/win32-ia32': 0.25.12 + '@esbuild/win32-x64': 0.25.12 + + escape-html@1.0.3: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + + etag@1.8.1: {} + + eventsource-parser@3.0.6: {} + + eventsource@3.0.7: + dependencies: + eventsource-parser: 3.0.6 + + expect-type@1.3.0: {} + + express-rate-limit@8.3.1(express@5.2.1): + dependencies: + express: 5.2.1 + ip-address: 10.1.0 + + express@5.2.1: + dependencies: + accepts: 2.0.0 + body-parser: 2.2.2 + content-disposition: 1.0.1 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.2.2 + debug: 4.4.3 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 2.1.1 + fresh: 2.0.0 + http-errors: 2.0.1 + merge-descriptors: 2.0.0 + mime-types: 3.0.2 + on-finished: 2.4.1 + once: 1.4.0 + parseurl: 1.3.3 + proxy-addr: 2.0.7 + qs: 6.15.0 + range-parser: 1.2.1 + router: 2.2.0 + send: 1.2.1 + serve-static: 2.2.1 + statuses: 2.0.2 + type-is: 2.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + fast-deep-equal@3.1.3: {} + + fast-uri@3.1.0: {} + + fdir@6.5.0(picomatch@4.0.4): + optionalDependencies: + picomatch: 4.0.4 + + finalhandler@2.1.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + forwarded@0.2.0: {} + + fresh@2.0.0: {} + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + + get-tsconfig@4.13.7: + dependencies: + resolve-pkg-maps: 1.0.0 + + gopd@1.2.0: {} + + has-symbols@1.1.0: {} + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + hono@4.12.9: {} + + hookable@6.1.0: {} + + html-encoding-sniffer@4.0.0: + dependencies: + whatwg-encoding: 3.1.1 + optional: true + + http-errors@2.0.1: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.2 + toidentifier: 1.0.1 + + http-proxy-agent@7.0.2: + dependencies: + agent-base: 7.1.4 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + optional: true + + https-proxy-agent@7.0.6: + dependencies: + agent-base: 7.1.4 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + optional: true + + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + optional: true + + iconv-lite@0.7.2: + dependencies: + safer-buffer: 2.1.2 + + import-without-cache@0.2.5: {} + + inherits@2.0.4: {} + + ip-address@10.1.0: {} + + ipaddr.js@1.9.1: {} + + is-potential-custom-element-name@1.0.1: + optional: true + + is-promise@4.0.0: {} + + isexe@2.0.0: {} + + jiti@2.6.1: + optional: true + + jose@6.2.2: {} + + jsdom@26.1.0: + dependencies: + cssstyle: 4.6.0 + data-urls: 5.0.0 + decimal.js: 10.6.0 + html-encoding-sniffer: 4.0.0 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.6 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.23 + parse5: 7.3.0 + rrweb-cssom: 0.8.0 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 5.1.2 + w3c-xmlserializer: 5.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 3.1.1 + whatwg-mimetype: 4.0.0 + whatwg-url: 14.2.0 + ws: 8.20.0 + xml-name-validator: 5.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + optional: true + + jsesc@3.1.0: {} + + json-schema-traverse@1.0.0: {} + + json-schema-typed@8.0.2: {} + + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + + lru-cache@10.4.3: + optional: true + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + marked@15.0.12: {} + + math-intrinsics@1.1.0: {} + + media-typer@1.1.0: {} + + merge-descriptors@2.0.0: {} + + mime-db@1.54.0: {} + + mime-types@3.0.2: + dependencies: + mime-db: 1.54.0 + + ms@2.1.3: {} + + nanoid@3.3.11: {} + + negotiator@1.0.0: {} + + nwsapi@2.2.23: + optional: true + + object-assign@4.1.1: {} + + object-inspect@1.13.4: {} + + obug@2.1.1: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + parse5@7.3.0: + dependencies: + entities: 6.0.1 + optional: true + + parseurl@1.3.3: {} + + path-key@3.1.1: {} + + path-to-regexp@8.4.0: {} + + pathe@2.0.3: {} + + picocolors@1.1.1: {} + + picomatch@4.0.4: {} + + pkce-challenge@5.0.1: {} + + postcss@8.5.8: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + proxy-addr@2.0.7: + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + + punycode@2.3.1: + optional: true + + qs@6.15.0: + dependencies: + side-channel: 1.1.0 + + quansync@1.0.0: {} + + range-parser@1.2.1: {} + + raw-body@3.0.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.7.2 + unpipe: 1.0.0 + + require-from-string@2.0.2: {} + + resolve-pkg-maps@1.0.0: {} + + rolldown-plugin-dts@0.23.2(rolldown@1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1))(typescript@6.0.2): + dependencies: + '@babel/generator': 8.0.0-rc.3 + '@babel/helper-validator-identifier': 8.0.0-rc.3 + '@babel/parser': 8.0.0-rc.3 + '@babel/types': 8.0.0-rc.3 + ast-kit: 3.0.0-beta.1 + birpc: 4.0.0 + dts-resolver: 2.1.3 + get-tsconfig: 4.13.7 + obug: 2.1.1 + picomatch: 4.0.4 + rolldown: 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + optionalDependencies: + typescript: 6.0.2 + transitivePeerDependencies: + - oxc-resolver + + rolldown@1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1): + dependencies: + '@oxc-project/types': 0.122.0 + '@rolldown/pluginutils': 1.0.0-rc.12 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-rc.12 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.12 + '@rolldown/binding-darwin-x64': 1.0.0-rc.12 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.12 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.12 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.12 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.12 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.12 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.12 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.12 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + + rollup@4.60.1: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.60.1 + '@rollup/rollup-android-arm64': 4.60.1 + '@rollup/rollup-darwin-arm64': 4.60.1 + '@rollup/rollup-darwin-x64': 4.60.1 + '@rollup/rollup-freebsd-arm64': 4.60.1 + '@rollup/rollup-freebsd-x64': 4.60.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.60.1 + '@rollup/rollup-linux-arm-musleabihf': 4.60.1 + '@rollup/rollup-linux-arm64-gnu': 4.60.1 + '@rollup/rollup-linux-arm64-musl': 4.60.1 + '@rollup/rollup-linux-loong64-gnu': 4.60.1 + '@rollup/rollup-linux-loong64-musl': 4.60.1 + '@rollup/rollup-linux-ppc64-gnu': 4.60.1 + '@rollup/rollup-linux-ppc64-musl': 4.60.1 + '@rollup/rollup-linux-riscv64-gnu': 4.60.1 + '@rollup/rollup-linux-riscv64-musl': 4.60.1 + '@rollup/rollup-linux-s390x-gnu': 4.60.1 + '@rollup/rollup-linux-x64-gnu': 4.60.1 + '@rollup/rollup-linux-x64-musl': 4.60.1 + '@rollup/rollup-openbsd-x64': 4.60.1 + '@rollup/rollup-openharmony-arm64': 4.60.1 + '@rollup/rollup-win32-arm64-msvc': 4.60.1 + '@rollup/rollup-win32-ia32-msvc': 4.60.1 + '@rollup/rollup-win32-x64-gnu': 4.60.1 + '@rollup/rollup-win32-x64-msvc': 4.60.1 + fsevents: 2.3.3 + + router@2.2.0: + dependencies: + debug: 4.4.3 + depd: 2.0.0 + is-promise: 4.0.0 + parseurl: 1.3.3 + path-to-regexp: 8.4.0 + transitivePeerDependencies: + - supports-color + + rrweb-cssom@0.8.0: + optional: true + + safer-buffer@2.1.2: {} + + saxes@6.0.0: + dependencies: + xmlchars: 2.2.0 + optional: true + + semver@7.7.4: {} + + send@1.2.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 2.0.0 + http-errors: 2.0.1 + mime-types: 3.0.2 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + serve-static@2.2.1: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 1.2.1 + transitivePeerDependencies: + - supports-color + + setprototypeof@1.2.0: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + side-channel-list@1.0.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + statuses@2.0.2: {} + + std-env@4.0.0: {} + + symbol-tree@3.2.4: + optional: true + + tinybench@2.9.0: {} + + tinyexec@1.0.4: {} + + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + + tinyrainbow@3.1.0: {} + + tldts-core@6.1.86: + optional: true + + tldts@6.1.86: + dependencies: + tldts-core: 6.1.86 + optional: true + + toidentifier@1.0.1: {} + + tough-cookie@5.1.2: + dependencies: + tldts: 6.1.86 + optional: true + + tr46@5.1.1: + dependencies: + punycode: 2.3.1 + optional: true + + tree-kill@1.2.2: {} + + tsdown@0.21.7(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(typescript@6.0.2): + dependencies: + ansis: 4.2.0 + cac: 7.0.0 + defu: 6.1.4 + empathic: 2.0.0 + hookable: 6.1.0 + import-without-cache: 0.2.5 + obug: 2.1.1 + picomatch: 4.0.4 + rolldown: 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + rolldown-plugin-dts: 0.23.2(rolldown@1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1))(typescript@6.0.2) + semver: 7.7.4 + tinyexec: 1.0.4 + tinyglobby: 0.2.15 + tree-kill: 1.2.2 + unconfig-core: 7.5.0 + unrun: 0.2.34(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + optionalDependencies: + typescript: 6.0.2 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + - '@ts-macro/tsc' + - '@typescript/native-preview' + - oxc-resolver + - synckit + - vue-tsc + + tslib@2.8.1: + optional: true + + type-is@2.0.1: + dependencies: + content-type: 1.0.5 + media-typer: 1.1.0 + mime-types: 3.0.2 + + typescript@6.0.2: {} + + unconfig-core@7.5.0: + dependencies: + '@quansync/fs': 1.0.0 + quansync: 1.0.0 + + undici-types@7.18.2: + optional: true + + unpipe@1.0.0: {} + + unrun@0.2.34(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1): + dependencies: + rolldown: 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + + vary@1.1.2: {} + + vite@6.4.1(@types/node@25.5.0)(jiti@2.6.1)(lightningcss@1.32.0): + dependencies: + esbuild: 0.25.12 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + postcss: 8.5.8 + rollup: 4.60.1 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 25.5.0 + fsevents: 2.3.3 + jiti: 2.6.1 + lightningcss: 1.32.0 + + vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1): + dependencies: + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.8 + rolldown: 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 25.5.0 + fsevents: 2.3.3 + jiti: 2.6.1 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + + vitest@4.1.2(@types/node@25.5.0)(jsdom@26.1.0)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1)): + dependencies: + '@vitest/expect': 4.1.2 + '@vitest/mocker': 4.1.2(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1)) + '@vitest/pretty-format': 4.1.2 + '@vitest/runner': 4.1.2 + '@vitest/snapshot': 4.1.2 + '@vitest/spy': 4.1.2 + '@vitest/utils': 4.1.2 + es-module-lexer: 2.0.0 + expect-type: 1.3.0 + magic-string: 0.30.21 + obug: 2.1.1 + pathe: 2.0.3 + picomatch: 4.0.4 + std-env: 4.0.0 + tinybench: 2.9.0 + tinyexec: 1.0.4 + tinyglobby: 0.2.15 + tinyrainbow: 3.1.0 + vite: 8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(jiti@2.6.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 25.5.0 + jsdom: 26.1.0 + transitivePeerDependencies: + - msw + + w3c-xmlserializer@5.0.0: + dependencies: + xml-name-validator: 5.0.0 + optional: true + + webidl-conversions@7.0.0: + optional: true + + whatwg-encoding@3.1.1: + dependencies: + iconv-lite: 0.6.3 + optional: true + + whatwg-mimetype@4.0.0: + optional: true + + whatwg-url@14.2.0: + dependencies: + tr46: 5.1.1 + webidl-conversions: 7.0.0 + optional: true + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + wrappy@1.0.2: {} + + ws@8.20.0: + optional: true + + xml-name-validator@5.0.0: + optional: true + + xmlchars@2.2.0: + optional: true + + zod-to-json-schema@3.25.2(zod@4.3.6): + dependencies: + zod: 4.3.6 + + zod@4.3.6: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..dee51e9 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - "packages/*" diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..9fe33b9 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "bundler", +"strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "verbatimModuleSyntax": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "esModuleInterop": false, + "skipLibCheck": true, + "ignoreDeprecations": "6.0" + } +}