@medialane/ui 0.376.0 → 0.377.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.
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -32,6 +32,7 @@ function ActionButton({
32
32
  icon,
33
33
  big,
34
34
  small,
35
+ solid,
35
36
  ghost,
36
37
  helpContent,
37
38
  disabled,
@@ -71,13 +72,14 @@ function ActionButton({
71
72
  disabled,
72
73
  className: (0, import_cn.cn)(
73
74
  "inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
74
- "text-foreground border-none transition-[filter] hover:brightness-125 disabled:opacity-40 disabled:pointer-events-none",
75
+ solid ? "text-white" : "text-foreground",
76
+ "border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none",
75
77
  sizeClass,
76
78
  className
77
79
  ),
78
- style: { backgroundImage: `linear-gradient(115deg, ${(0, import_brand.brandTint)(from, 0.28)}, ${(0, import_brand.brandTint)(to, 0.16)})`, ...style },
80
+ style: { backgroundImage: `linear-gradient(115deg, ${(0, import_brand.brandTint)(from, solid ? 1 : 0.28)}, ${(0, import_brand.brandTint)(to, solid ? 1 : 0.16)})`, ...style },
79
81
  children: [
80
- icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "inline-flex", style: { color: fg }, children: icon }),
82
+ icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "inline-flex", style: solid ? void 0 : { color: fg }, children: icon }),
81
83
  children,
82
84
  helpContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_help_icon.HelpIcon, { content: helpContent }) : null
83
85
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n /** Compact size for actions inside list rows. */\n small?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\n ghost,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-muted text-foreground border-none disabled:opacity-50 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={style}\n >\n {icon}{children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"text-foreground border-none transition-[filter] hover:brightness-125 disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ backgroundImage: `linear-gradient(115deg, ${brandTint(from, 0.28)}, ${brandTint(to, 0.16)})`, ...style }}\n >\n {icon && <span className=\"inline-flex\" style={{ color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDM;AA9CN,gBAAmB;AACnB,uBAAyB;AACzB,mBAA0F;AAsBnF,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,YAAY,MACd,2CACA,QACA,gCACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UAAM;AAAA,UACN,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,IACtD;AAAA,EAEJ;AAEA,QAAM,CAAC,MAAM,EAAE,IACb,SAAS,0BAAa,MAAM,IAC5B,OAAS,wBAAW,IAAI,IACxB,0BAAa;AAEf,QAAM,KACJ,SAAS,gCAAmB,MAAM,IAClC,OAAS,8BAAiB,IAAI,IAC9B,gCAAmB;AAErB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,iBAAiB,+BAA2B,wBAAU,MAAM,IAAI,CAAC,SAAK,wBAAU,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM;AAAA,MAE/G;AAAA,gBAAQ,4CAAC,UAAK,WAAU,eAAc,OAAO,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QAClE;AAAA,QACA,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n /** Compact size for actions inside list rows. */\n small?: boolean;\n\n /** Full-strength gradient for the one primary action on a surface. */\n solid?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\n solid,\n ghost,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-muted text-foreground border-none disabled:opacity-50 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={style}\n >\n {icon}{children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n solid ? \"text-white\" : \"text-foreground\",\n \"border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ backgroundImage: `linear-gradient(115deg, ${brandTint(from, solid ? 1 : 0.28)}, ${brandTint(to, solid ? 1 : 0.16)})`, ...style }}\n >\n {icon && <span className=\"inline-flex\" style={solid ? undefined : { color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDM;AAlDN,gBAAmB;AACnB,uBAAyB;AACzB,mBAA0F;AAyBnF,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,YAAY,MACd,2CACA,QACA,gCACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UAAM;AAAA,UACN,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,IACtD;AAAA,EAEJ;AAEA,QAAM,CAAC,MAAM,EAAE,IACb,SAAS,0BAAa,MAAM,IAC5B,OAAS,wBAAW,IAAI,IACxB,0BAAa;AAEf,QAAM,KACJ,SAAS,gCAAmB,MAAM,IAClC,OAAS,8BAAiB,IAAI,IAC9B,gCAAmB;AAErB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA,QAAQ,eAAe;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,iBAAiB,+BAA2B,wBAAU,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAK,wBAAU,IAAI,QAAQ,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM;AAAA,MAEvI;AAAA,gBAAQ,4CAAC,UAAK,WAAU,eAAc,OAAO,QAAQ,SAAY,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QACtF;AAAA,QACA,cAAc,4CAAC,6BAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
@@ -10,9 +10,11 @@ interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
10
10
  big?: boolean;
11
11
  /** Compact size for actions inside list rows. */
12
12
  small?: boolean;
13
+ /** Full-strength gradient for the one primary action on a surface. */
14
+ solid?: boolean;
13
15
  ghost?: boolean;
14
16
  helpContent?: string;
15
17
  }
