@medialane/ui 0.232.0 → 0.234.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 (59) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/badge.d.cts +1 -1
  4. package/dist/components/badge.d.ts +1 -1
  5. package/dist/components/button.d.cts +2 -2
  6. package/dist/components/button.d.ts +2 -2
  7. package/dist/components/claim-route-shell.cjs +35 -0
  8. package/dist/components/claim-route-shell.cjs.map +1 -0
  9. package/dist/components/claim-route-shell.d.cts +7 -0
  10. package/dist/components/claim-route-shell.d.ts +7 -0
  11. package/dist/components/claim-route-shell.js +11 -0
  12. package/dist/components/claim-route-shell.js.map +1 -0
  13. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  14. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  15. package/dist/components/launchpad/collection-create-form.cjs +302 -0
  16. package/dist/components/launchpad/collection-create-form.cjs.map +1 -0
  17. package/dist/components/launchpad/collection-create-form.d.cts +11 -0
  18. package/dist/components/launchpad/collection-create-form.d.ts +11 -0
  19. package/dist/components/launchpad/collection-create-form.js +275 -0
  20. package/dist/components/launchpad/collection-create-form.js.map +1 -0
  21. package/dist/components/launchpad/collection-create-presets.cjs +147 -0
  22. package/dist/components/launchpad/collection-create-presets.cjs.map +1 -0
  23. package/dist/components/launchpad/collection-create-presets.d.cts +60 -0
  24. package/dist/components/launchpad/collection-create-presets.d.ts +60 -0
  25. package/dist/components/launchpad/collection-create-presets.js +120 -0
  26. package/dist/components/launchpad/collection-create-presets.js.map +1 -0
  27. package/dist/components/rewards/reward-earned.cjs +38 -34
  28. package/dist/components/rewards/reward-earned.cjs.map +1 -1
  29. package/dist/components/rewards/reward-earned.d.cts +2 -3
  30. package/dist/components/rewards/reward-earned.d.ts +2 -3
  31. package/dist/components/rewards/reward-earned.js +37 -33
  32. package/dist/components/rewards/reward-earned.js.map +1 -1
  33. package/dist/components/sheet.d.cts +1 -1
  34. package/dist/components/sheet.d.ts +1 -1
  35. package/dist/components/wallet-required.cjs +62 -0
  36. package/dist/components/wallet-required.cjs.map +1 -0
  37. package/dist/components/wallet-required.d.cts +13 -0
  38. package/dist/components/wallet-required.d.ts +13 -0
  39. package/dist/components/wallet-required.js +38 -0
  40. package/dist/components/wallet-required.js.map +1 -0
  41. package/dist/index.cjs +26 -2
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +7 -1
  44. package/dist/index.d.ts +7 -1
  45. package/dist/index.js +17 -2
  46. package/dist/index.js.map +1 -1
  47. package/dist/utils/portfolio-cache.cjs +34 -0
  48. package/dist/utils/portfolio-cache.cjs.map +1 -0
  49. package/dist/utils/portfolio-cache.d.cts +3 -0
  50. package/dist/utils/portfolio-cache.d.ts +3 -0
  51. package/dist/utils/portfolio-cache.js +10 -0
  52. package/dist/utils/portfolio-cache.js.map +1 -0
  53. package/dist/utils/use-launchpad-image-upload.cjs +103 -0
  54. package/dist/utils/use-launchpad-image-upload.cjs.map +1 -0
  55. package/dist/utils/use-launchpad-image-upload.d.cts +21 -0
  56. package/dist/utils/use-launchpad-image-upload.d.ts +21 -0
  57. package/dist/utils/use-launchpad-image-upload.js +79 -0
  58. package/dist/utils/use-launchpad-image-upload.js.map +1 -0
  59. package/package.json +3 -1
