@limetry/ui 1.2.87 → 1.2.93

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.
Files changed (64) hide show
  1. package/dist/components/badge.d.ts +33 -0
  2. package/dist/components/badge.d.ts.map +1 -0
  3. package/dist/components/button.d.ts +47 -0
  4. package/dist/components/button.d.ts.map +1 -0
  5. package/dist/components/card.d.ts +55 -0
  6. package/dist/components/card.d.ts.map +1 -0
  7. package/dist/components/drawer-menu.d.ts +20 -0
  8. package/dist/components/drawer-menu.d.ts.map +1 -0
  9. package/dist/components/drawer-menu.types.d.ts +100 -0
  10. package/dist/components/drawer-menu.types.d.ts.map +1 -0
  11. package/dist/components/drawer-menu.web.d.ts +20 -0
  12. package/dist/components/drawer-menu.web.d.ts.map +1 -0
  13. package/dist/components/icons.d.ts +81 -0
  14. package/dist/components/icons.d.ts.map +1 -0
  15. package/dist/components/icons.web.d.ts +81 -0
  16. package/dist/components/icons.web.d.ts.map +1 -0
  17. package/dist/components/input.d.ts +75 -0
  18. package/dist/components/input.d.ts.map +1 -0
  19. package/dist/components/logo.d.ts +18 -0
  20. package/dist/components/logo.d.ts.map +1 -0
  21. package/dist/components/logo.web.d.ts +17 -0
  22. package/dist/components/logo.web.d.ts.map +1 -0
  23. package/dist/components/page-header.d.ts +78 -0
  24. package/dist/components/page-header.d.ts.map +1 -0
  25. package/dist/components/site-footer.d.ts +5 -0
  26. package/dist/components/site-footer.d.ts.map +1 -0
  27. package/dist/components/site-footer.types.d.ts +19 -0
  28. package/dist/components/site-footer.types.d.ts.map +1 -0
  29. package/dist/components/site-footer.web.d.ts +7 -0
  30. package/dist/components/site-footer.web.d.ts.map +1 -0
  31. package/dist/components/site-header.d.ts +13 -0
  32. package/dist/components/site-header.d.ts.map +1 -0
  33. package/dist/components/site-header.types.d.ts +50 -0
  34. package/dist/components/site-header.types.d.ts.map +1 -0
  35. package/dist/components/site-header.web.d.ts +14 -0
  36. package/dist/components/site-header.web.d.ts.map +1 -0
  37. package/dist/components/stat-card.d.ts +42 -0
  38. package/dist/components/stat-card.d.ts.map +1 -0
  39. package/dist/components/theme-toggle.d.ts +12 -0
  40. package/dist/components/theme-toggle.d.ts.map +1 -0
  41. package/dist/components/theme-toggle.web.d.ts +24 -0
  42. package/dist/components/theme-toggle.web.d.ts.map +1 -0
  43. package/dist/index.cjs +121 -19
  44. package/dist/index.d.ts +20 -503
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +120 -20
  47. package/dist/lib/cn.d.ts +12 -0
  48. package/dist/lib/cn.d.ts.map +1 -0
  49. package/dist/lib/site-footer-links.d.ts +67 -0
  50. package/dist/lib/site-footer-links.d.ts.map +1 -0
  51. package/dist/navigation/types.d.ts +87 -0
  52. package/dist/navigation/types.d.ts.map +1 -0
  53. package/package.json +23 -9
  54. package/src/components/logo.tsx +59 -0
  55. package/src/components/logo.web.tsx +61 -0
  56. package/src/components/site-footer.tsx +92 -0
  57. package/src/components/site-footer.types.ts +21 -0
  58. package/src/components/site-footer.web.tsx +101 -0
  59. package/src/components/site-header.web.tsx +2 -2
  60. package/src/index.ts +2 -0
  61. package/src/lib/site-footer-links.test.ts +1 -0
  62. package/src/lib/site-footer-links.ts +1 -0
  63. package/tailwind.config.ts +2 -2
  64. package/dist/index.d.cts +0 -504
package/dist/index.js CHANGED
@@ -267,19 +267,61 @@ function FormSection({ title, children }) {
267
267
  ] });
268
268
  }
269
269
 
270
- // src/components/page-header.tsx
271
- import { Text as Text5, View as View5 } from "react-native";
270
+ // src/components/logo.tsx
271
+ import { Image, Text as Text5, View as View5 } from "react-native";
272
272
  import { jsx as jsx6, jsxs as jsxs3 } from "nativewind/jsx-runtime";
