@medialane/ui 0.32.0 → 0.34.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.
Files changed (35) hide show
  1. package/dist/components/asset-collection-bar.cjs +135 -0
  2. package/dist/components/asset-collection-bar.cjs.map +1 -0
  3. package/dist/components/asset-collection-bar.d.cts +28 -0
  4. package/dist/components/asset-collection-bar.d.ts +28 -0
  5. package/dist/components/asset-collection-bar.js +101 -0
  6. package/dist/components/asset-collection-bar.js.map +1 -0
  7. package/dist/components/asset-marketplace-panel.cjs +284 -0
  8. package/dist/components/asset-marketplace-panel.cjs.map +1 -0
  9. package/dist/components/asset-marketplace-panel.d.cts +44 -0
  10. package/dist/components/asset-marketplace-panel.d.ts +44 -0
  11. package/dist/components/asset-marketplace-panel.js +270 -0
  12. package/dist/components/asset-marketplace-panel.js.map +1 -0
  13. package/dist/components/asset-top-sections.cjs +4 -9
  14. package/dist/components/asset-top-sections.cjs.map +1 -1
  15. package/dist/components/asset-top-sections.d.cts +1 -3
  16. package/dist/components/asset-top-sections.d.ts +1 -3
  17. package/dist/components/asset-top-sections.js +4 -9
  18. package/dist/components/asset-top-sections.js.map +1 -1
  19. package/dist/data/launchpad-services.cjs +3 -1
  20. package/dist/data/launchpad-services.cjs.map +1 -1
  21. package/dist/data/launchpad-services.js +3 -1
  22. package/dist/data/launchpad-services.js.map +1 -1
  23. package/dist/index.cjs +8 -0
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +4 -2
  26. package/dist/index.d.ts +4 -2
  27. package/dist/index.js +6 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/utils/format.cjs +17 -2
  30. package/dist/utils/format.cjs.map +1 -1
  31. package/dist/utils/format.d.cts +9 -1
  32. package/dist/utils/format.d.ts +9 -1
  33. package/dist/utils/format.js +15 -1
  34. package/dist/utils/format.js.map +1 -1
  35. package/package.json +2 -2
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var format_exports = {};
20
20
  __export(format_exports, {
21
- formatDisplayPrice: () => formatDisplayPrice
21
+ formatDisplayPrice: () => formatDisplayPrice,
22
+ parsePriceDisplay: () => parsePriceDisplay
22
23
  });
23
24
  module.exports = __toCommonJS(format_exports);
24
25
  function adaptiveDecimals(num) {
@@ -42,8 +43,22 @@ function formatDisplayPrice(price) {
42
43
  });
43
44
  return currencyPart ? `${formatted} ${currencyPart}` : formatted;
44
45
  }
46
+ function parsePriceDisplay(raw) {
47
+ if (!raw) return { numStr: "\u2014", symbol: null };
48
+ const parts = raw.trim().split(" ");
49
+ const sym = parts.length > 1 ? parts[parts.length - 1] : null;
50
+ const numericPart = sym ? parts.slice(0, -1).join(" ") : raw;
51
+ const num = Number(numericPart);
52
+ if (isNaN(num)) return { numStr: "\u2014", symbol: sym };
53
+ if (num > 1e12) return { numStr: "\u2014", symbol: null };
54
+ const formatted = formatDisplayPrice(numericPart);
55
+ if (!formatted || formatted === "\u2014") return { numStr: "\u2014", symbol: sym };
56
+ const clean = formatted.replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
57
+ return { numStr: clean || "\u2014", symbol: sym };
58
+ }
45
59
  // Annotate the CommonJS export names for ESM import in node:
46
60
  0 && (module.exports = {
47
- formatDisplayPrice
61
+ formatDisplayPrice,
62
+ parsePriceDisplay
48
63
  });
49
64
  //# sourceMappingURL=format.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,iBAAiB,KAAqB;AAC7C,MAAI,QAAQ,KAAK,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,eAAe,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;AAC1D,SAAO,eAAe;AACxB;AAMO,SAAS,mBAAmB,OAAmD;AACpF,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,QAAM,WAAW,OAAO,KAAK;AAC7B,QAAM,QAAQ,SAAS,MAAM,GAAG;AAChC,QAAM,cAAc,MAAM,CAAC;AAC3B,QAAM,eAAe,MAAM,SAAS,IAAI,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,IAAI;AACnE,QAAM,MAAM,OAAO,WAAW;AAC9B,MAAI,MAAM,GAAG,EAAG,QAAO;AACvB,QAAM,cAAc,iBAAiB,GAAG;AACxC,QAAM,YAAY,IAAI,eAAe,QAAW;AAAA,IAC9C,uBAAuB,KAAK,IAAI,GAAG,WAAW;AAAA,IAC9C,uBAAuB;AAAA,EACzB,CAAC;AACD,SAAO,eAAe,GAAG,SAAS,IAAI,YAAY,KAAK;AACzD;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n\n/**\n * Parse a backend price string like \"0.000012000000 WBTC\" into a clean display + symbol.\n * Strips trailing zeros (\"1.500000\" → \"1.50\"); guards against raw-wei values (> 1e12 → \"—\").\n */\nexport function parsePriceDisplay(raw: string | null | undefined): { numStr: string; symbol: string | null } {\n if (!raw) return { numStr: \"—\", symbol: null };\n const parts = raw.trim().split(\" \");\n const sym = parts.length > 1 ? parts[parts.length - 1] : null;\n const numericPart = sym ? parts.slice(0, -1).join(\" \") : raw;\n const num = Number(numericPart);\n if (isNaN(num)) return { numStr: \"—\", symbol: sym };\n if (num > 1e12) return { numStr: \"—\", symbol: null };\n const formatted = formatDisplayPrice(numericPart);\n if (!formatted || formatted === \"—\") return { numStr: \"—\", symbol: sym };\n const clean = formatted.replace(/(\\.\\d*?)0+$/, \"$1\").replace(/\\.$/, \"\");\n return { numStr: clean || \"—\", symbol: sym };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,iBAAiB,KAAqB;AAC7C,MAAI,QAAQ,KAAK,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,eAAe,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;AAC1D,S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,5 +3,13 @@