@@ -0,0 +1,120 @@
1
+ import { Layers, Ticket, Users } from "lucide-react";
2
+ const FREE = "Free to publish \u2014 protocol fee is zero.";
3
+ const CLUB_PRESET = {
4
+ service: "ip-club",
5
+ icon: Users,
6
+ iconClass: "text-brand-purple",
7
+ buttonClass: "bg-brand-purple",
8
+ signedOut: { title: "Secure your account to create a club", description: "Create a club, then mint membership cards for your community." },
9
+ shell: { title: "Create Club", subtitle: "One club \u2014 create membership tiers and mint cards to your community." },
10
+ dialog: { title: "Create club", workingLabel: "Creating your club\u2026", firstStepLabel: "Prepare metadata" },
11
+ success: { caption: "Your club is live", fallbackName: "Your club", reward: "create_club", againLabel: "Create another" },
12
+ cardFallbackSymbol: "Club",
13
+ copy: {
14
+ imageHeading: "Club image",
15
+ nameLabel: "Club name *",
16
+ namePlaceholder: "My Club",
17
+ nameHint: "Shown in wallets, explorers, and on every membership card.",
18
+ symbolPlaceholder: "CLUB",
19
+ symbolHint: "Short ticker \u2014 2 to 10 uppercase letters.",
20
+ descriptionPlaceholder: "Describe your club \u2014 what does membership unlock?",
21
+ submit: "Create Club",
22
+ footnotes: [FREE]
23
+ },
24
+ suggestSymbol: false,
25
+ registerAfterDeploy: false,
26
+ actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: "Create memberships" } : void 0 })
27
+ };
28
+ const TICKETS_PRESET = {
29
+ service: "ip-tickets",
30
+ icon: Ticket,
31
+ iconClass: "text-teal-500",
32
+ buttonClass: "bg-teal-600",
33
+ signedOut: { title: "Secure your account to create tickets", description: "Create a tickets collection, then mint tickets to your audience." },
34
+ shell: { title: "Create Ticket Collection", subtitle: "One collection \u2014 create tickets and mint them to your audience." },
35
+ dialog: { title: "Create tickets collection", workingLabel: "Creating your collection\u2026", firstStepLabel: "Prepare metadata" },
36
+ success: { caption: "Your collection is live", fallbackName: "Your collection", reward: "create_ticket_collection", againLabel: "Create another" },
37
+ cardFallbackSymbol: "Tickets",
38
+ copy: {
39
+ imageHeading: "Collection image",
40
+ nameLabel: "Collection name *",
41
+ namePlaceholder: "My Tickets",
42
+ nameHint: "Shown in wallets, explorers, and on every ticket.",
43
+ symbolPlaceholder: "TIX",
44
+ symbolHint: "Short ticker \u2014 2 to 10 uppercase letters.",
45
+ descriptionPlaceholder: "Describe your tickets \u2014 what do they admit or unlock?",
46
+ submit: "Create Ticket Collection",
47
+ footnotes: [FREE]
48
+ },
49
+ suggestSymbol: false,
50
+ registerAfterDeploy: false,
51
+ actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: "Create tickets" } : void 0 })
52
+ };
53
+ const EDITIONS_PRESET = {
54
+ service: "mip-erc1155",
55
+ icon: Layers,
56
+ iconClass: "text-brand-purple",
57
+ buttonClass: "bg-brand-purple",
58
+ signedOut: { title: "Secure your account to create a collection", description: "Create a collection where each piece can have multiple editions." },
59
+ shell: { title: "Create an Edition Collection", subtitle: "Create a collection where each piece can have multiple editions \u2014 free to publish, and it's yours." },
60
+ dialog: { title: "Create collection", workingLabel: "Creating your collection\u2026", firstStepLabel: "Prepare metadata" },
61
+ success: { caption: "Your collection is live", fallbackName: "Your collection", reward: "create_collection", againLabel: "Create another" },
62
+ cardFallbackSymbol: "Editions",
63
+ copy: {
64
+ imageHeading: "Collection image",
65
+ imageHelp: "This becomes the cover for your collection.",
66
+ nameLabel: "Collection name *",
67
+ namePlaceholder: "My Creative Works",
68
+ nameHint: "The main title collectors see across the collection page, wallets, and future listings.",
69
+ symbolPlaceholder: "MCW",
70
+ symbolHint: "Short ticker (2\u201310 uppercase letters). We suggest one from the collection name.",
71
+ descriptionPlaceholder: "Describe your collection and what kind of work it contains\u2026",
72
+ descriptionHint: "Use this to explain the creative direction, media type, or audience for the collection.",
73
+ submit: "Publish Collection",
74
+ footnotes: [
75
+ FREE,
76
+ "Next step: mint pieces into this collection \u2014 you set the number of copies for each piece when you mint it, and can add more copies later."
77
+ ]
78
+ },
79
+ suggestSymbol: true,
80
+ registerAfterDeploy: true,
81
+ actions: ({ address, collectionHref }) => ({
82
+ primary: address ? { href: `/launchpad/nfteditions/${address}/mint`, label: "Mint tokens" } : void 0,
83
+ secondary: collectionHref ? { href: collectionHref, label: "View collection" } : void 0
84
+ })
85
+ };
86
+ const SINGLE_PRESET = {
87
+ service: null,
88
+ icon: Layers,
89
+ iconClass: "text-brand-blue",
90
+ buttonClass: "bg-brand-blue",
91
+ signedOut: { title: "Secure your account to create a collection", description: "Set up a collection to mint your work into." },
92
+ shell: { title: "Create a Collection", subtitle: "Set up a collection to mint your work into \u2014 free to publish, and it's yours." },
93
+ dialog: { title: "Create collection", workingLabel: "Creating your collection\u2026", firstStepLabel: "Prepare metadata" },
94
+ success: { caption: "Your collection is live", fallbackName: "Your collection", reward: "create_collection", againLabel: "Create another" },
95
+ cardFallbackSymbol: "Collection",
96
+ copy: {
97
+ imageHeading: "Collection image",
98
+ nameLabel: "Collection name *",
99
+ namePlaceholder: "My Creative Works",
100
+ nameHint: "The display name for your collection.",
101
+ symbolPlaceholder: "MCW",
102
+ symbolHint: "Short ticker (2\u201310 uppercase letters). Shown in wallets and marketplaces.",
103
+ descriptionPlaceholder: "Describe your collection and what kind of work it contains\u2026",
104
+ submit: "Create collection",
105
+ footnotes: [FREE]
106
+ },
107
+ suggestSymbol: false,
108
+ registerAfterDeploy: false,
109
+ actions: ({ collectionHref }) => ({
110
+ primary: { href: "/launchpad/single-editions", label: "Mint an asset" },
111
+ secondary: collectionHref ? { href: collectionHref, label: "View collection" } : void 0
112
+ })
113
+ };
114
+ export {
115
+ CLUB_PRESET,
116
+ EDITIONS_PRESET,
117
+ SINGLE_PRESET,
118
+ TICKETS_PRESET
119
+ };
120
+ //# sourceMappingURL=collection-create-presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/launchpad/collection-create-presets.ts"],"sourcesContent":["import { Layers, Ticket, Users } from \"lucide-react\";\nimport type { ElementType } from \"react\";\n\nexport interface CollectionCreateAction {\n href: string;\n label: string;\n}\n\nexport interface CollectionCreatePreset {\n service: \"ip-club\" | \"ip-tickets\" | \"mip-erc1155\" | null;\n icon: ElementType;\n iconClass: string;\n buttonClass: string;\n signedOut: { title: string; description: string };\n shell: { title: string; subtitle: string };\n dialog: { title: string; workingLabel: string; firstStepLabel: string };\n success: { caption: string; fallbackName: string; reward: string; againLabel: string };\n cardFallbackSymbol: string;\n copy: {\n imageHeading: string;\n imageHelp?: string;\n nameLabel: string;\n namePlaceholder: string;\n nameHint: string;\n symbolPlaceholder: string;\n symbolHint: string;\n descriptionPlaceholder: string;\n descriptionHint?: string;\n submit: string;\n footnotes: string[];\n };\n suggestSymbol: boolean;\n registerAfterDeploy: boolean;\n actions: (found: { address: string | null; collectionHref: string | null }) => {\n primary?: CollectionCreateAction;\n secondary?: CollectionCreateAction;\n };\n}\n\nconst FREE = \"Free to publish — protocol fee is zero.\";\n\nexport const CLUB_PRESET: CollectionCreatePreset = {\n service: \"ip-club\",\n icon: Users,\n iconClass: \"text-brand-purple\",\n buttonClass: \"bg-brand-purple\",\n signedOut: { title: \"Secure your account to create a club\", description: \"Create a club, then mint membership cards for your community.\" },\n shell: { title: \"Create Club\", subtitle: \"One club — create membership tiers and mint cards to your community.\" },\n dialog: { title: \"Create club\", workingLabel: \"Creating your club…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your club is live\", fallbackName: \"Your club\", reward: \"create_club\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Club\",\n copy: {\n imageHeading: \"Club image\",\n nameLabel: \"Club name *\",\n namePlaceholder: \"My Club\",\n nameHint: \"Shown in wallets, explorers, and on every membership card.\",\n symbolPlaceholder: \"CLUB\",\n symbolHint: \"Short ticker — 2 to 10 uppercase letters.\",\n descriptionPlaceholder: \"Describe your club — what does membership unlock?\",\n submit: \"Create Club\",\n footnotes: [FREE],\n },\n suggestSymbol: false,\n registerAfterDeploy: false,\n actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: \"Create memberships\" } : undefined }),\n};\n\nexport const TICKETS_PRESET: CollectionCreatePreset = {\n service: \"ip-tickets\",\n icon: Ticket,\n iconClass: \"text-teal-500\",\n buttonClass: \"bg-teal-600\",\n signedOut: { title: \"Secure your account to create tickets\", description: \"Create a tickets collection, then mint tickets to your audience.\" },\n shell: { title: \"Create Ticket Collection\", subtitle: \"One collection — create tickets and mint them to your audience.\" },\n dialog: { title: \"Create tickets collection\", workingLabel: \"Creating your collection…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your collection is live\", fallbackName: \"Your collection\", reward: \"create_ticket_collection\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Tickets\",\n copy: {\n imageHeading: \"Collection image\",\n nameLabel: \"Collection name *\",\n namePlaceholder: \"My Tickets\",\n nameHint: \"Shown in wallets, explorers, and on every ticket.\",\n symbolPlaceholder: \"TIX\",\n symbolHint: \"Short ticker — 2 to 10 uppercase letters.\",\n descriptionPlaceholder: \"Describe your tickets — what do they admit or unlock?\",\n submit: \"Create Ticket Collection\",\n footnotes: [FREE],\n },\n suggestSymbol: false,\n registerAfterDeploy: false,\n actions: ({ collectionHref }) => ({ primary: collectionHref ? { href: collectionHref, label: \"Create tickets\" } : undefined }),\n};\n\nexport const EDITIONS_PRESET: CollectionCreatePreset = {\n service: \"mip-erc1155\",\n icon: Layers,\n iconClass: \"text-brand-purple\",\n buttonClass: \"bg-brand-purple\",\n signedOut: { title: \"Secure your account to create a collection\", description: \"Create a collection where each piece can have multiple editions.\" },\n shell: { title: \"Create an Edition Collection\", subtitle: \"Create a collection where each piece can have multiple editions — free to publish, and it's yours.\" },\n dialog: { title: \"Create collection\", workingLabel: \"Creating your collection…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your collection is live\", fallbackName: \"Your collection\", reward: \"create_collection\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Editions\",\n copy: {\n imageHeading: \"Collection image\",\n imageHelp: \"This becomes the cover for your collection.\",\n nameLabel: \"Collection name *\",\n namePlaceholder: \"My Creative Works\",\n nameHint: \"The main title collectors see across the collection page, wallets, and future listings.\",\n symbolPlaceholder: \"MCW\",\n symbolHint: \"Short ticker (2–10 uppercase letters). We suggest one from the collection name.\",\n descriptionPlaceholder: \"Describe your collection and what kind of work it contains…\",\n descriptionHint: \"Use this to explain the creative direction, media type, or audience for the collection.\",\n submit: \"Publish Collection\",\n footnotes: [\n FREE,\n \"Next step: mint pieces into this collection — you set the number of copies for each piece when you mint it, and can add more copies later.\",\n ],\n },\n suggestSymbol: true,\n registerAfterDeploy: true,\n actions: ({ address, collectionHref }) => ({\n primary: address ? { href: `/launchpad/nfteditions/${address}/mint`, label: \"Mint tokens\" } : undefined,\n secondary: collectionHref ? { href: collectionHref, label: \"View collection\" } : undefined,\n }),\n};\n\nexport const SINGLE_PRESET: CollectionCreatePreset = {\n service: null,\n icon: Layers,\n iconClass: \"text-brand-blue\",\n buttonClass: \"bg-brand-blue\",\n signedOut: { title: \"Secure your account to create a collection\", description: \"Set up a collection to mint your work into.\" },\n shell: { title: \"Create a Collection\", subtitle: \"Set up a collection to mint your work into — free to publish, and it's yours.\" },\n dialog: { title: \"Create collection\", workingLabel: \"Creating your collection…\", firstStepLabel: \"Prepare metadata\" },\n success: { caption: \"Your collection is live\", fallbackName: \"Your collection\", reward: \"create_collection\", againLabel: \"Create another\" },\n cardFallbackSymbol: \"Collection\",\n copy: {\n imageHeading: \"Collection image\",\n nameLabel: \"Collection name *\",\n namePlaceholder: \"My Creative Works\",\n nameHint: \"The display name for your collection.\",\n symbolPlaceholder: \"MCW\",\n symbolHint: \"Short ticker (2–10 uppercase letters). Shown in wallets and marketplaces.\",\n descriptionPlaceholder: \"Describe your collection and what kind of work it contains…\",\n submit: \"Create collection\",\n footnotes: [FREE],\n },\n suggestSymbol: false,\n registerAfterDeploy: false,\n actions: ({ collectionHref }) => ({\n primary: { href: \"/launchpad/single-editions\", label: \"Mint an asset\" },\n secondary: collectionHref ? { href: collectionHref, label: \"View collection\" } : undefined,\n }),\n};\n"],"mappings":"AAAA,SAAS,QAAQ,QAAQ,aAAa;AAuCtC,MAAM,OAAO;AAEN,MAAM,cAAsC;AAAA,EACjD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,WAAW;AAAA,EACX,aAAa;AAAA,EACb,WAAW,EAAE,OAAO,wCAAwC,aAAa,gEAAgE;AAAA,EACzI,OAAO,EAAE,OAAO,eAAe,UAAU,4EAAuE;AAAA,EAChH,QAAQ,EAAE,OAAO,eAAe,cAAc,4BAAuB,gBAAgB,mBAAmB;AAAA,EACxG,SAAS,EAAE,SAAS,qBAAqB,cAAc,aAAa,QAAQ,eAAe,YAAY,iBAAiB;A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mBAAmB;AAAA,IACnB,YAAY;AAAA,IACZ,wBAAwB;AAAA,IACxB,QAAQ;AAAA,IACR,WAAW,CAAC,IAAI;AAAA,EAClB;AAAA,EACA,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,SAAS,CAAC,EAAE,eAAe,OAAO;AAAA,IAChC,SAAS,EAAE,MAAM,8BAA8B,OAAO,gBAAgB;AAAA,IACtE,WAAW,iBAAiB,EAAE,MAAM,gBAAgB,OAAO,kBAAkB,IAAI;AAAA,EACnF;AACF;","names":[]}
@@ -19,47 +19,51 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
  var reward_earned_exports = {};
