@mohasinac/appkit 3.1.2 → 3.1.4

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.
@@ -62,7 +62,7 @@ export const DEFAULT_DARK_THEME = {
62
62
  "appkit-font-mono": "ui-monospace, \"SFMono-Regular\", \"Cascadia Mono\", \"Consolas\", monospace",
63
63
  },
64
64
  gradients: {
65
- brand: "linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-primary-400))",
65
+ brand: "linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-info))",
66
66
  "brand-tri": "linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-secondary), var(--appkit-color-info))",
67
67
  accent: "linear-gradient(to right, var(--appkit-color-info), var(--appkit-color-primary))",
68
68
  "accent-divider": "linear-gradient(to right, transparent, var(--appkit-color-primary), transparent)",
@@ -79,6 +79,7 @@ export const DEFAULT_DARK_THEME = {
79
79
  "card-teal": "linear-gradient(to bottom right, rgba(56,189,248,0.10), var(--appkit-color-surface), var(--appkit-color-surface))",
80
80
  "card-amber": "linear-gradient(to bottom right, var(--appkit-color-warning-surface), var(--appkit-color-surface), var(--appkit-color-surface))",
81
81
  "card-rose": "linear-gradient(to bottom right, var(--appkit-color-error-surface), var(--appkit-color-surface), var(--appkit-color-surface))",
82
- logo: "linear-gradient(to right, var(--appkit-color-primary-700) 0%, var(--appkit-color-primary-500) 55%, var(--appkit-color-secondary-400) 100%)",
82
+ logo: "linear-gradient(to right, var(--appkit-color-primary-300) 0%, var(--appkit-color-primary-400) 55%, var(--appkit-color-info) 100%)",
83
+ sidebar: "linear-gradient(to bottom, var(--appkit-color-primary), var(--appkit-color-info))",
83
84
  },
84
85
  };
@@ -86,5 +86,6 @@ export const DEFAULT_LIGHT_THEME = {
86
86
  "card-amber": "linear-gradient(to bottom right, var(--appkit-color-warning-surface), var(--appkit-color-surface), var(--appkit-color-surface))",
87
87
  "card-rose": "linear-gradient(to bottom right, var(--appkit-color-error-surface), var(--appkit-color-surface), var(--appkit-color-surface))",
88
88
  logo: "linear-gradient(to right, var(--appkit-color-primary-700) 0%, var(--appkit-color-primary-500) 55%, var(--appkit-color-secondary-400) 100%)",
89
+ sidebar: "linear-gradient(to bottom, var(--appkit-color-primary-700), var(--appkit-color-secondary-500))",
89
90
  },
90
91
  };
@@ -34,4 +34,4 @@ export interface ThemeRecord {
34
34
  gradients: Readonly<Record<GradientKey, string>>;
35
35
  }
36
36
  /** The named gradient slots every theme must declare. */
37
- export type GradientKey = "brand" | "brand-tri" | "accent" | "accent-divider" | "page-header" | "section-warm" | "section-cool" | "section-mesh" | "accent-banner" | "promotion" | "spotlight" | "whatsapp-card" | "glass" | "card-indigo" | "card-teal" | "card-amber" | "card-rose" | "logo";
37
+ export type GradientKey = "brand" | "brand-tri" | "accent" | "accent-divider" | "page-header" | "section-warm" | "section-cool" | "section-mesh" | "accent-banner" | "promotion" | "spotlight" | "whatsapp-card" | "glass" | "card-indigo" | "card-teal" | "card-amber" | "card-rose" | "logo" | "sidebar";
@@ -303,6 +303,12 @@
303
303
  --appkit-gradient-card-amber: linear-gradient(to bottom right, var(--appkit-color-warning-surface), var(--appkit-color-surface), var(--appkit-color-surface));
304
304
  --appkit-gradient-card-rose: linear-gradient(to bottom right, var(--appkit-color-error-surface), var(--appkit-color-surface), var(--appkit-color-surface));
305
305
  --appkit-gradient-logo: linear-gradient(to right, var(--appkit-color-primary-700) 0%, var(--appkit-color-primary-500) 55%, var(--appkit-color-secondary-400) 100%);
306
+ --appkit-gradient-sidebar: linear-gradient(to bottom, var(--appkit-color-primary-700), var(--appkit-color-secondary-500));
307
+ /* Per-stop variables so SiteLogo SVG can reference each stop individually
308
+ (SVG linearGradient cannot consume a full CSS gradient value directly). */
309
+ --appkit-logo-stop-from: var(--appkit-color-primary-700);
310
+ --appkit-logo-stop-mid: var(--appkit-color-primary-500);
311
+ --appkit-logo-stop-to: var(--appkit-color-secondary-400);
306
312
  }