16
- declare function ActionButton({ action, tone, icon, big, small, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
18
+ declare function ActionButton({ action, tone, icon, big, small, solid, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
17
19
 
18
20
  export { ActionButton, type ActionButtonProps, type ActionKey, type ToneKey };
@@ -10,9 +10,11 @@ interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement
10
10
  big?: boolean;
11
11
  /** Compact size for actions inside list rows. */
12
12
  small?: boolean;
13
+ /** Full-strength gradient for the one primary action on a surface. */
14
+ solid?: boolean;
13
15
  ghost?: boolean;
14
16
  helpContent?: string;
15
17
  }
16
- declare function ActionButton({ action, tone, icon, big, small, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
18
+ declare function ActionButton({ action, tone, icon, big, small, solid, ghost, helpContent, disabled, children, className, style, ...rest }: ActionButtonProps): react_jsx_runtime.JSX.Element;
17
19
 
18
20
  export { ActionButton, type ActionButtonProps, type ActionKey, type ToneKey };
@@ -9,6 +9,7 @@ function ActionButton({
9
9
  icon,
10
10
  big,
11
11
  small,
12
+ solid,
12
13
  ghost,
13
14
  helpContent,
14
15
  disabled,
@@ -48,13 +49,14 @@ function ActionButton({
48
49
  disabled,
49
50
  className: cn(
50
51
  "inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap",
51
- "text-foreground border-none transition-[filter] hover:brightness-125 disabled:opacity-40 disabled:pointer-events-none",
52
+ solid ? "text-white" : "text-foreground",
53
+ "border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none",
52
54
  sizeClass,
53
55
  className
54
56
  ),
55
- style: { backgroundImage: `linear-gradient(115deg, ${brandTint(from, 0.28)}, ${brandTint(to, 0.16)})`, ...style },
57
+ style: { backgroundImage: `linear-gradient(115deg, ${brandTint(from, solid ? 1 : 0.28)}, ${brandTint(to, solid ? 1 : 0.16)})`, ...style },
56
58
  children: [
57
- icon && /* @__PURE__ */ jsx("span", { className: "inline-flex", style: { color: fg }, children: icon }),
59
+ icon && /* @__PURE__ */ jsx("span", { className: "inline-flex", style: solid ? void 0 : { color: fg }, children: icon }),
58
60
  children,
59
61
  helpContent ? /* @__PURE__ */ jsx(HelpIcon, { content: helpContent }) : null
60
62
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n /** Compact size for actions inside list rows. */\n small?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\n ghost,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-muted text-foreground border-none disabled:opacity-50 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={style}\n >\n {icon}{children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"text-foreground border-none transition-[filter] hover:brightness-125 disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ backgroundImage: `linear-gradient(115deg, ${brandTint(from, 0.28)}, ${brandTint(to, 0.16)})`, ...style }}\n >\n {icon && <span className=\"inline-flex\" style={{ color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n}\n"],"mappings":";AAgDM,SAYiB,KAZjB;AA9CN,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,cAAc,kBAAkB,YAAY,iBAAiB;AAsBnF,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,YAAY,MACd,2CACA,QACA,gCACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UAAM;AAAA,UACN,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,IACtD;AAAA,EAEJ;AAEA,QAAM,CAAC,MAAM,EAAE,IACb,SAAS,aAAa,MAAM,IAC5B,OAAS,WAAW,IAAI,IACxB,aAAa;AAEf,QAAM,KACJ,SAAS,mBAAmB,MAAM,IAClC,OAAS,iBAAiB,IAAI,IAC9B,mBAAmB;AAErB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,iBAAiB,2BAA2B,UAAU,MAAM,IAAI,CAAC,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM;AAAA,MAE/G;AAAA,gBAAQ,oBAAC,UAAK,WAAU,eAAc,OAAO,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QAClE;AAAA,QACA,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/action-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { ACTION_FOREGROUNDS, ACTION_PAIRS, TONE_FOREGROUNDS, TONE_PAIRS, brandTint } from \"../data/brand.js\";\n\nexport type ActionKey = keyof typeof ACTION_PAIRS;\nexport type ToneKey = keyof typeof TONE_PAIRS;\n\nexport interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\n action?: ActionKey;\n\n tone?: ToneKey;\n icon?: React.ReactNode;\n\n big?: boolean;\n\n /** Compact size for actions inside list rows. */\n small?: boolean;\n\n /** Full-strength gradient for the one primary action on a surface. */\n solid?: boolean;\n\n ghost?: boolean;\n\n helpContent?: string;\n}\n\nexport function ActionButton({\n action,\n tone,\n icon,\n big,\n small,\n solid,\n ghost,\n helpContent,\n disabled,\n children,\n className,\n style,\n ...rest\n}: ActionButtonProps) {\n const sizeClass = big\n ? \"h-[54px] px-5 rounded-[13px] text-base\"\n : small\n ? \"h-9 px-3 rounded-xl text-xs\"\n : \"h-[46px] px-5 rounded-[13px] text-sm\";\n\n if (ghost) {\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n \"bg-muted text-foreground border-none disabled:opacity-50 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={style}\n >\n {icon}{children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n }\n\n const [from, to] =\n action ? ACTION_PAIRS[action] :\n tone ? TONE_PAIRS[tone] :\n ACTION_PAIRS.buy;\n\n const fg =\n action ? ACTION_FOREGROUNDS[action] :\n tone ? TONE_FOREGROUNDS[tone] :\n ACTION_FOREGROUNDS.buy;\n\n return (\n <button\n {...rest}\n disabled={disabled}\n className={cn(\n \"inline-flex items-center justify-center gap-2 font-semibold cursor-pointer whitespace-nowrap\",\n solid ? \"text-white\" : \"text-foreground\",\n \"border-none transition-[filter] hover:brightness-110 disabled:opacity-40 disabled:pointer-events-none\",\n sizeClass,\n className,\n )}\n style={{ backgroundImage: `linear-gradient(115deg, ${brandTint(from, solid ? 1 : 0.28)}, ${brandTint(to, solid ? 1 : 0.16)})`, ...style }}\n >\n {icon && <span className=\"inline-flex\" style={solid ? undefined : { color: fg }}>{icon}</span>}\n {children}\n {helpContent ? <HelpIcon content={helpContent} /> : null}\n </button>\n );\n}\n"],"mappings":";AAoDM,SAYiB,KAZjB;AAlDN,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,cAAc,kBAAkB,YAAY,iBAAiB;AAyBnF,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,YAAY,MACd,2CACA,QACA,gCACA;AAEJ,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UAAM;AAAA,UACN,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,IACtD;AAAA,EAEJ;AAEA,QAAM,CAAC,MAAM,EAAE,IACb,SAAS,aAAa,MAAM,IAC5B,OAAS,WAAW,IAAI,IACxB,aAAa;AAEf,QAAM,KACJ,SAAS,mBAAmB,MAAM,IAClC,OAAS,iBAAiB,IAAI,IAC9B,mBAAmB;AAErB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,QAAQ,eAAe;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,iBAAiB,2BAA2B,UAAU,MAAM,QAAQ,IAAI,IAAI,CAAC,KAAK,UAAU,IAAI,QAAQ,IAAI,IAAI,CAAC,KAAK,GAAG,MAAM;AAAA,MAEvI;AAAA,gBAAQ,oBAAC,UAAK,WAAU,eAAc,OAAO,QAAQ,SAAY,EAAE,OAAO,GAAG,GAAI,gBAAK;AAAA,QACtF;AAAA,QACA,cAAc,oBAAC,YAAS,SAAS,aAAa,IAAK;AAAA;AAAA;AAAA,EACtD;AAEJ;","names":[]}
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6
- variant?: "default" | "destructive" | null | undefined;
6
+ variant?: "destructive" | "default" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
9
9
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6
- variant?: "default" | "destructive" | null | undefined;
6
+ variant?: "destructive" | "default" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
9
9
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -104,7 +104,7 @@ function AssetMarketplacePanel({
104
104
  }
105
105
  ) : null;
106
106
  const offerButton = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { action: "offer", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, children: t("Make offer") });
107
- const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
107
+ const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
108
108
  const listedPrice = !isOwner && liveCheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceBlock, { order: liveCheapest, usdValue }) : null;
109
109
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-4", children: [
110
110
  isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DS;AA5DT,mBAAyC;AACzC,0BAGO;AACP,2BAA6B;AAC7B,6BAA+B;AAC/B,2BAA6B;AAC7B,kBAAqC;AACrC,0BAA8B;AAC9B,gBAAmB;AACnB,uBAAyB;AACzB,gCAAuD;AACvD,2BAA+C;AAC/C,sBAAqB;AACrB,mBAAsB;AA2CtB,SAAS,UAAU,EAAE,SAAS,GAA4B;AACxD,QAAM,MAAM,sBAAS,QAAQ,QAAQ,EAAE,SAAS,MAAM;AACtD,SAAO,4CAAC,SAAI,eAAW,cAAG,iEAAiE,OAAO,8BAA8B,GAAI,UAAS;AAC/I;AAEA,SAAS,WAAW,EAAE,OAAO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,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,4CAAC,gDAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton solid action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DS;AA5DT,mBAAyC;AACzC,0BAGO;AACP,2BAA6B;AAC7B,6BAA+B;AAC/B,2BAA6B;AAC7B,kBAAqC;AACrC,0BAA8B;AAC9B,gBAAmB;AACnB,uBAAyB;AACzB,gCAAuD;AACvD,2BAA+C;AAC/C,sBAAqB;AACrB,mBAAsB;AA2CtB,SAAS,UAAU,EAAE,SAAS,GAA4B;AACxD,QAAM,MAAM,sBAAS,QAAQ,QAAQ,EAAE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,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA,4CAAC,qCAAa,OAAK,MAAC,QAAO,OAAM,MAAM,4CAAC,mCAAY,WAAU,eAAc,GAAI,UAAU,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,4CAAC,gDAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
@@ -91,7 +91,7 @@ function AssetMarketplacePanel({
91
91
  }
92
92
  ) : null;
93
93
  const offerButton = /* @__PURE__ */ jsx(ActionButton, { action: "offer", icon: /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, children: t("Make offer") });
94
- const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ jsx(ActionButton, { action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
94
+ const buyButton = liveCheapest && (!isOwner || canBuyMore) ? /* @__PURE__ */ jsx(ActionButton, { solid: true, action: "buy", onClick: () => onOpenPurchase(liveCheapest), children: t("Buy now") }) : null;
95
95
  const listedPrice = !isOwner && liveCheapest ? /* @__PURE__ */ jsx(PriceBlock, { order: liveCheapest, usdValue }) : null;
96
96
  return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: "relative space-y-4", children: [
97
97
  isOwner ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AA8DS,cA2DH,YA3DG;AA5DT,SAAS,gBAAgC;AACzC;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;AAAA,EAAK;AAAA,OACA;AACP,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,0BAA0B;AACvD,SAAS,uBAAsC;AAC/C,SAAS,YAAY;AACrB,SAAS,aAAa;AA2CtB,SAAS,UAAU,EAAE,SAAS,GAA4B;AACxD,QAAM,MAAM,SAAS,QAAQ,QAAQ,EAAE,SAAS,MAAM;AACtD,SAAO,oBAAC,SAAI,WAAW,GAAG,iEAAiE,OAAO,8BAA8B,GAAI,UAAS;AAC/I;AAEA,SAAS,WAAW,EAAE,OAAO,SAAS,GAAsD;AAC1F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB,MAAM,MAAM;AAAA,MAC7B,UAAU,MAAM,MAAM;AAAA,MACtB;AAAA,MACA,OAAM;AAAA,MACN,UAAU,oBAAC,YAAS,SAAS,WAAW,UAA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ources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Children, type ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Handshake, Loader2,\n Tag, X,\n} from \"lucide-react\";\nimport { PriceDisplay } from \"./price-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { AssetAccessButtons, CompanionAppButton } from \"./asset-access-cards.js\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { Panel } from \"./panel.js\";\n\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n asset: AssetRef;\n compact?: boolean;\n cheapest?: T;\n isOwner: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n\n}\n\nfunction ActionRow({ children }: { children: ReactNode }) {\n const odd = Children.toArray(children).length % 2 === 1;\n return <div className={cn(\"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:[&>*]:min-w-36\", odd && \"[&>*:first-child]:col-span-2\")}>{children}</div>;\n}\n\nfunction PriceBlock({ order, usdValue }: { order: ApiOrderLike; usdValue?: string | null }) {\n return (\n <PriceDisplay\n amountFormatted={order.price.formatted}\n currency={order.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={<HelpIcon content={`Expires ${timeUntil(order.endTime)}`} />}\n />\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n asset,\n compact = false,\n cheapest,\n isOwner,\n isProcessing,\n isERC1155,\n canListMoreEditions,\n isMarketLoading = false,\n myListing,\n activeBids,\n remixEnabled = false,\n showDealOption = false,\n showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n usdValue,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const t = useT();\n const { walletAddress } = useMedialaneApp();\n const isSignedIn = !!walletAddress;\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n const remixButton = remixEnabled && onOpenRemix ? (\n <ActionButton\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n >\n {t(\"Remix\")}\n </ActionButton>\n ) : null;\n\n const offerButton = (\n <ActionButton action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer}>\n {t(\"Make offer\")}\n </ActionButton>\n );\n\n const buyButton = liveCheapest && (!isOwner || canBuyMore) ? (\n <ActionButton solid action=\"buy\" onClick={() => onOpenPurchase(liveCheapest)}>\n {t(\"Buy now\")}\n </ActionButton>\n ) : null;\n\n const listedPrice = !isOwner && liveCheapest ? <PriceBlock order={liveCheapest} usdValue={usdValue} /> : null;\n\n return (\n <div className=\"relative\">\n\n <div className=\"relative space-y-4\">\n {isOwner ? (\n <div className=\"space-y-4\">\n {liveMyListing ? (\n <PriceBlock\n order={liveMyListing}\n usdValue={liveMyListing.orderHash === liveCheapest?.orderHash ? usdValue : null}\n />\n ) : null}\n <ActionRow>\n {liveMyListing ? (\n <ActionButton\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n helpContent={`Expires ${timeUntil(liveMyListing.endTime)}`}\n >\n {t(\"Cancel listing\")}\n </ActionButton>\n ) : null}\n {!liveMyListing || (isERC1155 && canListMoreEditions !== false) ? (\n <ActionButton tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing}>\n {liveMyListing ? t(\"Sell more\") : t(\"Sell\")}\n </ActionButton>\n ) : null}\n <ActionButton tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer}>{t(\"Transfer\")}</ActionButton>\n {remixButton}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n >\n {t(\"Open for sponsorship\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n {buyButton && liveCheapest ? (\n <div className=\"space-y-4\">\n <PriceBlock order={liveCheapest} usdValue={usdValue} />\n <ActionRow>{buyButton}</ActionRow>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"space-y-4\">\n {listedPrice}\n {isSignedIn ? (\n <ActionRow>\n {buyButton}\n {offerButton}\n {remixButton}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n action=\"license\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n >\n {t(\"License\")}\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n >\n {t(\"Sponsor\")}\n </ActionButton>\n ) : null}\n </ActionRow>\n ) : (\n <AssetAccessButtons asset={asset} stacked={compact} />\n )}\n </div>\n )}\n\n {myBid ? (\n <Panel tone={[\"orange\", \"rose\"]} className=\"px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-brand-orange shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-brand-orange\">{t(\"Your active offer\")}</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <PriceDisplay amountFormatted={myBid.price.formatted} currency={myBid.price.currency} scale=\"row\" />\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-brand-rose hover:opacity-80 transition-opacity flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n {t(\"Cancel\")}\n </button>\n </Panel>\n ) : null}\n\n {isOwner && liveBids.length > 0 ? (\n <div className=\"space-y-2\">\n <p className=\"text-xs font-semibold text-muted-foreground\">{t(\"Incoming offers ({count})\", { count: liveBids.length })}</p>\n <div className=\"divide-y divide-border/40\">\n {liveBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <PriceDisplay amountFormatted={bid.price.formatted} currency={bid.price.currency} scale=\"row\" />\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <ActionButton small action=\"buy\" icon={<CheckCircle className=\"h-3.5 w-3.5\" />} disabled={isProcessing} onClick={() => onAcceptBid(bid)}>\n {t(\"Accept\")}\n </ActionButton>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n\n {isSignedIn ? <CompanionAppButton asset={asset} variant=\"link\" /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";AA8DS,cA2DH,YA3DG;AA5DT,SAAS,gBAAgC;AACzC;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;AAAA,EAAK;AAAA,OACA;AACP,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,0BAA0B;AACvD,SAAS,uBAAsC;AAC/C,SAAS,YAAY;AACrB,SAAS,aAAa;AA2CtB,SAAS,UAAU,EAAE,SAAS,GAA4B;AACxD,QAAM,MAAM,SAAS,QAAQ,QAAQ,EAAE,SAAS,MAAM;AACtD,SAAO,oBAAC,SAAI,WAAW,GAAG,iEAAiE,OA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AM,oBAAC,eAAY,WAAU,eAAc,GAAI,UAAU,cAAc,SAAS,MAAM,YAAY,GAAG,GACnI,YAAE,QAAQ,GACb;AAAA,WAhBQ,IAAI,SAiBd,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,aAAa,oBAAC,sBAAmB,OAAc,SAAQ,QAAO,IAAK;AAAA,KACtE,GACF;AAEJ;","names":[]}
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
7
+ variant?: "destructive" | "default" | "outline" | "secondary" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
10
10
  }
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
7
+ variant?: "destructive" | "default" | "outline" | "secondary" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
10
10
  }
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "link" | "default" | "destructive" | "ghost" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
+ variant?: "destructive" | "ghost" | "link" | "default" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "link" | "default" | "destructive" | "ghost" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
+ variant?: "destructive" | "ghost" | "link" | "default" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -62,7 +62,7 @@ function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUr
62
62
  (c) => c.label === ipType || c.apiValue === ipType
63
63
  );
64
64
  if (!config) return null;
65
- const { icon: Icon, colorClass, bgClass, slug, label } = config;
65
+ const { icon: Icon, colorClass, slug, label } = config;
66
66
  const { container, icon } = SIZE[size];
67
67
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
68
68
  "a",
@@ -71,8 +71,7 @@ function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUr
71
71
  title: t(label),
72
72
  className: (0, import_cn.cn)(
73
73
  "inline-flex items-center justify-center rounded-full",
74
- "transition-opacity hover:opacity-80",
75
- bgClass,
74
+ "bg-background/40 transition-opacity hover:opacity-80",
76
75
  showLabel ? PILL[size] : container,
77
76
  className
78
77
  ),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem,\n FileText, BookOpen, File, Building, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n rwa: Building,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const t = useT();\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={t(label)}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\",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,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY,KAAK,IAAI,IAAI;AAAA,QACzB;AAAA,MACF;AAAA,MACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,MAElC;AAAA,oDAAC,QAAK,eAAW,cAAG,YAAY,IAAI,GAAG;AAAA,QACtC,YAAY,4CAAC,UAAK,eAAW,cAAG,yBAAyB,UAAU,GAAI,YAAE,KAAK,GAAE,IAAU;AAAA;AAAA;AAAA,EAC7F;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem,\n FileText, BookOpen, File, Building, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n rwa: Building,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const t = useT();\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={t(label)}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"bg-background/40 transition-opacity hover:opacity-80\",\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{t(label)}</span> : null}\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiEI;AA/DJ,0BAGO;AACP,gBAAmB;AACnB,sBAAqB;AACrB,sBAA+C;AAOxC,MAAM,iBAAiC,6BAAa,IAAI,CAAC,MAAM;AACpE,QAAM,QAA2C;AAAA,IAC/C,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AACA,SAAO,EAAE,GAAG,GAAG,MAAM,MAAM,EAAE,IAAI,KAAK,2BAAO;AAC/C,CAAC;AAEM,MAAM,cAAc,OAAO;AAAA,EAChC,eAAe,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACvC;AAKA,MAAM,OAAO;AAAA,EACX,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAAA,EAC5C,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAC9C;AAEA,MAAM,OAAO;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AACN;AAWO,SAAS,YAAY,EAAE,QAAQ,OAAO,MAAM,YAAY,OAAO,WAAW,UAAU,GAAG,GAAqB;AACjH,QAAM,QAAI,sBAAK;AACf,QAAM,SAAS,eAAe;AAAA,IAC5B,CAAC,MAAM,EAAE,UAAU,UAAU,EAAE,aAAa;AAAA,EAC9C;AACA,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,EAAE,MAAM,MAAM,YAAY,MAAM,MAAM,IAAI;AAChD,QAAM,EAAE,WAAW,KAAK,IAAI,KAAK,IAAI;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,GAAG,OAAO,IAAI,IAAI;AAAA,MACxB,OAAO,EAAE,KAAK;AAAA,MACd,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,YAAY,KAAK,IAAI,IAAI;AAAA,QACzB;AAAA,MACF;AAAA,MACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,MAElC;AAAA,oDAAC,QAAK,eAAW,cAAG,YAAY,IAAI,GAAG;AAAA,QACtC,YAAY,4CAAC,UAAK,eAAW,cAAG,yBAAyB,UAAU,GAAI,YAAE,KAAK,GAAE,IAAU;AAAA;AAAA;AAAA,EAC7F;AAEJ;","names":[]}
@@ -46,7 +46,7 @@ function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUr
46
46
  (c) => c.label === ipType || c.apiValue === ipType
47
47
  );
48
48
  if (!config) return null;
49
- const { icon: Icon, colorClass, bgClass, slug, label } = config;
49
+ const { icon: Icon, colorClass, slug, label } = config;
50
50
  const { container, icon } = SIZE[size];
51
51
  return /* @__PURE__ */ jsxs(
52
52
  "a",
@@ -55,8 +55,7 @@ function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUr
55
55
  title: t(label),
56
56
  className: cn(
57
57
  "inline-flex items-center justify-center rounded-full",
58
- "transition-opacity hover:opacity-80",
59
- bgClass,
58
+ "bg-background/40 transition-opacity hover:opacity-80",
60
59
  showLabel ? PILL[size] : container,
61
60
  className
62
61
  ),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem,\n FileText, BookOpen, File, Building, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n rwa: Building,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const t = useT();\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={t(label)}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{t(label)}</span> : null}\n </a>\n );\n}\n"],"mappings":";AAiEI,SAYE,KAZF;AA/DJ;AAAA,EACE;AAAA,EAAO;AAAA,EAAS;AAAA,EAAM;AAAA,EAAQ;AAAA,EAC9B;AAAA,EAAU;AAAA,EAAU;AAAA,EAAM;AAAA,EAAU;AAAA,OAC/B;AACP,SAAS,UAAU;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc,wBAAwB;AAOxC,MAAM,iBAAiC,aAAa,IAAI,CAAC,MAAM;AACpE,QAAM,QAA2C;AAAA,IAC/C,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AACA,SAAO,EAAE,GAAG,GAAG,MAAM,MAAM,EAAE,IAAI,KAAK,OAAO;AAC/C,CAAC;AAEM,MAAM,cAAc,OAAO;AAAA,EAChC,eAAe,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACvC;AAKA,MAAM,OAAO;AAAA,EACX,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAAA,EAC5C,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAC9C;AAEA,MAAM,OAAO;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AACN;AAWO,SAAS,YAAY,EAAE,QAAQ,OAAO,MAAM,YAAY,OAAO,WAAW,UAAU,GAAG,GAAqB;AACjH,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,eAAe;AAAA,IAC5B,CAAC,MAAM,EAAE,UAAU,UAAU,EAAE,aAAa;AAAA,EAC9C;AACA,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,EAAE,MAAM,MAAM,YAAY,SAAS,MAAM,MAAM,IAAI;AACzD,QAAM,EAAE,WAAW,KAAK,IAAI,KAAK,IAAI;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,GAAG,OAAO,IAAI,IAAI;AAAA,MACxB,OAAO,EAAE,KAAK;AAAA,MACd,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY,KAAK,IAAI,IAAI;AAAA,QACzB;AAAA,MACF;AAAA,MACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,MAElC;AAAA,4BAAC,QAAK,WAAW,GAAG,YAAY,IAAI,GAAG;AAAA,QACtC,YAAY,oBAAC,UAAK,WAAW,GAAG,yBAAyB,UAAU,GAAI,YAAE,KAAK,GAAE,IAAU;AAAA;AAAA;AAAA,EAC7F;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem,\n FileText, BookOpen, File, Building, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n rwa: Building,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const t = useT();\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={t(label)}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"bg-background/40 transition-opacity hover:opacity-80\",\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{t(label)}</span> : null}\n </a>\n );\n}\n"],"mappings":";AAiEI,SAWE,KAXF;AA/DJ;AAAA,EACE;AAAA,EAAO;AAAA,EAAS;AAAA,EAAM;AAAA,EAAQ;AAAA,EAC9B;AAAA,EAAU;AAAA,EAAU;AAAA,EAAM;AAAA,EAAU;AAAA,OAC/B;AACP,SAAS,UAAU;AACnB,SAAS,YAAY;AACrB,SAAS,cAAc,wBAAwB;AAOxC,MAAM,iBAAiC,aAAa,IAAI,CAAC,MAAM;AACpE,QAAM,QAA2C;AAAA,IAC/C,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IAC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  name: string;