21
21
  __export(reward_earned_exports, {
22
- createRewardEarned: () => createRewardEarned
22
+ RewardEarned: () => RewardEarned
23
23
  });
24
24
  module.exports = __toCommonJS(reward_earned_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_react = require("react");
27
27
  var import_xp_earned = require("./xp-earned.js");
28
- function createRewardEarned(getRewardsConfig) {
29
- let configPromise = null;
30
- const loadConfig = () => configPromise ?? (configPromise = getRewardsConfig());
31
- return function RewardEarned({ actionType, snapshot, className }) {
32
- const [config, setConfig] = (0, import_react.useState)(null);
33
- (0, import_react.useEffect)(() => {
34
- let alive = true;
35
- loadConfig().then((loaded) => {
36
- if (alive) setConfig(loaded);
37
- }).catch((err) => {
38
- console.error("rewards config could not be loaded", err);
39
- configPromise = null;
40
- });
41
- return () => {
42
- alive = false;
43
- };
44
- }, []);
45
- const action = config?.actions.find((a) => a.type === actionType);
46
- if (!config || !action) return null;
47
- const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : void 0;
48
- const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : void 0;
49
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
- import_xp_earned.XpEarned,
51
- {
52
- xp: action.xp,
53
- label: action.label,
54
- totalXp: snapshot?.totalXp,
55
- levelXp: snapshot ? level?.xpRequired ?? 0 : void 0,
56
- nextLevelXp: snapshot ? nextLevel?.xpRequired ?? null : void 0
57
- }
58
- ) });
59
- };
28
+ var import_medialane_app = require("../medialane-app.js");
29
+ const configs = /* @__PURE__ */ new WeakMap();
30
+ function RewardEarned({ actionType, snapshot, className }) {
31
+ const api = (0, import_medialane_app.useMedialaneApp)().getClient().api;
32
+ const [config, setConfig] = (0, import_react.useState)(null);
33
+ (0, import_react.useEffect)(() => {
34
+ let alive = true;
35
+ let pending = configs.get(api);
36
+ if (!pending) {
37
+ pending = api.rewards.config();
38
+ configs.set(api, pending);
39
+ }
40
+ pending.then((loaded) => {
41
+ if (alive) setConfig(loaded);
42
+ }).catch((err) => {
43
+ console.error("rewards config could not be loaded", err);
44
+ configs.delete(api);
45
+ });
46
+ return () => {
47
+ alive = false;
48
+ };
49
+ }, [api]);
50
+ const action = config?.actions.find((a) => a.type === actionType);
51
+ if (!config || !action) return null;
52
+ const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : void 0;
53
+ const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : void 0;
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ import_xp_earned.XpEarned,
56
+ {
57
+ xp: action.xp,
58
+ label: action.label,
59
+ totalXp: snapshot?.totalXp,
60
+ levelXp: snapshot ? level?.xpRequired ?? 0 : void 0,
61
+ nextLevelXp: snapshot ? nextLevel?.xpRequired ?? null : void 0
62
+ }
63
+ ) });
60
64
  }