307
313
 
308
314
  /* --- Theme — Dark ([data-theme="dark"]) ----------------------------------- */
@@ -362,17 +368,29 @@
362
368
  --appkit-shadow-glow-pink: 0 0 0 1px rgba(233,30,140,0.14), 0 4px 20px -4px rgba(233,30,140,0.28);
363
369
 
364
370
  /* Dark-mode gradient overrides */
365
- --appkit-gradient-brand: linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-primary-400));
371
+ --appkit-gradient-brand: linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-info));
366
372
  --appkit-gradient-brand-tri: linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-secondary), var(--appkit-color-info));
367
373
  --appkit-gradient-accent: linear-gradient(to right, var(--appkit-color-info), var(--appkit-color-primary));
368
374
  --appkit-gradient-accent-divider: linear-gradient(to right, transparent, var(--appkit-color-primary), transparent);
369
375
  --appkit-gradient-page-header: linear-gradient(to bottom right, rgba(233,30,140,0.10), transparent 60%, transparent);
376
+ --appkit-gradient-section-warm: linear-gradient(to bottom right, var(--appkit-color-warning-surface), transparent);
370
377
  --appkit-gradient-section-cool: linear-gradient(to bottom right, rgba(56,189,248,0.10), transparent);
371
378
  --appkit-gradient-section-mesh: radial-gradient(ellipse at top, rgba(233,30,140,0.10), var(--appkit-color-surface), rgba(56,189,248,0.08));
372
379
  --appkit-gradient-accent-banner: linear-gradient(to right, var(--appkit-color-primary), var(--appkit-color-info));
380
+ --appkit-gradient-promotion: linear-gradient(to bottom right, var(--appkit-color-error), var(--appkit-color-primary), var(--appkit-color-warning));
373
381
  --appkit-gradient-spotlight: linear-gradient(to bottom right, rgba(56,189,248,0.10), var(--appkit-color-bg), rgba(56,189,248,0.10));
382
+ --appkit-gradient-whatsapp-card: linear-gradient(to bottom right, var(--appkit-color-success), var(--appkit-color-success));
383
+ --appkit-gradient-glass: linear-gradient(to bottom right, color-mix(in srgb, var(--appkit-color-surface) 85%, transparent), color-mix(in srgb, var(--appkit-color-surface) 65%, transparent));
374
384
  --appkit-gradient-card-indigo: linear-gradient(to bottom right, rgba(233,30,140,0.10), var(--appkit-color-surface), var(--appkit-color-surface));
375
385
  --appkit-gradient-card-teal: linear-gradient(to bottom right, rgba(56,189,248,0.10), var(--appkit-color-surface), var(--appkit-color-surface));
386
+ --appkit-gradient-card-amber: linear-gradient(to bottom right, var(--appkit-color-warning-surface), var(--appkit-color-surface), var(--appkit-color-surface));
387
+ --appkit-gradient-card-rose: linear-gradient(to bottom right, var(--appkit-color-error-surface), var(--appkit-color-surface), var(--appkit-color-surface));
388
+ --appkit-gradient-logo: linear-gradient(to right, var(--appkit-color-primary-300) 0%, var(--appkit-color-primary-400) 55%, var(--appkit-color-info) 100%);
389
+ --appkit-gradient-sidebar: linear-gradient(to bottom, var(--appkit-color-primary), var(--appkit-color-info));
390
+ /* Logo stop overrides — lighter shades visible on dark (#020617) background */
391
+ --appkit-logo-stop-from: var(--appkit-color-primary-300);
392
+ --appkit-logo-stop-mid: var(--appkit-color-primary-400);
393
+ --appkit-logo-stop-to: var(--appkit-color-info);
376
394
  }
377
395
 
378
396
  /* --- Theme — Cobalt Night ([data-theme="cobalt-night"]) ------------------- */
@@ -408,6 +426,10 @@
408
426
  --appkit-color-focus-ring: #8eb9ff;
409
427
  --appkit-shadow-glow: 0 0 0 1px rgba(89,146,255,0.18), 0 4px 16px -4px rgba(89,146,255,0.30);
410
428
  --appkit-shadow-glow-pink: 0 0 0 1px rgba(89,146,255,0.18), 0 4px 20px -4px rgba(89,146,255,0.30);
429
+ /* Logo stops — lighter cobalt blues visible on #111e58 background */
430
+ --appkit-logo-stop-from: var(--appkit-color-primary-300);
431
+ --appkit-logo-stop-mid: var(--appkit-color-primary-400);
432
+ --appkit-logo-stop-to: var(--appkit-color-secondary);
411
433
  }
