@limetry/ui 1.2.87 → 1.2.94

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 (72) 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/contact-form.d.ts +13 -0
  8. package/dist/components/contact-form.d.ts.map +1 -0
  9. package/dist/components/contact-form.types.d.ts +27 -0
  10. package/dist/components/contact-form.types.d.ts.map +1 -0
  11. package/dist/components/contact-form.web.d.ts +14 -0
  12. package/dist/components/contact-form.web.d.ts.map +1 -0
  13. package/dist/components/drawer-menu.d.ts +20 -0
  14. package/dist/components/drawer-menu.d.ts.map +1 -0
  15. package/dist/components/drawer-menu.types.d.ts +100 -0
  16. package/dist/components/drawer-menu.types.d.ts.map +1 -0
  17. package/dist/components/drawer-menu.web.d.ts +20 -0
  18. package/dist/components/drawer-menu.web.d.ts.map +1 -0
  19. package/dist/components/icons.d.ts +81 -0
  20. package/dist/components/icons.d.ts.map +1 -0
  21. package/dist/components/icons.web.d.ts +81 -0
  22. package/dist/components/icons.web.d.ts.map +1 -0
  23. package/dist/components/input.d.ts +75 -0
  24. package/dist/components/input.d.ts.map +1 -0
  25. package/dist/components/logo.d.ts +18 -0
  26. package/dist/components/logo.d.ts.map +1 -0
  27. package/dist/components/logo.web.d.ts +17 -0
  28. package/dist/components/logo.web.d.ts.map +1 -0
  29. package/dist/components/page-header.d.ts +78 -0
  30. package/dist/components/page-header.d.ts.map +1 -0
  31. package/dist/components/site-footer.d.ts +5 -0
  32. package/dist/components/site-footer.d.ts.map +1 -0
  33. package/dist/components/site-footer.types.d.ts +23 -0
  34. package/dist/components/site-footer.types.d.ts.map +1 -0
  35. package/dist/components/site-footer.web.d.ts +7 -0
  36. package/dist/components/site-footer.web.d.ts.map +1 -0
  37. package/dist/components/site-header.d.ts +13 -0
  38. package/dist/components/site-header.d.ts.map +1 -0
  39. package/dist/components/site-header.types.d.ts +50 -0
  40. package/dist/components/site-header.types.d.ts.map +1 -0
  41. package/dist/components/site-header.web.d.ts +14 -0
  42. package/dist/components/site-header.web.d.ts.map +1 -0
  43. package/dist/components/stat-card.d.ts +42 -0
  44. package/dist/components/stat-card.d.ts.map +1 -0
  45. package/dist/components/theme-toggle.d.ts +12 -0
  46. package/dist/components/theme-toggle.d.ts.map +1 -0
  47. package/dist/components/theme-toggle.web.d.ts +24 -0
  48. package/dist/components/theme-toggle.web.d.ts.map +1 -0
  49. package/dist/index.cjs +134 -19
  50. package/dist/index.d.ts +20 -503
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +133 -20
  53. package/dist/lib/cn.d.ts +12 -0
  54. package/dist/lib/cn.d.ts.map +1 -0
  55. package/dist/lib/site-footer-links.d.ts +67 -0
  56. package/dist/lib/site-footer-links.d.ts.map +1 -0
  57. package/dist/navigation/types.d.ts +87 -0
  58. package/dist/navigation/types.d.ts.map +1 -0
  59. package/package.json +30 -9
  60. package/src/components/contact-form.tsx +131 -0
  61. package/src/components/contact-form.types.ts +28 -0
  62. package/src/components/contact-form.web.tsx +207 -0
  63. package/src/components/logo.tsx +59 -0
  64. package/src/components/logo.web.tsx +61 -0
  65. package/src/components/site-footer.tsx +107 -0
  66. package/src/components/site-footer.types.ts +25 -0
  67. package/src/components/site-footer.web.tsx +112 -0
  68. package/src/components/site-header.web.tsx +2 -2
  69. package/src/index.ts +2 -0
  70. package/src/lib/site-footer-links.test.ts +2 -1
  71. package/tailwind.config.ts +2 -2
  72. 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,81 @@ 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
