@fiestaboard/ui 1.6.4 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ import { type BoardPreviewEntry, type PreviewShapeLabels } from "../../lib/board-previews";
2
+ export interface BoardShowcaseLabels extends PreviewShapeLabels {
3
+ /** Accessible name for the shape tab list. */
4
+ boardShape: string;
5
+ /** Accessible name for the board-colour group. */
6
+ boardColor: string;
7
+ blackBoard: string;
8
+ whiteBoard: string;
9
+ }
10
+ export declare const DEFAULT_SHOWCASE_LABELS: BoardShowcaseLabels;
11
+ export interface BoardShowcaseProps {
12
+ /** Literal boards to show; the first is the default tab. */
13
+ previews: BoardPreviewEntry[];
14
+ /** Accessible description of the board, e.g. "Weather on a split-flap board". */
15
+ previewLabel?: string;
16
+ size?: "sm" | "md" | "lg";
17
+ /** Controlled board colour. Leave unset to let the showcase own it. */
18
+ boardType?: "black" | "white";
19
+ defaultBoardType?: "black" | "white";
20
+ onBoardTypeChange?: (boardType: "black" | "white") => void;
21
+ labels?: Partial<BoardShowcaseLabels>;
22
+ className?: string;
23
+ }
24
+ export declare function BoardShowcase({ previews, previewLabel, size, boardType, defaultBoardType, onBoardTypeChange, labels, className, }: BoardShowcaseProps): import("react").JSX.Element | null;
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { Tabs as t, TabsContent as n, TabsList as r, TabsTrigger as i } from "../ui/tabs.js";
4
+ import { StaticBoardDisplay as a } from "../board/static-board-display.js";
5
+ import { DEFAULT_SHAPE_LABELS as o, previewLabels as s, previewMessage as c } from "../../lib/board-previews.js";
6
+ import { useState as l } from "react";
7
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ //#region src/components/plugin/board-showcase.tsx
9
+ var f = {
10
+ ...o,
11
+ boardShape: "Board shape",
12
+ boardColor: "Board color",
13
+ blackBoard: "Black Board",
14
+ whiteBoard: "White Board"
15
+ }, p = "rounded-full border px-4 py-1.5 text-xs font-medium transition-colors data-[active]:border-brand-emphasis data-[active]:bg-brand-emphasis data-[active]:text-brand-foreground data-[active]:font-semibold hover:border-brand hover:text-brand data-[active]:hover:text-brand-foreground";
16
+ function m({ previews: o, previewLabel: m, size: h = "md", boardType: g, defaultBoardType: _ = "black", onBoardTypeChange: v, labels: y, className: b }) {
17
+ let x = {
18
+ ...f,
19
+ ...y
20
+ }, [S, C] = l(_), w = g ?? S;
21
+ function T(e) {
22
+ g === void 0 && C(e), v?.(e);
23
+ }
24
+ if (o.length === 0) return null;
25
+ let E = s(o, x);
26
+ return /* @__PURE__ */ d("div", {
27
+ "data-slot": "board-showcase",
28
+ className: e("flex flex-col items-center gap-4", b),
29
+ children: [/* @__PURE__ */ d(t, {
30
+ defaultValue: 0,
31
+ className: "flex w-full flex-col items-center gap-4",
32
+ children: [o.length > 1 && /* @__PURE__ */ u(r, {
33
+ "aria-label": x.boardShape,
34
+ className: "h-auto gap-2 rounded-full bg-transparent p-0",
35
+ children: E.map((e, t) => /* @__PURE__ */ u(i, {
36
+ value: t,
37
+ className: p,
38
+ children: e
39
+ }, e))
40
+ }), o.map((e, t) => /* @__PURE__ */ u(n, {
41
+ value: t,
42
+ className: "mt-0 flex w-full justify-center overflow-x-auto rounded-xl bg-muted/40 px-4 py-6 shadow-card",
43
+ children: /* @__PURE__ */ u(a, {
44
+ message: c(e),
45
+ size: h,
46
+ boardType: w,
47
+ deviceType: e.device_type ?? "flagship",
48
+ notesWide: e.notes_wide ?? 1,
49
+ notesTall: e.notes_tall ?? 1,
50
+ previewLabel: m
51
+ })
52
+ }, E[t]))]
53
+ }), /* @__PURE__ */ u("div", {
54
+ role: "group",
55
+ "aria-label": x.boardColor,
56
+ className: "flex",
57
+ children: ["black", "white"].map((t) => {
58
+ let n = w === t;
59
+ return /* @__PURE__ */ u("button", {
60
+ type: "button",
61
+ "aria-pressed": n,
62
+ onClick: () => T(t),
63
+ className: e("border px-4 py-1.5 text-xs font-medium transition-colors", "first:rounded-l-full last:rounded-r-full [&:not(:last-child)]:border-r-0", "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", n ? "border-brand-emphasis bg-brand-emphasis font-semibold text-brand-foreground" : "text-muted-foreground hover:border-brand hover:text-brand"),
64
+ children: t === "black" ? x.blackBoard : x.whiteBoard
65
+ }, t);
66
+ })
67
+ })]
68
+ });
69
+ }
70
+ //#endregion
71
+ export { m as BoardShowcase, f as DEFAULT_SHOWCASE_LABELS };
72
+
73
+ //# sourceMappingURL=board-showcase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-showcase.js","names":[],"sources":["../../../src/components/plugin/board-showcase.tsx"],"mappings":";;;;;;;;AAiCA,IAAa,IAA+C;CAC1D,GAAG;CACH,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;AACd,GAoBM,IACJ;AAIF,SAAgB,EAAc,EAC5B,aACA,iBACA,UAAO,MACP,cACA,sBAAmB,SACnB,sBACA,WACA,gBACqB;CACrB,IAAM,IAAI;EAAE,GAAG;EAAyB,GAAG;CAAO,GAC5C,CAAC,GAAuB,KAA4B,EAA4B,CAAgB,GAChG,IAAkB,KAAa;CAErC,SAAS,EAAgB,GAAyB;EAEhD,AADI,MAAc,KAAA,KAAW,EAAyB,CAAI,GAC1D,IAAoB,CAAI;CAC1B;CAEA,IAAI,EAAS,WAAW,GAAG,OAAO;CAElC,IAAM,IAAY,EAAc,GAAU,CAAC;CAE3C,OACE,kBAAC,OAAD;EAAK,aAAU;EAAiB,WAAW,EAAG,oCAAoC,CAAS;EAA3F,UAAA,CACE,kBAAC,GAAD;GAAM,cAAc;GAAG,WAAU;GAAjC,UAAA,CACG,EAAS,SAAS,KACjB,kBAAC,GAAD;IAAU,cAAY,EAAE;IAAY,WAAU;IAC3C,UAAA,EAAU,KAAK,GAAO,MACrB,kBAAC,GAAD;KAAyB,OAAO;KAAO,WAAW;KAC/C,UAAA;IACU,GAFK,CAEL,CACd;GACO,CAAA,GAGX,EAAS,KAAK,GAAS,MACtB,kBAAC,GAAD;IAEE,OAAO;IACP,WAAU;IAEV,UAAA,kBAAC,GAAD;KACE,SAAS,EAAe,CAAO;KACzB;KACN,WAAW;KACX,YAAY,EAAQ,eAAe;KACnC,WAAW,EAAQ,cAAc;KACjC,WAAW,EAAQ,cAAc;KACnB;IACf,CAAA;GACU,GAbN,EAAU,EAaJ,CACd,CACG;EAEN,CAAA,GAAA,kBAAC,OAAD;GAAK,MAAK;GAAQ,cAAY,EAAE;GAAY,WAAU;GAClD,UAAA,CAAC,SAAS,OAAO,CAAC,CAAW,KAAK,MAAU;IAC5C,IAAM,IAAS,MAAoB;IACnC,OACE,kBAAC,UAAD;KAEE,MAAK;KACL,gBAAc;KACd,eAAe,EAAgB,CAAK;KACpC,WAAW,EACT,4DACA,4EACA,oEACA,IACI,gFACA,2DACN;KAEC,UAAA,MAAU,UAAU,EAAE,aAAa,EAAE;IAChC,GAdD,CAcC;GAEZ,CAAC;EACE,CAAA,CACF;;AAET"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Directory card for a plugin: name, category, description, author, and a
3
+ * split-flap teaser strip showing what the plugin actually puts on a board.
4
+ *
5
+ * Presentational — routing and localization stay with the consumer. The
6
+ * primary link is supplied through `renderLink` because the two consumers use
7
+ * different routers (Docusaurus `Link`, the app's `smart-link`); the card
8
+ * stretches it over the whole surface so the `action` slot can hold a button
9
+ * without nesting one interactive element inside another.
10
+ */
11
+ import type { CSSProperties, ReactNode } from "react";
12
+ export interface PluginCardProps {
13
+ name: string;
14
+ description?: ReactNode;
15
+ /**
16
+ * Pre-formatted attribution, e.g. `"by FiestaBoard Team"` — the wording is a
17
+ * localized string, so the consumer builds it.
18
+ */
19
+ authorLabel?: ReactNode;
20
+ /** Manifest category id, e.g. `"weather"`. Omit to hide the badge. */
21
+ category?: string;
22
+ /** Localized category name. */
23
+ categoryLabel?: string;
24
+ /** Literal board line, at most 15 tiles. Omit to hide the teaser footer. */
25
+ teaser?: string;
26
+ boardType?: "black" | "white";
27
+ /**
28
+ * Renders the card's primary link. Receives the class that stretches it over
29
+ * the card, and the card title as children.
30
+ */
31
+ renderLink: (props: {
32
+ className: string;
33
+ children: ReactNode;
34
+ }) => ReactNode;
35
+ /** Trailing action, e.g. an Install button. Rendered above the stretched link. */
36
+ action?: ReactNode;
37
+ className?: string;
38
+ style?: CSSProperties;
39
+ }
40
+ export declare function PluginCard({ name, description, authorLabel, category, categoryLabel, teaser, boardType, renderLink, action, className, style, }: PluginCardProps): import("react").JSX.Element;
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { Heading as t } from "../ui/heading.js";
4
+ import { Text as n } from "../ui/text.js";
5
+ import { PluginCategoryBadge as r } from "./plugin-category-badge.js";
6
+ import { ScaledBoardTeaser as i } from "./scaled-board-teaser.js";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ //#region src/components/plugin/plugin-card.tsx
9
+ var s = "after:absolute after:inset-0 after:rounded-xl after:content-[''] outline-none focus-visible:after:ring-[3px] focus-visible:after:ring-ring/50 text-foreground no-underline hover:no-underline hover:text-foreground";
10
+ function c({ name: c, description: l, authorLabel: u, category: d, categoryLabel: f, teaser: p, boardType: m = "black", renderLink: h, action: g, className: _, style: v }) {
11
+ return /* @__PURE__ */ o("div", {
12
+ "data-slot": "plugin-card",
13
+ style: v,
14
+ className: e("group relative flex h-full flex-col overflow-hidden rounded-xl border bg-card text-card-foreground", "shadow-card transition-[transform,box-shadow] duration-200 hover:-translate-y-1 hover:shadow-lg", "motion-reduce:transition-none motion-reduce:hover:translate-y-0", _),
15
+ children: [/* @__PURE__ */ o("div", {
16
+ className: "flex flex-1 flex-col gap-2 p-4",
17
+ children: [
18
+ /* @__PURE__ */ o("div", {
19
+ className: "flex flex-wrap items-center gap-2",
20
+ children: [/* @__PURE__ */ a(t, {
21
+ level: 3,
22
+ className: "min-w-0 text-base",
23
+ children: h({
24
+ className: s,
25
+ children: c
26
+ })
27
+ }), d && /* @__PURE__ */ a(r, {
28
+ category: d,
29
+ label: f,
30
+ className: "ml-auto"
31
+ })]
32
+ }),
33
+ l && /* @__PURE__ */ a(n, {
34
+ tone: "muted",
35
+ size: "sm",
36
+ className: "line-clamp-3 flex-1 leading-relaxed",
37
+ children: l
38
+ }),
39
+ /* @__PURE__ */ o("div", {
40
+ className: "mt-auto flex items-center justify-between gap-2 pt-1",
41
+ children: [u ? /* @__PURE__ */ a(n, {
42
+ as: "span",
43
+ tone: "muted",
44
+ size: "xs",
45
+ className: "truncate",
46
+ children: u
47
+ }) : /* @__PURE__ */ a("span", {}), g && /* @__PURE__ */ a("div", {
48
+ className: "relative z-10 shrink-0",
49
+ children: g
50
+ })]
51
+ })
52
+ ]
53
+ }), p && /* @__PURE__ */ a("div", {
54
+ className: "border-t bg-muted/30 px-3 py-4",
55
+ children: /* @__PURE__ */ a(i, {
56
+ teaser: p,
57
+ boardType: m
58
+ })
59
+ })]
60
+ });
61
+ }
62
+ //#endregion
63
+ export { c as PluginCard };
64
+
65
+ //# sourceMappingURL=plugin-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-card.js","names":[],"sources":["../../../src/components/plugin/plugin-card.tsx"],"mappings":";;;;;;;;AAsBA,IAAM,IACJ;AA8BF,SAAgB,EAAW,EACzB,SACA,gBACA,gBACA,aACA,kBACA,WACA,eAAY,SACZ,eACA,WACA,cACA,YACkB;CAClB,OACE,kBAAC,OAAD;EACE,aAAU;EACH;EACP,WAAW,EACT,sGACA,mGACA,mEACA,CACF;EARF,UAAA,CAUE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,kBAAC,GAAD;MAAS,OAAO;MAAG,WAAU;MAC1B,UAAA,EAAW;OAAE,WAAW;OAAsB,UAAU;MAAK,CAAC;KACxD,CAAA,GACR,KAAY,kBAAC,GAAD;MAA+B;MAAU,OAAO;MAAe,WAAU;KAAW,CAAA,CAC9F;;IAEJ,KACC,kBAAC,GAAD;KAAM,MAAK;KAAQ,MAAK;KAAK,WAAU;KACpC,UAAA;IACG,CAAA;IAGR,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACG,IACC,kBAAC,GAAD;MAAM,IAAG;MAAO,MAAK;MAAQ,MAAK;MAAK,WAAU;MAC9C,UAAA;KACG,CAAA,IAEN,kBAAC,QAAD,CAAO,CAAA,GAER,KAAU,kBAAC,OAAD;MAAK,WAAU;MAA0B,UAAA;KAAY,CAAA,CAC7D;;GACF;EAEJ,CAAA,GAAA,KACC,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAAC,GAAD;IAA2B;IAAmB;GAAY,CAAA;EACvD,CAAA,CAEJ;;AAET"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Category badge for a plugin. One hue per category, defined once here so a
3
+ * plugin reads the same colour in the FiestaBoard marketplace and in the docs
4
+ * plugin directory. Unknown categories fall back to the neutral badge.
5
+ */
6
+ /** The categories FiestaBoard plugins may declare (manifest `category`). */
7
+ export declare const PLUGIN_CATEGORIES: readonly ["art", "data", "entertainment", "home", "transit", "utility", "weather"];
8
+ export type PluginCategory = (typeof PLUGIN_CATEGORIES)[number];
9
+ export interface PluginCategoryBadgeProps {
10
+ /** Manifest category id, e.g. `"weather"`. */
11
+ category: string;
12
+ /** Localized display name. Defaults to the raw category id. */
13
+ label?: string;
14
+ className?: string;
15
+ }
16
+ export declare function PluginCategoryBadge({ category, label, className }: PluginCategoryBadgeProps): import("react").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Badge as t } from "../ui/badge.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/plugin/plugin-category-badge.tsx
5
+ var r = [
6
+ "art",
7
+ "data",
8
+ "entertainment",
9
+ "home",
10
+ "transit",
11
+ "utility",
12
+ "weather"
13
+ ], i = {
14
+ art: "bg-category-art/15 border-category-art/30 text-category-art-foreground",
15
+ data: "bg-category-data/15 border-category-data/30 text-category-data-foreground",
16
+ entertainment: "bg-category-entertainment/15 border-category-entertainment/30 text-category-entertainment-foreground",
17
+ home: "bg-category-home/15 border-category-home/30 text-category-home-foreground",
18
+ transit: "bg-category-transit/15 border-category-transit/30 text-category-transit-foreground",
19
+ utility: "bg-category-utility/15 border-category-utility/30 text-category-utility-foreground",
20
+ weather: "bg-category-weather/15 border-category-weather/30 text-category-weather-foreground"
21
+ };
22
+ function a(e) {
23
+ return e in i;
24
+ }
25
+ function o({ category: r, label: o, className: s }) {
26
+ let c = a(r) ? i[r] : "";
27
+ return /* @__PURE__ */ n(t, {
28
+ variant: a(r) ? "outline" : "secondary",
29
+ "data-category": r,
30
+ className: e("text-[0.68rem] font-semibold uppercase tracking-wide px-2 py-0.5", c, s),
31
+ children: o ?? r
32
+ });
33
+ }
34
+ //#endregion
35
+ export { r as PLUGIN_CATEGORIES, o as PluginCategoryBadge };
36
+
37
+ //# sourceMappingURL=plugin-category-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-category-badge.js","names":[],"sources":["../../../src/components/plugin/plugin-category-badge.tsx"],"mappings":";;;;AAUA,IAAa,IAAoB;CAAC;CAAO;CAAQ;CAAiB;CAAQ;CAAW;CAAW;AAAS,GAQnG,IAAmD;CACvD,KAAK;CACL,MAAM;CACN,eAAe;CACf,MAAM;CACN,SAAS;CACT,SAAS;CACT,SAAS;AACX;AAEA,SAAS,EAAgB,GAA8C;CACrE,OAAO,KAAY;AACrB;AAUA,SAAgB,EAAoB,EAAE,aAAU,UAAO,gBAAuC;CAC5F,IAAM,IAAO,EAAgB,CAAQ,IAAI,EAAiB,KAAY;CACtE,OACE,kBAAC,GAAD;EACE,SAAS,EAAgB,CAAQ,IAAI,YAAY;EACjD,iBAAe;EACf,WAAW,EAAG,oEAAoE,GAAM,CAAS;EAEhG,UAAA,KAAS;CACL,CAAA;AAEX"}
@@ -0,0 +1,11 @@
1
+ export interface ScaledBoardTeaserProps {
2
+ /** Literal board line, e.g. `"{66}AQI 45 CLEAR"`. */
3
+ teaser: string;
4
+ boardType?: "black" | "white";
5
+ /** Strip width in tiles. */
6
+ tiles?: number;
7
+ minScale?: number;
8
+ maxScale?: number;
9
+ className?: string;
10
+ }
11
+ export declare function ScaledBoardTeaser({ teaser, boardType, tiles, minScale, maxScale, className, }: ScaledBoardTeaserProps): import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { BoardTeaser as t } from "../board/board-teaser.js";
4
+ import { useEffect as n, useRef as r, useState as i } from "react";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ //#region src/components/plugin/scaled-board-teaser.tsx
7
+ var o = 18;
8
+ function s({ teaser: s, boardType: c = "black", tiles: l = 15, minScale: u = .85, maxScale: d = 1.5, className: f }) {
9
+ let p = r(null), [m, h] = i(1);
10
+ return n(() => {
11
+ let e = p.current, t = e?.firstElementChild;
12
+ if (!e || !t) return;
13
+ let n = () => {
14
+ t.offsetWidth > 0 && h(Math.min(d, Math.max(u, e.clientWidth / t.offsetWidth)));
15
+ };
16
+ n();
17
+ let r = new ResizeObserver(n);
18
+ return r.observe(e), () => r.disconnect();
19
+ }, [u, d]), /* @__PURE__ */ a("div", {
20
+ ref: p,
21
+ "data-slot": "scaled-board-teaser",
22
+ className: e("flex justify-center overflow-hidden", f),
23
+ style: { height: `${o * m}px` },
24
+ children: /* @__PURE__ */ a("div", {
25
+ style: {
26
+ transform: `scale(${m})`,
27
+ transformOrigin: "top center"
28
+ },
29
+ children: /* @__PURE__ */ a(t, {
30
+ teaser: s,
31
+ tiles: l,
32
+ boardType: c
33
+ })
34
+ })
35
+ });
36
+ }
37
+ //#endregion
38
+ export { s as ScaledBoardTeaser };
39
+
40
+ //# sourceMappingURL=scaled-board-teaser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaled-board-teaser.js","names":[],"sources":["../../../src/components/plugin/scaled-board-teaser.tsx"],"mappings":";;;;;;AAgBA,IAAM,IAAe;AAarB,SAAgB,EAAkB,EAChC,WACA,eAAY,SACZ,WAAQ,IACR,cAAW,KACX,cAAW,KACX,gBACyB;CACzB,IAAM,IAAe,EAAuB,IAAI,GAC1C,CAAC,GAAO,KAAY,EAAS,CAAC;CAkBpC,OAhBA,QAAgB;EACd,IAAM,IAAY,EAAa,SACzB,IAAQ,GAAW;EACzB,IAAI,CAAC,KAAa,CAAC,GAAO;EAC1B,IAAM,UAAgB;GAEpB,AAAI,EAAM,cAAc,KACtB,EAAS,KAAK,IAAI,GAAU,KAAK,IAAI,GAAU,EAAU,cAAc,EAAM,WAAW,CAAC,CAAC;EAE9F;EACA,EAAQ;EACR,IAAM,IAAW,IAAI,eAAe,CAAO;EAE3C,OADA,EAAS,QAAQ,CAAS,SACb,EAAS,WAAW;CACnC,GAAG,CAAC,GAAU,CAAQ,CAAC,GAGrB,kBAAC,OAAD;EACE,KAAK;EACL,aAAU;EACV,WAAW,EAAG,uCAAuC,CAAS;EAC9D,OAAO,EAAE,QAAQ,GAAG,IAAe,EAAM,IAAI;EAE7C,UAAA,kBAAC,OAAD;GAAK,OAAO;IAAE,WAAW,SAAS,EAAM;IAAI,iBAAiB;GAAa;GACxE,UAAA,kBAAC,GAAD;IAAqB;IAAe;IAAkB;GAAY,CAAA;EAC/D,CAAA;CACF,CAAA;AAET"}
@@ -23,45 +23,42 @@ function i(n, i, a, o, s = 1) {
23
23
  console.error(`${o}: WebGL2 not available`);
24
24
  return;
25
25
  }