61
65
  // Annotate the CommonJS export names for ESM import in node:
62
66
  0 && (module.exports = {
63
- createRewardEarned
67
+ RewardEarned
64
68
  });
65
69
  //# sourceMappingURL=reward-earned.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/rewards/reward-earned.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { XpEarned } from \"./xp-earned.js\";\nimport type { ApiRewardsConfig } from \"@medialane/sdk\";\n\nexport interface RewardSnapshot {\n totalXp: number;\n currentLevel: number;\n}\n\nexport interface RewardEarnedProps {\n actionType: string;\n snapshot?: RewardSnapshot;\n className?: string;\n}\n\nexport function createRewardEarned(getRewardsConfig: () => Promise<ApiRewardsConfig>) {\n let configPromise: Promise<ApiRewardsConfig> | null = null;\n const loadConfig = () => (configPromise ??= getRewardsConfig());\n\n return function RewardEarned({ actionType, snapshot, className }: RewardEarnedProps) {\n const [config, setConfig] = useState<ApiRewardsConfig | null>(null);\n\n useEffect(() => {\n let alive = true;\n loadConfig()\n .then((loaded) => {\n if (alive) setConfig(loaded);\n })\n .catch((err) => {\n console.error(\"rewards config could not be loaded\", err);\n configPromise = null;\n });\n return () => {\n alive = false;\n };\n }, []);\n\n const action = config?.actions.find((a) => a.type === actionType);\n if (!config || !action) return null;\n\n const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : undefined;\n const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : undefined;\n\n return (\n <div className={className}>\n <XpEarned\n xp={action.xp}\n label={action.label}\n totalXp={snapshot?.totalXp}\n levelXp={snapshot ? level?.xpRequired ?? 0 : undefined}\n nextLevelXp={snapshot ? nextLevel?.xpRequired ?? null : undefined}\n />\n </div>\n );\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CQ;AA7CR,mBAAoC;AACpC,uBAAyB;AAclB,SAAS,mBAAmB,kBAAmD;AACpF,MAAI,gBAAkD;AACtD,QAAM,aAAa,MAAO,kCAAkB,iBAAiB;AAE7D,SAAO,SAAS,aAAa,EAAE,YAAY,UAAU,UAAU,GAAsB;AACnF,UAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkC,IAAI;AAElE,gCAAU,MAAM;AACd,UAAI,QAAQ;AACZ,iBAAW,EACR,KAAK,CAAC,WAAW;AAChB,YAAI,MAAO,WAAU,MAAM;AAAA,MAC7B,CAAC,EACA,MAAM,CAAC,QAAQ;AACd,gBAAQ,MAAM,sCAAsC,GAAG;AACvD,wBAAgB;AAAA,MAClB,CAAC;AACH,aAAO,MAAM;AACX,gBAAQ;AAAA,MACV;AAAA,IACF,GAAG,CAAC,CAAC;AAEL,UAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,UAAU;AAChE,QAAI,CAAC,UAAU,CAAC,OAAQ,QAAO;AAE/B,UAAM,QAAQ,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,UAAU,SAAS,YAAY,IAAI;AACxF,UAAM,YAAY,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,UAAU,SAAS,eAAe,CAAC,IAAI;AAEhG,WACE,4CAAC,SAAI,WACH;AAAA,MAAC;AAAA;AAAA,QACC,IAAI,OAAO;AAAA,QACX,OAAO,OAAO;AAAA,QACd,SAAS,UAAU;AAAA,QACnB,SAAS,WAAW,OAAO,cAAc,IAAI;AAAA,QAC7C,aAAa,WAAW,WAAW,cAAc,OAAO;AAAA;AAAA,IAC1D,GACF;AAAA,EAEJ;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/rewards/reward-earned.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { XpEarned } from \"./xp-earned.js\";\nimport type { ApiRewardsConfig } from \"@medialane/sdk\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\n\nexport interface RewardSnapshot {\n totalXp: number;\n currentLevel: number;\n}\n\nexport interface RewardEarnedProps {\n actionType: string;\n snapshot?: RewardSnapshot;\n className?: string;\n}\n\nconst configs = new WeakMap<object, Promise<ApiRewardsConfig>>();\n\nexport function RewardEarned({ actionType, snapshot, className }: RewardEarnedProps) {\n const api = useMedialaneApp().getClient().api;\n const [config, setConfig] = useState<ApiRewardsConfig | null>(null);\n\n useEffect(() => {\n let alive = true;\n let pending = configs.get(api);\n if (!pending) {\n pending = api.rewards.config();\n configs.set(api, pending);\n }\n pending\n .then((loaded) => {\n if (alive) setConfig(loaded);\n })\n .catch((err) => {\n console.error(\"rewards config could not be loaded\", err);\n configs.delete(api);\n });\n return () => {\n alive = false;\n };\n }, [api]);\n\n const action = config?.actions.find((a) => a.type === actionType);\n if (!config || !action) return null;\n\n const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : undefined;\n const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : undefined;\n\n return (\n <div className={className}>\n <XpEarned\n xp={action.xp}\n label={action.label}\n totalXp={snapshot?.totalXp}\n levelXp={snapshot ? level?.xpRequired ?? 0 : undefined}\n nextLevelXp={snapshot ? nextLevel?.xpRequired ?? null : undefined}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDM;AAlDN,mBAAoC;AACpC,uBAAyB;AAEzB,2BAAgC;AAahC,MAAM,UAAU,oBAAI,QAA2C;AAExD,SAAS,aAAa,EAAE,YAAY,UAAU,UAAU,GAAsB;AACnF,QAAM,UAAM,sCAAgB,EAAE,UAAU,EAAE;AAC1C,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkC,IAAI;AAElE,8BAAU,MAAM;AACd,QAAI,QAAQ;AACZ,QAAI,UAAU,QAAQ,IAAI,GAAG;AAC7B,QAAI,CAAC,SAAS;AACZ,gBAAU,IAAI,QAAQ,OAAO;AAC7B,cAAQ,IAAI,KAAK,OAAO;AAAA,IAC1B;AACA,YACG,KAAK,CAAC,WAAW;AAChB,UAAI,MAAO,WAAU,MAAM;AAAA,IAC7B,CAAC,EACA,MAAM,CAAC,QAAQ;AACd,cAAQ,MAAM,sCAAsC,GAAG;AACvD,cAAQ,OAAO,GAAG;AAAA,IACpB,CAAC;AACH,WAAO,MAAM;AACX,cAAQ;AAAA,IACV;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AAER,QAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,UAAU;AAChE,MAAI,CAAC,UAAU,CAAC,OAAQ,QAAO;AAE/B,QAAM,QAAQ,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,UAAU,SAAS,YAAY,IAAI;AACxF,QAAM,YAAY,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,UAAU,SAAS,eAAe,CAAC,IAAI;AAEhG,SACE,4CAAC,SAAI,WACH;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,OAAO;AAAA,MACX,OAAO,OAAO;AAAA,MACd,SAAS,UAAU;AAAA,MACnB,SAAS,WAAW,OAAO,cAAc,IAAI;AAAA,MAC7C,aAAa,WAAW,WAAW,cAAc,OAAO;AAAA;AAAA,EAC1D,GACF;AAEJ;","names":[]}
