@medialane/ui 0.285.0 → 0.286.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/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/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/marketplace-filters.cjs +253 -0
- package/dist/components/marketplace-filters.cjs.map +1 -0
- package/dist/components/marketplace-filters.d.cts +34 -0
- package/dist/components/marketplace-filters.d.ts +34 -0
- package/dist/components/marketplace-filters.js +216 -0
- package/dist/components/marketplace-filters.js.map +1 -0
- package/dist/components/marketplace-search.cjs +175 -0
- package/dist/components/marketplace-search.cjs.map +1 -0
- package/dist/components/marketplace-search.d.cts +11 -0
- package/dist/components/marketplace-search.d.ts +11 -0
- package/dist/components/marketplace-search.js +140 -0
- package/dist/components/marketplace-search.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/use-debounced-value.cjs +38 -0
- package/dist/utils/use-debounced-value.cjs.map +1 -0
- package/dist/utils/use-debounced-value.d.cts +3 -0
- package/dist/utils/use-debounced-value.d.ts +3 -0
- package/dist/utils/use-debounced-value.js +14 -0
- package/dist/utils/use-debounced-value.js.map +1 -0
- 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>, "onChange" | "value" | "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>, "onChange" | "value" | "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>, "onChange" | "value" | "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>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -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?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "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?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "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_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
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 | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
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 | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
8
|
+
declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { FastMint };
|
|
@@ -16,7 +16,6 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
16
16
|
royalty: zod.ZodNumber;
|
|
17
17
|
}, "strip", zod.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
-
value: string;
|
|
20
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
21
20
|
licenseType: string;
|
|
22
21
|
commercialUse: "Yes" | "No";
|
|
@@ -25,12 +24,12 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
25
24
|
geographicScope: string;
|
|
26
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
27
26
|
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;
|
|
34
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
35
34
|
licenseType: string;
|
|
36
35
|
commercialUse: "Yes" | "No";
|
|
@@ -39,6 +38,7 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
39
38
|
geographicScope: string;
|
|
40
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
41
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -16,7 +16,6 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
16
16
|
royalty: zod.ZodNumber;
|
|
17
17
|
}, "strip", zod.ZodTypeAny, {
|
|
18
18
|
name: string;
|
|
19
|
-
value: string;
|
|
20
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
21
20
|
licenseType: string;
|
|
22
21
|
commercialUse: "Yes" | "No";
|
|
@@ -25,12 +24,12 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
25
24
|
geographicScope: string;
|
|
26
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
27
26
|
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;
|
|
34
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
35
34
|
licenseType: string;
|
|
36
35
|
commercialUse: "Yes" | "No";
|
|
@@ -39,6 +38,7 @@ declare const editionMintSchema: zod.ZodObject<{
|
|
|
39
38
|
geographicScope: string;
|
|
40
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
41
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
42
|
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var marketplace_filters_exports = {};
|
|
31
|
+
__export(marketplace_filters_exports, {
|
|
32
|
+
ActiveFilters: () => ActiveFilters,
|
|
33
|
+
FiltersButton: () => FiltersButton,
|
|
34
|
+
FiltersDialog: () => FiltersDialog,
|
|
35
|
+
useMarketplaceFilters: () => useMarketplaceFilters
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(marketplace_filters_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_react = require("react");
|
|
40
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
41
|
+
var import_navigation = require("next/navigation");
|
|
42
|
+
var import_lucide_react = require("lucide-react");
|
|
43
|
+
var import_sdk = require("@medialane/sdk");
|
|
44
|
+
var import_input = require("./input.js");
|
|
45
|
+
var import_button = require("./button.js");
|
|
46
|
+
var import_dialog = require("./dialog.js");
|
|
47
|
+
var import_currency_icon = require("./currency-icon.js");
|
|
48
|
+
var import_help_icon = require("./help-icon.js");
|
|
49
|
+
var import_ip = require("../data/ip.js");
|
|
50
|
+
var import_use_debounced_value = require("../utils/use-debounced-value.js");
|
|
51
|
+
var import_cn = require("../utils/cn.js");
|
|
52
|
+
const SORT_OPTIONS = [
|
|
53
|
+
{ label: "Recent", value: "recent" },
|
|
54
|
+
{ label: "Price \u2191", value: "price_asc" },
|
|
55
|
+
{ label: "Price \u2193", value: "price_desc" }
|
|
56
|
+
];
|
|
57
|
+
const TYPE_OPTIONS = [
|
|
58
|
+
{ label: "All", value: "" },
|
|
59
|
+
{ label: "Listings", value: "listings" },
|
|
60
|
+
{ label: "Offers", value: "offers" }
|
|
61
|
+
];
|
|
62
|
+
const CURRENCY_OPTIONS = import_sdk.SUPPORTED_TOKENS.map((t) => ({
|
|
63
|
+
label: t.symbol,
|
|
64
|
+
value: t.symbol,
|
|
65
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: t.symbol, size: 13 })
|
|
66
|
+
}));
|
|
67
|
+
function toRawAmount(value, decimals) {
|
|
68
|
+
const trimmed = value.trim();
|
|
69
|
+
if (!trimmed) return void 0;
|
|
70
|
+
try {
|
|
71
|
+
return (0, import_sdk.parseAmount)(trimmed, decimals);
|
|
72
|
+
} catch {
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function useMarketplaceFilters() {
|
|
77
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
78
|
+
const [sort, setSort] = (0, import_react.useState)("recent");
|
|
79
|
+
const [currency, setCurrency] = (0, import_react.useState)("");
|
|
80
|
+
const [orderType, setOrderType] = (0, import_react.useState)("");
|
|
81
|
+
const [minInput, setMinInput] = (0, import_react.useState)("");
|
|
82
|
+
const [maxInput, setMaxInput] = (0, import_react.useState)("");
|
|
83
|
+
const debouncedMin = (0, import_use_debounced_value.useDebouncedValue)(minInput, 400);
|
|
84
|
+
const debouncedMax = (0, import_use_debounced_value.useDebouncedValue)(maxInput, 400);
|
|
85
|
+
const decimals = (0, import_sdk.getTokenBySymbol)(currency)?.decimals ?? 18;
|
|
86
|
+
const minPrice = minInput ? toRawAmount(debouncedMin, decimals) : void 0;
|
|
87
|
+
const maxPrice = maxInput ? toRawAmount(debouncedMax, decimals) : void 0;
|
|
88
|
+
const clearPrice = () => {
|
|
89
|
+
setMinInput("");
|
|
90
|
+
setMaxInput("");
|
|
91
|
+
};
|
|
92
|
+
const selectCurrency = (symbol) => {
|
|
93
|
+
setCurrency(currency === symbol ? "" : symbol);
|
|
94
|
+
clearPrice();
|
|
95
|
+
};
|
|
96
|
+
const reset = () => {
|
|
97
|
+
setSort("recent");
|
|
98
|
+
setCurrency("");
|
|
99
|
+
setOrderType("");
|
|
100
|
+
clearPrice();
|
|
101
|
+
};
|
|
102
|
+
const count = [sort !== "recent", currency, orderType, minPrice || maxPrice].filter(Boolean).length;
|
|
103
|
+
return {
|
|
104
|
+
open,
|
|
105
|
+
setOpen,
|
|
106
|
+
sort,
|
|
107
|
+
setSort,
|
|
108
|
+
currency,
|
|
109
|
+
selectCurrency,
|
|
110
|
+
orderType,
|
|
111
|
+
setOrderType,
|
|
112
|
+
minInput,
|
|
113
|
+
setMinInput,
|
|
114
|
+
maxInput,
|
|
115
|
+
setMaxInput,
|
|
116
|
+
minPrice,
|
|
117
|
+
maxPrice,
|
|
118
|
+
clearPrice,
|
|
119
|
+
reset,
|
|
120
|
+
count
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const chipClass = (active) => (0, import_cn.cn)(
|
|
124
|
+
"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-full border transition-colors whitespace-nowrap",
|
|
125
|
+
active ? "border-primary bg-primary/10 text-primary font-medium" : "border-border text-muted-foreground hover:border-primary/50"
|
|
126
|
+
);
|
|
127
|
+
function ChipGroup({ title, options, value, onSelect }) {
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs font-semibold text-muted-foreground", children: title }),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { onClick: () => onSelect(opt.value), className: chipClass(value === opt.value), children: [
|
|
131
|
+
opt.icon,
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: opt.label })
|
|
133
|
+
] }, opt.value)) })
|
|
134
|
+
] });
|
|
135
|
+
}
|
|
136
|
+
function IpTypeChip({ href, label }) {
|
|
137
|
+
const pathname = (0, import_navigation.usePathname)();
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
import_link.default,
|
|
140
|
+
{
|
|
141
|
+
href,
|
|
142
|
+
className: (0, import_cn.cn)(
|
|
143
|
+
"text-xs px-3 py-1 rounded-full border transition-colors whitespace-nowrap",
|
|
144
|
+
pathname === href ? "border-primary bg-primary/10 text-primary font-medium" : "border-border text-muted-foreground hover:border-primary/50 hover:text-foreground"
|
|
145
|
+
),
|
|
146
|
+
children: label
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
function ActiveChip({ children, onClear }) {
|
|
151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1 text-xs px-2.5 py-1 rounded-full border border-primary/40 bg-primary/10 text-primary", children: [
|
|
152
|
+
children,
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: onClear, className: "ml-0.5 hover:text-primary/60", children: "\xD7" })
|
|
154
|
+
] });
|
|
155
|
+
}
|
|
156
|
+
function FiltersButton({ filters }) {
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
onClick: () => filters.setOpen(true),
|
|
161
|
+
className: (0, import_cn.cn)(
|
|
162
|
+
"relative flex items-center gap-1.5 h-9 px-3 rounded-lg border text-xs font-medium transition-colors shrink-0",
|
|
163
|
+
filters.count > 0 ? "border-primary bg-primary/10 text-primary" : "border-border text-muted-foreground hover:border-primary/50 hover:text-foreground"
|
|
164
|
+
),
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
167
|
+
"Filters",
|
|
168
|
+
filters.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-primary text-2xs font-bold text-primary-foreground", children: filters.count })
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
function ActiveFilters({ filters }) {
|
|
174
|
+
const { sort, setSort, orderType, setOrderType, currency, selectCurrency, minPrice, maxPrice, minInput, maxInput, clearPrice, count } = filters;
|
|
175
|
+
if (count === 0) return null;
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
177
|
+
sort !== "recent" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActiveChip, { onClear: () => setSort("recent"), children: SORT_OPTIONS.find((o) => o.value === sort)?.label }),
|
|
178
|
+
orderType && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActiveChip, { onClear: () => setOrderType(""), children: TYPE_OPTIONS.find((o) => o.value === orderType)?.label }),
|
|
179
|
+
currency && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ActiveChip, { onClear: () => selectCurrency(currency), children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: currency, size: 12 }),
|
|
181
|
+
currency
|
|
182
|
+
] }),
|
|
183
|
+
(minPrice || maxPrice) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ActiveChip, { onClear: clearPrice, children: [
|
|
184
|
+
minInput || "0",
|
|
185
|
+
" \u2013 ",
|
|
186
|
+
maxInput || "\u221E"
|
|
187
|
+
] })
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
function FiltersDialog({ filters }) {
|
|
191
|
+
const { open, setOpen, sort, setSort, orderType, setOrderType, currency, selectCurrency, minInput, setMinInput, maxInput, setMaxInput, reset, count } = filters;
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, { className: "w-full max-w-sm sm:max-w-md p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]", children: [
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between px-5 py-4 border-b border-border/60 pr-12", children: [
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogTitle, { className: "text-base font-bold flex items-center gap-2", children: [
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.SlidersHorizontal, { className: "h-4 w-4 text-primary" }),
|
|
196
|
+
"Filters"
|
|
197
|
+
] }),
|
|
198
|
+
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "ghost", size: "sm", className: "h-7 text-xs text-muted-foreground", onClick: reset, children: "Clear all" })
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-5", children: [
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChipGroup, { title: "Sort", options: SORT_OPTIONS, value: sort, onSelect: setSort }),
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChipGroup, { title: "Order type", options: TYPE_OPTIONS, value: orderType, onSelect: setOrderType }),
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChipGroup, { title: "Currency", options: CURRENCY_OPTIONS, value: currency, onSelect: selectCurrency }),
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs font-semibold text-muted-foreground", children: "Price range" }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
208
|
+
import_input.Input,
|
|
209
|
+
{
|
|
210
|
+
placeholder: "Min",
|
|
211
|
+
value: minInput,
|
|
212
|
+
onChange: (e) => setMinInput(e.target.value),
|
|
213
|
+
className: "h-9 text-sm",
|
|
214
|
+
type: "number",
|
|
215
|
+
min: "0"
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-muted-foreground shrink-0", children: "\u2013" }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
|
+
import_input.Input,
|
|
221
|
+
{
|
|
222
|
+
placeholder: "Max",
|
|
223
|
+
value: maxInput,
|
|
224
|
+
onChange: (e) => setMaxInput(e.target.value),
|
|
225
|
+
className: "h-9 text-sm",
|
|
226
|
+
type: "number",
|
|
227
|
+
min: "0"
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 pt-1 border-t border-border/60", children: [
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "flex items-center gap-1 text-2xs font-semibold text-muted-foreground", children: [
|
|
234
|
+
"IP Type",
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_help_icon.HelpIcon, { content: "Filter by intellectual property category \u2014 Art, Audio, Video, Software, and more", side: "right" })
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(IpTypeChip, { href: "/marketplace", label: "All" }),
|
|
239
|
+
import_ip.IP_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IpTypeChip, { href: `/${type.toLowerCase()}`, label: type }, type))
|
|
240
|
+
] })
|
|
241
|
+
] })
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-5 py-3 border-t border-border/60", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { className: "w-full", onClick: () => setOpen(false), children: "Apply filters" }) })
|
|
244
|
+
] }) });
|
|
245
|
+
}
|
|
246
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
247
|
+
0 && (module.exports = {
|
|
248
|
+
ActiveFilters,
|
|
249
|
+
FiltersButton,
|
|
250
|
+
FiltersDialog,
|
|
251
|
+
useMarketplaceFilters
|
|
252
|
+
});
|
|
253
|
+
//# sourceMappingURL=marketplace-filters.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/marketplace-filters.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport Link from \"./link.js\";\nimport { usePathname } from \"next/navigation\";\nimport { SlidersHorizontal } from \"lucide-react\";\nimport { getTokenBySymbol, parseAmount, SUPPORTED_TOKENS } from \"@medialane/sdk\";\nimport { Input } from \"./input.js\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { HelpIcon } from \"./help-icon.js\";\nimport { IP_TYPES } from \"../data/ip.js\";\nimport { useDebouncedValue } from \"../utils/use-debounced-value.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst SORT_OPTIONS = [\n { label: \"Recent\", value: \"recent\" },\n { label: \"Price ↑\", value: \"price_asc\" },\n { label: \"Price ↓\", value: \"price_desc\" },\n];\n\nconst TYPE_OPTIONS = [\n { label: \"All\", value: \"\" },\n { label: \"Listings\", value: \"listings\" },\n { label: \"Offers\", value: \"offers\" },\n];\n\nconst CURRENCY_OPTIONS = SUPPORTED_TOKENS.map((t) => ({\n label: t.symbol,\n value: t.symbol,\n icon: <CurrencyIcon symbol={t.symbol} size={13} />,\n}));\n\nfunction toRawAmount(value: string, decimals: number): string | undefined {\n const trimmed = value.trim();\n if (!trimmed) return undefined;\n try {\n return parseAmount(trimmed, decimals);\n } catch {\n return undefined;\n }\n}\n\nexport function useMarketplaceFilters() {\n const [open, setOpen] = useState(false);\n const [sort, setSort] = useState(\"recent\");\n const [currency, setCurrency] = useState(\"\");\n const [orderType, setOrderType] = useState(\"\");\n const [minInput, setMinInput] = useState(\"\");\n const [maxInput, setMaxInput] = useState(\"\");\n const debouncedMin = useDebouncedValue(minInput, 400);\n const debouncedMax = useDebouncedValue(maxInput, 400);\n\n const decimals = getTokenBySymbol(currency)?.decimals ?? 18;\n const minPrice = minInput ? toRawAmount(debouncedMin, decimals) : undefined;\n const maxPrice = maxInput ? toRawAmount(debouncedMax, decimals) : undefined;\n\n const clearPrice = () => {\n setMinInput(\"\");\n setMaxInput(\"\");\n };\n\n const selectCurrency = (symbol: string) => {\n setCurrency(currency === symbol ? \"\" : symbol);\n clearPrice();\n };\n\n const reset = () => {\n setSort(\"recent\");\n setCurrency(\"\");\n setOrderType(\"\");\n clearPrice();\n };\n\n const count = [sort !== \"recent\", currency, orderType, minPrice || maxPrice].filter(Boolean).length;\n\n return {\n open, setOpen,\n sort, setSort,\n currency, selectCurrency,\n orderType, setOrderType,\n minInput, setMinInput,\n maxInput, setMaxInput,\n minPrice, maxPrice,\n clearPrice, reset, count,\n };\n}\n\nexport type MarketplaceFilters = ReturnType<typeof useMarketplaceFilters>;\n\nconst chipClass = (active: boolean) =>\n cn(\n \"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-full border transition-colors whitespace-nowrap\",\n active\n ? \"border-primary bg-primary/10 text-primary font-medium\"\n : \"border-border text-muted-foreground hover:border-primary/50\"\n );\n\nfunction ChipGroup({ title, options, value, onSelect }: {\n title: string;\n options: { label: string; value: string; icon?: ReactNode }[];\n value: string;\n onSelect: (value: string) => void;\n}) {\n return (\n <div className=\"space-y-2\">\n <p className=\"text-2xs font-semibold text-muted-foreground\">{title}</p>\n <div className=\"flex flex-wrap gap-1.5\">\n {options.map((opt) => (\n <button key={opt.value} onClick={() => onSelect(opt.value)} className={chipClass(value === opt.value)}>\n {opt.icon}\n <span>{opt.label}</span>\n </button>\n ))}\n </div>\n </div>\n );\n}\n\nfunction IpTypeChip({ href, label }: { href: string; label: string }) {\n const pathname = usePathname();\n return (\n <Link\n href={href}\n className={cn(\n \"text-xs px-3 py-1 rounded-full border transition-colors whitespace-nowrap\",\n pathname === href\n ? \"border-primary bg-primary/10 text-primary font-medium\"\n : \"border-border text-muted-foreground hover:border-primary/50 hover:text-foreground\"\n )}\n >\n {label}\n </Link>\n );\n}\n\nfunction ActiveChip({ children, onClear }: { children: ReactNode; onClear: () => void }) {\n return (\n <span className=\"flex items-center gap-1 text-xs px-2.5 py-1 rounded-full border border-primary/40 bg-primary/10 text-primary\">\n {children}\n <button onClick={onClear} className=\"ml-0.5 hover:text-primary/60\">×</button>\n </span>\n );\n}\n\nexport function FiltersButton({ filters }: { filters: MarketplaceFilters }) {\n return (\n <button\n onClick={() => filters.setOpen(true)}\n className={cn(\n \"relative flex items-center gap-1.5 h-9 px-3 rounded-lg border text-xs font-medium transition-colors shrink-0\",\n filters.count > 0\n ? \"border-primary bg-primary/10 text-primary\"\n : \"border-border text-muted-foreground hover:border-primary/50 hover:text-foreground\"\n )}\n >\n <SlidersHorizontal className=\"h-3.5 w-3.5\" />\n Filters\n {filters.count > 0 && (\n <span className=\"flex h-4 w-4 items-center justify-center rounded-full bg-primary text-2xs font-bold text-primary-foreground\">\n {filters.count}\n </span>\n )}\n </button>\n );\n}\n\nexport function ActiveFilters({ filters }: { filters: MarketplaceFilters }) {\n const { sort, setSort, orderType, setOrderType, currency, selectCurrency, minPrice, maxPrice, minInput, maxInput, clearPrice, count } = filters;\n if (count === 0) return null;\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {sort !== \"recent\" && (\n <ActiveChip onClear={() => setSort(\"recent\")}>{SORT_OPTIONS.find((o) => o.value === sort)?.label}</ActiveChip>\n )}\n {orderType && (\n <ActiveChip onClear={() => setOrderType(\"\")}>{TYPE_OPTIONS.find((o) => o.value === orderType)?.label}</ActiveChip>\n )}\n {currency && (\n <ActiveChip onClear={() => selectCurrency(currency)}>\n <CurrencyIcon symbol={currency} size={12} />\n {currency}\n </ActiveChip>\n )}\n {(minPrice || maxPrice) && (\n <ActiveChip onClear={clearPrice}>{minInput || \"0\"} – {maxInput || \"∞\"}</ActiveChip>\n )}\n </div>\n );\n}\n\nexport function FiltersDialog({ filters }: { filters: MarketplaceFilters }) {\n const { open, setOpen, sort, setSort, orderType, setOrderType, currency, selectCurrency, minInput, setMinInput, maxInput, setMaxInput, reset, count } = filters;\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"w-full max-w-sm sm:max-w-md p-0 overflow-hidden gap-0 flex flex-col max-h-[85svh]\">\n\n <div className=\"flex items-center justify-between px-5 py-4 border-b border-border/60 pr-12\">\n <DialogTitle className=\"text-base font-bold flex items-center gap-2\">\n <SlidersHorizontal className=\"h-4 w-4 text-primary\" />\n Filters\n </DialogTitle>\n {count > 0 && (\n <Button variant=\"ghost\" size=\"sm\" className=\"h-7 text-xs text-muted-foreground\" onClick={reset}>\n Clear all\n </Button>\n )}\n </div>\n\n <div className=\"flex-1 overflow-y-auto px-5 py-4 space-y-5\">\n <ChipGroup title=\"Sort\" options={SORT_OPTIONS} value={sort} onSelect={setSort} />\n <ChipGroup title=\"Order type\" options={TYPE_OPTIONS} value={orderType} onSelect={setOrderType} />\n <ChipGroup title=\"Currency\" options={CURRENCY_OPTIONS} value={currency} onSelect={selectCurrency} />\n\n <div className=\"space-y-2\">\n <p className=\"text-2xs font-semibold text-muted-foreground\">Price range</p>\n <div className=\"flex items-center gap-2\">\n <Input\n placeholder=\"Min\"\n value={minInput}\n onChange={(e) => setMinInput(e.target.value)}\n className=\"h-9 text-sm\"\n type=\"number\"\n min=\"0\"\n />\n <span className=\"text-sm text-muted-foreground shrink-0\">–</span>\n <Input\n placeholder=\"Max\"\n value={maxInput}\n onChange={(e) => setMaxInput(e.target.value)}\n className=\"h-9 text-sm\"\n type=\"number\"\n min=\"0\"\n />\n </div>\n </div>\n\n <div className=\"space-y-2 pt-1 border-t border-border/60\">\n <p className=\"flex items-center gap-1 text-2xs font-semibold text-muted-foreground\">\n IP Type\n <HelpIcon content=\"Filter by intellectual property category — Art, Audio, Video, Software, and more\" side=\"right\" />\n </p>\n <div className=\"flex flex-wrap gap-1.5\">\n <IpTypeChip href=\"/marketplace\" label=\"All\" />\n {IP_TYPES.map((type) => (\n <IpTypeChip key={type} href={`/${type.toLowerCase()}`} label={type} />\n ))}\n </div>\n </div>\n </div>\n\n <div className=\"px-5 py-3 border-t border-border/60\">\n <Button className=\"w-full\" onClick={() => setOpen(false)}>\n Apply filters\n </Button>\n </div>\n\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BQ;AA7BR,mBAAyC;AACzC,kBAAiB;AACjB,wBAA4B;AAC5B,0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cACZ,OAAO;AAAA,cACP,UAAU,CAAC,MAAM,YAAY,EAAE,OAAO,KAAK;AAAA,cAC3C,WAAU;AAAA,cACV,MAAK;AAAA,cACL,KAAI;AAAA;AAAA,UACN;AAAA,WACF;AAAA,SACF;AAAA,MAEA,6CAAC,SAAI,WAAU,4CACb;AAAA,qDAAC,OAAE,WAAU,wEAAuE;AAAA;AAAA,UAElF,4CAAC,6BAAS,SAAQ,yFAAmF,MAAK,SAAQ;AAAA,WACpH;AAAA,QACA,6CAAC,SAAI,WAAU,0BACb;AAAA,sDAAC,cAAW,MAAK,gBAAe,OAAM,OAAM;AAAA,UAC3C,mBAAS,IAAI,CAAC,SACb,4CAAC,cAAsB,MAAM,IAAI,KAAK,YAAY,CAAC,IAAI,OAAO,QAA7C,IAAmD,CACrE;AAAA,WACH;AAAA,SACF;AAAA,OACF;AAAA,IAEA,4CAAC,SAAI,WAAU,uCACb,sDAAC,wBAAO,WAAU,UAAS,SAAS,MAAM,QAAQ,KAAK,GAAG,2BAE1D,GACF;AAAA,KAEF,GACF;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare function useMarketplaceFilters(): {
|
|
5
|
+
open: boolean;
|
|
6
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
sort: string;
|
|
8
|
+
setSort: React.Dispatch<React.SetStateAction<string>>;
|
|
9
|
+
currency: string;
|
|
10
|
+
selectCurrency: (symbol: string) => void;
|
|
11
|
+
orderType: string;
|
|
12
|
+
setOrderType: React.Dispatch<React.SetStateAction<string>>;
|
|
13
|
+
minInput: string;
|
|
14
|
+
setMinInput: React.Dispatch<React.SetStateAction<string>>;
|
|
15
|
+
maxInput: string;
|
|
16
|
+
setMaxInput: React.Dispatch<React.SetStateAction<string>>;
|
|
17
|
+
minPrice: string | undefined;
|
|
18
|
+
maxPrice: string | undefined;
|
|
19
|
+
clearPrice: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
count: number;
|
|
22
|
+
};
|
|
23
|
+
type MarketplaceFilters = ReturnType<typeof useMarketplaceFilters>;
|
|
24
|
+
declare function FiltersButton({ filters }: {
|
|
25
|
+
filters: MarketplaceFilters;
|
|
26
|
+
}): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function ActiveFilters({ filters }: {
|
|
28
|
+
filters: MarketplaceFilters;
|
|
29
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
30
|
+
declare function FiltersDialog({ filters }: {
|
|
31
|
+
filters: MarketplaceFilters;
|
|
32
|
+
}): react_jsx_runtime.JSX.Element;
|
|
33
|
+
|
|
34
|
+
export { ActiveFilters, FiltersButton, FiltersDialog, type MarketplaceFilters, useMarketplaceFilters };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare function useMarketplaceFilters(): {
|
|
5
|
+
open: boolean;
|
|
6
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
sort: string;
|
|
8
|
+
setSort: React.Dispatch<React.SetStateAction<string>>;
|
|
9
|
+
currency: string;
|
|
10
|
+
selectCurrency: (symbol: string) => void;
|
|
11
|
+
orderType: string;
|
|
12
|
+
setOrderType: React.Dispatch<React.SetStateAction<string>>;
|
|
13
|
+
minInput: string;
|
|
14
|
+
setMinInput: React.Dispatch<React.SetStateAction<string>>;
|
|
15
|
+
maxInput: string;
|
|
16
|
+
setMaxInput: React.Dispatch<React.SetStateAction<string>>;
|
|
17
|
+
minPrice: string | undefined;
|
|
18
|
+
maxPrice: string | undefined;
|
|
19
|
+
clearPrice: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
count: number;
|
|
22
|
+
};
|
|
23
|
+
type MarketplaceFilters = ReturnType<typeof useMarketplaceFilters>;
|
|
24
|
+
declare function FiltersButton({ filters }: {
|
|
25
|
+
filters: MarketplaceFilters;
|
|
26
|
+
}): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function ActiveFilters({ filters }: {
|
|
28
|
+
filters: MarketplaceFilters;
|
|
29
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
30
|
+
declare function FiltersDialog({ filters }: {
|
|
31
|
+
filters: MarketplaceFilters;
|
|
32
|
+
}): react_jsx_runtime.JSX.Element;
|
|
33
|
+
|
|
34
|
+
export { ActiveFilters, FiltersButton, FiltersDialog, type MarketplaceFilters, useMarketplaceFilters };
|