@medialane/ui 0.299.0 → 0.300.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.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/launchpad/collection-picker.cjs +1 -1
- package/dist/components/launchpad/collection-picker.cjs.map +1 -1
- package/dist/components/launchpad/collection-picker.js +1 -1
- package/dist/components/launchpad/collection-picker.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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>, "
|
|
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>, "
|
|
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>, "
|
|
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>, "
|
|
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;
|
|
@@ -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" | "
|
|
7
|
+
variant?: "default" | "destructive" | "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" | "
|
|
7
|
+
variant?: "default" | "destructive" | "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?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "ghost" | "link" | "default" | "destructive" | "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?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "ghost" | "link" | "default" | "destructive" | "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;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { FastMintProps } from './types.cjs';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { FastMintProps } from './types.js';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
7
7
|
|
|
8
|
-
declare function FastMint(props: FastMintProps): string | number | bigint | boolean |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -58,7 +58,7 @@ function CollectionPicker({ collections, loading, value, onChange, newCollection
|
|
|
58
58
|
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-[4.25rem] rounded-xl" });
|
|
59
59
|
if (collections.length === 0) {
|
|
60
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl border border-dashed border-border p-5 text-center space-y-3", children: [
|
|
61
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "No collection found. It may take a minute to display recently created collections." }),
|
|
62
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
63
|
import_link.default,
|
|
64
64
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/launchpad/collection-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Boxes, Check, ChevronDown, Plus } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Input } from \"../input.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\n\nexport interface CollectionPickerProps {\n collections: ApiCollection[];\n loading: boolean;\n value: string;\n onChange: (id: string) => void;\n newCollectionHref: string;\n}\n\nfunction label(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction works(col: ApiCollection) {\n return col.totalSupply != null ? `${col.totalSupply.toLocaleString()} work${col.totalSupply !== 1 ? \"s\" : \"\"}` : \"Empty\";\n}\n\nfunction Thumb({ image, size }: { image: string | null | undefined; size: \"sm\" | \"md\" }) {\n const url = useImageUrl()(image);\n return (\n <div className={cn(\"relative rounded-lg overflow-hidden bg-muted shrink-0\", size === \"md\" ? \"h-10 w-10\" : \"h-8 w-8\")}>\n {url ? (\n <Image src={url} alt=\"\" fill unoptimized className=\"object-cover\" />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nexport function CollectionPicker({ collections, loading, value, onChange, newCollectionHref }: CollectionPickerProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n\n if (loading) return <Skeleton className=\"h-[4.25rem] rounded-xl\" />;\n\n if (collections.length === 0) {\n return (\n <div className=\"rounded-xl border border-dashed border-border p-5 text-center space-y-3\">\n <p className=\"text-sm text-muted-foreground\">
|
|
1
|
+
{"version":3,"sources":["../../../src/components/launchpad/collection-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Boxes, Check, ChevronDown, Plus } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Input } from \"../input.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\n\nexport interface CollectionPickerProps {\n collections: ApiCollection[];\n loading: boolean;\n value: string;\n onChange: (id: string) => void;\n newCollectionHref: string;\n}\n\nfunction label(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction works(col: ApiCollection) {\n return col.totalSupply != null ? `${col.totalSupply.toLocaleString()} work${col.totalSupply !== 1 ? \"s\" : \"\"}` : \"Empty\";\n}\n\nfunction Thumb({ image, size }: { image: string | null | undefined; size: \"sm\" | \"md\" }) {\n const url = useImageUrl()(image);\n return (\n <div className={cn(\"relative rounded-lg overflow-hidden bg-muted shrink-0\", size === \"md\" ? \"h-10 w-10\" : \"h-8 w-8\")}>\n {url ? (\n <Image src={url} alt=\"\" fill unoptimized className=\"object-cover\" />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nexport function CollectionPicker({ collections, loading, value, onChange, newCollectionHref }: CollectionPickerProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n\n if (loading) return <Skeleton className=\"h-[4.25rem] rounded-xl\" />;\n\n if (collections.length === 0) {\n return (\n <div className=\"rounded-xl border border-dashed border-border p-5 text-center space-y-3\">\n <p className=\"text-sm text-muted-foreground\">No collection found. It may take a minute to display recently created collections.</p>\n <Link\n href={newCollectionHref}\n className=\"inline-flex items-center gap-1.5 h-9 px-4 rounded-xl text-sm font-semibold text-white bg-brand-blue hover:brightness-110 transition-all\"\n >\n <Plus className=\"h-3.5 w-3.5\" />\n Create your first collection\n </Link>\n </div>\n );\n }\n\n const selected = collections.find((c) => c.collectionId === value) ?? null;\n const filtered = query.trim() ? collections.filter((c) => label(c).toLowerCase().includes(query.trim().toLowerCase())) : collections;\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) setQuery(\"\");\n }}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-expanded={open}\n className=\"flex w-full items-center gap-3 rounded-xl border border-border p-3 text-left transition-colors hover:bg-muted/40\"\n >\n <Thumb image={selected?.image} size=\"md\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold truncate\">{selected ? label(selected) : \"Choose a collection\"}</p>\n <p className=\"text-xs text-muted-foreground\">{selected ? works(selected) : \"Where this work will live\"}</p>\n </div>\n <span className=\"flex items-center gap-1 text-xs font-medium text-muted-foreground shrink-0\">\n Change\n <ChevronDown className=\"h-3.5 w-3.5\" />\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[var(--radix-popover-trigger-width)] p-0\" align=\"start\">\n {collections.length > 5 && (\n <div className=\"border-b border-border p-2\">\n <Input value={query} onChange={(e) => setQuery(e.target.value)} placeholder=\"Search collections…\" className=\"h-8\" />\n </div>\n )}\n <div className=\"max-h-64 overflow-y-auto p-1\">\n {filtered.length === 0 ? (\n <p className=\"px-3 py-4 text-center text-sm text-muted-foreground\">No collection found.</p>\n ) : (\n filtered.map((col) => (\n <button\n key={col.collectionId!}\n type=\"button\"\n onClick={() => {\n onChange(col.collectionId!);\n setOpen(false);\n }}\n className=\"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60\"\n >\n <Thumb image={col.image} size=\"sm\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{label(col)}</p>\n <p className=\"text-xs text-muted-foreground\">{works(col)}</p>\n </div>\n {value === col.collectionId && <Check className=\"h-4 w-4 text-brand-blue shrink-0\" />}\n </button>\n ))\n )}\n </div>\n <div className=\"border-t border-border p-1\">\n <Link\n href={newCollectionHref}\n className=\"flex items-center gap-2 rounded-lg px-2 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/60 hover:text-foreground transition-colors\"\n >\n <Plus className=\"h-4 w-4\" />\n New collection\n </Link>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCQ;AAhCR,mBAAyB;AACzB,0BAAgD;AAEhD,mBAAkB;AAClB,kBAAiB;AACjB,mBAAsB;AACtB,sBAAyB;AACzB,qBAAwD;AACxD,gBAAmB;AACnB,2BAA4B;AAU5B,SAAS,MAAM,KAAoB;AACjC,SAAO,IAAI,QAAQ,IAAI,UAAU,eAAe,IAAI,YAAY;AAClE;AAEA,SAAS,MAAM,KAAoB;AACjC,SAAO,IAAI,eAAe,OAAO,GAAG,IAAI,YAAY,eAAe,CAAC,QAAQ,IAAI,gBAAgB,IAAI,MAAM,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A;AAAA;AAAA,YAb9E,IAAI;AAAA,UAcX,CACD,GAEL;AAAA,UACA,4CAAC,SAAI,WAAU,8BACb;AAAA,YAAC,YAAAA;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN,WAAU;AAAA,cAEV;AAAA,4DAAC,4BAAK,WAAU,WAAU;AAAA,gBAAE;AAAA;AAAA;AAAA,UAE9B,GACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["Image","Link"]}
|
|
@@ -25,7 +25,7 @@ function CollectionPicker({ collections, loading, value, onChange, newCollection
|
|
|
25
25
|
if (loading) return /* @__PURE__ */ jsx(Skeleton, { className: "h-[4.25rem] rounded-xl" });
|
|
26
26
|
if (collections.length === 0) {
|
|
27
27
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-dashed border-border p-5 text-center space-y-3", children: [
|
|
28
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "No collection found. It may take a minute to display recently created collections." }),
|
|
29
29
|
/* @__PURE__ */ jsxs(
|
|
30
30
|
Link,
|
|
31
31
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/launchpad/collection-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Boxes, Check, ChevronDown, Plus } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Input } from \"../input.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\n\nexport interface CollectionPickerProps {\n collections: ApiCollection[];\n loading: boolean;\n value: string;\n onChange: (id: string) => void;\n newCollectionHref: string;\n}\n\nfunction label(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction works(col: ApiCollection) {\n return col.totalSupply != null ? `${col.totalSupply.toLocaleString()} work${col.totalSupply !== 1 ? \"s\" : \"\"}` : \"Empty\";\n}\n\nfunction Thumb({ image, size }: { image: string | null | undefined; size: \"sm\" | \"md\" }) {\n const url = useImageUrl()(image);\n return (\n <div className={cn(\"relative rounded-lg overflow-hidden bg-muted shrink-0\", size === \"md\" ? \"h-10 w-10\" : \"h-8 w-8\")}>\n {url ? (\n <Image src={url} alt=\"\" fill unoptimized className=\"object-cover\" />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nexport function CollectionPicker({ collections, loading, value, onChange, newCollectionHref }: CollectionPickerProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n\n if (loading) return <Skeleton className=\"h-[4.25rem] rounded-xl\" />;\n\n if (collections.length === 0) {\n return (\n <div className=\"rounded-xl border border-dashed border-border p-5 text-center space-y-3\">\n <p className=\"text-sm text-muted-foreground\">
|
|
1
|
+
{"version":3,"sources":["../../../src/components/launchpad/collection-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Boxes, Check, ChevronDown, Plus } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Input } from \"../input.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\n\nexport interface CollectionPickerProps {\n collections: ApiCollection[];\n loading: boolean;\n value: string;\n onChange: (id: string) => void;\n newCollectionHref: string;\n}\n\nfunction label(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction works(col: ApiCollection) {\n return col.totalSupply != null ? `${col.totalSupply.toLocaleString()} work${col.totalSupply !== 1 ? \"s\" : \"\"}` : \"Empty\";\n}\n\nfunction Thumb({ image, size }: { image: string | null | undefined; size: \"sm\" | \"md\" }) {\n const url = useImageUrl()(image);\n return (\n <div className={cn(\"relative rounded-lg overflow-hidden bg-muted shrink-0\", size === \"md\" ? \"h-10 w-10\" : \"h-8 w-8\")}>\n {url ? (\n <Image src={url} alt=\"\" fill unoptimized className=\"object-cover\" />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nexport function CollectionPicker({ collections, loading, value, onChange, newCollectionHref }: CollectionPickerProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n\n if (loading) return <Skeleton className=\"h-[4.25rem] rounded-xl\" />;\n\n if (collections.length === 0) {\n return (\n <div className=\"rounded-xl border border-dashed border-border p-5 text-center space-y-3\">\n <p className=\"text-sm text-muted-foreground\">No collection found. It may take a minute to display recently created collections.</p>\n <Link\n href={newCollectionHref}\n className=\"inline-flex items-center gap-1.5 h-9 px-4 rounded-xl text-sm font-semibold text-white bg-brand-blue hover:brightness-110 transition-all\"\n >\n <Plus className=\"h-3.5 w-3.5\" />\n Create your first collection\n </Link>\n </div>\n );\n }\n\n const selected = collections.find((c) => c.collectionId === value) ?? null;\n const filtered = query.trim() ? collections.filter((c) => label(c).toLowerCase().includes(query.trim().toLowerCase())) : collections;\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) setQuery(\"\");\n }}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-expanded={open}\n className=\"flex w-full items-center gap-3 rounded-xl border border-border p-3 text-left transition-colors hover:bg-muted/40\"\n >\n <Thumb image={selected?.image} size=\"md\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold truncate\">{selected ? label(selected) : \"Choose a collection\"}</p>\n <p className=\"text-xs text-muted-foreground\">{selected ? works(selected) : \"Where this work will live\"}</p>\n </div>\n <span className=\"flex items-center gap-1 text-xs font-medium text-muted-foreground shrink-0\">\n Change\n <ChevronDown className=\"h-3.5 w-3.5\" />\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[var(--radix-popover-trigger-width)] p-0\" align=\"start\">\n {collections.length > 5 && (\n <div className=\"border-b border-border p-2\">\n <Input value={query} onChange={(e) => setQuery(e.target.value)} placeholder=\"Search collections…\" className=\"h-8\" />\n </div>\n )}\n <div className=\"max-h-64 overflow-y-auto p-1\">\n {filtered.length === 0 ? (\n <p className=\"px-3 py-4 text-center text-sm text-muted-foreground\">No collection found.</p>\n ) : (\n filtered.map((col) => (\n <button\n key={col.collectionId!}\n type=\"button\"\n onClick={() => {\n onChange(col.collectionId!);\n setOpen(false);\n }}\n className=\"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60\"\n >\n <Thumb image={col.image} size=\"sm\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{label(col)}</p>\n <p className=\"text-xs text-muted-foreground\">{works(col)}</p>\n </div>\n {value === col.collectionId && <Check className=\"h-4 w-4 text-brand-blue shrink-0\" />}\n </button>\n ))\n )}\n </div>\n <div className=\"border-t border-border p-1\">\n <Link\n href={newCollectionHref}\n className=\"flex items-center gap-2 rounded-lg px-2 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/60 hover:text-foreground transition-colors\"\n >\n <Plus className=\"h-4 w-4\" />\n New collection\n </Link>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";AAkCQ,cAoBA,YApBA;AAhCR,SAAS,gBAAgB;AACzB,SAAS,OAAO,OAAO,aAAa,YAAY;AAEhD,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AACnB,S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AAC,OAAE,WAAU,gCAAgC,gBAAM,GAAG,GAAE;AAAA,kBACxD,oBAAC,OAAE,WAAU,iCAAiC,gBAAM,GAAG,GAAE;AAAA,mBAC3D;AAAA,gBACC,UAAU,IAAI,gBAAgB,oBAAC,SAAM,WAAU,oCAAmC;AAAA;AAAA;AAAA,YAb9E,IAAI;AAAA,UAcX,CACD,GAEL;AAAA,UACA,oBAAC,SAAI,WAAU,8BACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,WAAU;AAAA,cAEV;AAAA,oCAAC,QAAK,WAAU,WAAU;AAAA,gBAAE;AAAA;AAAA;AAAA,UAE9B,GACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
10
10
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
overlayClassName?: string;
|