@@ -1,5 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ApiRewardsConfig } from '@medialane/sdk';
3
2
 
4
3
  interface RewardSnapshot {
5
4
  totalXp: number;
@@ -10,6 +9,6 @@ interface RewardEarnedProps {
10
9
  snapshot?: RewardSnapshot;
11
10
  className?: string;
12
11
  }
13
- declare function createRewardEarned(getRewardsConfig: () => Promise<ApiRewardsConfig>): ({ actionType, snapshot, className }: RewardEarnedProps) => react_jsx_runtime.JSX.Element | null;
12
+ declare function RewardEarned({ actionType, snapshot, className }: RewardEarnedProps): react_jsx_runtime.JSX.Element | null;
14
13
 
15
- export { type RewardEarnedProps, type RewardSnapshot, createRewardEarned };
14
+ export { RewardEarned, type RewardEarnedProps, type RewardSnapshot };
@@ -1,5 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ApiRewardsConfig } from '@medialane/sdk';
3
2
 
4
3
  interface RewardSnapshot {
5
4
  totalXp: number;
@@ -10,6 +9,6 @@ interface RewardEarnedProps {
10
9
  snapshot?: RewardSnapshot;
11
10
  className?: string;
12
11
  }
13
- declare function createRewardEarned(getRewardsConfig: () => Promise<ApiRewardsConfig>): ({ actionType, snapshot, className }: RewardEarnedProps) => react_jsx_runtime.JSX.Element | null;
12
+ declare function RewardEarned({ actionType, snapshot, className }: RewardEarnedProps): react_jsx_runtime.JSX.Element | null;
14
13
 
15
- export { type RewardEarnedProps, type RewardSnapshot, createRewardEarned };
14
+ export { RewardEarned, type RewardEarnedProps, type RewardSnapshot };
@@ -2,40 +2,44 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from "react";
4
4
  import { XpEarned } from "./xp-earned.js";
5
- function createRewardEarned(getRewardsConfig) {
6
- let configPromise = null;
7
- const loadConfig = () => configPromise ?? (configPromise = getRewardsConfig());
8
- return function RewardEarned({ actionType, snapshot, className }) {
9
- const [config, setConfig] = useState(null);
10
- useEffect(() => {
11
- let alive = true;
12
- loadConfig().then((loaded) => {
13
- if (alive) setConfig(loaded);
14
- }).catch((err) => {
15
- console.error("rewards config could not be loaded", err);
16
- configPromise = null;
17
- });
18
- return () => {
19
- alive = false;
20
- };
21
- }, []);
22
- const action = config?.actions.find((a) => a.type === actionType);
23
- if (!config || !action) return null;
24
- const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : void 0;
25
- const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : void 0;
26
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
27
- XpEarned,
28
- {
29
- xp: action.xp,
30
- label: action.label,
31
- totalXp: snapshot?.totalXp,
32
- levelXp: snapshot ? level?.xpRequired ?? 0 : void 0,
33
- nextLevelXp: snapshot ? nextLevel?.xpRequired ?? null : void 0
34
- }
35
- ) });
36
- };
5
+ import { useMedialaneApp } from "../medialane-app.js";
6
+ const configs = /* @__PURE__ */ new WeakMap();
7
+ function RewardEarned({ actionType, snapshot, className }) {
8
+ const api = useMedialaneApp().getClient().api;
9
+ const [config, setConfig] = useState(null);
10
+ useEffect(() => {
11
+ let alive = true;
12
+ let pending = configs.get(api);
13
+ if (!pending) {
14
+ pending = api.rewards.config();
15
+ configs.set(api, pending);
16
+ }
17
+ pending.then((loaded) => {
18
+ if (alive) setConfig(loaded);
19
+ }).catch((err) => {
20
+ console.error("rewards config could not be loaded", err);
21
+ configs.delete(api);
22
+ });
23
+ return () => {
24
+ alive = false;
25
+ };
26
+ }, [api]);
27
+ const action = config?.actions.find((a) => a.type === actionType);
28
+ if (!config || !action) return null;
29
+ const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : void 0;
30
+ const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : void 0;
31
+ return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
32
+ XpEarned,
33
+ {
34
+ xp: action.xp,
35
+ label: action.label,
36
+ totalXp: snapshot?.totalXp,
37
+ levelXp: snapshot ? level?.xpRequired ?? 0 : void 0,
38
+ nextLevelXp: snapshot ? nextLevel?.xpRequired ?? null : void 0
39
+ }
40
+ ) });
37
41
  }
