@bze/bze-ui-kit 0.4.2 → 0.4.3

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.
package/README.md CHANGED
@@ -123,6 +123,18 @@ The library reads these `NEXT_PUBLIC_*` env vars at build time (inlined by Next.
123
123
  | `NEXT_PUBLIC_REST_URL_FLIX` | OmniFlix REST |
124
124
  | `NEXT_PUBLIC_REST_URL_ATOMONE` | AtomOne REST |
125
125
 
126
+ ### Ecosystem navigation
127
+
128
+ Override links and labels for the "Other" dropdown in the navbar, or exclude apps entirely. Useful for testnet deployments.
129
+
130
+ | Env var | Default | Description |
131
+ |---------|---------|-------------|
132
+ | `NEXT_PUBLIC_ECOSYSTEM_EXCLUDED` | _(empty)_ | Comma-separated keys to hide from the dropdown (e.g. `staking,factory`). Valid keys: `website`, `staking`, `dex`, `burner`, `factory` |
133
+ | `NEXT_PUBLIC_ECOSYSTEM_LINK_{KEY}` | _(per app)_ | Override the URL for an app. Key is uppercased (e.g. `NEXT_PUBLIC_ECOSYSTEM_LINK_WEBSITE=https://testnet.getbze.com`) |
134
+ | `NEXT_PUBLIC_ECOSYSTEM_LABEL_{KEY}` | _(per app)_ | Override the display label (e.g. `NEXT_PUBLIC_ECOSYSTEM_LABEL_DEX=TestDEX`) |
135
+
136
+ Call `getEcosystemApps()` to get the filtered and overridden list. Each app should exclude itself via `NEXT_PUBLIC_ECOSYSTEM_EXCLUDED`.
137
+
126
138
  ### AtomOne validator (dex-only)
127
139
 
128
140
  | Env var | Default | Description |
package/dist/index.d.mts CHANGED
@@ -484,10 +484,16 @@ interface EcosystemApp {
484
484
  href: string;
485
485
  disabled: boolean;
486
486
  icon: IconType;
487
+ /** Unique key used for env var overrides and exclusions (e.g. 'website', 'staking', 'dex') */
488
+ key: string;
487
489
  }
488
490
  /**
489
- * Returns the list of ecosystem apps excluding the current app.
490
- * Uses NEXT_PUBLIC_SITE_URL to determine which app we're running in.
491
+ * Returns the list of ecosystem apps with env var overrides applied and exclusions removed.
492
+ *
493
+ * Env vars:
494
+ * - NEXT_PUBLIC_ECOSYSTEM_LINK_{KEY} — override the href for an app (key uppercased, e.g. NEXT_PUBLIC_ECOSYSTEM_LINK_WEBSITE)
495
+ * - NEXT_PUBLIC_ECOSYSTEM_LABEL_{KEY} — override the label for an app (e.g. NEXT_PUBLIC_ECOSYSTEM_LABEL_DEX)
496
+ * - NEXT_PUBLIC_ECOSYSTEM_EXCLUDED — comma-separated keys to exclude (e.g. "staking,factory")
491
497
  */
492
498
  declare const getEcosystemApps: () => EcosystemApp[];
493
499
 
package/dist/index.d.ts CHANGED
@@ -484,10 +484,16 @@ interface EcosystemApp {
484
484
  href: string;
485
485
  disabled: boolean;
486
486
  icon: IconType;
487
+ /** Unique key used for env var overrides and exclusions (e.g. 'website', 'staking', 'dex') */
488
+ key: string;
487
489
  }
488
490
  /**
489
- * Returns the list of ecosystem apps excluding the current app.
490
- * Uses NEXT_PUBLIC_SITE_URL to determine which app we're running in.
491
+ * Returns the list of ecosystem apps with env var overrides applied and exclusions removed.
492
+ *
493
+ * Env vars:
494
+ * - NEXT_PUBLIC_ECOSYSTEM_LINK_{KEY} — override the href for an app (key uppercased, e.g. NEXT_PUBLIC_ECOSYSTEM_LINK_WEBSITE)
495
+ * - NEXT_PUBLIC_ECOSYSTEM_LABEL_{KEY} — override the label for an app (e.g. NEXT_PUBLIC_ECOSYSTEM_LABEL_DEX)
496
+ * - NEXT_PUBLIC_ECOSYSTEM_EXCLUDED — comma-separated keys to exclude (e.g. "staking,factory")
491
497
  */
492
498
  declare const getEcosystemApps: () => EcosystemApp[];
493
499
 
package/dist/index.js CHANGED
@@ -1683,19 +1683,34 @@ var EXCLUDED_MARKETS = {
1683
1683
  // src/constants/ecosystem.ts
1684
1684
  var import_lu = require("react-icons/lu");
1685
1685
  var ECOSYSTEM_MENU_LABEL = "Other";
1686
- var ALL_APPS = [
1687
- { name: "Website", href: "https://getbze.com", disabled: false, icon: import_lu.LuGlobe },
1688
- { name: "Staking", href: "https://staking.getbze.com", disabled: false, icon: import_lu.LuCoins },
1689
- { name: "DEX", href: "https://dex.getbze.com", disabled: false, icon: import_lu.LuChartColumn },
1690
- { name: "Burner", href: "https://burner.getbze.com", disabled: false, icon: import_lu.LuFlame },
1691
- { name: "Factory", href: "#", disabled: true, icon: import_lu.LuFactory }
1686
+ var DEFAULT_APPS = [
1687
+ { key: "website", name: "Website", href: "https://getbze.com", disabled: false, icon: import_lu.LuGlobe },
1688
+ { key: "staking", name: "Staking", href: "https://staking.getbze.com", disabled: false, icon: import_lu.LuCoins },
1689
+ { key: "dex", name: "DEX", href: "https://dex.getbze.com", disabled: false, icon: import_lu.LuChartColumn },
1690
+ { key: "burner", name: "Burner", href: "https://burner.getbze.com", disabled: false, icon: import_lu.LuFlame },
1691
+ { key: "factory", name: "Factory", href: "#", disabled: true, icon: import_lu.LuFactory }
1692
1692
  ];
1693
- var getEcosystemApps = () => {
1694
- const currentHost = process.env.NEXT_PUBLIC_SITE_URL || "";
1695
- if (!currentHost) {
1696
- return ALL_APPS;
1693
+ var getExcludedKeys = () => {
1694
+ const raw = process.env.NEXT_PUBLIC_ECOSYSTEM_EXCLUDED || "";
1695
+ if (!raw.trim()) {
1696
+ return /* @__PURE__ */ new Set();
1697
1697
  }
1698
- return ALL_APPS.filter((app) => app.href !== currentHost);
1698
+ return new Set(raw.split(",").map((k) => k.trim().toLowerCase()).filter(Boolean));
1699
+ };
1700
+ var getEcosystemApps = () => {
1701
+ const excluded = getExcludedKeys();
1702
+ return DEFAULT_APPS.filter((app) => !excluded.has(app.key)).map((app) => {
1703
+ const envKey = app.key.toUpperCase();
1704
+ const linkOverride = process.env[`NEXT_PUBLIC_ECOSYSTEM_LINK_${envKey}`];
1705
+ const labelOverride = process.env[`NEXT_PUBLIC_ECOSYSTEM_LABEL_${envKey}`];
1706
+ return {
1707
+ key: app.key,
1708
+ name: labelOverride || app.name,
1709
+ href: linkOverride || app.href,
1710
+ disabled: linkOverride ? false : app.disabled,
1711
+ icon: app.icon
1712
+ };
1713
+ });
1699
1714
  };
1700
1715
 
1701
1716
  // src/constants/keplr.ts