26
- l.clearColor(0, 0, 0, 0), l.enable(l.BLEND), l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA);
27
26
  function u(e, t) {
28
27
  let n = l.createShader(e);
29
28
  return n ? (l.shaderSource(n, t), l.compileShader(n), l.getShaderParameter(n, l.COMPILE_STATUS) ? n : (console.error(`${o} shader error:`, l.getShaderInfoLog(n)), null)) : null;
30
29
  }
31
- let d = u(l.VERTEX_SHADER, t), f = u(l.FRAGMENT_SHADER, i);
32
- if (!d || !f) return;
33
- let p = l.createProgram();
34
- if (!p) return;
35
- if (l.attachShader(p, d), l.attachShader(p, f), l.linkProgram(p), !l.getProgramParameter(p, l.LINK_STATUS)) {
36
- console.error(`${o} link error:`, l.getProgramInfoLog(p));
37
- return;
30
+ let d = null, f = null, p = null, m = null, h = null, g = null;
31
+ function _() {
32
+ if (l.isContextLost() || (l.clearColor(0, 0, 0, 0), l.enable(l.BLEND), l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA), f = u(l.VERTEX_SHADER, t), p = u(l.FRAGMENT_SHADER, i), !f || !p) || (d = l.createProgram(), !d)) return !1;
33
+ if (l.attachShader(d, f), l.attachShader(d, p), l.linkProgram(d), !l.getProgramParameter(d, l.LINK_STATUS)) return console.error(`${o} link error:`, l.getProgramInfoLog(d)), !1;
34
+ l.useProgram(d), m = l.createBuffer(), l.bindBuffer(l.ARRAY_BUFFER, m), l.bufferData(l.ARRAY_BUFFER, new Float32Array([
35
+ -1,
36
+ -1,
37
+ 3,
38
+ -1,
39
+ -1,
40
+ 3
41
+ ]), l.STATIC_DRAW);
42
+ let n = l.getAttribLocation(d, "position");
43
+ l.enableVertexAttribArray(n), l.vertexAttribPointer(n, 2, l.FLOAT, !1, 0, 0), h = l.getUniformLocation(d, "uTime");
44
+ let a = l.getUniformLocation(d, "uColorStops");
45
+ g = l.getUniformLocation(d, "uResolution");
46
+ let s = l.getUniformLocation(d, "uBlend");
47
+ return l.uniform3fv(a, new Float32Array(e.slice(0, 6).flatMap(r))), l.uniform1f(s, .75), !0;
38
48
  }