38
42
  export {
39
- createRewardEarned
43
+ RewardEarned
40
44
  };
41
45
  //# sourceMappingURL=reward-earned.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/rewards/reward-earned.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { XpEarned } from \"./xp-earned.js\";\nimport type { ApiRewardsConfig } from \"@medialane/sdk\";\n\nexport interface RewardSnapshot {\n totalXp: number;\n currentLevel: number;\n}\n\nexport interface RewardEarnedProps {\n actionType: string;\n snapshot?: RewardSnapshot;\n className?: string;\n}\n\nexport function createRewardEarned(getRewardsConfig: () => Promise<ApiRewardsConfig>) {\n let configPromise: Promise<ApiRewardsConfig> | null = null;\n const loadConfig = () => (configPromise ??= getRewardsConfig());\n\n return function RewardEarned({ actionType, snapshot, className }: RewardEarnedProps) {\n const [config, setConfig] = useState<ApiRewardsConfig | null>(null);\n\n useEffect(() => {\n let alive = true;\n loadConfig()\n .then((loaded) => {\n if (alive) setConfig(loaded);\n })\n .catch((err) => {\n console.error(\"rewards config could not be loaded\", err);\n configPromise = null;\n });\n return () => {\n alive = false;\n };\n }, []);\n\n const action = config?.actions.find((a) => a.type === actionType);\n if (!config || !action) return null;\n\n const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : undefined;\n const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : undefined;\n\n return (\n <div className={className}>\n <XpEarned\n xp={action.xp}\n label={action.label}\n totalXp={snapshot?.totalXp}\n levelXp={snapshot ? level?.xpRequired ?? 0 : undefined}\n nextLevelXp={snapshot ? nextLevel?.xpRequired ?? null : undefined}\n />\n </div>\n );\n };\n}\n"],"mappings":";AA+CQ;AA7CR,SAAS,WAAW,gBAAgB;AACpC,SAAS,gBAAgB;AAclB,SAAS,mBAAmB,kBAAmD;AACpF,MAAI,gBAAkD;AACtD,QAAM,aAAa,MAAO,kCAAkB,iBAAiB;AAE7D,SAAO,SAAS,aAAa,EAAE,YAAY,UAAU,UAAU,GAAsB;AACnF,UAAM,CAAC,QAAQ,SAAS,IAAI,SAAkC,IAAI;AAElE,cAAU,MAAM;AACd,UAAI,QAAQ;AACZ,iBAAW,EACR,KAAK,CAAC,WAAW;AAChB,YAAI,MAAO,WAAU,MAAM;AAAA,MAC7B,CAAC,EACA,MAAM,CAAC,QAAQ;AACd,gBAAQ,MAAM,sCAAsC,GAAG;AACvD,wBAAgB;AAAA,MAClB,CAAC;AACH,aAAO,MAAM;AACX,gBAAQ;AAAA,MACV;AAAA,IACF,GAAG,CAAC,CAAC;AAEL,UAAM,SAAS,QAAQ,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,UAAU;AAChE,QAAI,CAAC,UAAU,CAAC,OAAQ,QAAO;AAE/B,UAAM,QAAQ,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,UAAU,SAAS,YAAY,IAAI;AACxF,UAAM,YAAY,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,UAAU,SAAS,eAAe,CAAC,IAAI;AAEhG,WACE,oBAAC,SAAI,WACH;AAAA,MAAC;AAAA;AAAA,QACC,IAAI,OAAO;AAAA,QACX,OAAO,OAAO;AAAA,QACd,SAAS,UAAU;AAAA,QACnB,SAAS,WAAW,OAAO,cAAc,IAAI;AAAA,QAC7C,aAAa,WAAW,WAAW,cAAc,OAAO;AAAA;AAAA,IAC1D,GACF;AAAA,EAEJ;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/rewards/reward-earned.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { XpEarned } from \"./xp-earned.js\";\nimport type { ApiRewardsConfig } from \"@medialane/sdk\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\n\nexport interface RewardSnapshot {\n totalXp: number;\n currentLevel: number;\n}\n\nexport interface RewardEarnedProps {\n actionType: string;\n snapshot?: RewardSnapshot;\n className?: string;\n}\n\nconst configs = new WeakMap<object, Promise<ApiRewardsConfig>>();\n\nexport function RewardEarned({ actionType, snapshot, className }: RewardEarnedProps) {\n const api = useMedialaneApp().getClient().api;\n const [config, setConfig] = useState<ApiRewardsConfig | null>(null);\n\n useEffect(() => {\n let alive = true;\n let pending = configs.get(api);\n if (!pending) {\n pending = api.rewards.config();\n configs.set(api, pending);\n }\n pending\n .then((loaded) => {\n if (alive) setConfig(loaded);\n })\n .catch((err) => {\n console.error(\"rewards config could not be loaded\", err);\n configs.delete(api);\n });\n return () => {\n alive = false;\n };\n }, [api]);\n\n const action = config?.actions.find((a) => a.type === actionType);\n if (!config || !action) return null;\n\n const level = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel) : undefined;\n const nextLevel = snapshot ? config.levels.find((l) => l.level === snapshot.currentLevel + 1) : undefined;\n\n return (\n <div className={className}>\n <XpEarned\n xp={action.xp}\n label={action.label}\n totalXp={snapshot?.totalXp}\n levelXp={snapsh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AA,MAC7C,aAAa,WAAW,WAAW,cAAc,OAAO;AAAA;AAAA,EAC1D,GACF;AAEJ;","names":[]}
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
10
10
  declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