412
434
 
413
435
  /* --- Theme — Sunset ([data-theme="sunset"]) ------------------------------- */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  /**
3
4
  * LetItRip site logo — SVG wordmark "LetItRip" + small ".in" superscript.
@@ -9,8 +10,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  * Sizes are responsive presets — the variant catalogue forbids consumer-side
10
11
  * className overrides on primitive components.
11
12
  */
13
+ import { useId } from "react";
12
14
  import { MediaImage } from "../../features/media/MediaImage";
13
- const GRADIENT_ID = "appkit-logo-gradient";
15
+ // Gradient ID prefix — made unique per instance via useId() to prevent
16
+ // cross-SVG id conflicts when multiple SiteLogo components share the page.
17
+ const GRADIENT_ID_PREFIX = "appkit-logo-gradient";
14
18
  const SIZE_HEIGHTS = {
15
19
  sm: "h-5",
16
20
  md: "h-7 md:h-9 lg:h-10",
@@ -18,7 +22,7 @@ const SIZE_HEIGHTS = {
18
22
  xl: "h-12 md:h-16 lg:h-20",
19
23
  hero: "h-24 xl:h-32 2xl:h-40",
20
24
  };
21
- function resolveFill(tone) {
25
+ function resolveFill(tone, gradientId) {
22
26
  switch (tone) {
23
27
  case "mono":
24
28
  return "currentColor";
@@ -28,19 +32,21 @@ function resolveFill(tone) {
28
32
  return "var(--appkit-color-text)";
29
33
  case "brand":
30
34
  default:
31
- return `url(#${GRADIENT_ID})`;
35
+ return `url(#${gradientId})`;
32
36
  }
33
37
  }
34
38
  export function SiteLogo({ size = "md", tone = "brand", title = "LetItRip.in", src, }) {
39
+ const uid = useId();
40
+ const gradientId = `${GRADIENT_ID_PREFIX}-${uid.replace(/:/g, "")}`;
35
41
  const heightCls = SIZE_HEIGHTS[size];
36
42
  if (src) {
37
43
  return (_jsx(MediaImage, { src: src, alt: title, size: "thumbnail", objectFit: "contain",
38
44
  // backed by the catalogued `size` enum; no consumer-provided overrides.
39
45
  className: `block w-auto ${heightCls}` }));
40
46
  }
41
- const fill = resolveFill(tone);
47
+ const fill = resolveFill(tone, gradientId);
42
48
  const isGradient = tone === "brand";
43
49
  return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 214 56", role: "img", "aria-label": title, "data-testid": "site-logo",
44
50
  // backed by the catalogued `size` enum; no consumer-provided overrides.
45
- className: `block w-auto ${heightCls}`, children: [_jsx("title", { children: title }), isGradient && (_jsx("defs", { children: _jsxs("linearGradient", { id: GRADIENT_ID, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", style: { stopColor: "var(--appkit-color-primary-700)" } }), _jsx("stop", { offset: "55%", style: { stopColor: "var(--appkit-color-primary-500)" } }), _jsx("stop", { offset: "100%", style: { stopColor: "var(--appkit-color-secondary-400)" } })] }) })), _jsx("text", { x: "0", y: "44", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "800", fontSize: "44", letterSpacing: "-1.5", fill: fill, children: "LetItRip" }), _jsx("rect", { x: "169", y: "5", width: "43", height: "21", rx: "10.5", fill: fill, opacity: "0.12" }), _jsx("text", { x: "174", y: "21", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "700", fontSize: "15", letterSpacing: "0.2", fill: fill, children: ".in" })] }));
51
+ className: `block w-auto ${heightCls}`, children: [_jsx("title", { children: title }), isGradient && (_jsx("defs", { children: _jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", style: { stopColor: "var(--appkit-logo-stop-from)" } }), _jsx("stop", { offset: "55%", style: { stopColor: "var(--appkit-logo-stop-mid)" } }), _jsx("stop", { offset: "100%", style: { stopColor: "var(--appkit-logo-stop-to)" } })] }) })), _jsx("text", { x: "0", y: "44", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "800", fontSize: "44", letterSpacing: "-1.5", fill: fill, children: "LetItRip" }), _jsx("rect", { x: "169", y: "5", width: "43", height: "21", rx: "10.5", fill: fill, opacity: "0.12" }), _jsx("text", { x: "174", y: "21", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "700", fontSize: "15", letterSpacing: "0.2", fill: fill, children: ".in" })] }));
46
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -240,3 +240,4 @@
240
240
  "vitest": "^4.1.7"
241
241
  }
242
242
  }
243
+