+ contactHref,
366
+ discordHref
367
+ }) {
368
+ 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: [
369
+ /* @__PURE__ */ jsxs5(View7, { className: "grid grid-cols-2 gap-8 md:grid-cols-4", children: [
370
+ /* @__PURE__ */ jsxs5(View7, { className: "col-span-2 max-w-xs md:col-span-1", children: [
371
+ /* @__PURE__ */ jsx8(LinkComponent, { href: "/", className: "inline-flex", children: brand }),
372
+ /* @__PURE__ */ jsx8(Text7, { className: "mt-3 text-sm leading-relaxed text-slate-500 dark:text-slate-400", children: links.blurb }),
373
+ contactHref || discordHref ? /* @__PURE__ */ jsxs5(View7, { className: "mt-4 gap-2", children: [
374
+ contactHref ? /* @__PURE__ */ jsx8(LinkComponent, { href: contactHref, className: "inline-flex", children: /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: "Contact" }) }) : null,
375
+ discordHref ? /* @__PURE__ */ jsx8(
376
+ LinkComponent,
377
+ {
378
+ href: discordHref,
379
+ target: "_blank",
380
+ rel: "noopener noreferrer",
381
+ className: "inline-flex",
382
+ children: /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: "Discord" })
383
+ }
384
+ ) : null
385
+ ] }) : null
386
+ ] }),
387
+ /* @__PURE__ */ jsx8(FooterColumn, { title: "Product", links: links.product, LinkComponent }),
388
+ /* @__PURE__ */ jsx8(FooterColumn, { title: "Open Source", links: links.opensource, LinkComponent }),
389
+ /* @__PURE__ */ jsx8(FooterColumn, { title: "Docs", links: links.docs, LinkComponent })
390
+ ] }),
391
+ /* @__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: [
392
+ /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: `Copyright \xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Limetry` }),
393
+ /* @__PURE__ */ jsxs5(View7, { className: "flex-row flex-wrap items-center gap-4", children: [
394
+ /* @__PURE__ */ jsx8(FooterLinkRow, { link: links.legal.privacy, LinkComponent }),
395
+ /* @__PURE__ */ jsx8(FooterLinkRow, { link: links.legal.terms, LinkComponent }),
396
+ 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
397
+ ] })
398
+ ] })
399
+ ] }) });
400
+ }
401
+ function FooterColumn({
402
+ title,
403
+ links,
404
+ LinkComponent
405
+ }) {
406
+ return /* @__PURE__ */ jsxs5(View7, { className: "min-w-32", children: [
407
+ /* @__PURE__ */ jsx8(Text7, { className: "text-sm font-semibold text-slate-900 dark:text-slate-100", children: title }),
408
+ /* @__PURE__ */ jsx8(View7, { className: "mt-4 gap-2", children: links.map((link) => /* @__PURE__ */ jsx8(FooterLinkRow, { link, LinkComponent }, `${link.label}-${link.href}`)) })
409
+ ] });
410
+ }
411
+ function FooterLinkRow({
412
+ link,
413
+ LinkComponent
414
+ }) {
415
+ return /* @__PURE__ */ jsx8(
416
+ LinkComponent,
417
+ {
418
+ href: link.href,
419
+ ...link.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
420
+ className: "inline-flex",
421
+ children: /* @__PURE__ */ jsx8(Text7, { className: "text-sm text-slate-500 dark:text-slate-400", children: link.label })
422
+ }
423
+ );
313
424
  }
314
425
 
315
426
  // 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";