19
+ value: string;
19
20
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
20
21
  licenseType: string;
21
22
  commercialUse: "Yes" | "No";
@@ -24,12 +25,12 @@ declare const editionMintSchema: z.ZodObject<{
24
25
  geographicScope: string;
25
26
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
26
27
  royalty: number;
27
- value: string;
28
28
  recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
+ value: string;
33
34
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
34
35
  licenseType: string;
35
36
  commercialUse: "Yes" | "No";
@@ -38,7 +39,6 @@ declare const editionMintSchema: z.ZodObject<{
38
39
  geographicScope: string;
39
40
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
40
41
  royalty: number;
41
- value: string;
42
42
  recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
@@ -16,6 +16,7 @@ declare const editionMintSchema: z.ZodObject<{
16
16
  royalty: z.ZodNumber;
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  name: string;
19
+ value: string;
19
20
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
20
21
  licenseType: string;
21
22
  commercialUse: "Yes" | "No";
@@ -24,12 +25,12 @@ declare const editionMintSchema: z.ZodObject<{
24
25
  geographicScope: string;
25
26
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
26
27
  royalty: number;
27
- value: string;
28
28
  recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
+ value: string;
33
34
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
34
35
  licenseType: string;
35
36
  commercialUse: "Yes" | "No";
@@ -38,7 +39,6 @@ declare const editionMintSchema: z.ZodObject<{
38
39
  geographicScope: string;
39
40
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
40
41
  royalty: number;
41
- value: string;
42
42
  recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
@@ -41,9 +41,9 @@ var import_brand = require("../data/brand.js");
41
41
  const stop = (color, alpha) => `hsl(var(--brand-${color}) / ${alpha})`;
42
42
  function panelBackground(tone = "neutral") {
43
43
  if (tone === "neutral") return "linear-gradient(to bottom right, hsl(var(--muted) / 0.4), transparent)";
44
- if (typeof tone === "string") return `linear-gradient(to bottom right, ${stop(tone, 0.2)}, transparent)`;
44
+ if (typeof tone === "string") return `linear-gradient(to bottom right, ${stop(tone, 0.32)}, transparent)`;
45
45
  const [from, to] = tone;
46
- return `linear-gradient(to bottom right, ${stop(from, 0.2)}, ${stop(to, 0.1)}, transparent)`;
46
+ return `linear-gradient(to bottom right, ${stop(from, 0.32)}, ${stop(to, 0.16)}, transparent)`;
47
47
  }
48
48
  const Panel = React.forwardRef(
49
49
  ({ tone = "neutral", className, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/panel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn.js\";\nimport { BRAND } from \"../data/brand.js\";\n\nexport type PanelColor = keyof typeof BRAND;\n\n/** \"neutral\", one brand colour, or a pair blended from the first into the second. */\nexport type PanelTone = \"neutral\" | PanelColor | readonly [PanelColor, PanelColor];\n\nconst stop = (color: PanelColor, alpha: number) => `hsl(var(--brand-${color}) / ${alpha})`;\n\n/** Borderless surface: a soft gradient from the top-left corner that fades to transparent. */\nexport function panelBackground(tone: PanelTone = \"neutral\"): string {\n if (tone === \"neutral\") return \"linear-gradient(to bottom right, hsl(var(--muted) / 0.4), transparent)\";\n if (typeof tone === \"string\") return `linear-gradient(to bottom right, ${stop(tone, 0.2)}, transparent)`;\n const [from, to] = tone;\n return `linear-gradient(to bottom right, ${stop(from, 0.2)}, ${stop(to, 0.1)}, transparent)`;\n}\n\nexport interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {\n tone?: PanelTone;\n}\n\nexport const Panel = React.forwardRef<HTMLDivElement, PanelProps>(\n ({ tone = \"neutral\", className, style, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-2xl\", className)}\n style={{ backgroundImage: panelBackground(tone), ...style }}\n {...props}\n />\n ),\n);\nPanel.displayName = \"Panel\";\n\n/** Surface for controls and chips that sit on a panel. */\nexport const PANEL_INSET = \"bg-background/40 hover:bg-background/70 transition-colors\";\n\nexport interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Brand colour for the text and icon; muted text when omitted. */\n color?: PanelColor;\n}\n\nexport function Pill({ color, className, ...props }: PillProps) {\n return (\n <span\n className={cn(\n \"inline-flex w-fit items-center gap-1.5 rounded-full bg-background/40 px-3 py-1 text-xs font-medium\",\n color ? BRAND[color].text : \"text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBI;AAzBJ,YAAuB;AACvB,gBAAmB;AACnB,mBAAsB;AAOtB,MAAM,OAAO,CAAC,OAAmB,UAAkB,mBAAmB,KAAK,OAAO,KAAK;AAGhF,SAAS,gBAAgB,OAAkB,WAAmB;AACnE,MAAI,SAAS,UAAW,QAAO;AAC/B,MAAI,OAAO,SAAS,SAAU,QAAO,oCAAoC,KAAK,MAAM,GAAG,CAAC;AACxF,QAAM,CAAC,MAAM,EAAE,IAAI;AACnB,SAAO,oCAAoC,KAAK,MAAM,GAAG,CAAC,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9E;AAMO,MAAM,QAAQ,MAAM;AAAA,EACzB,CAAC,EAAE,OAAO,WAAW,WAAW,OAAO,GAAG,MAAM,GAAG,QACjD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,eAAe,SAAS;AAAA,MACtC,OAAO,EAAE,iBAAiB,gBAAgB,IAAI,GAAG,GAAG,MAAM;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;AAGb,MAAM,cAAc;AAOpB,SAAS,KAAK,EAAE,OAAO,WAAW,GAAG,MAAM,GAAc;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA,QAAQ,mBAAM,KAAK,EAAE,OAAO;AAAA,QAC5B;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/panel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn.js\";\nimport { BRAND } from \"../data/brand.js\";\n\nexport type PanelColor = keyof typeof BRAND;\n\n/** \"neutral\", one brand colour, or a pair blended from the first into the second. */\nexport type PanelTone = \"neutral\" | PanelColor | readonly [PanelColor, PanelColor];\n\nconst stop = (color: PanelColor, alpha: number) => `hsl(var(--brand-${color}) / ${alpha})`;\n\n/** Borderless surface: a soft gradient from the top-left corner that fades to transparent. */\nexport function panelBackground(tone: PanelTone = \"neutral\"): string {\n if (tone === \"neutral\") return \"linear-gradient(to bottom right, hsl(var(--muted) / 0.4), transparent)\";\n if (typeof tone === \"string\") return `linear-gradient(to bottom right, ${stop(tone, 0.32)}, transparent)`;\n const [from, to] = tone;\n return `linear-gradient(to bottom right, ${stop(from, 0.32)}, ${stop(to, 0.16)}, transparent)`;\n}\n\nexport interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {\n tone?: PanelTone;\n}\n\nexport const Panel = React.forwardRef<HTMLDivElement, PanelProps>(\n ({ tone = \"neutral\", className, style, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-2xl\", className)}\n style={{ backgroundImage: panelBackground(tone), ...style }}\n {...props}\n />\n ),\n);\nPanel.displayName = \"Panel\";\n\n/** Surface for controls and chips that sit on a panel. */\nexport const PANEL_INSET = \"bg-background/40 hover:bg-background/70 transition-colors\";\n\nexport interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Brand colour for the text and icon; muted text when omitted. */\n color?: PanelColor;\n}\n\nexport function Pill({ color, className, ...props }: PillProps) {\n return (\n <span\n className={cn(\n \"inline-flex w-fit items-center gap-1.5 rounded-full bg-background/40 px-3 py-1 text-xs font-medium\",\n color ? BRAND[color].text : \"text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBI;AAzBJ,YAAuB;AACvB,gBAAmB;AACnB,mBAAsB;AAOtB,MAAM,OAAO,CAAC,OAAmB,UAAkB,mBAAmB,KAAK,OAAO,KAAK;AAGhF,SAAS,gBAAgB,OAAkB,WAAmB;AACnE,MAAI,SAAS,UAAW,QAAO;AAC/B,MAAI,OAAO,SAAS,SAAU,QAAO,oCAAoC,KAAK,MAAM,IAAI,CAAC;AACzF,QAAM,CAAC,MAAM,EAAE,IAAI;AACnB,SAAO,oCAAoC,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC;AAChF;AAMO,MAAM,QAAQ,MAAM;AAAA,EACzB,CAAC,EAAE,OAAO,WAAW,WAAW,OAAO,GAAG,MAAM,GAAG,QACjD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,eAAe,SAAS;AAAA,MACtC,OAAO,EAAE,iBAAiB,gBAAgB,IAAI,GAAG,GAAG,MAAM;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;AAGb,MAAM,cAAc;AAOpB,SAAS,KAAK,EAAE,OAAO,WAAW,GAAG,MAAM,GAAc;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA,QAAQ,mBAAM,KAAK,EAAE,OAAO;AAAA,QAC5B;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -5,9 +5,9 @@ import { BRAND } from "../data/brand.js";
5
5
  const stop = (color, alpha) => `hsl(var(--brand-${color}) / ${alpha})`;
6
6
  function panelBackground(tone = "neutral") {
7
7
  if (tone === "neutral") return "linear-gradient(to bottom right, hsl(var(--muted) / 0.4), transparent)";
8
- if (typeof tone === "string") return `linear-gradient(to bottom right, ${stop(tone, 0.2)}, transparent)`;
8
+ if (typeof tone === "string") return `linear-gradient(to bottom right, ${stop(tone, 0.32)}, transparent)`;
9
9
  const [from, to] = tone;
10
- return `linear-gradient(to bottom right, ${stop(from, 0.2)}, ${stop(to, 0.1)}, transparent)`;
10
+ return `linear-gradient(to bottom right, ${stop(from, 0.32)}, ${stop(to, 0.16)}, transparent)`;
11
11
  }
12
12
  const Panel = React.forwardRef(
13
13
  ({ tone = "neutral", className, style, ...props }, ref) => /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/panel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn.js\";\nimport { BRAND } from \"../data/brand.js\";\n\nexport type PanelColor = keyof typeof BRAND;\n\n/** \"neutral\", one brand colour, or a pair blended from the first into the second. */\nexport type PanelTone = \"neutral\" | PanelColor | readonly [PanelColor, PanelColor];\n\nconst stop = (color: PanelColor, alpha: number) => `hsl(var(--brand-${color}) / ${alpha})`;\n\n/** Borderless surface: a soft gradient from the top-left corner that fades to transparent. */\nexport function panelBackground(tone: PanelTone = \"neutral\"): string {\n if (tone === \"neutral\") return \"linear-gradient(to bottom right, hsl(var(--muted) / 0.4), transparent)\";\n if (typeof tone === \"string\") return `linear-gradient(to bottom right, ${stop(tone, 0.2)}, transparent)`;\n const [from, to] = tone;\n return `linear-gradient(to bottom right, ${stop(from, 0.2)}, ${stop(to, 0.1)}, transparent)`;\n}\n\nexport interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {\n tone?: PanelTone;\n}\n\nexport const Panel = React.forwardRef<HTMLDivElement, PanelProps>(\n ({ tone = \"neutral\", className, style, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-2xl\", className)}\n style={{ backgroundImage: panelBackground(tone), ...style }}\n {...props}\n />\n ),\n);\nPanel.displayName = \"Panel\";\n\n/** Surface for controls and chips that sit on a panel. */\nexport const PANEL_INSET = \"bg-background/40 hover:bg-background/70 transition-colors\";\n\nexport interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Brand colour for the text and icon; muted text when omitted. */\n color?: PanelColor;\n}\n\nexport function Pill({ color, className, ...props }: PillProps) {\n return (\n <span\n className={cn(\n \"inline-flex w-fit items-center gap-1.5 rounded-full bg-background/40 px-3 py-1 text-xs font-medium\",\n color ? BRAND[color].text : \"text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"AAyBI;AAzBJ,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa;AAOtB,MAAM,OAAO,CAAC,OAAmB,UAAkB,mBAAmB,KAAK,OAAO,KAAK;AAGhF,SAAS,gBAAgB,OAAkB,WAAmB;AACnE,MAAI,SAAS,UAAW,QAAO;AAC/B,MAAI,OAAO,SAAS,SAAU,QAAO,oCAAoC,KAAK,MAAM,GAAG,CAAC;AACxF,QAAM,CAAC,MAAM,EAAE,IAAI;AACnB,SAAO,oCAAoC,KAAK,MAAM,GAAG,CAAC,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9E;AAMO,MAAM,QAAQ,MAAM;AAAA,EACzB,CAAC,EAAE,OAAO,WAAW,WAAW,OAAO,GAAG,MAAM,GAAG,QACjD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,eAAe,SAAS;AAAA,MACtC,OAAO,EAAE,iBAAiB,gBAAgB,IAAI,GAAG,GAAG,MAAM;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;AAGb,MAAM,cAAc;AAOpB,SAAS,KAAK,EAAE,OAAO,WAAW,GAAG,MAAM,GAAc;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,QAAQ,MAAM,KAAK,EAAE,OAAO;AAAA,QAC5B;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/panel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn.js\";\nimport { BRAND } from \"../data/brand.js\";\n\nexport type PanelColor = keyof typeof BRAND;\n\n/** \"neutral\", one brand colour, or a pair blended from the first into the second. */\nexport type PanelTone = \"neutral\" | PanelColor | readonly [PanelColor, PanelColor];\n\nconst stop = (color: PanelColor, alpha: number) => `hsl(var(--brand-${color}) / ${alpha})`;\n\n/** Borderless surface: a soft gradient from the top-left corner that fades to transparent. */\nexport function panelBackground(tone: PanelTone = \"neutral\"): string {\n if (tone === \"neutral\") return \"linear-gradient(to bottom right, hsl(var(--muted) / 0.4), transparent)\";\n if (typeof tone === \"string\") return `linear-gradient(to bottom right, ${stop(tone, 0.32)}, transparent)`;\n const [from, to] = tone;\n return `linear-gradient(to bottom right, ${stop(from, 0.32)}, ${stop(to, 0.16)}, transparent)`;\n}\n\nexport interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {\n tone?: PanelTone;\n}\n\nexport const Panel = React.forwardRef<HTMLDivElement, PanelProps>(\n ({ tone = \"neutral\", className, style, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-2xl\", className)}\n style={{ backgroundImage: panelBackground(tone), ...style }}\n {...props}\n />\n ),\n);\nPanel.displayName = \"Panel\";\n\n/** Surface for controls and chips that sit on a panel. */\nexport const PANEL_INSET = \"bg-background/40 hover:bg-background/70 transition-colors\";\n\nexport interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Brand colour for the text and icon; muted text when omitted. */\n color?: PanelColor;\n}\n\nexport function Pill({ color, className, ...props }: PillProps) {\n return (\n <span\n className={cn(\n \"inline-flex w-fit items-center gap-1.5 rounded-full bg-background/40 px-3 py-1 text-xs font-medium\",\n color ? BRAND[color].text : \"text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":"AAyBI;AAzBJ,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa;AAOtB,MAAM,OAAO,CAAC,OAAmB,UAAkB,mBAAmB,KAAK,OAAO,KAAK;AAGhF,SAAS,gBAAgB,OAAkB,WAAmB;AACnE,MAAI,SAAS,UAAW,QAAO;AAC/B,MAAI,OAAO,SAAS,SAAU,QAAO,oCAAoC,KAAK,MAAM,IAAI,CAAC;AACzF,QAAM,CAAC,MAAM,EAAE,IAAI;AACnB,SAAO,oCAAoC,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC;AAChF;AAMO,MAAM,QAAQ,MAAM;AAAA,EACzB,CAAC,EAAE,OAAO,WAAW,WAAW,OAAO,GAAG,MAAM,GAAG,QACjD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,eAAe,SAAS;AAAA,MACtC,OAAO,EAAE,iBAAiB,gBAAgB,IAAI,GAAG,GAAG,MAAM;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;AAGb,MAAM,cAAc;AAOpB,SAAS,KAAK,EAAE,OAAO,WAAW,GAAG,MAAM,GAAc;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,QAAQ,MAAM,KAAK,EAAE,OAAO;AAAA,QAC5B;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.376.0",
3
+ "version": "0.377.0",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "sideEffects": false,