273
+ function Logo({
274
+ iconSource,
275
+ productSource,
276
+ variant = "wordmark",
277
+ className,
278
+ label = "Limetry"
279
+ }) {
280
+ if (variant === "product" && productSource) {
281
+ return /* @__PURE__ */ jsx6(
282
+ Image,
283
+ {
284
+ source: productSource,
285
+ accessibilityLabel: label,
286
+ resizeMode: "contain",
287
+ className: className ?? "h-7 w-28"
288
+ }
289
+ );
290
+ }
291
+ return /* @__PURE__ */ jsxs3(
292
+ View5,
293
+ {
294
+ accessibilityLabel: label,
295
+ className: `flex-row items-center gap-2 ${variant === "mark" ? "h-8 w-8" : "h-8"} ${className ?? ""}`,
296
+ children: [
297
+ iconSource ? /* @__PURE__ */ jsx6(
298
+ Image,
299
+ {
300
+ source: iconSource,
301
+ accessibilityLabel: label,
302
+ resizeMode: "contain",
303
+ className: "h-8 w-8 shrink-0"
304
+ }
305
+ ) : null,
306
+ variant === "wordmark" ? /* @__PURE__ */ jsx6(Text5, { className: "font-sans text-[1.35rem] font-bold tracking-tight text-[#21b263]", children: "Limetry" }) : null
307
+ ]
308
+ }
309
+ );
310
+ }
311
+
312
+ // src/components/page-header.tsx
313
+ import { Text as Text6, View as View6 } from "react-native";
314
+ import { jsx as jsx7, jsxs as jsxs4 } from "nativewind/jsx-runtime";
273
315
  function PageHeader({
274
316
  title,
275
317
  description,
276
318
  action,
277
319
  className
278
320
  }) {
279
- return /* @__PURE__ */ jsxs3(View5, { className: cn("mb-6 flex-row items-start justify-between", className), children: [
280
- /* @__PURE__ */ jsxs3(View5, { className: "flex-1 pr-4", children: [
281
- /* @__PURE__ */ jsx6(Text5, { className: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-100 md:text-3xl", children: title }),
282
- description ? /* @__PURE__ */ jsx6(Text5, { className: "mt-1 text-base text-slate-500 dark:text-slate-400", children: description }) : null
321
+ return /* @__PURE__ */ jsxs4(View6, { className: cn("mb-6 flex-row items-start justify-between", className), children: [
322
+ /* @__PURE__ */ jsxs4(View6, { className: "flex-1 pr-4", children: [
323
+ /* @__PURE__ */ jsx7(Text6, { className: "text-2xl font-bold tracking-tight text-slate-900 dark:text-slate-100 md:text-3xl", children: title }),
324
+ description ? /* @__PURE__ */ jsx7(Text6, { className: "mt-1 text-base text-slate-500 dark:text-slate-400", children: description }) : null
283
325
  ] }),
284
326
  action
285
327
  ] });
@@ -289,10 +331,10 @@ function EmptyState({
289
331
  description,
290
332
  action
291
333
  }) {
292
- return /* @__PURE__ */ jsxs3(View5, { className: "items-center rounded-2xl border border-dashed border-slate-200 bg-white px-6 py-16 dark:border-slate-700 dark:bg-slate-900", children: [
293
- /* @__PURE__ */ jsx6(Text5, { className: "text-lg font-semibold text-slate-900 dark:text-slate-100", children: title }),
294
- /* @__PURE__ */ jsx6(Text5, { className: "mt-2 max-w-sm text-center text-sm text-slate-500 dark:text-slate-400", children: description }),
295
- action ? /* @__PURE__ */ jsx6(View5, { className: "mt-6", children: action }) : null
334
+ return /* @__PURE__ */ jsxs4(View6, { className: "items-center rounded-2xl border border-dashed border-slate-200 bg-white px-6 py-16 dark:border-slate-700 dark:bg-slate-900", children: [
335
+ /* @__PURE__ */ jsx7(Text6, { className: "text-lg font-semibold text-slate-900 dark:text-slate-100", children: title }),
336
+ /* @__PURE__ */ jsx7(Text6, { className: "mt-2 max-w-sm text-center text-sm text-slate-500 dark:text-slate-400", children: description }),
337
+ action ? /* @__PURE__ */ jsx7(View6, { className: "mt-6", children: action }) : null
296
338
  ] });
297
339
  }
298
340
  var alertStyles = {
@@ -309,12 +351,68 @@ function AlertBanner({
309
351
  message,
310
352
  variant = "info"
311
353
  }) {
312
- return /* @__PURE__ */ jsx6(View5, { className: cn("mb-4 rounded-xl border px-4 py-3", alertStyles[variant]), children: /* @__PURE__ */ jsx6(Text5, { className: cn("text-sm font-medium", alertTextStyles[variant]), children: message }) });
354
+ return /* @__PURE__ */ jsx7(View6, { className: cn("mb-4 rounded-xl border px-4 py-3", alertStyles[variant]), children: /* @__PURE__ */ jsx7(Text6, { className: cn("text-sm font-medium", alertTextStyles[variant]), children: message }) });
355
+ }
356
+
357
+ // src/components/site-footer.tsx
358
+ import { Text as Text7, View as View7 } from "react-native";
359
+ import { jsx as jsx8, jsxs as jsxs5 } from "nativewind/jsx-runtime";
360
+ function SiteFooter({
361
+ links,
362
+ brand,
363
+ LinkComponent,
364
+ version,
365
+ discordHref
366
+ }) {
367
+ return /* @__PURE__ */ jsx8(View7, { className: "border-t border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-950", children: /* @__PURE__ */ jsxs5(View7, { className: "mx-auto w-full max-w-7xl px-4 py-12 sm:px-6 lg:px-8", children: [
368
+ /* @__PURE__ */ jsxs5(View7, { className: "grid grid-cols-2 gap-8 md:grid-cols-4", children: [
369
+ /* @__PURE__ */ jsxs5(View7, { className: "col-span-2 max-w-xs md:col-span-1", children: [
370
+ /* @__PURE__ */ jsx8(LinkComponent, { href: "/", className: "inline-flex", children: brand }),
371
+ /* @__PURE__ */ jsx8(Text7, { className: "mt-3 text-sm leading-relaxed text-slate-500 dark:text-slate-400", children: links.blurb }),
372
+ discordHref ? /* @__PURE__ */ jsx8(LinkComponent, { href: discordHref, target: "_blank", rel: "noopener noreferrer", className: "mt-4 inline-flex", children: /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: "Discord" }) }) : null
373
+ ] }),
374
+ /* @__PURE__ */ jsx8(FooterColumn, { title: "Product", links: links.product, LinkComponent }),
375
+ /* @__PURE__ */ jsx8(FooterColumn, { title: "Open Source", links: links.opensource, LinkComponent }),
376
+ /* @__PURE__ */ jsx8(FooterColumn, { title: "Docs", links: links.docs, LinkComponent })
377
+ ] }),
378
+ /* @__PURE__ */ jsxs5(View7, { className: "mt-10 flex-col items-center justify-between gap-4 border-t border-slate-200 pt-8 sm:flex-row dark:border-slate-800", children: [
379
+ /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: `Copyright \xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Limetry` }),
380
+ /* @__PURE__ */ jsxs5(View7, { className: "flex-row flex-wrap items-center gap-4", children: [
381
+ /* @__PURE__ */ jsx8(FooterLinkRow, { link: links.legal.privacy, LinkComponent }),
382
+ /* @__PURE__ */ jsx8(FooterLinkRow, { link: links.legal.terms, LinkComponent }),
383
+ version ? /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", accessibilityLabel: "App version", children: version.startsWith("v") ? version : `v${version}` }) : null
384
+ ] })
385
+ ] })
386
+ ] }) });
387
+ }
388
+ function FooterColumn({
389
+ title,
390
+ links,
391
+ LinkComponent
392
+ }) {
393
+ return /* @__PURE__ */ jsxs5(View7, { className: "min-w-32", children: [
394
+ /* @__PURE__ */ jsx8(Text7, { className: "text-sm font-semibold text-slate-900 dark:text-slate-100", children: title }),
395
+ /* @__PURE__ */ jsx8(View7, { className: "mt-4 gap-2", children: links.map((link) => /* @__PURE__ */ jsx8(FooterLinkRow, { link, LinkComponent }, `${link.label}-${link.href}`)) })
396
+ ] });
397
+ }
398
+ function FooterLinkRow({
399
+ link,
400
+ LinkComponent
401
+ }) {
402
+ return /* @__PURE__ */ jsx8(
403
+ LinkComponent,
404
+ {
405
+ href: link.href,
406
+ ...link.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
407
+ className: "inline-flex",
408
+ children: /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: link.label })
409
+ }
410
+ );
313
411
  }
314
412
 
315
413
  // src/components/stat-card.tsx
316
- import { Text as Text6, View as View6 } from "react-native";
317
- import { jsx as jsx7, jsxs as jsxs4 } from "nativewind/jsx-runtime";
414
+ import { Text as Text8, View as View8 } from "react-native";
415
+ import { jsx as jsx9, jsxs as jsxs6 } from "nativewind/jsx-runtime";
318
416
  var trendColors = {
319
417
  up: "text-emerald-500 dark:text-emerald-400",
320
418
  down: "text-red-500 dark:text-red-400",
@@ -328,20 +426,20 @@ function StatCard({
328
426
  icon,
329
427
  className
330
428
  }) {
331
- return /* @__PURE__ */ jsxs4(
332
- View6,
429
+ return /* @__PURE__ */ jsxs6(
430
+ View8,
333
431
  {
334
432
  className: cn(
335
433
  "rounded-2xl border border-slate-200 bg-white p-5 dark:border-slate-800 dark:bg-slate-900",
336
434
  className
337
435
  ),
338
436
  children: [
339
- /* @__PURE__ */ jsxs4(View6, { className: "mb-3 flex-row items-center justify-between", children: [
340
- /* @__PURE__ */ jsx7(Text6, { className: "text-sm font-medium text-slate-500 dark:text-slate-400", children: label }),
341
- icon ? /* @__PURE__ */ jsx7(View6, { className: "opacity-80", children: icon }) : null
437
+ /* @__PURE__ */ jsxs6(View8, { className: "mb-3 flex-row items-center justify-between", children: [
438
+ /* @__PURE__ */ jsx9(Text8, { className: "text-sm font-medium text-slate-500 dark:text-slate-400", children: label }),
439
+ icon ? /* @__PURE__ */ jsx9(View8, { className: "opacity-80", children: icon }) : null
342
440
  ] }),
343
- /* @__PURE__ */ jsx7(Text6, { className: "text-3xl font-bold tracking-tight text-slate-900 dark:text-slate-100", children: value }),
344
- change ? /* @__PURE__ */ jsx7(Text6, { className: cn("mt-2 text-xs font-medium", trendColors[trend]), children: change }) : null
441
+ /* @__PURE__ */ jsx9(Text8, { className: "text-3xl font-bold tracking-tight text-slate-900 dark:text-slate-100", children: value }),
442
+ change ? /* @__PURE__ */ jsx9(Text8, { className: cn("mt-2 text-xs font-medium", trendColors[trend]), children: change }) : null
345
443
  ]
346
444
  }
347
445
  );
@@ -425,10 +523,12 @@ export {
425
523
  HomeIcon,
426
524
  Input,
427
525
  KeyIcon,
526
+ Logo,
428
527
  MenuIcon,
429
528
  PageHeader,
430
529
  RulesIcon,
431
530
  ShieldIcon,
531
+ SiteFooter,
432
532
  StatCard,
433
533
  TerminalIcon,
434
534
  TextArea,
@@ -0,0 +1,12 @@
1
+ import { type ClassValue } from "clsx";
2
+ /**
3
+ * Merges conditional class names with Tailwind conflict resolution.
4
+ *
5
+ * Combines `clsx` for conditional lists and `tailwind-merge` so later utilities
6
+ * override earlier conflicting ones (for example `p-2` vs `p-4`).
7
+ *
8
+ * @param inputs - Class values accepted by `clsx` (strings, arrays, objects).
9
+ * @returns A single space-separated class string safe for NativeWind / Tailwind.
10
+ */
11
+ export declare function cn(...inputs: ClassValue[]): string;
12
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAO,MAAM,MAAM,CAAA;AAG3C;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAElD"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Canonical site footer link columns shared by Limetry web and API landings.
3
+ *
4
+ * OSS marketing pages (docs, community, blog, changelog, privacy, terms) always
5
+ * resolve to the OSS web origin. OpenAPI points at the caller's API surface.
6
+ */
7
+ /**
8
+ * One footer destination.
9
+ */
10
+ export type SiteFooterLink = {
11
+ href: string;
12
+ label: string;
13
+ /**
14
+ * When true, open in a new tab (third-party or cross-product origins).
15
+ */
16
+ external?: boolean;
17
+ };
18
+ /**
19
+ * Inputs for {@link buildSiteFooterLinks}.
20
+ */
21
+ export type BuildSiteFooterLinksInput = {
22
+ /**
23
+ * Authoritative OSS marketing origin (`https://limetry.org` or local `:3800`).
24
+ */
25
+ ossWebOrigin: string;
26
+ /**
27
+ * Cloud marketing origin for the Limetry Cloud product link.
28
+ */
29
+ cloudAppOrigin: string;
30
+ /**
31
+ * This surface's OpenAPI / Swagger UI href (may be same-origin `/openapi`).
32
+ */
33
+ openApiHref: string;
34
+ /**
35
+ * Public GitHub repository URL.
36
+ */
37
+ githubUrl: string;
38
+ /**
39
+ * When true, include the Limetry Cloud product link.
40
+ */
41
+ includeCloudLink?: boolean;
42
+ /**
43
+ * When true, OSS destinations use path-only hrefs (caller is the OSS site).
44
+ */
45
+ ossLinksRelative?: boolean;
46
+ };
47
+ /**
48
+ * Footer column groups plus legal bar destinations.
49
+ */
50
+ export type SiteFooterLinks = {
51
+ product: SiteFooterLink[];
52
+ opensource: SiteFooterLink[];
53
+ docs: SiteFooterLink[];
54
+ legal: {
55
+ privacy: SiteFooterLink;
56
+ terms: SiteFooterLink;
57
+ };
58
+ blurb: string;
59
+ };
60
+ /**
61
+ * Builds the shared Product / Open Source / Docs / legal footer destinations.
62
+ *
63
+ * @param input - Origins and OpenAPI target for the current frontend.
64
+ * @returns Column link lists and legal bar links.
65
+ */
66
+ export declare function buildSiteFooterLinks(input: BuildSiteFooterLinksInput): SiteFooterLinks;
67
+ //# sourceMappingURL=site-footer-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-footer-links.d.ts","sourceRoot":"","sources":["../../src/lib/site-footer-links.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,KAAK,EAAE;QACL,OAAO,EAAE,cAAc,CAAA;QACvB,KAAK,EAAE,cAAc,CAAA;KACtB,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AA0CD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,eAAe,CAiDtF"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Navigation item model and active-route helpers for drawer / tab chrome.
3
+ *
4
+ * Path matching strips Expo / Next route-group segments (for example `/(app)`)
5
+ * so highlight logic works against public pathnames.
6
+ */
7
+ /**
8
+ * A single navigable link, optionally nested under a section.
9
+ */
10
+ export type NavItem = {
11
+ /**
12
+ * Destination path (may include route-group segments that are normalized away).
13
+ */
14
+ href: string;
15
+ /**
16
+ * Human-readable label shown in drawers and tabs.
17
+ */
18
+ label: string;
19
+ /**
20
+ * Optional icon id consumed by drawer `renderIcon` callbacks.
21
+ */
22
+ icon?: string;
23
+ /**
24
+ * When true, the item is eligible for mobile bottom-tab presentation.
25
+ */
26
+ mobileTab?: boolean;
27
+ /**
28
+ * Nested items (for example Docs sections). Drawers render an expand/collapse group.
29
+ */
30
+ children?: NavItem[];
31
+ };
32
+ /**
33
+ * Strips Expo / Next route-group segments like `/(app)` from a path.
34
+ *
35
+ * @param pathname - Raw router pathname that may include parenthesized groups.
36
+ * @returns Normalized path beginning with `/`, or `"/"` when empty after stripping.
37
+ */
38
+ export declare function normalizePathname(pathname: string): string;
39
+ /**
40
+ * Returns true when pathname matches the item href or a nested child path.
41
+ *
42
+ * Root (`"/"`) matches only the exact root path. Other targets match equality
43
+ * or a prefix followed by `/`.
44
+ *
45
+ * @param pathname - Current location pathname.
46
+ * @param href - Nav item href to test.
47
+ * @returns Whether the pathname is active for that href.
48
+ */
49
+ export declare function isNavItemActive(pathname: string, href: string): boolean;
50
+ /**
51
+ * True when pathname matches this item or any descendant.
52
+ *
53
+ * @param pathname - Current location pathname.
54
+ * @param item - Nav item that may contain nested `children`.
55
+ * @returns Whether this item or a child is active for the pathname.
56
+ */
57
+ export declare function isNavItemOrChildActive(pathname: string, item: NavItem): boolean;
58
+ /**
59
+ * Returns the href of the single most specific nav item for pathname (longest match;
60
+ * deepest item wins ties). Used so only one drawer row gets active highlight.
61
+ *
62
+ * @param pathname - Current location pathname.
63
+ * @param items - Top-level nav tree to search.
64
+ * @returns Winning item `href`, or `null` when nothing matches.
65
+ */
66
+ export declare function findActiveNavHref(pathname: string, items: NavItem[]): string | null;
67
+ /**
68
+ * True when this specific NavItem is the single active highlighted leaf/target for pathname.
69
+ * If this item is a section/folder container and has an active child, it returns false so
70
+ * only the specific child page gets the active highlight.
71
+ *
72
+ * @param pathname - Current location pathname.
73
+ * @param item - Candidate nav item.
74
+ * @param activeHref - Result of {@link findActiveNavHref}, or `null` when none.
75
+ * @returns Whether this item alone should receive the active highlight styles.
76
+ */
77
+ export declare function isItemHighlighted(pathname: string, item: NavItem, activeHref: string | null): boolean;
78
+ /**
79
+ * True when this href is the single highlighted drawer item for pathname.
80
+ *
81
+ * @param pathname - Current location pathname.
82
+ * @param href - Href to compare against the winning active item.
83
+ * @param items - Top-level nav tree used to resolve the active href.
84
+ * @returns Whether `href` equals the single highlighted nav href.
85
+ */
86
+ export declare function isHighlightedNavItem(pathname: string, href: string, items: NavItem[]): boolean;
87
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;CACrB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOvE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAK/E;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,IAAI,CAiCnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,OAAO,CAeT;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAM9F"}
package/package.json CHANGED
@@ -1,40 +1,54 @@
1
1
  {
2
2
  "name": "@limetry/ui",
3
- "version": "1.2.87",
3
+ "version": "1.2.93",
4
4
  "description": "Shared design system for Limetry — components, icons, and design tokens.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "main": "./src/index.ts",
7
+ "main": "./dist/index.js",
8
8
  "react-native": "./src/index.ts",
9
- "types": "./src/index.ts",
9
+ "types": "./dist/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./dist/index.d.ts",
13
13
  "import": "./dist/index.js",
14
14
  "require": "./dist/index.cjs",
15
- "default": "./src/index.ts"
15
+ "default": "./dist/index.js"
16
16
  },
17
17
  "./drawer": {
18
- "types": "./src/components/drawer-menu.web.tsx",
18
+ "types": "./dist/components/drawer-menu.web.d.ts",
19
19
  "react-native": "./src/components/drawer-menu.tsx",
20
20
  "browser": "./src/components/drawer-menu.web.tsx",
21
21
  "import": "./src/components/drawer-menu.web.tsx",
22
22
  "default": "./src/components/drawer-menu.web.tsx"
23
23
  },
24
24
  "./site-header": {
25
- "types": "./src/components/site-header.web.tsx",
25
+ "types": "./dist/components/site-header.web.d.ts",
26
26
  "react-native": "./src/components/site-header.tsx",
27
27
  "browser": "./src/components/site-header.web.tsx",
28
28
  "import": "./src/components/site-header.web.tsx",
29
29
  "default": "./src/components/site-header.web.tsx"
30
30
  },
31
+ "./logo": {
32
+ "types": "./dist/components/logo.web.d.ts",
33
+ "react-native": "./src/components/logo.tsx",
34
+ "browser": "./src/components/logo.web.tsx",
35
+ "import": "./src/components/logo.web.tsx",
36
+ "default": "./src/components/logo.web.tsx"
37
+ },
38
+ "./site-footer": {
39
+ "types": "./dist/components/site-footer.web.d.ts",
40
+ "react-native": "./src/components/site-footer.tsx",
41
+ "browser": "./src/components/site-footer.web.tsx",
42
+ "import": "./src/components/site-footer.web.tsx",
43
+ "default": "./src/components/site-footer.web.tsx"
44
+ },
31
45
  "./site-footer-links": {
32
- "types": "./src/lib/site-footer-links.ts",
46
+ "types": "./dist/lib/site-footer-links.d.ts",
33
47
  "import": "./src/lib/site-footer-links.ts",
34
48
  "default": "./src/lib/site-footer-links.ts"
35
49
  },
36
50
  "./theme-toggle": {
37
- "types": "./src/components/theme-toggle.web.tsx",
51
+ "types": "./dist/components/theme-toggle.web.d.ts",
38
52
  "react-native": "./src/components/theme-toggle.tsx",
39
53
  "browser": "./src/components/theme-toggle.web.tsx",
40
54
  "import": "./src/components/theme-toggle.web.tsx",
@@ -49,7 +63,7 @@
49
63
  "tailwind.config.ts"
50
64
  ],
51
65
  "scripts": {
52
- "build": "tsup src/index.ts --format esm,cjs --dts --clean --out-dir dist",
66
+ "build": "tsup src/index.ts --format esm,cjs --clean --out-dir dist && yarn run -T tsgo -p tsconfig.build.json",
53
67
  "typecheck": "yarn run -T tsgo -p tsconfig.json --noEmit",
54
68
  "test": "vitest run"
55
69
  },
@@ -0,0 +1,59 @@
1
+ import { Image, type ImageSourcePropType, Text, View } from "react-native"
2
+
3
+ import type { LogoVariant } from "./logo.web"
4
+
5
+ export type { LogoVariant }
6
+
7
+ export type LogoProps = {
8
+ /** Native image source for the icon mark. */
9
+ iconSource?: ImageSourcePropType
10
+ /** Native image source for the full product logo. */
11
+ productSource?: ImageSourcePropType
12
+ /** Render only the icon mark. */
13
+ variant?: LogoVariant
14
+ /** NativeWind classes applied to the outer logo. */
15
+ className?: string
16
+ /** Accessible label for the mark. */
17
+ label?: string
18
+ }
19
+
20
+ /** Shared Limetry native logo. */
21
+ export function Logo({
22
+ iconSource,
23
+ productSource,
24
+ variant = "wordmark",
25
+ className,
26
+ label = "Limetry",
27
+ }: LogoProps): React.JSX.Element {
28
+ if (variant === "product" && productSource) {
29
+ return (
30
+ <Image
31
+ source={productSource}
32
+ accessibilityLabel={label}
33
+ resizeMode="contain"
34
+ className={className ?? "h-7 w-28"}
35
+ />
36
+ )
37
+ }
38
+
39
+ return (
40
+ <View
41
+ accessibilityLabel={label}
42
+ className={`flex-row items-center gap-2 ${variant === "mark" ? "h-8 w-8" : "h-8"} ${className ?? ""}`}
43
+ >
44
+ {iconSource ? (
45
+ <Image
46
+ source={iconSource}
47
+ accessibilityLabel={label}
48
+ resizeMode="contain"
49
+ className="h-8 w-8 shrink-0"
50
+ />
51
+ ) : null}
52
+ {variant === "wordmark" ? (
53
+ <Text className="font-sans text-[1.35rem] font-bold tracking-tight text-[#21b263]">
54
+ Limetry
55
+ </Text>
56
+ ) : null}
57
+ </View>
58
+ )
59
+ }
@@ -0,0 +1,61 @@
1
+ import type { JSX } from "react"
2
+
3
+ import { cn } from "../lib/cn"
4
+
5
+ export type LogoVariant = "wordmark" | "mark" | "product"
6
+
7
+ export type LogoProps = {
8
+ /** Public icon URL. */
9
+ iconSrc?: string
10
+ /** Optional full white product logo used by operator chrome. */
11
+ productSrc?: string
12
+ /** Render only the icon mark. */
13
+ variant?: LogoVariant
14
+ /** Tailwind classes applied to the outer logo. */
15
+ className?: string
16
+ /** Accessible label for the mark. */
17
+ label?: string
18
+ }
19
+
20
+ /** Shared Limetry web logo with a self-contained gradient wordmark. */
21
+ export function Logo({
22
+ iconSrc = "/limetry-icon.svg",
23
+ productSrc = "/limetry-logo-white.png",
24
+ variant = "wordmark",
25
+ className,
26
+ label = "Limetry",
27
+ }: LogoProps): JSX.Element {
28
+ if (variant === "product") {
29
+ return (
30
+ <img
31
+ src={productSrc}
32
+ alt={label}
33
+ className={cn("h-7 w-auto object-contain", className)}
34
+ />
35
+ )
36
+ }
37
+
38
+ return (
39
+ <span
40
+ className={cn(
41
+ "inline-flex items-center gap-2",
42
+ variant === "mark" ? "h-8 w-8" : "h-8",
43
+ className,
44
+ )}
45
+ role="img"
46
+ aria-label={label}
47
+ >
48
+ <img
49
+ src={iconSrc}
50
+ alt=""
51
+ aria-hidden="true"
52
+ className="h-8 w-8 shrink-0 object-contain"
53
+ />
54
+ {variant === "wordmark" ? (
55
+ <span className="bg-linear-to-r from-[#21b263] to-[#27A1D2] bg-clip-text font-sans text-[1.35rem] font-bold tracking-tight text-transparent">
56
+ Limetry
57
+ </span>
58
+ ) : null}
59
+ </span>
60
+ )
61
+ }
@@ -0,0 +1,92 @@
1
+ import { Text, View } from "react-native"
2
+
3
+ import type { SiteFooterLink, SiteFooterProps } from "./site-footer.types"
4
+
5
+ export type { SiteFooterLink, SiteFooterLinks, SiteFooterProps } from "./site-footer.types"
6
+
7
+ /** Shared NativeWind footer used by Expo web and native-compatible shells. */
8
+ export function SiteFooter({
9
+ links,
10
+ brand,
11
+ LinkComponent,
12
+ version,
13
+ discordHref,
14
+ }: SiteFooterProps): React.JSX.Element {
15
+ return (
16
+ <View className="border-t border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-950">
17
+ <View className="mx-auto w-full max-w-7xl px-4 py-12 sm:px-6 lg:px-8">
18
+ <View className="grid grid-cols-2 gap-8 md:grid-cols-4">
19
+ <View className="col-span-2 max-w-xs md:col-span-1">
20
+ <LinkComponent href="/" className="inline-flex">
21
+ {brand}
22
+ </LinkComponent>
23
+ <Text className="mt-3 text-sm leading-relaxed text-slate-500 dark:text-slate-400">
24
+ {links.blurb}
25
+ </Text>
26
+ {discordHref ? (
27
+ <LinkComponent href={discordHref} target="_blank" rel="noopener noreferrer" className="mt-4 inline-flex">
28
+ <Text className="text-sm text-slate-500 dark:text-slate-400">Discord</Text>
29
+ </LinkComponent>
30
+ ) : null}
31
+ </View>
32
+ <FooterColumn title="Product" links={links.product} LinkComponent={LinkComponent} />
33
+ <FooterColumn title="Open Source" links={links.opensource} LinkComponent={LinkComponent} />
34
+ <FooterColumn title="Docs" links={links.docs} LinkComponent={LinkComponent} />
35
+ </View>
36
+ <View className="mt-10 flex-col items-center justify-between gap-4 border-t border-slate-200 pt-8 sm:flex-row dark:border-slate-800">
37
+ <Text className="text-sm text-slate-500 dark:text-slate-400">
38
+ {`Copyright © ${new Date().getFullYear()} Limetry`}
39
+ </Text>
40
+ <View className="flex-row flex-wrap items-center gap-4">
41
+ <FooterLinkRow link={links.legal.privacy} LinkComponent={LinkComponent} />
42
+ <FooterLinkRow link={links.legal.terms} LinkComponent={LinkComponent} />
43
+ {version ? (
44
+ <Text className="text-sm text-slate-500 dark:text-slate-400" accessibilityLabel="App version">
45
+ {version.startsWith("v") ? version : `v${version}`}
46
+ </Text>
47
+ ) : null}
48
+ </View>
49
+ </View>
50
+ </View>
51
+ </View>
52
+ )
53
+ }
54
+
55
+ function FooterColumn({
56
+ title,
57
+ links,
58
+ LinkComponent,
59
+ }: {
60
+ title: string
61
+ links: SiteFooterLink[]
62
+ LinkComponent: SiteFooterProps["LinkComponent"]
63
+ }): React.JSX.Element {
64
+ return (
65
+ <View className="min-w-32">
66
+ <Text className="text-sm font-semibold text-slate-900 dark:text-slate-100">{title}</Text>
67
+ <View className="mt-4 gap-2">
68
+ {links.map((link) => (
69
+ <FooterLinkRow key={`${link.label}-${link.href}`} link={link} LinkComponent={LinkComponent} />
70
+ ))}
71
+ </View>
72
+ </View>
73
+ )
74
+ }
75
+
76
+ function FooterLinkRow({
77
+ link,
78
+ LinkComponent,
79
+ }: {
80
+ link: SiteFooterLink
81
+ LinkComponent: SiteFooterProps["LinkComponent"]
82
+ }): React.JSX.Element {
83
+ return (
84
+ <LinkComponent
85
+ href={link.href}
86
+ {...(link.external ? { target: "_blank", rel: "noopener noreferrer" } : {})}
87
+ className="inline-flex"
88
+ >
89
+ <Text className="text-sm text-slate-500 dark:text-slate-400">{link.label}</Text>
90
+ </LinkComponent>
91
+ )
92
+ }