427
+ import { Text as Text8, View as View8 } from "react-native";
428
+ import { jsx as jsx9, jsxs as jsxs6 } from "nativewind/jsx-runtime";
318
429
  var trendColors = {
319
430
  up: "text-emerald-500 dark:text-emerald-400",
320
431
  down: "text-red-500 dark:text-red-400",
@@ -328,20 +439,20 @@ function StatCard({
328
439
  icon,
329
440
  className
330
441
  }) {
331
- return /* @__PURE__ */ jsxs4(
332
- View6,
442
+ return /* @__PURE__ */ jsxs6(
443
+ View8,
333
444
  {
334
445
  className: cn(
335
446
  "rounded-2xl border border-slate-200 bg-white p-5 dark:border-slate-800 dark:bg-slate-900",
336
447
  className
337
448
  ),
338
449
  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
450
+ /* @__PURE__ */ jsxs6(View8, { className: "mb-3 flex-row items-center justify-between", children: [
451
+ /* @__PURE__ */ jsx9(Text8, { className: "text-sm font-medium text-slate-500 dark:text-slate-400", children: label }),
452
+ icon ? /* @__PURE__ */ jsx9(View8, { className: "opacity-80", children: icon }) : null
342
453
  ] }),
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
454
+ /* @__PURE__ */ jsx9(Text8, { className: "text-3xl font-bold tracking-tight text-slate-900 dark:text-slate-100", children: value }),
455
+ change ? /* @__PURE__ */ jsx9(Text8, { className: cn("mt-2 text-xs font-medium", trendColors[trend]), children: change }) : null
345
456
  ]
346
457
  }
347
458
  );
@@ -425,10 +536,12 @@ export {
425
536
  HomeIcon,
426
537
  Input,
427
538
  KeyIcon,
539
+ Logo,
428
540
  MenuIcon,
429
541
  PageHeader,
430
542
  RulesIcon,
431
543
  ShieldIcon,
544
+ SiteFooter,
432
545
  StatCard,
433
546
  TerminalIcon,
434
547
  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,CAgDtF"}
@@ -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,61 @@
1
1
  {
2
2
  "name": "@limetry/ui",
3
- "version": "1.2.87",
3
+ "version": "1.2.94",
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
  },
50
+ "./contact-form": {
51
+ "types": "./dist/components/contact-form.web.d.ts",
52
+ "react-native": "./src/components/contact-form.tsx",
53
+ "browser": "./src/components/contact-form.web.tsx",
54
+ "import": "./src/components/contact-form.web.tsx",
55
+ "default": "./src/components/contact-form.web.tsx"
56
+ },
36
57
  "./theme-toggle": {
37
- "types": "./src/components/theme-toggle.web.tsx",
58
+ "types": "./dist/components/theme-toggle.web.d.ts",
38
59
  "react-native": "./src/components/theme-toggle.tsx",
39
60
  "browser": "./src/components/theme-toggle.web.tsx",
40
61
  "import": "./src/components/theme-toggle.web.tsx",
@@ -49,7 +70,7 @@
49
70
  "tailwind.config.ts"
50
71
  ],
51
72
  "scripts": {
52
- "build": "tsup src/index.ts --format esm,cjs --dts --clean --out-dir dist",
73
+ "build": "tsup src/index.ts --format esm,cjs --clean --out-dir dist && yarn run -T tsgo -p tsconfig.build.json",
53
74
  "typecheck": "yarn run -T tsgo -p tsconfig.json --noEmit",
54
75
  "test": "vitest run"
55
76
  },
@@ -0,0 +1,131 @@
1
+ /**
2
+ * NativeWind contact form for Expo / React Native hosts.
3
+ */
4
+
5
+ import { useState, type JSX } from "react"
6
+ import { Text, View } from "react-native"
7
+
8
+ import { Button } from "./button"
9
+ import type { ContactFormProps } from "./contact-form.types"
10
+ import { Input, TextArea } from "./input"
11
+
12
+ export type { ContactFormFields, ContactFormProps } from "./contact-form.types"
13
+
14
+ type SubmitState = "idle" | "submitting" | "success" | "error"
15
+
16
+ /**
17
+ * Interactive contact form backed by a host-provided submit handler.
18
+ *
19
+ * @param props - Layout options and {@link ContactFormProps.onSubmit}.
20
+ */
21
+ export function ContactForm({
22
+ className,
23
+ source = "contact-page",
24
+ compact = false,
25
+ onSubmit,
26
+ }: ContactFormProps): JSX.Element {
27
+ const [name, setName] = useState("")
28
+ const [email, setEmail] = useState("")
29
+ const [company, setCompany] = useState("")
30
+ const [message, setMessage] = useState("")
31
+ const [state, setState] = useState<SubmitState>("idle")
32
+ const [errorMessage, setErrorMessage] = useState<string | null>(null)
33
+
34
+ async function handleSubmit(): Promise<void> {
35
+ setState("submitting")
36
+ setErrorMessage(null)
37
+ try {
38
+ await onSubmit({
39
+ name,
40
+ email,
41
+ company: company.trim() || undefined,
42
+ message,
43
+ source,
44
+ })
45
+ setName("")
46
+ setEmail("")
47
+ setCompany("")
48
+ setMessage("")
49
+ setState("success")
50
+ } catch (error) {
51
+ setState("error")
52
+ setErrorMessage(
53
+ error instanceof Error ? error.message : "Could not send your message",
54
+ )
55
+ }
56
+ }
57
+
58
+ if (state === "success") {
59
+ return (
60
+ <View className={className} accessibilityRole="text">
61
+ <Text className="rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm font-medium text-slate-900 dark:text-slate-100">
62
+ Message sent. We will get back to you soon.
63
+ </Text>
64
+ </View>
65
+ )
66
+ }
67
+
68
+ return (
69
+ <View className={className}>
70
+ <View className={compact ? "gap-4 md:flex-row md:flex-wrap" : "gap-4"}>
71
+ <View className={compact ? "md:w-[calc(50%-0.5rem)]" : undefined}>
72
+ <Input
73
+ label="Name"
74
+ value={name}
75
+ onChangeText={setName}
76
+ placeholder="Your name"
77
+ autoComplete="off"
78
+ />
79
+ </View>
80
+ <View className={compact ? "md:w-[calc(50%-0.5rem)]" : undefined}>
81
+ <Input
82
+ label="Email"
83
+ value={email}
84
+ onChangeText={setEmail}
85
+ placeholder="you@company.com"
86
+ keyboardType="email-address"
87
+ autoCapitalize="none"
88
+ autoComplete="off"
89
+ />
90
+ </View>
91
+ {!compact ? (
92
+ <Input
93
+ label="Company (optional)"
94
+ value={company}
95
+ onChangeText={setCompany}
96
+ placeholder="Organization"
97
+ autoComplete="off"
98
+ />
99
+ ) : null}
100
+ <TextArea
101
+ label="Message"
102
+ value={message}
103
+ onChangeText={setMessage}
104
+ placeholder={
105
+ compact ? "How can we help?" : "Tell us about your agents or workspace."
106
+ }
107
+ rows={compact ? 3 : 5}
108
+ />
109
+ {errorMessage ? (
110
+ <Text
111
+ className="rounded-lg border border-red-500/25 bg-red-500/10 px-3 py-2 text-sm font-medium text-red-700 dark:text-red-400"
112
+ accessibilityRole="alert"
113
+ >
114
+ {errorMessage}
115
+ </Text>
116
+ ) : null}
117
+ <View className="w-full items-start">
118
+ <Button
119
+ size="lg"
120
+ disabled={state === "submitting"}
121
+ onPress={() => {
122
+ void handleSubmit()
123
+ }}
124
+ >
125
+ {state === "submitting" ? "Sending…" : "Send message"}
126
+ </Button>
127
+ </View>
128
+ </View>
129
+ </View>
130
+ )
131
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Shared contact-form props for DOM and NativeWind implementations.
3
+ */
4
+
5
+ export type ContactFormFields = {
6
+ name: string
7
+ email: string
8
+ company?: string
9
+ message: string
10
+ source: string
11
+ }
12
+
13
+ export type ContactFormProps = {
14
+ className?: string
15
+ idPrefix?: string
16
+ /**
17
+ * Analytics / attribution source stamped onto the submission payload.
18
+ */
19
+ source?: string
20
+ /**
21
+ * Compact layout for footer strips (two-column name/email, shorter message).
22
+ */
23
+ compact?: boolean
24
+ /**
25
+ * Host-provided submit handler (posts to that site's contact API).
26
+ */
27
+ onSubmit: (fields: ContactFormFields) => Promise<void>
28
+ }