3
3
  * Handles "1.234 USDC" format — reformats the numeric part, preserves the symbol.
4
4
  */
5
5
  declare function formatDisplayPrice(price: string | number | null | undefined): string;
6
+ /**
7
+ * Parse a backend price string like "0.000012000000 WBTC" into a clean display + symbol.
8
+ * Strips trailing zeros ("1.500000" → "1.50"); guards against raw-wei values (> 1e12 → "—").
9
+ */
10
+ declare function parsePriceDisplay(raw: string | null | undefined): {
11
+ numStr: string;
12
+ symbol: string | null;
13
+ };
6
14
 
7
- export { formatDisplayPrice };
15
+ export { formatDisplayPrice, parsePriceDisplay };
@@ -3,5 +3,13 @@
3
3
  * Handles "1.234 USDC" format — reformats the numeric part, preserves the symbol.
4
4
  */
5
5
  declare function formatDisplayPrice(price: string | number | null | undefined): string;
6
+ /**
7
+ * Parse a backend price string like "0.000012000000 WBTC" into a clean display + symbol.
8
+ * Strips trailing zeros ("1.500000" → "1.50"); guards against raw-wei values (> 1e12 → "—").
9
+ */
10
+ declare function parsePriceDisplay(raw: string | null | undefined): {
11
+ numStr: string;
12
+ symbol: string | null;
13
+ };
6
14
 
7
- export { formatDisplayPrice };
15
+ export { formatDisplayPrice, parsePriceDisplay };
@@ -19,7 +19,21 @@ function formatDisplayPrice(price) {
19
19
  });
20
20
  return currencyPart ? `${formatted} ${currencyPart}` : formatted;
21
21
  }
22
+ function parsePriceDisplay(raw) {
23
+ if (!raw) return { numStr: "\u2014", symbol: null };
24
+ const parts = raw.trim().split(" ");
25
+ const sym = parts.length > 1 ? parts[parts.length - 1] : null;
26
+ const numericPart = sym ? parts.slice(0, -1).join(" ") : raw;
27
+ const num = Number(numericPart);
28
+ if (isNaN(num)) return { numStr: "\u2014", symbol: sym };
29
+ if (num > 1e12) return { numStr: "\u2014", symbol: null };
30
+ const formatted = formatDisplayPrice(numericPart);
31
+ if (!formatted || formatted === "\u2014") return { numStr: "\u2014", symbol: sym };
32
+ const clean = formatted.replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
33
+ return { numStr: clean || "\u2014", symbol: sym };
34
+ }
22
35
  export {
23
- formatDisplayPrice
36
+ formatDisplayPrice,
37
+ parsePriceDisplay
24
38
  };
