docthub-core-components 2.93.0 → 2.95.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.
@@ -64,10 +64,10 @@ export declare function getFooterRoutes(): FooterRoutes;
64
64
  * @deprecated Use {@link getFooterRoutes} instead.
65
65
  *
66
66
  * Module-level constant — evaluated once at import time. In SSR contexts
67
- * (Next.js server components) `window` is unavailable, so `resolveNavEnv()`
68
- * falls back to `import.meta.env.PROD`. Because both QA and PROD sites are
69
- * built with `vite build`, that flag is always `true`, causing QA sites to
70
- * receive production URLs. Use `getFooterRoutes()` inside the component render
71
- * to guarantee hostname-based resolution runs in the browser.
67
+ * (Next.js SSR) `window` is unavailable. Without `NEXT_PUBLIC_NAV_ENV` or
68
+ * `NEXT_PUBLIC_BASE_URL` (hostname *.in / *.com), `resolveNavEnv()` falls back
69
+ * to `import.meta.env.PROD` / `NODE_ENV === "production"`, which can point QA
70
+ * builds at production URLs. Prefer `getFooterRoutes()` at render time and set
71
+ * those env vars for correct SSR on QA.
72
72
  */
73
73
  export declare const FOOTER_ROUTES: FooterRoutes;
@@ -3,13 +3,12 @@
3
3
  * Used by both individual and organization nav menus.
4
4
  *
5
5
  * Resolution order:
6
- * 1. VITE_NAV_ENVexplicit override (qa | production | prod | dev)
7
- * 2. window.location.hostname — localhost → QA; *.com → prod; *.in → QA
8
- * (Hostname takes precedence over build flags to ensure correct routing
9
- * when a QA site like dochub.in is deployed as a production build.)
10
- * 3. import.meta.env.PROD Vite prod build → prod (SSR fallback only)
11
- * 4. process.env.NODE_ENV — Node/Next.js SSR fallback "production" means prod
12
- * 5. Default → QA
6
+ * 1. Explicit override `VITE_NAV_ENV` (Vite) or `NEXT_PUBLIC_NAV_ENV` (Next.js)
7
+ * 2. `window.location.hostname` — localhost → QA; *.com → prod; *.in → QA
8
+ * 3. SSR only parse `NEXT_PUBLIC_BASE_URL` hostname (Next.js) when `window` is unavailable
9
+ * 4. `import.meta.env.PROD` Vite prod build (SSR fallback)
10
+ * 5. `process.env.NODE_ENV === "production"` Node/Next SSR fallback
11
+ * 6. DefaultQA
13
12
  */
14
13
  export declare function resolveNavEnv(): "qa" | "production";
15
14
  /** True when nav links should point to production (docthub.com). */
@@ -7,5 +7,7 @@ export interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
7
7
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
8
  query?: string;
9
9
  disabled?: boolean;
10
+ /** When true, shows a clear (×) control when the field has text. Calls `onChange` with an empty value. */
11
+ allowClear?: boolean;
10
12
  }
11
13
  export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -3,3 +3,11 @@
3
3
  interface ImportMetaEnv {
4
4
  readonly VITE_NAV_ENV?: "qa" | "dev" | "production" | "prod";
5
5
  }
6
+
7
+ /** Used when this package is consumed from Next.js (SSR resolves `process.env`). */
8
+ declare namespace NodeJS {
9
+ interface ProcessEnv {
10
+ readonly NEXT_PUBLIC_NAV_ENV?: "qa" | "dev" | "production" | "prod";
11
+ readonly NEXT_PUBLIC_BASE_URL?: string;
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docthub-core-components",
3
- "version": "2.93.0",
3
+ "version": "2.95.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",