11
11
  declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
12
  declare const sheetVariants: (props?: ({
13
- side?: "bottom" | "left" | "right" | "top" | null | undefined;
13
+ side?: "left" | "right" | "bottom" | "top" | null | undefined;
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
16
16
  overlayClassName?: string;
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
10
10
  declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
11
11
  declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
12
  declare const sheetVariants: (props?: ({
13
- side?: "bottom" | "left" | "right" | "top" | null | undefined;
13
+ side?: "left" | "right" | "bottom" | "top" | null | undefined;
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
16
16
  overlayClassName?: string;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var wallet_required_exports = {};
21
+ __export(wallet_required_exports, {
22
+ WalletRequired: () => WalletRequired
23
+ });
24
+ module.exports = __toCommonJS(wallet_required_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_lucide_react = require("lucide-react");
27
+ var import_button = require("./button.js");
28
+ var import_skeleton = require("./skeleton.js");
29
+ var import_medialane_app = require("./medialane-app.js");
30
+ function WalletRequired({ icon: Icon, iconClassName = "text-muted-foreground", title, description, children }) {
31
+ const { walletAddress, walletLoading, onRequireWallet, connectLabel } = (0, import_medialane_app.useMedialaneApp)();
32
+ if (walletAddress) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
33
+ if (walletLoading) {
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4", children: [
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-10 w-10 rounded-full mx-auto" }),
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-7 w-56 mx-auto" }),
37
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-72 mx-auto" }),
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-10 w-44 mx-auto rounded-md" })
39
+ ] });
40
+ }
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: `h-10 w-10 mx-auto ${iconClassName}` }),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-2xl font-bold", children: title }),
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: description }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "btn-border-animated inline-block p-[1px] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
46
+ import_button.Button,
47
+ {
48
+ onClick: onRequireWallet,
49
+ className: "bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all",
50
+ children: [
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Wallet, { className: "h-4 w-4 mr-1.5" }),
52
+ connectLabel ?? "Connect"
53
+ ]
54
+ }
55
+ ) })
56
+ ] });
57
+ }
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ WalletRequired
61
+ });
62
+ //# sourceMappingURL=wallet-required.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/wallet-required.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\n\nexport interface WalletRequiredProps {\n icon: ElementType;\n iconClassName?: string;\n title: string;\n description: string;\n children: ReactNode;\n}\n\nexport function WalletRequired({ icon: Icon, iconClassName = \"text-muted-foreground\", title, description, children }: WalletRequiredProps) {\n const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();\n\n if (walletAddress) return <>{children}</>;\n\n if (walletLoading) {\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4\">\n <Skeleton className=\"h-10 w-10 rounded-full mx-auto\" />\n <Skeleton className=\"h-7 w-56 mx-auto\" />\n <Skeleton className=\"h-4 w-72 mx-auto\" />\n <Skeleton className=\"h-10 w-44 mx-auto rounded-md\" />\n </div>\n );\n }\n\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Icon className={`h-10 w-10 mx-auto ${iconClassName}`} />\n <h1 className=\"text-2xl font-bold\">{title}</h1>\n <p className=\"text-muted-foreground\">{description}</p>\n <div className=\"btn-border-animated inline-block p-[1px] rounded-lg\">\n <Button\n onClick={onRequireWallet}\n className=\"bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all\"\n >\n <Wallet className=\"h-4 w-4 mr-1.5\" />\n {connectLabel ?? \"Connect\"}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmB4B;AAhB5B,0BAAuB;AACvB,oBAAuB;AACvB,sBAAyB;AACzB,2BAAgC;AAUzB,SAAS,eAAe,EAAE,MAAM,MAAM,gBAAgB,yBAAyB,OAAO,aAAa,SAAS,GAAwB;AACzI,QAAM,EAAE,eAAe,eAAe,iBAAiB,aAAa,QAAI,sCAAgB;AAExF,MAAI,cAAe,QAAO,2EAAG,UAAS;AAEtC,MAAI,eAAe;AACjB,WACE,6CAAC,SAAI,WAAU,8CACb;AAAA,kDAAC,4BAAS,WAAU,kCAAiC;AAAA,MACrD,4CAAC,4BAAS,WAAU,oBAAmB;AAAA,MACvC,4CAAC,4BAAS,WAAU,oBAAmB;AAAA,MACvC,4CAAC,4BAAS,WAAU,gCAA+B;AAAA,OACrD;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WAAU,0DACb;AAAA,gDAAC,QAAK,WAAW,qBAAqB,aAAa,IAAI;AAAA,IACvD,4CAAC,QAAG,WAAU,sBAAsB,iBAAM;AAAA,IAC1C,4CAAC,OAAE,WAAU,yBAAyB,uBAAY;AAAA,IAClD,4CAAC,SAAI,WAAU,uDACb;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,sDAAC,8BAAO,WAAU,kBAAiB;AAAA,UAClC,gBAAgB;AAAA;AAAA;AAAA,IACnB,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ElementType, ReactNode } from 'react';
3
+
4
+ interface WalletRequiredProps {
5
+ icon: ElementType;
6
+ iconClassName?: string;
7
+ title: string;
8
+ description: string;
9
+ children: ReactNode;
10
+ }
11
+ declare function WalletRequired({ icon: Icon, iconClassName, title, description, children }: WalletRequiredProps): react_jsx_runtime.JSX.Element;
12
+
13
+ export { WalletRequired, type WalletRequiredProps };
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ElementType, ReactNode } from 'react';
3
+
4
+ interface WalletRequiredProps {
5
+ icon: ElementType;
6
+ iconClassName?: string;
7
+ title: string;
8
+ description: string;
9
+ children: ReactNode;
10
+ }
11
+ declare function WalletRequired({ icon: Icon, iconClassName, title, description, children }: WalletRequiredProps): react_jsx_runtime.JSX.Element;
12
+
13
+ export { WalletRequired, type WalletRequiredProps };
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Wallet } from "lucide-react";
4
+ import { Button } from "./button.js";
5
+ import { Skeleton } from "./skeleton.js";
6
+ import { useMedialaneApp } from "./medialane-app.js";
7
+ function WalletRequired({ icon: Icon, iconClassName = "text-muted-foreground", title, description, children }) {
8
+ const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();
9
+ if (walletAddress) return /* @__PURE__ */ jsx(Fragment, { children });
10
+ if (walletLoading) {
11
+ return /* @__PURE__ */ jsxs("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4", children: [
12
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-10 rounded-full mx-auto" }),
13
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-56 mx-auto" }),
14
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-72 mx-auto" }),
15
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-44 mx-auto rounded-md" })
16
+ ] });
17
+ }
18
+ return /* @__PURE__ */ jsxs("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
19
+ /* @__PURE__ */ jsx(Icon, { className: `h-10 w-10 mx-auto ${iconClassName}` }),
20
+ /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold", children: title }),
21
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: description }),
22
+ /* @__PURE__ */ jsx("div", { className: "btn-border-animated inline-block p-[1px] rounded-lg", children: /* @__PURE__ */ jsxs(
23
+ Button,
24
+ {
25
+ onClick: onRequireWallet,
26
+ className: "bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all",
27
+ children: [
28
+ /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 mr-1.5" }),
29
+ connectLabel ?? "Connect"
30
+ ]
31
+ }
32
+ ) })
33
+ ] });
34
+ }
35
+ export {
36
+ WalletRequired
37
+ };
38
+ //# sourceMappingURL=wallet-required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/wallet-required.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\n\nexport interface WalletRequiredProps {\n icon: ElementType;\n iconClassName?: string;\n title: string;\n description: string;\n children: ReactNode;\n}\n\nexport function WalletRequired({ icon: Icon, iconClassName = \"text-muted-foreground\", title, description, children }: WalletRequiredProps) {\n const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();\n\n if (walletAddress) return <>{children}</>;\n\n if (walletLoading) {\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4\">\n <Skeleton className=\"h-10 w-10 rounded-full mx-auto\" />\n <Skeleton className=\"h-7 w-56 mx-auto\" />\n <Skeleton className=\"h-4 w-72 mx-auto\" />\n <Skeleton className=\"h-10 w-44 mx-auto rounded-md\" />\n </div>\n );\n }\n\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Icon className={`h-10 w-10 mx-auto ${iconClassName}`} />\n <h1 className=\"text-2xl font-bold\">{title}</h1>\n <p className=\"text-muted-foreground\">{description}</p>\n <div className=\"btn-border-animated inline-block p-[1px] rounded-lg\">\n <Button\n onClick={onRequireWallet}\n className=\"bg-transparent text-white rounded-[7px] hover:bg-transparent hover:brightness-110 active:scale-[0.98] transition-all\"\n >\n <Wallet className=\"h-4 w-4 mr-1.5\" />\n {connectLabel ?? \"Connect\"}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";AAmB4B,wBAItB,YAJsB;AAhB5B,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAUzB,SAAS,eAAe,EAAE,MAAM,MAAM,gBAAgB,yBAAyB,OAAO,aAAa,SAAS,GAAwB;AACzI,QAAM,EAAE,eAAe,eAAe,iBAAiB,aAAa,IAAI,gBAAgB;AAExF,MAAI,cAAe,QAAO,gCAAG,UAAS;AAEtC,MAAI,eAAe;AACjB,WACE,qBAAC,SAAI,WAAU,8CACb;AAAA,0BAAC,YAAS,WAAU,kCAAiC;AAAA,MACrD,oBAAC,YAAS,WAAU,oBAAmB;AAAA,MACvC,oBAAC,YAAS,WAAU,oBAAmB;AAAA,MACvC,oBAAC,YAAS,WAAU,gCAA+B;AAAA,OACrD;AAAA,EAEJ;AAEA,SACE,qBAAC,SAAI,WAAU,0DACb;AAAA,wBAAC,QAAK,WAAW,qBAAqB,aAAa,IAAI;AAAA,IACvD,oBAAC,QAAG,WAAU,sBAAsB,iBAAM;AAAA,IAC1C,oBAAC,OAAE,WAAU,yBAAyB,uBAAY;AAAA,IAClD,oBAAC,SAAI,WAAU,uDACb;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QAEV;AAAA,8BAAC,UAAO,WAAU,kBAAiB;AAAA,UAClC,gBAAgB;AAAA;AAAA;AAAA,IACnB,GACF;AAAA,KACF;AAEJ;","names":[]}