39
- l.useProgram(p);
40
- let m = l.createBuffer();
41
- l.bindBuffer(l.ARRAY_BUFFER, m), l.bufferData(l.ARRAY_BUFFER, new Float32Array([
42
- -1,
43
- -1,
44
- 3,
45
- -1,
46
- -1,
47
- 3
48
- ]), l.STATIC_DRAW);
49
- let h = l.getAttribLocation(p, "position");
50
- l.enableVertexAttribArray(h), l.vertexAttribPointer(h, 2, l.FLOAT, !1, 0, 0);
51
- let g = l.getUniformLocation(p, "uTime"), _ = l.getUniformLocation(p, "uColorStops"), v = l.getUniformLocation(p, "uResolution"), y = l.getUniformLocation(p, "uBlend");
52
- l.uniform3fv(_, new Float32Array(e.slice(0, 6).flatMap(r))), l.uniform1f(y, .75);
53
- function b() {
49
+ let v = _();
50
+ function y() {
54
51
  let e = a.parentElement;
55
52
  if (!e) return;
56
53
  let { width: t, height: n } = e.getBoundingClientRect(), r = Math.max(1, Math.round(t * s)), i = Math.max(1, Math.round(n * s));
57
- a.width = r, a.height = i, a.style.width = `${t}px`, a.style.height = `${n}px`, l.viewport(0, 0, r, i), l.uniform2f(v, r, i);
54
+ a.width = r, a.height = i, a.style.width = `${t}px`, a.style.height = `${n}px`, l.viewport(0, 0, r, i), l.uniform2f(g, r, i);
58
55
  }
59
- let x = 0, S = (e) => {
60
- l.uniform1f(g, e), l.clear(l.COLOR_BUFFER_BIT), l.drawArrays(l.TRIANGLES, 0, 3);
56
+ let b = 0, x = !1, S = (e) => {
57
+ !v || x || (l.uniform1f(h, e), l.clear(l.COLOR_BUFFER_BIT), l.drawArrays(l.TRIANGLES, 0, 3));
61
58
  }, C = (e) => {
62
- x = requestAnimationFrame(C), S(e * .001);
59
+ b = requestAnimationFrame(C), S(e * .001);
63
60
  }, w = window.matchMedia("(prefers-reduced-motion: reduce)"), T = !0, E = () => {
64
- cancelAnimationFrame(x), w.matches ? S(0) : T && (x = requestAnimationFrame(C));
61
+ cancelAnimationFrame(b), !(!v || x) && (w.matches ? S(0) : T && (b = requestAnimationFrame(C)));
65
62
  };
66
63
  w.addEventListener("change", E);
67
64
  let D = new IntersectionObserver((e) => {
@@ -69,10 +66,16 @@ function i(n, i, a, o, s = 1) {
69
66
  });
70
67
  D.observe(a);
71
68
  let O = new ResizeObserver(() => {
72
- b(), w.matches && S(0);
69
+ y(), w.matches && S(0);
73
70
  });
74
- return O.observe(a.parentElement), b(), E(), () => {
75
- cancelAnimationFrame(x), D.disconnect(), w.removeEventListener("change", E), O.disconnect(), l.deleteProgram(p), l.deleteShader(d), l.deleteShader(f), l.deleteBuffer(m);
71
+ O.observe(a.parentElement), y(), E();
72
+ let k = (e) => {
73
+ e.preventDefault(), x = !0, cancelAnimationFrame(b);
74
+ }, A = () => {
75
+ x = !1, v = _(), v && (y(), E());
76
+ };
77
+ return a.addEventListener("webglcontextlost", k), a.addEventListener("webglcontextrestored", A), () => {
78
+ cancelAnimationFrame(b), D.disconnect(), w.removeEventListener("change", E), O.disconnect(), a.removeEventListener("webglcontextlost", k), a.removeEventListener("webglcontextrestored", A), l.deleteProgram(d), l.deleteShader(f), l.deleteShader(p), l.deleteBuffer(m);
76
79
  };
77
80
  }, [
78
81
  n,
@@ -1 +1 @@
1
- {"version":3,"file":"aurora-canvas.js","names":[],"sources":["../../../src/components/seasons/aurora-canvas.ts"],"mappings":";;;AAWA,IAAa,IAAc,+FAKd,IAAsB;AAyCnC,SAAgB,EAAS,GAAuC;CAC9D,OAAO;EACL,SAAS,EAAI,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI;EAChC,SAAS,EAAI,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI;EAChC,SAAS,EAAI,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI;CAClC;AACF;AAYA,SAAgB,EACd,GACA,GACA,GACA,GACA,IAAkB,GAClB;CAKA,IAAM,IAAY,EAAO,KAAK,GAAG;CACjC,QAAgB;EAId,IAAM,IAAS,EAAU,MAAM,GAAG,GAC5B,IAAS,EAAU;EACzB,IAAI,CAAC,GAAQ;EAEb,IAAM,IAAK,EAAO,WAAW,UAAU;GAAE,OAAO;GAAM,oBAAoB;GAAO,WAAW;EAAK,CAAC;EAClG,IAAI,CAAC,GAAI;GACP,QAAQ,MAAM,GAAG,EAAM,uBAAuB;GAC9C;EACF;EAIA,AAFA,EAAG,WAAW,GAAG,GAAG,GAAG,CAAC,GACxB,EAAG,OAAO,EAAG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;EAGD,AAFA,EAAG,QAAQ,EAAO,aAAc,GAChC,EAAO,GACP,EAAc;EAOd,IAAM,KAAiB,MAAiB;GAGtC,AAFA,EAAM,eAAe,GACrB,IAAc,IACd,qBAAqB,CAAK;EAC5B,GACM,UAA0B;GAI9B,IAAc,IACd,IAAQ,EAAU,GACb,MACL,EAAO,GACP,EAAc;EAChB;EAKA,OAJA,EAAO,iBAAiB,oBAAoB,CAAa,GACzD,EAAO,iBAAiB,wBAAwB,CAAiB,SAGpD;GAaX,AAZA,qBAAqB,CAAK,GAC1B,EAAG,WAAW,GACd,EAAc,oBAAoB,UAAU,CAAa,GACzD,EAAG,WAAW,GACd,EAAO,oBAAoB,oBAAoB,CAAa,GAC5D,EAAO,oBAAoB,wBAAwB,CAAiB,GAIpE,EAAG,cAAc,CAAI,GACrB,EAAG,aAAa,CAAI,GACpB,EAAG,aAAa,CAAI,GACpB,EAAG,aAAa,CAAG;EACrB;CACF,GAAG;EAAC;EAAW;EAAY;EAAW;EAAO;CAAe,CAAC;AAC/D"}
@@ -34,10 +34,10 @@ function o({ colorStops: o = [
34
34
  alpha: !0,
35
35
  premultipliedAlpha: !0,
36
36
  antialias: !0
37
- }), d = u.gl;
38
- d.clearColor(0, 0, 0, 0), d.enable(d.BLEND), d.blendFunc(d.ONE, d.ONE_MINUS_SRC_ALPHA), d.canvas.style.backgroundColor = "transparent";
39
- let p = new l(d);
40
- p.attributes.uv && delete p.attributes.uv;
37
+ }), d = u.gl, p = () => {
38
+ d.clearColor(0, 0, 0, 0), d.enable(d.BLEND), d.blendFunc(d.ONE, d.ONE_MINUS_SRC_ALPHA), d.canvas.style.backgroundColor = "transparent";
39
+ };
40
+ p();
41
41
  let m = "", h = [], g = (e) => {
42
42
  let t = e.join(",");
43
43
  return t !== m && (m = t, h = e.map((e) => {
@@ -48,45 +48,61 @@ function o({ colorStops: o = [
48
48
  t.b
49
49
  ];
50
50
  })), h;
51
- }, _ = new s(d, {
52
- vertex: i,
53
- fragment: a,
54
- uniforms: {
55
- uTime: { value: 0 },
56
- uAmplitude: { value: f.current.amplitude },
57
- uColorStops: { value: g(f.current.colorStops) },
58
- uResolution: { value: [e.offsetWidth, e.offsetHeight] },
59
- uBlend: { value: f.current.blend }
51
+ }, _ = !1, v, y, b = () => {
52
+ if (v = void 0, y = void 0, !d.isContextLost()) try {
53
+ let t = new l(d);
54
+ t.attributes.uv && delete t.attributes.uv, v = new s(d, {
55
+ vertex: i,
56
+ fragment: a,
57
+ uniforms: {
58
+ uTime: { value: 0 },
59
+ uAmplitude: { value: f.current.amplitude },
60
+ uColorStops: { value: g(f.current.colorStops) },
61
+ uResolution: { value: [e.offsetWidth, e.offsetHeight] },
62
+ uBlend: { value: f.current.blend }
63
+ }
64
+ }), y = new o(d, {
65
+ geometry: t,
66
+ program: v
67
+ });
68
+ } catch (e) {
69
+ v = void 0, y = void 0, console.error("Aurora scene build failed:", e);
60
70
  }
61
- }), v = new o(d, {
62
- geometry: p,
63
- program: _
64
- }), y = (e) => {
71
+ };
72
+ b();
73
+ let x = (e) => {
74
+ if (_ || !v || !y) return;
65
75
  let t = f.current, n = t.time ?? e * .01;
66
- _.uniforms.uTime.value = n * (t.speed ?? 1) * .1, _.uniforms.uAmplitude.value = t.amplitude ?? 1, _.uniforms.uBlend.value = t.blend ?? .5, _.uniforms.uColorStops.value = g(t.colorStops), u.render({ scene: v });
67
- }, b = window.matchMedia("(prefers-reduced-motion: reduce)"), x = 0, S = 0;
68
- function C() {
76
+ v.uniforms.uTime.value = n * (t.speed ?? 1) * .1, v.uniforms.uAmplitude.value = t.amplitude ?? 1, v.uniforms.uBlend.value = t.blend ?? .5, v.uniforms.uColorStops.value = g(t.colorStops), u.render({ scene: y });
77
+ }, S = window.matchMedia("(prefers-reduced-motion: reduce)"), C = 0, w = 0;
78
+ function T() {
69
79
  if (!e) return;
70
80
  let t = e.offsetWidth, n = e.offsetHeight;
71
- (t !== x || n !== S) && (x = t, S = n, u.setSize(t, n), _.uniforms.uResolution.value = [t, n], b.matches && y(0));
81
+ (t !== C || n !== w) && (C = t, w = n, u.setSize(t, n), v && (v.uniforms.uResolution.value = [t, n]), S.matches && x(0));
72
82
  }
73
- let w = null, T = () => {
74
- w === null && (w = requestAnimationFrame(() => {
75
- w = null, C();
83
+ let E = null, D = () => {
84
+ E === null && (E = requestAnimationFrame(() => {
85
+ E = null, T();
76
86
  }));
77
87
  };
78
- window.addEventListener("resize", T), e.appendChild(d.canvas);
79
- let E = 0, D = (e) => {
80
- E = requestAnimationFrame(D), y(e);
81
- }, O = !0, k = () => {
82
- cancelAnimationFrame(E), b.matches ? y(0) : O && (E = requestAnimationFrame(D));
88
+ window.addEventListener("resize", D), e.appendChild(d.canvas);
89
+ let O = 0, k = (e) => {
90
+ O = requestAnimationFrame(k), x(e);
91
+ }, A = !0, j = () => {
92
+ cancelAnimationFrame(O), !(_ || !v) && (S.matches ? x(0) : A && (O = requestAnimationFrame(k)));
83
93
  };
84
- b.addEventListener("change", k);
85
- let A = new IntersectionObserver((e) => {
86
- O = e[0].intersectionRatio > 0, k();
94
+ S.addEventListener("change", j);
95
+ let M = new IntersectionObserver((e) => {
96
+ A = e[0].intersectionRatio > 0, j();
87
97
  });
88
- A.observe(e), C(), k(), n = () => {
89
- cancelAnimationFrame(E), A.disconnect(), b.removeEventListener("change", k), window.removeEventListener("resize", T), w !== null && cancelAnimationFrame(w), e && d.canvas.parentNode === e && e.removeChild(d.canvas), d.getExtension("WEBGL_lose_context")?.loseContext();
98
+ M.observe(e), T(), j();
99
+ let N = (e) => {
100
+ e.preventDefault(), _ = !0, cancelAnimationFrame(O);
101
+ }, P = () => {
102
+ _ = !1, p(), b(), C = 0, w = 0, T(), j();
103
+ };
104
+ d.canvas.addEventListener("webglcontextlost", N), d.canvas.addEventListener("webglcontextrestored", P), n = () => {
105
+ cancelAnimationFrame(O), M.disconnect(), S.removeEventListener("change", j), window.removeEventListener("resize", D), E !== null && cancelAnimationFrame(E), d.canvas.removeEventListener("webglcontextlost", N), d.canvas.removeEventListener("webglcontextrestored", P), e && d.canvas.parentNode === e && e.removeChild(d.canvas), d.getExtension("WEBGL_lose_context")?.loseContext();
90
106
  };
91
107
  })(), () => {
92
108
  t = !0, n?.();
@@ -1 +1 @@
1
- {"version":3,"file":"aurora.js","names":[],"sources":["../../../src/components/ui/aurora.tsx"],"mappings":";;;;AAIA,IAAM,IAAO,qGAOP,IAAO;AA2Gb,SAAgB,EAAO,EACrB,gBAAa;CAAC;CAAW;CAAW;AAAS,GAC7C,eAAY,GACZ,WAAQ,IACR,WAAQ,GACR,WACc;CACd,IAAM,IAAe,EAAuB,IAAI,GAC1C,IAAW,EAAO;EAAE;EAAY;EAAW;EAAO;EAAO;CAAK,CAAC;CAuKrE,OAlKA,QAAsB;EACpB,EAAS,UAAU;GAAE;GAAY;GAAW;GAAO;GAAO;EAAK;CACjE,CAAC,GAED,QAAgB;EACd,IAAM,IAAM,EAAa;EACzB,IAAI,CAAC,GAAK;EAOV,IAAI,IAAY,IACZ;EA2IJ,QAzIM,YAAY;GAChB,IAAM,EAAE,UAAO,SAAM,YAAS,aAAU,gBAAa,MAAM,OAAO;GAGlE,IAAI,GAAW;GAEf,IAAM,IAAW,IAAI,EAAS;IAC5B,OAAO;IACP,oBAAoB;IACpB,WAAW;GACb,CAAC,GACK,IAAK,EAAS;GAIpB,AAHA,EAAG,WAAW,GAAG,GAAG,GAAG,CAAC,GACxB,EAAG,OAAO,EAAG,KAAK,GAClB,EAAG,UAAU,EAAG,KAAK,EAAG,mBAAmB,GAC3C,EAAG,OAAO,MAAM,kBAAkB;GAElC,IAAM,IAAW,IAAI,EAAS,CAAE;GAChC,AAAI,EAAS,WAAW,MACtB,OAAO,EAAS,WAAW;GAM7B,IAAI,IAAiB,IACjB,IAA0B,CAAC,GACzB,KAAgB,MAAoC;IACxD,IAAM,IAAM,EAAM,KAAK,GAAG;IAQ1B,OAPI,MAAQ,MACV,IAAiB,GACjB,IAAc,EAAM,KAAK,MAAQ;KAC/B,IAAM,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,IAAW,IACT,UAAsB;IAC1B,qBAAqB,CAAS,GAC1B,OAAe,CAAC,OAChB,EAAc,UAAS,EAAY,CAAC,IAC/B,MAAU,IAAY,sBAAsB,CAAM;GAC7D;GACA,EAAc,iBAAiB,UAAU,CAAa;GAEtD,IAAM,IAAW,IAAI,sBAAsB,MAAY;IAErD,AADA,IAAW,EAAQ,EAAE,CAAC,oBAAoB,GAC1C,EAAc;GAChB,CAAC;GAID,AAHA,EAAS,QAAQ,CAAG,GAEpB,EAAO,GACP,EAAc;GAMd,IAAM,KAAiB,MAAiB;IAGtC,AAFA,EAAM,eAAe,GACrB,IAAc,IACd,qBAAqB,CAAS;GAChC,GACM,UAA0B;IAU9B,AANA,IAAc,IACd,EAAY,GACZ,EAAW,GACX,IAAe,GACf,IAAgB,GAChB,EAAO,GACP,EAAc;GAChB;GAIA,AAHA,EAAG,OAAO,iBAAiB,oBAAoB,CAAa,GAC5D,EAAG,OAAO,iBAAiB,wBAAwB,CAAiB,GAEpE,UAAiB;IAWf,AAVA,qBAAqB,CAAS,GAC9B,EAAS,WAAW,GACpB,EAAc,oBAAoB,UAAU,CAAa,GACzD,OAAO,oBAAoB,UAAU,CAAQ,GACzC,MAAgB,QAAM,qBAAqB,CAAW,GAC1D,EAAG,OAAO,oBAAoB,oBAAoB,CAAa,GAC/D,EAAG,OAAO,oBAAoB,wBAAwB,CAAiB,GACnE,KAAO,EAAG,OAAO,eAAe,KAClC,EAAI,YAAY,EAAG,MAAM,GAE3B,EAAG,aAAa,oBAAoB,CAAC,EAAE,YAAY;GACrD;EACF,EAAA,CAAG,SAEU;GAKX,AADA,IAAY,IACZ,IAAW;EACb;CACF,GAAG,CAAC,CAAC,GAEE,kBAAC,OAAD;EAAK,KAAK;EAAc,OAAO;GAAE,OAAO;GAAQ,QAAQ;EAAO;CAAI,CAAA;AAC5E"}
package/dist/index.d.ts CHANGED
@@ -64,3 +64,8 @@ export * from "./components/board/static-board-display";
64
64
  export * from "./lib/board-characters";
65
65
  export * from "./lib/board-colors";
66
66
  export * from "./lib/board-dimensions";
67
+ export * from "./lib/board-previews";
68
+ export * from "./components/plugin/board-showcase";
69
+ export * from "./components/plugin/plugin-card";
70
+ export * from "./components/plugin/plugin-category-badge";
71
+ export * from "./components/plugin/scaled-board-teaser";
package/dist/index.js CHANGED
@@ -56,4 +56,9 @@ import { BoardDisplay as un } from "./components/board/board-display.js";
56
56
  import { BoardTeaser as dn } from "./components/board/board-teaser.js";
57
57
  import { ScaledBoardDisplay as fn } from "./components/board/scaled-board-display.js";
58
58
  import { StaticBoardDisplay as pn } from "./components/board/static-board-display.js";
59
- export { Bt as ALL_COLOR_CODES, Vt as AVAILABLE_COLORS, t as Accordion, n as AccordionContent, r as AccordionItem, i as AccordionTrigger, a as Alert, o as AlertDescription, u as AlertDialog, d as AlertDialogAction, f as AlertDialogCancel, p as AlertDialogContent, m as AlertDialogDescription, h as AlertDialogFooter, g as AlertDialogHeader, _ as AlertDialogOverlay, v as AlertDialogPortal, y as AlertDialogTitle, b as AlertDialogTrigger, s as AlertTitle, x as Aurora, Jt as BOARD_CHARS, Ht as BOARD_COLORS, S as Badge, un as BoardDisplay, pt as BoardIcon, mt as BoardSelector, dn as BoardTeaser, w as Box, c as Button, Ut as COLOR_CODE_MAP, Wt as COLOR_DISPLAY, T as Card, E as CardAction, D as CardContent, O as CardDescription, k as CardFooter, A as CardHeader, j as CardTitle, M as Checkbox, N as Code, P as Collapsible, F as CollapsibleContent, I as CollapsibleTrigger, nn as DEVICE_DIMENSIONS, be as DecryptedText, L as Dialog, R as DialogClose, z as DialogContent, B as DialogDescription, V as DialogFooter, H as DialogHeader, U as DialogOverlay, W as DialogPortal, G as DialogTitle, K as DialogTrigger, q as DropdownMenu, J as DropdownMenuCheckboxItem, Y as DropdownMenuContent, X as DropdownMenuGroup, Z as DropdownMenuItem, Q as DropdownMenuLabel, $ as DropdownMenuPortal, ee as DropdownMenuRadioGroup, te as DropdownMenuRadioItem, ne as DropdownMenuSeparator, re as DropdownMenuShortcut, ie as DropdownMenuSub, ae as DropdownMenuSubContent, oe as DropdownMenuSubTrigger, se as DropdownMenuTrigger, Yt as EXTRA_CHARS, ce as EmptyState, ht as FIESTA_ICON_DATA_URI, gt as FIESTA_ICON_PALETTE, _t as FIESTA_ICON_SVG, xe as FadeContent, vt as FiestaIcon, yt as FiestaLogo, le as Flex, de as Grid, jt as HIDE_FESTIVE_COOKIE, pe as Heading, he as Input, ge as Label, bt as LanguageSelector, _e as List, ve as ListItem, rn as MAX_NOTES_PER_AXIS, xt as MainContent, an as NOTE_COLS, on as NOTE_ROWS, Mt as PRIDE_SEASON, St as PageHeader, Ct as PageIconGradientDefs, wt as PageLayout, Tt as PageToolbar, Nt as SEASONS, fn as ScaledBoardDisplay, Se as ScrollArea, Ce as ScrollBar, we as Select, Te as SelectContent, Ee as SelectGroup, De as SelectItem, Oe as SelectLabel, ke as SelectScrollDownButton, Ae as SelectScrollUpButton, je as SelectSeparator, Me as SelectTrigger, Ne as SelectValue, Pe as Sheet, Fe as SheetClose, Ie as SheetContent, Le as SheetDescription, Re as SheetFooter, ze as SheetHeader, Be as SheetOverlay, Ve as SheetPortal, He as SheetTitle, Ue as SheetTrigger, Ot as Sidebar, Et as SidebarAurora, Dt as SidebarAuroraHorizontal, We as Skeleton, kt as SkipToContent, Ge as Slider, Ke as Stack, pn as StaticBoardDisplay, Je as Switch, Ye as Table, Xe as TableBody, Ze as TableCell, Qe as TableHead, $e as TableHeader, et as TableRow, tt as Tabs, nt as TabsContent, rt as TabsList, it as TabsTrigger, at as Text, st as TextLink, ct as Textarea, At as ThemeToggle, lt as Tooltip, ut as TooltipContent, dt as TooltipProvider, ft as TooltipTrigger, C as badgeVariants, l as buttonVariants, e as cn, Pt as fireSeasonBurst, ue as flexVariants, Ft as getActiveSeason, Gt as getBoardColor, Xt as getCharFromToken, Zt as getCharIndex, fe as gridVariants, me as headingVariants, Qt as isColorTile, sn as isNoteArray, Kt as isValidBoardColor, ye as listVariants, $t as messageToGrid, cn as noteArrayDimensions, en as parseLine, It as readCookieString, qt as resolveColorCode, ln as resolveDimensions, Lt as shouldShowPride, qe as stackVariants, ot as textVariants, tn as tokensEqual, Rt as useActiveSeason, zt as usePrideActive };
59
+ import { DEFAULT_SHAPE_LABELS as mn, previewLabel as hn, previewLabels as gn, previewMessage as _n } from "./lib/board-previews.js";
60
+ import { BoardShowcase as vn, DEFAULT_SHOWCASE_LABELS as yn } from "./components/plugin/board-showcase.js";
61
+ import { PLUGIN_CATEGORIES as bn, PluginCategoryBadge as xn } from "./components/plugin/plugin-category-badge.js";
62
+ import { ScaledBoardTeaser as Sn } from "./components/plugin/scaled-board-teaser.js";
63
+ import { PluginCard as Cn } from "./components/plugin/plugin-card.js";
64
+ export { Bt as ALL_COLOR_CODES, Vt as AVAILABLE_COLORS, t as Accordion, n as AccordionContent, r as AccordionItem, i as AccordionTrigger, a as Alert, o as AlertDescription, u as AlertDialog, d as AlertDialogAction, f as AlertDialogCancel, p as AlertDialogContent, m as AlertDialogDescription, h as AlertDialogFooter, g as AlertDialogHeader, _ as AlertDialogOverlay, v as AlertDialogPortal, y as AlertDialogTitle, b as AlertDialogTrigger, s as AlertTitle, x as Aurora, Jt as BOARD_CHARS, Ht as BOARD_COLORS, S as Badge, un as BoardDisplay, pt as BoardIcon, mt as BoardSelector, vn as BoardShowcase, dn as BoardTeaser, w as Box, c as Button, Ut as COLOR_CODE_MAP, Wt as COLOR_DISPLAY, T as Card, E as CardAction, D as CardContent, O as CardDescription, k as CardFooter, A as CardHeader, j as CardTitle, M as Checkbox, N as Code, P as Collapsible, F as CollapsibleContent, I as CollapsibleTrigger, mn as DEFAULT_SHAPE_LABELS, yn as DEFAULT_SHOWCASE_LABELS, nn as DEVICE_DIMENSIONS, be as DecryptedText, L as Dialog, R as DialogClose, z as DialogContent, B as DialogDescription, V as DialogFooter, H as DialogHeader, U as DialogOverlay, W as DialogPortal, G as DialogTitle, K as DialogTrigger, q as DropdownMenu, J as DropdownMenuCheckboxItem, Y as DropdownMenuContent, X as DropdownMenuGroup, Z as DropdownMenuItem, Q as DropdownMenuLabel, $ as DropdownMenuPortal, ee as DropdownMenuRadioGroup, te as DropdownMenuRadioItem, ne as DropdownMenuSeparator, re as DropdownMenuShortcut, ie as DropdownMenuSub, ae as DropdownMenuSubContent, oe as DropdownMenuSubTrigger, se as DropdownMenuTrigger, Yt as EXTRA_CHARS, ce as EmptyState, ht as FIESTA_ICON_DATA_URI, gt as FIESTA_ICON_PALETTE, _t as FIESTA_ICON_SVG, xe as FadeContent, vt as FiestaIcon, yt as FiestaLogo, le as Flex, de as Grid, jt as HIDE_FESTIVE_COOKIE, pe as Heading, he as Input, ge as Label, bt as LanguageSelector, _e as List, ve as ListItem, rn as MAX_NOTES_PER_AXIS, xt as MainContent, an as NOTE_COLS, on as NOTE_ROWS, bn as PLUGIN_CATEGORIES, Mt as PRIDE_SEASON, St as PageHeader, Ct as PageIconGradientDefs, wt as PageLayout, Tt as PageToolbar, Cn as PluginCard, xn as PluginCategoryBadge, Nt as SEASONS, fn as ScaledBoardDisplay, Sn as ScaledBoardTeaser, Se as ScrollArea, Ce as ScrollBar, we as Select, Te as SelectContent, Ee as SelectGroup, De as SelectItem, Oe as SelectLabel, ke as SelectScrollDownButton, Ae as SelectScrollUpButton, je as SelectSeparator, Me as SelectTrigger, Ne as SelectValue, Pe as Sheet, Fe as SheetClose, Ie as SheetContent, Le as SheetDescription, Re as SheetFooter, ze as SheetHeader, Be as SheetOverlay, Ve as SheetPortal, He as SheetTitle, Ue as SheetTrigger, Ot as Sidebar, Et as SidebarAurora, Dt as SidebarAuroraHorizontal, We as Skeleton, kt as SkipToContent, Ge as Slider, Ke as Stack, pn as StaticBoardDisplay, Je as Switch, Ye as Table, Xe as TableBody, Ze as TableCell, Qe as TableHead, $e as TableHeader, et as TableRow, tt as Tabs, nt as TabsContent, rt as TabsList, it as TabsTrigger, at as Text, st as TextLink, ct as Textarea, At as ThemeToggle, lt as Tooltip, ut as TooltipContent, dt as TooltipProvider, ft as TooltipTrigger, C as badgeVariants, l as buttonVariants, e as cn, Pt as fireSeasonBurst, ue as flexVariants, Ft as getActiveSeason, Gt as getBoardColor, Xt as getCharFromToken, Zt as getCharIndex, fe as gridVariants, me as headingVariants, Qt as isColorTile, sn as isNoteArray, Kt as isValidBoardColor, ye as listVariants, $t as messageToGrid, cn as noteArrayDimensions, en as parseLine, hn as previewLabel, gn as previewLabels, _n as previewMessage, It as readCookieString, qt as resolveColorCode, ln as resolveDimensions, Lt as shouldShowPride, qe as stackVariants, ot as textVariants, tn as tokensEqual, Rt as useActiveSeason, zt as usePrideActive };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Board previews — the `teaser` / `previews` plugin-manifest contract, shared
3
+ * by every surface that advertises a plugin (the FiestaBoard marketplace, the
4
+ * docs plugin directory).
5
+ *
6
+ * A preview holds *literal* board rows, never `{{variables}}`: widths count
7
+ * tiles, so a color marker like `{66}` is one tile and an end tag `{/green}` is
8
+ * none. See FiestaBoard's docs/development/PLUGIN_DEVELOPMENT.md.
9
+ */
10
+ import type { DeviceType } from "./board-dimensions";
11
+ /** One literal board, at one shape. */
12
+ export interface BoardPreviewEntry {
13
+ /** Human tab label; when absent, derive one with `previewLabel()`. */
14
+ label?: string;
15
+ device_type?: DeviceType;
16
+ /** Notes wide (note_array only). */
17
+ notes_wide?: number;
18
+ /** Notes tall (note_array only). */
19
+ notes_tall?: number;
20
+ rows: string[];
21
+ }
22
+ /** Localized shape names. `noteArray` may contain `{w}` and `{h}` placeholders. */
23
+ export interface PreviewShapeLabels {
24
+ flagship: string;
25
+ note: string;
26
+ noteArray: string;
27
+ }
28
+ export declare const DEFAULT_SHAPE_LABELS: PreviewShapeLabels;
29
+ /** Tab label for a preview: its declared label, or one derived from the shape. */
30
+ export declare function previewLabel(preview: BoardPreviewEntry, labels?: PreviewShapeLabels): string;
31
+ /**
32
+ * Tab labels for a whole preview list, numbering repeats so every tab has a
33
+ * distinct accessible name — authors may declare several previews of the same
34
+ * shape ("Flagship" twice).
35
+ */
36
+ export declare function previewLabels(previews: BoardPreviewEntry[], labels?: PreviewShapeLabels): string[];
37
+ /** The newline-joined message `StaticBoardDisplay` renders. */
38
+ export declare function previewMessage(preview: BoardPreviewEntry): string;
@@ -0,0 +1,23 @@
1
+ //#region src/lib/board-previews.ts
2
+ var e = {
3
+ flagship: "Flagship",
4
+ note: "Note",
5
+ noteArray: "Note Array {w}×{h}"
6
+ };
7
+ function t(t, n = e) {
8
+ return t.label ? t.label : t.device_type === "note_array" ? n.noteArray.replace("{w}", String(t.notes_wide ?? 1)).replace("{h}", String(t.notes_tall ?? 1)) : t.device_type === "note" ? n.note : n.flagship;
9
+ }
10
+ function n(e, n) {
11
+ let r = /* @__PURE__ */ new Map();
12
+ return e.map((e) => {
13
+ let i = t(e, n), a = r.get(i) ?? 0;
14
+ return r.set(i, a + 1), a > 0 ? `${i} ${a + 1}` : i;
15
+ });
16
+ }
17
+ function r(e) {
18
+ return e.rows.join("\n");
19
+ }
20
+ //#endregion
21
+ export { e as DEFAULT_SHAPE_LABELS, t as previewLabel, n as previewLabels, r as previewMessage };
22
+
23
+ //# sourceMappingURL=board-previews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-previews.js","names":[],"sources":["../../src/lib/board-previews.ts"],"mappings":";AA+BA,IAAa,IAA2C;CACtD,UAAU;CACV,MAAM;CACN,WAAW;AACb;AAGA,SAAgB,EAAa,GAA4B,IAA6B,GAA8B;CAOlH,OANI,EAAQ,QAAc,EAAQ,QAC9B,EAAQ,gBAAgB,eACnB,EAAO,UACX,QAAQ,OAAO,OAAO,EAAQ,cAAc,CAAC,CAAC,CAAC,CAC/C,QAAQ,OAAO,OAAO,EAAQ,cAAc,CAAC,CAAC,IAE5C,EAAQ,gBAAgB,SAAS,EAAO,OAAO,EAAO;AAC/D;AAOA,SAAgB,EAAc,GAA+B,GAAuC;CAClG,IAAM,oBAAO,IAAI,IAAoB;CACrC,OAAO,EAAS,KAAK,MAAY;EAC/B,IAAM,IAAO,EAAa,GAAS,CAAM,GACnC,IAAS,EAAK,IAAI,CAAI,KAAK;EAEjC,OADA,EAAK,IAAI,GAAM,IAAS,CAAC,GAClB,IAAS,IAAI,GAAG,EAAK,GAAG,IAAS,MAAM;CAChD,CAAC;AACH;AAGA,SAAgB,EAAe,GAAoC;CACjE,OAAO,EAAQ,KAAK,KAAK,IAAI;AAC/B"}
package/dist/theme.css CHANGED
@@ -86,6 +86,23 @@
86
86
  --color-tag-formula: var(--tag-formula);
87
87
  --color-tag-formula-foreground: var(--tag-formula-foreground);
88
88
 
89
+ /* Plugin category accents (PluginCategoryBadge) — one hue per category so a
90
+ plugin reads the same on the marketplace and in the docs directory. */
91
+ --color-category-weather: var(--category-weather);
92
+ --color-category-weather-foreground: var(--category-weather-foreground);
93
+ --color-category-transit: var(--category-transit);
94
+ --color-category-transit-foreground: var(--category-transit-foreground);
95
+ --color-category-data: var(--category-data);
96
+ --color-category-data-foreground: var(--category-data-foreground);
97
+ --color-category-entertainment: var(--category-entertainment);
98
+ --color-category-entertainment-foreground: var(--category-entertainment-foreground);
99
+ --color-category-art: var(--category-art);
100
+ --color-category-art-foreground: var(--category-art-foreground);
101
+ --color-category-utility: var(--category-utility);
102
+ --color-category-utility-foreground: var(--category-utility-foreground);
103
+ --color-category-home: var(--category-home);
104
+ --color-category-home-foreground: var(--category-home-foreground);
105
+
89
106
  /* Overlay */
90
107
  --color-overlay: var(--overlay);
91
108
 
@@ -193,6 +210,20 @@
193
210
  --tag-success-foreground: oklch(0.35 0.1 160);
194
211
  --tag-formula: oklch(0.45 0.15 80);
195
212
  --tag-formula-foreground: oklch(0.35 0.1 80);
213
+ --category-weather: oklch(0.55 0.14 245);
214
+ --category-weather-foreground: oklch(0.42 0.11 245);
215
+ --category-transit: oklch(0.55 0.15 145);
216
+ --category-transit-foreground: oklch(0.42 0.12 145);
217
+ --category-data: oklch(0.55 0.16 305);
218
+ --category-data-foreground: oklch(0.42 0.13 305);
219
+ --category-entertainment: oklch(0.55 0.14 75);
220
+ --category-entertainment-foreground: oklch(0.42 0.11 75);
221
+ --category-art: oklch(0.55 0.16 30);
222
+ --category-art-foreground: oklch(0.42 0.13 30);
223
+ --category-utility: oklch(0.55 0.03 255);
224
+ --category-utility-foreground: oklch(0.42 0.03 255);
225
+ --category-home: oklch(0.55 0.12 180);
226
+ --category-home-foreground: oklch(0.42 0.1 180);
196
227
  --overlay: oklch(0 0 0 / 80%);
197
228
  /* Brand accent - darkened for WCAG 2.2 AA (≥4.5:1 on light bg) */
198
229
  --brand: oklch(0.56 0.15 75);
@@ -392,6 +423,20 @@
392
423
  --tag-success-foreground: oklch(0.85 0.08 160);
393
424
  --tag-formula: oklch(0.65 0.15 80);
394
425
  --tag-formula-foreground: oklch(0.85 0.08 80);
426
+ --category-weather: oklch(0.68 0.13 245);
427
+ --category-weather-foreground: oklch(0.85 0.08 245);
428
+ --category-transit: oklch(0.68 0.14 145);
429
+ --category-transit-foreground: oklch(0.85 0.09 145);
430
+ --category-data: oklch(0.68 0.14 305);
431
+ --category-data-foreground: oklch(0.85 0.09 305);
432
+ --category-entertainment: oklch(0.68 0.13 75);
433
+ --category-entertainment-foreground: oklch(0.85 0.08 75);
434
+ --category-art: oklch(0.68 0.14 30);
435
+ --category-art-foreground: oklch(0.85 0.09 30);
436
+ --category-utility: oklch(0.68 0.03 255);
437
+ --category-utility-foreground: oklch(0.85 0.02 255);
438
+ --category-home: oklch(0.68 0.11 180);
439
+ --category-home-foreground: oklch(0.85 0.07 180);
395
440
  --overlay: oklch(0 0 0 / 80%);
396
441
  --brand: oklch(0.78 0.14 75);
397
442
  --brand-emphasis: oklch(0.55 0.16 60);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiestaboard/ui",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "description": "FiestaUI — the FiestaBoard design system. React components on Base UI with Tailwind v4 design tokens.",
5
5
  "license": "MIT",
6
6
  "repository": {