25
39
  //# sourceMappingURL=format.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n"],"mappings":"AAAA,SAAS,iBAAiB,KAAqB;AAC7C,MAAI,QAAQ,KAAK,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,eAAe,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;AAC1D,SAAO,eAAe;AACxB;AAMO,SAAS,mBAAmB,OAAmD;AACpF,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,QAAM,WAAW,OAAO,KAAK;AAC7B,QAAM,QAAQ,SAAS,MAAM,GAAG;AAChC,QAAM,cAAc,MAAM,CAAC;AAC3B,QAAM,eAAe,MAAM,SAAS,IAAI,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,IAAI;AACnE,QAAM,MAAM,OAAO,WAAW;AAC9B,MAAI,MAAM,GAAG,EAAG,QAAO;AACvB,QAAM,cAAc,iBAAiB,GAAG;AACxC,QAAM,YAAY,IAAI,eAAe,QAAW;AAAA,IAC9C,uBAAuB,KAAK,IAAI,GAAG,WAAW;AAAA,IAC9C,uBAAuB;AAAA,EACzB,CAAC;AACD,SAAO,eAAe,GAAG,SAAS,IAAI,YAAY,KAAK;AACzD;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/format.ts"],"sourcesContent":["function adaptiveDecimals(num: number): number {\n if (num === 0 || num >= 1) return 2;\n if (num >= 0.01) return 4;\n const leadingZeros = Math.floor(-Math.log10(Math.abs(num)));\n return leadingZeros + 2;\n}\n\n/**\n * Format a display price string with adaptive decimal places.\n * Handles \"1.234 USDC\" format — reformats the numeric part, preserves the symbol.\n */\nexport function formatDisplayPrice(price: string | number | null | undefined): string {\n if (price === null || price === undefined) return \"\";\n const priceStr = String(price);\n const parts = priceStr.split(\" \");\n const numericPart = parts[0];\n const currencyPart = parts.length > 1 ? parts.slice(1).join(\" \") : \"\";\n const num = Number(numericPart);\n if (isNaN(num)) return priceStr;\n const maxDecimals = adaptiveDecimals(num);\n const formatted = num.toLocaleString(undefined, {\n minimumFractionDigits: Math.min(2, maxDecimals),\n maximumFractionDigits: maxDecimals,\n });\n return currencyPart ? `${formatted} ${currencyPart}` : formatted;\n}\n\n/**\n * Parse a backend price string like \"0.000012000000 WBTC\" into a clean display + symbol.\n * Strips trailing zeros (\"1.500000\" → \"1.50\"); guards against raw-wei values (> 1e12 → \"—\").\n */\nexport function parsePriceDisplay(raw: string | null | undefined): { numStr: string; symbol: string | null } {\n if (!raw) return { numStr: \"—\", symbol: null };\n const parts = raw.trim().split(\" \");\n const sym = parts.length > 1 ? parts[parts.length - 1] : null;\n const numericPart = sym ? parts.slice(0, -1).join(\" \") : raw;\n const num = Number(numericPart);\n if (isNaN(num)) return { numStr: \"—\", symbol: sym };\n if (num > 1e12) return { numStr: \"—\", symbol: null };\n const formatted = formatDisplayPrice(numericPart);\n if (!formatted || formatted === \"—\") return { numStr: \"—\", symbol: sym };\n const clean = formatted.replace(/(\\.\\d*?)0+$/, \"$1\").replace(/\\.$/, \"\");\n return { numStr: clean || \"—\", symbol: sym };\n}\n"],"mappings":"AAAA,SAAS,iBAAiB,KAAqB;AAC7C,MAAI,QAAQ,KAAK,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,eAAe,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;AAC1D,SAAO,eAAe;AACxB;AAMO,SAAS,mBAAmB,OAAmD;AACpF,MAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,QAAM,WAAW,OAAO,KAAK;AAC7B,QAAM,QAAQ,SAAS,MAAM,GAAG;AAChC,QAAM,cAAc,MAAM,CAAC;AAC3B,QAAM,eAAe,MAAM,SAAS,IAAI,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,IAAI;AACnE,QAAM,MAAM,OAAO,WAAW;AAC9B,MAAI,MAAM,GAAG,EAAG,QAAO;AACvB,QAAM,cAAc,iBAAiB,GAAG;AACxC,QAAM,YAAY,IAAI,eAAe,QAAW;AAAA,IAC9C,uBAAuB,KAAK,IAAI,GAAG,WAAW;AAAA,IAC9C,uBAAuB;AAAA,EACzB,CAAC;AACD,SAAO,eAAe,GAAG,SAAS,IAAI,YAAY,KAAK;AACzD;AAMO,SAAS,kBAAkB,KAA2E;AAC3G,MAAI,CAAC,IAAK,QAAO,EAAE,QAAQ,UAAK,QAAQ,KAAK;AAC7C,QAAM,QAAQ,IAAI,KAAK,EAAE,MAAM,GAAG;AAClC,QAAM,MAAM,MAAM,SAAS,IAAI,MAAM,MAAM,SAAS,CAAC,IAAI;AACzD,QAAM,cAAc,MAAM,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,IAAI;AACzD,QAAM,MAAM,OAAO,WAAW;AAC9B,MAAI,MAAM,GAAG,EAAG,QAAO,EAAE,QAAQ,UAAK,QAAQ,IAAI;AAClD,MAAI,MAAM,KAAM,QAAO,EAAE,QAAQ,UAAK,QAAQ,KAAK;AACnD,QAAM,YAAY,mBAAmB,WAAW;AAChD,MAAI,CAAC,aAAa,cAAc,SAAK,QAAO,EAAE,QAAQ,UAAK,QAAQ,IAAI;AACvE,QAAM,QAAQ,UAAU,QAAQ,eAAe,IAAI,EAAE,QAAQ,OAAO,EAAE;AACtE,SAAO,EAAE,QAAQ,SAAS,UAAK,QAAQ,IAAI;AAC7C;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -45,7 +45,7 @@
45
45
  "cmdk": ">=1.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@medialane/sdk": "^0.8.2",
48
+ "@medialane/sdk": "0.48.0",
49
49
  "@types/react": "^19.0.0",
50
50
  "@types/react-dom": "^19.0.0",
51
51
  "clsx": "^2.0.0",