kaleido-ui 0.1.105 → 0.1.107
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/web/index.cjs +168 -67
- package/dist/web/index.d.cts +34 -3
- package/dist/web/index.d.ts +34 -3
- package/dist/web/index.js +168 -67
- package/package.json +2 -1
package/dist/web/index.cjs
CHANGED
|
@@ -3800,6 +3800,42 @@ function readableTagColor(color) {
|
|
|
3800
3800
|
const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
|
|
3801
3801
|
return luminance < 0.45 ? `color-mix(in srgb, ${color} 45%, white)` : color;
|
|
3802
3802
|
}
|
|
3803
|
+
var chipBaseClass = "shrink-0 rounded-full text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors";
|
|
3804
|
+
var chipActiveClass = "bg-primary/[0.14] text-primary";
|
|
3805
|
+
var chipIdleClass = "bg-surface-card text-text-dimmed hover:text-white/75";
|
|
3806
|
+
function AssetSelectorNetworkMark({ network }) {
|
|
3807
|
+
return network.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: network.iconUrl, alt: "", className: "size-4 shrink-0 rounded-full" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-xxs font-bold uppercase leading-none text-muted-foreground", children: network.label.charAt(0) });
|
|
3808
|
+
}
|
|
3809
|
+
function AssetSelectorNetworkFilterTrigger({
|
|
3810
|
+
activeNetworkOption,
|
|
3811
|
+
open,
|
|
3812
|
+
onClick
|
|
3813
|
+
}) {
|
|
3814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3815
|
+
"button",
|
|
3816
|
+
{
|
|
3817
|
+
type: "button",
|
|
3818
|
+
onClick,
|
|
3819
|
+
className: cn(
|
|
3820
|
+
chipBaseClass,
|
|
3821
|
+
"flex items-center gap-1.5 py-1.5 pl-2 pr-2.5",
|
|
3822
|
+
activeNetworkOption || open ? chipActiveClass : chipIdleClass
|
|
3823
|
+
),
|
|
3824
|
+
children: [
|
|
3825
|
+
activeNetworkOption && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssetSelectorNetworkMark, { network: activeNetworkOption }),
|
|
3826
|
+
activeNetworkOption ? activeNetworkOption.label : "All",
|
|
3827
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3828
|
+
Icon,
|
|
3829
|
+
{
|
|
3830
|
+
name: "expand_more",
|
|
3831
|
+
size: "xs",
|
|
3832
|
+
className: cn("shrink-0 transition-transform duration-200", open && "rotate-180")
|
|
3833
|
+
}
|
|
3834
|
+
)
|
|
3835
|
+
]
|
|
3836
|
+
}
|
|
3837
|
+
);
|
|
3838
|
+
}
|
|
3803
3839
|
function AssetSelector({
|
|
3804
3840
|
label,
|
|
3805
3841
|
selectedTicker,
|
|
@@ -3807,6 +3843,8 @@ function AssetSelector({
|
|
|
3807
3843
|
options,
|
|
3808
3844
|
categories = [],
|
|
3809
3845
|
defaultActiveCategories,
|
|
3846
|
+
networks = [],
|
|
3847
|
+
quickAssets = [],
|
|
3810
3848
|
networkFilter,
|
|
3811
3849
|
venueFilter,
|
|
3812
3850
|
disabled,
|
|
@@ -3821,16 +3859,25 @@ function AssetSelector({
|
|
|
3821
3859
|
const [activeCategories, setActiveCategories] = (0, import_react11.useState)(
|
|
3822
3860
|
defaultActiveCategories ?? categories.map((category) => category.id)
|
|
3823
3861
|
);
|
|
3862
|
+
const [activeNetwork, setActiveNetwork] = (0, import_react11.useState)(null);
|
|
3863
|
+
const [networkMenuOpen, setNetworkMenuOpen] = (0, import_react11.useState)(false);
|
|
3864
|
+
const [activeQuickAsset, setActiveQuickAsset] = (0, import_react11.useState)(null);
|
|
3824
3865
|
const selectedKey = selectedId ?? selectedTicker;
|
|
3825
3866
|
const selected = options.find((option) => option.id === selectedKey) ?? options.find((option) => option.ticker === selectedTicker);
|
|
3826
3867
|
const selectedOptionId = selected?.id ?? selectedKey;
|
|
3827
3868
|
const hasCategoryFilters = categories.length > 0;
|
|
3869
|
+
const hasNetworkFilter = networks.length > 0;
|
|
3870
|
+
const hasQuickAssets = quickAssets.length > 0;
|
|
3871
|
+
const activeNetworkOption = networks.find((network) => network.id === activeNetwork) ?? null;
|
|
3828
3872
|
const filtered = options.filter((option) => {
|
|
3829
3873
|
const category = option.category ?? null;
|
|
3830
3874
|
const matchesCategory = !hasCategoryFilters || category === null || activeCategories.includes(category);
|
|
3831
3875
|
const matchesNetwork = !networkFilter || option.network === networkFilter;
|
|
3876
|
+
const matchesNetworkFilter = !activeNetwork || option.networkId == null || option.networkId === activeNetwork;
|
|
3877
|
+
const matchesQuickAsset = !activeQuickAsset || option.ticker.toUpperCase() === activeQuickAsset;
|
|
3832
3878
|
const matchesVenue = !venueFilter || option.venue === venueFilter;
|
|
3833
|
-
if (!matchesCategory || !matchesNetwork || !matchesVenue)
|
|
3879
|
+
if (!matchesCategory || !matchesNetwork || !matchesNetworkFilter || !matchesQuickAsset || !matchesVenue)
|
|
3880
|
+
return false;
|
|
3834
3881
|
if (!search) return true;
|
|
3835
3882
|
const searchValue = search.toLowerCase();
|
|
3836
3883
|
const matchesSearch = option.ticker.toLowerCase().includes(searchValue) || (option.name?.toLowerCase().includes(searchValue) ?? false) || (option.assetId?.toLowerCase().includes(searchValue) ?? false) || (option.network?.toLowerCase().includes(searchValue) ?? false) || (option.networkTag?.label.toLowerCase().includes(searchValue) ?? false) || (option.category?.toLowerCase().includes(searchValue) ?? false);
|
|
@@ -3847,6 +3894,117 @@ function AssetSelector({
|
|
|
3847
3894
|
disabled: option.id === disabledId || option.ticker === disabledTicker
|
|
3848
3895
|
}));
|
|
3849
3896
|
const categoryLabelById = new Map(categories.map((category) => [category.id, category.label]));
|
|
3897
|
+
const networkFilterButton = hasNetworkFilter && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative shrink-0", children: [
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3899
|
+
AssetSelectorNetworkFilterTrigger,
|
|
3900
|
+
{
|
|
3901
|
+
activeNetworkOption,
|
|
3902
|
+
open: networkMenuOpen,
|
|
3903
|
+
onClick: () => setNetworkMenuOpen((value) => !value)
|
|
3904
|
+
}
|
|
3905
|
+
),
|
|
3906
|
+
networkMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "absolute right-0 top-full z-10 mt-1.5 w-48 overflow-hidden rounded-xl border border-white/[0.08] bg-popover shadow-popover", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "max-h-60 overflow-y-auto p-1", children: [
|
|
3907
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3908
|
+
"button",
|
|
3909
|
+
{
|
|
3910
|
+
type: "button",
|
|
3911
|
+
onClick: () => {
|
|
3912
|
+
setActiveNetwork(null);
|
|
3913
|
+
setNetworkMenuOpen(false);
|
|
3914
|
+
},
|
|
3915
|
+
className: cn(
|
|
3916
|
+
"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-xs font-semibold transition-colors",
|
|
3917
|
+
activeNetwork === null ? "bg-primary/[0.14] text-primary" : "text-white/75 hover:bg-accent hover:text-white"
|
|
3918
|
+
),
|
|
3919
|
+
children: [
|
|
3920
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { name: "hub", size: "xs", className: "shrink-0" }),
|
|
3921
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "min-w-0 flex-1 truncate text-left", children: "All networks" }),
|
|
3922
|
+
activeNetwork === null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { name: "check", size: "xs", className: "shrink-0 text-primary" })
|
|
3923
|
+
]
|
|
3924
|
+
}
|
|
3925
|
+
),
|
|
3926
|
+
networks.map((network) => {
|
|
3927
|
+
const isActive = activeNetwork === network.id;
|
|
3928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3929
|
+
"button",
|
|
3930
|
+
{
|
|
3931
|
+
type: "button",
|
|
3932
|
+
onClick: () => {
|
|
3933
|
+
setActiveNetwork(network.id);
|
|
3934
|
+
setNetworkMenuOpen(false);
|
|
3935
|
+
},
|
|
3936
|
+
className: cn(
|
|
3937
|
+
"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-xs font-semibold transition-colors",
|
|
3938
|
+
isActive ? "bg-primary/[0.14] text-primary" : "text-white/75 hover:bg-accent hover:text-white"
|
|
3939
|
+
),
|
|
3940
|
+
children: [
|
|
3941
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssetSelectorNetworkMark, { network }),
|
|
3942
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "min-w-0 flex-1 truncate text-left", children: network.label }),
|
|
3943
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { name: "check", size: "xs", className: "shrink-0 text-primary" })
|
|
3944
|
+
]
|
|
3945
|
+
},
|
|
3946
|
+
network.id
|
|
3947
|
+
);
|
|
3948
|
+
})
|
|
3949
|
+
] }) })
|
|
3950
|
+
] });
|
|
3951
|
+
const filterControls = (hasQuickAssets || hasCategoryFilters) && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3952
|
+
hasQuickAssets && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mt-3 flex flex-wrap items-center gap-1.5", children: quickAssets.map((quick) => {
|
|
3953
|
+
const tickerKey = quick.ticker.toUpperCase();
|
|
3954
|
+
const isActive = activeQuickAsset === tickerKey;
|
|
3955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3956
|
+
"button",
|
|
3957
|
+
{
|
|
3958
|
+
type: "button",
|
|
3959
|
+
onClick: () => setActiveQuickAsset(isActive ? null : tickerKey),
|
|
3960
|
+
className: cn(
|
|
3961
|
+
chipBaseClass,
|
|
3962
|
+
"flex items-center gap-1.5 py-1 pl-1.5 pr-2.5",
|
|
3963
|
+
isActive ? chipActiveClass : chipIdleClass
|
|
3964
|
+
),
|
|
3965
|
+
children: [
|
|
3966
|
+
quick.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: quick.iconUrl, alt: "", className: "size-4 shrink-0 rounded-full" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssetIcon, { ticker: quick.ticker, size: 16, className: "shrink-0" }),
|
|
3967
|
+
quick.ticker
|
|
3968
|
+
]
|
|
3969
|
+
},
|
|
3970
|
+
tickerKey
|
|
3971
|
+
);
|
|
3972
|
+
}) }),
|
|
3973
|
+
hasCategoryFilters && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mt-3 flex flex-wrap items-center gap-1.5", children: [
|
|
3974
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3975
|
+
"button",
|
|
3976
|
+
{
|
|
3977
|
+
type: "button",
|
|
3978
|
+
onClick: () => setActiveCategories(categories.map((category) => category.id)),
|
|
3979
|
+
className: cn(
|
|
3980
|
+
chipBaseClass,
|
|
3981
|
+
"px-2.5 py-1",
|
|
3982
|
+
activeCategories.length === categories.length ? chipActiveClass : chipIdleClass
|
|
3983
|
+
),
|
|
3984
|
+
children: "All"
|
|
3985
|
+
}
|
|
3986
|
+
),
|
|
3987
|
+
categories.map((category) => {
|
|
3988
|
+
const isActive = activeCategories.includes(category.id);
|
|
3989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3990
|
+
"button",
|
|
3991
|
+
{
|
|
3992
|
+
type: "button",
|
|
3993
|
+
onClick: () => setActiveCategories(
|
|
3994
|
+
(current) => current.includes(category.id) ? current.filter((value) => value !== category.id) : [...current, category.id]
|
|
3995
|
+
),
|
|
3996
|
+
className: cn(
|
|
3997
|
+
chipBaseClass,
|
|
3998
|
+
"px-2.5 py-1",
|
|
3999
|
+
isActive ? chipActiveClass : chipIdleClass
|
|
4000
|
+
),
|
|
4001
|
+
children: category.label
|
|
4002
|
+
},
|
|
4003
|
+
category.id
|
|
4004
|
+
);
|
|
4005
|
+
})
|
|
4006
|
+
] })
|
|
4007
|
+
] });
|
|
3850
4008
|
const renderAssetOption = (option, optionSelected, optionDisabled) => {
|
|
3851
4009
|
const optionCategoryLabel = option.categoryLabel || (option.category ? categoryLabelById.get(option.category) : void 0);
|
|
3852
4010
|
const hasNetworkBadge = Boolean(option.networkIconUrl || option.networkTag);
|
|
@@ -3915,6 +4073,7 @@ function AssetSelector({
|
|
|
3915
4073
|
const closePanel = () => {
|
|
3916
4074
|
setOpen(false);
|
|
3917
4075
|
setSearch("");
|
|
4076
|
+
setNetworkMenuOpen(false);
|
|
3918
4077
|
};
|
|
3919
4078
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative w-36 flex-shrink-0", children: [
|
|
3920
4079
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
@@ -3974,7 +4133,7 @@ function AssetSelector({
|
|
|
3974
4133
|
" available"
|
|
3975
4134
|
] })
|
|
3976
4135
|
] }),
|
|
3977
|
-
selected && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
4136
|
+
networkFilterButton || selected && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
3978
4137
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssetIcon, { ticker: selected.ticker, logoUri: selected.icon, size: 18 }),
|
|
3979
4138
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-tiny font-semibold text-white", children: selected.ticker })
|
|
3980
4139
|
] })
|
|
@@ -4001,38 +4160,7 @@ function AssetSelector({
|
|
|
4001
4160
|
}
|
|
4002
4161
|
)
|
|
4003
4162
|
] }),
|
|
4004
|
-
|
|
4005
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4006
|
-
"button",
|
|
4007
|
-
{
|
|
4008
|
-
type: "button",
|
|
4009
|
-
onClick: () => setActiveCategories(categories.map((category) => category.id)),
|
|
4010
|
-
className: cn(
|
|
4011
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
4012
|
-
activeCategories.length === categories.length ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
4013
|
-
),
|
|
4014
|
-
children: "All"
|
|
4015
|
-
}
|
|
4016
|
-
),
|
|
4017
|
-
categories.map((category) => {
|
|
4018
|
-
const isActive = activeCategories.includes(category.id);
|
|
4019
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4020
|
-
"button",
|
|
4021
|
-
{
|
|
4022
|
-
type: "button",
|
|
4023
|
-
onClick: () => setActiveCategories(
|
|
4024
|
-
(current) => current.includes(category.id) ? current.filter((value) => value !== category.id) : [...current, category.id]
|
|
4025
|
-
),
|
|
4026
|
-
className: cn(
|
|
4027
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
4028
|
-
isActive ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
4029
|
-
),
|
|
4030
|
-
children: category.label
|
|
4031
|
-
},
|
|
4032
|
-
category.id
|
|
4033
|
-
);
|
|
4034
|
-
})
|
|
4035
|
-
] })
|
|
4163
|
+
filterControls
|
|
4036
4164
|
] }),
|
|
4037
4165
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mx-4 h-px bg-white/[0.06]" }),
|
|
4038
4166
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScrollArea, { className: "min-h-0 flex-1", viewportClassName: "max-h-[56vh] px-2 py-2 pb-6", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-10 text-center text-sm text-white/30", children: [
|
|
@@ -4125,7 +4253,7 @@ function AssetSelector({
|
|
|
4125
4253
|
" available"
|
|
4126
4254
|
] })
|
|
4127
4255
|
] }),
|
|
4128
|
-
selected && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
4256
|
+
networkFilterButton || selected && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
4129
4257
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AssetIcon, { ticker: selected.ticker, logoUri: selected.icon, size: 18 }),
|
|
4130
4258
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-tiny font-semibold text-white", children: selected.ticker })
|
|
4131
4259
|
] })
|
|
@@ -4152,38 +4280,7 @@ function AssetSelector({
|
|
|
4152
4280
|
}
|
|
4153
4281
|
)
|
|
4154
4282
|
] }),
|
|
4155
|
-
|
|
4156
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4157
|
-
"button",
|
|
4158
|
-
{
|
|
4159
|
-
type: "button",
|
|
4160
|
-
onClick: () => setActiveCategories(categories.map((category) => category.id)),
|
|
4161
|
-
className: cn(
|
|
4162
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
4163
|
-
activeCategories.length === categories.length ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
4164
|
-
),
|
|
4165
|
-
children: "All"
|
|
4166
|
-
}
|
|
4167
|
-
),
|
|
4168
|
-
categories.map((category) => {
|
|
4169
|
-
const isActive = activeCategories.includes(category.id);
|
|
4170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4171
|
-
"button",
|
|
4172
|
-
{
|
|
4173
|
-
type: "button",
|
|
4174
|
-
onClick: () => setActiveCategories(
|
|
4175
|
-
(current) => current.includes(category.id) ? current.filter((value) => value !== category.id) : [...current, category.id]
|
|
4176
|
-
),
|
|
4177
|
-
className: cn(
|
|
4178
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
4179
|
-
isActive ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
4180
|
-
),
|
|
4181
|
-
children: category.label
|
|
4182
|
-
},
|
|
4183
|
-
category.id
|
|
4184
|
-
);
|
|
4185
|
-
})
|
|
4186
|
-
] })
|
|
4283
|
+
filterControls
|
|
4187
4284
|
] })
|
|
4188
4285
|
] }),
|
|
4189
4286
|
renderOption: ({ option, selected: optionSelected, disabled: optionDisabled }) => {
|
|
@@ -4206,6 +4303,8 @@ function SwapInputCard({
|
|
|
4206
4303
|
toOptions,
|
|
4207
4304
|
categories,
|
|
4208
4305
|
defaultActiveCategories,
|
|
4306
|
+
fromNetworks,
|
|
4307
|
+
fromQuickAssets,
|
|
4209
4308
|
availableText,
|
|
4210
4309
|
showMaxText = false,
|
|
4211
4310
|
maxText,
|
|
@@ -4283,6 +4382,8 @@ function SwapInputCard({
|
|
|
4283
4382
|
options: fromOptions,
|
|
4284
4383
|
categories,
|
|
4285
4384
|
defaultActiveCategories,
|
|
4385
|
+
networks: fromNetworks,
|
|
4386
|
+
quickAssets: fromQuickAssets,
|
|
4286
4387
|
disabledId: toSelectedId,
|
|
4287
4388
|
onChange: onFromTickerChange
|
|
4288
4389
|
}
|
package/dist/web/index.d.cts
CHANGED
|
@@ -726,6 +726,8 @@ interface AssetSelectorOption {
|
|
|
726
726
|
assetId?: string;
|
|
727
727
|
category?: string | null;
|
|
728
728
|
categoryLabel?: string;
|
|
729
|
+
/** Network id matched against the network filter slider; options without one always pass. */
|
|
730
|
+
networkId?: string;
|
|
729
731
|
/** URL of the network mark rendered as a mini-badge over the asset icon. */
|
|
730
732
|
networkIconUrl?: string;
|
|
731
733
|
/** Right-aligned network tag: label pill tinted with `color`, ticker beneath. */
|
|
@@ -738,6 +740,19 @@ interface AssetSelectorCategory {
|
|
|
738
740
|
id: string;
|
|
739
741
|
label: string;
|
|
740
742
|
}
|
|
743
|
+
/** One entry of the single-select network filter slider inside the picker panel. */
|
|
744
|
+
interface AssetSelectorNetworkOption {
|
|
745
|
+
id: string;
|
|
746
|
+
label: string;
|
|
747
|
+
/** Network mark rendered inside the chip; falls back to a lettered dot. */
|
|
748
|
+
iconUrl?: string;
|
|
749
|
+
}
|
|
750
|
+
/** One entry of the quick-asset filter chips (e.g. BTC / USDT / USDC). */
|
|
751
|
+
interface AssetSelectorQuickAsset {
|
|
752
|
+
ticker: string;
|
|
753
|
+
/** Icon URL for the chip; falls back to AssetIcon's local/CDN resolution. */
|
|
754
|
+
iconUrl?: string;
|
|
755
|
+
}
|
|
741
756
|
interface AssetSelectorProps {
|
|
742
757
|
label: string;
|
|
743
758
|
selectedTicker: string;
|
|
@@ -745,6 +760,18 @@ interface AssetSelectorProps {
|
|
|
745
760
|
options: AssetSelectorOption[];
|
|
746
761
|
categories?: AssetSelectorCategory[];
|
|
747
762
|
defaultActiveCategories?: string[];
|
|
763
|
+
/**
|
|
764
|
+
* Single-select network filter rendered as a dropdown button in the panel's
|
|
765
|
+
* top-right corner ("All" by default). Selecting a network keeps only
|
|
766
|
+
* options whose `networkId` matches (options without a `networkId` always
|
|
767
|
+
* pass, mirroring the category convention).
|
|
768
|
+
*/
|
|
769
|
+
networks?: AssetSelectorNetworkOption[];
|
|
770
|
+
/**
|
|
771
|
+
* Quick-asset chips rendered under the search input. Pressing one narrows
|
|
772
|
+
* the list to that ticker; pressing it again clears the filter.
|
|
773
|
+
*/
|
|
774
|
+
quickAssets?: AssetSelectorQuickAsset[];
|
|
748
775
|
networkFilter?: NetworkType | null;
|
|
749
776
|
venueFilter?: string | null;
|
|
750
777
|
disabled?: boolean;
|
|
@@ -754,7 +781,7 @@ interface AssetSelectorProps {
|
|
|
754
781
|
onOpenPanelHeightChange?: (height: number) => void;
|
|
755
782
|
onChange: (id: string) => void;
|
|
756
783
|
}
|
|
757
|
-
declare function AssetSelector({ label, selectedTicker, selectedId, options, categories, defaultActiveCategories, networkFilter, venueFilter, disabled, disabledTicker, disabledId, compact, onOpenPanelHeightChange, onChange, }: AssetSelectorProps): react_jsx_runtime.JSX.Element;
|
|
784
|
+
declare function AssetSelector({ label, selectedTicker, selectedId, options, categories, defaultActiveCategories, networks, quickAssets, networkFilter, venueFilter, disabled, disabledTicker, disabledId, compact, onOpenPanelHeightChange, onChange, }: AssetSelectorProps): react_jsx_runtime.JSX.Element;
|
|
758
785
|
|
|
759
786
|
interface SwapInputCardProps {
|
|
760
787
|
fromTicker: string;
|
|
@@ -766,6 +793,10 @@ interface SwapInputCardProps {
|
|
|
766
793
|
toOptions: AssetSelectorOption[];
|
|
767
794
|
categories?: AssetSelectorCategory[];
|
|
768
795
|
defaultActiveCategories?: string[];
|
|
796
|
+
/** Network filter slider rendered inside the "You Pay" asset picker. */
|
|
797
|
+
fromNetworks?: AssetSelectorNetworkOption[];
|
|
798
|
+
/** Quick-asset chips rendered inside the "You Pay" asset picker. */
|
|
799
|
+
fromQuickAssets?: AssetSelectorQuickAsset[];
|
|
769
800
|
availableText: string;
|
|
770
801
|
showMaxText?: boolean;
|
|
771
802
|
maxText?: string;
|
|
@@ -804,7 +835,7 @@ interface SwapInputCardProps {
|
|
|
804
835
|
onFlip: () => void;
|
|
805
836
|
onSubmit: () => void;
|
|
806
837
|
}
|
|
807
|
-
declare function SwapInputCard({ fromTicker, toTicker, fromSelectedId, toSelectedId, fromInput, fromOptions, toOptions, categories, defaultActiveCategories, availableText, showMaxText, maxText, selectedPercentage, percentageDisabled, hidePercentages, oneWay, fromUnitLabel, fromDisplayUnit, fromUnitIsToggle, receiveAmount, receiveUnitLabel, receiveDisplayUnit, isLoadingQuote, quoteError, quoteRateText, quoteVenueText, quoteVenueTone, quoteFeeText, quoteExpiresText, quoteExpiresUrgent, warning, submitLabel, submitIcon, submitVariant, submitDisabled, onFromTickerChange, onToTickerChange, onFromInputChange, onPercentageClick, onToggleFromUnit, onFlip, onSubmit, }: SwapInputCardProps): react_jsx_runtime.JSX.Element;
|
|
838
|
+
declare function SwapInputCard({ fromTicker, toTicker, fromSelectedId, toSelectedId, fromInput, fromOptions, toOptions, categories, defaultActiveCategories, fromNetworks, fromQuickAssets, availableText, showMaxText, maxText, selectedPercentage, percentageDisabled, hidePercentages, oneWay, fromUnitLabel, fromDisplayUnit, fromUnitIsToggle, receiveAmount, receiveUnitLabel, receiveDisplayUnit, isLoadingQuote, quoteError, quoteRateText, quoteVenueText, quoteVenueTone, quoteFeeText, quoteExpiresText, quoteExpiresUrgent, warning, submitLabel, submitIcon, submitVariant, submitDisabled, onFromTickerChange, onToTickerChange, onFromInputChange, onPercentageClick, onToggleFromUnit, onFlip, onSubmit, }: SwapInputCardProps): react_jsx_runtime.JSX.Element;
|
|
808
839
|
|
|
809
840
|
interface ActivityListItem<TData = unknown> {
|
|
810
841
|
id: string;
|
|
@@ -1806,4 +1837,4 @@ declare function getFallbackAssetIconUrl(seed: string): string;
|
|
|
1806
1837
|
*/
|
|
1807
1838
|
declare function useAssetIcon(ticker: string, cdnBaseUrl?: string): string;
|
|
1808
1839
|
|
|
1809
|
-
export { AccountCapabilitiesCard, type AccountCapabilitiesCardProps, AccountChoiceChip, AccountHeaderIcons, AccountInfoGrid, AccountNetworkNotice, AccountNetworkPicker, AccountNetworkSelector, AccountNotice, type AccountSettingsNetwork, type AccountSettingsProtocol, AccountSettingsRow, AccountSettingsShell, AccountStatusPills, type AccountStatusTabItem, AccountStatusTabs, type AccountStatusTabsProps, ActionTile, type ActionTileProps, ActivityDetailRow, type ActivityDetailRowProps, ActivityFilterBar, type ActivityFilterBarProps, ActivityList, type ActivityListItem, type ActivityListProps, type ActivityNetworkFilterOption, type ActivityNetworkFilterValue, ActivityNetworkFilters, type ActivityNetworkFiltersProps, ActivityRow, type ActivityRowProps, type ActivityStatusOption, type ActivityTypeTabCounts, type ActivityTypeTabValue, ActivityTypeTabs, AlertBanner, type AmountDisplayOptions, type AmountDisplayUnit, AppIcon, type AppIconName, type AppIconProps, ArkadeNetworkIcon, AssetCard, type AssetCardProps, AssetIcon, AssetSelector, type AssetSelectorCategory, type AssetSelectorOption, type AssetSelectorProps, BalanceBreakdown, type BalanceBreakdownAccounts, type BalanceBreakdownAsset, type BalanceBreakdownNodeInfo, type BalanceBreakdownProps, BottomNav, type BottomNavItem, type BottomNavProps, BottomSheet, type BottomSheetAction, type BottomSheetProps, BtcUnifiedReceive, type BtcUnifiedReceiveAddress, type BtcUnifiedReceiveProps, type BtcUnifiedReceiveResult, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CopyIcon, type DepositAccountId, DepositAssetSelection, type DepositAssetSelectionProps, type DepositGeneratedAsset, DepositGeneratedView, type DepositGeneratedViewProps, type DepositGenerationController, type DepositInvoiceAsset, DepositInvoiceGeneration, type DepositInvoiceGenerationProps, type DepositNetworkConfigEntry, DepositNetworkDefaultModal, type DepositNetworkDefaultModalProps, type DepositNetworkKey, type DepositNetworkOption, DepositPreGeneration, type DepositPreGenerationAsset, type DepositPreGenerationProps, type DepositSelectionAsset, DepositSuccessScreen, type DepositSuccessScreenProps, type DepositTransferMethod, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisclosureCard, type DisclosureCardProps, DotPagination, type DotPaginationProps, type DotTone, ErrorBoundary, ErrorCard, type ErrorCardProps, ExpandIcon, ExtensionPageFrame, type ExtensionPageFrameProps, FadeOverlay, type FadeOverlayProps, FilterChipGroup, type FilterChipGroupProps, type FilterChipOption, FilterDropdown, type FilterDropdownOption, type FilterDropdownProps, HeadlineGradient, type HeadlineGradientProps, Icon, type IconName, type IconProps, Icons, InfoPanel, type InfoPanelProps, InlineAction, InlineSelector, type InlineSelectorOption, type InlineSelectorProps, Input, type InputProps, InvoiceStatusBanner, KaleidoScopeHeroAnimation, type KaleidoScopeHeroAnimationProps, Label, LightningNetworkIcon, LiquidNetworkIcon, ListSkeletonRows, type ListSkeletonRowsProps, LoadingCard, type LoadingCardProps, MethodChoiceChip, MetricCard, type MetricCardProps, MobileHeroAnimation, type MobileHeroAnimationProps, NETWORK_CONFIG, NetworkBadge, type NetworkBadgeProps, type NetworkIconProps, NetworkInfoDisclosure, NetworkStatusChip, type NetworkStatusChipProps, type NetworkType, NostrNetworkIcon, NumberInput, type NumberInputProps, OptionSelector, type OptionSelectorOption, type OptionSelectorProps, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, PaidOverlay, QrCode, type QrCodeProps, RecoveryPhraseCard, type RecoveryPhraseCardProps, RgbNetworkIcon, ScrollArea, type ScrollAreaProps, SecretRevealCard, type SecretRevealCardProps, SectionHeader, type SectionHeaderProps, SectionLabel, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SelectableCard, type SelectableCardProps, SettingItem, SettingsActionButton, SettingsSectionCard, type SettingsSectionCardProps, SettingsSelectorRow, type SettingsSelectorRowProps, SettingsStatusPanel, SettingsTile, type SettingsTileProps, Skeleton, type SkeletonProps, type SkeletonTone, SparkNetworkIcon, StatusBadge, StatusIconBadge, type StatusIconBadgeProps, type StatusType, StepperNumberInput, type StepperNumberInputProps, SwapInputCard, type SwapInputCardProps, Switch, SwitchRow, type SwitchRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, ToneBadge, type ToneBadgeProps, TransactionCard, type TransactionCardProps, TransferRouteCard, WalletAssetList, type WalletAssetListEmptyState, type WalletAssetListItem, type WalletAssetListProps, type WithdrawAddressType, WithdrawAmountInput, type WithdrawAmountInputProps, WithdrawConfirmation, type WithdrawConfirmationProps, type WithdrawConfirmationRgbInvoice, type WithdrawDecodedLnInvoice, type WithdrawDecodedRgbInvoice, WithdrawDestinationInput, type WithdrawDestinationInputProps, type WithdrawInvoiceAsset, WithdrawInvoiceInfo, type WithdrawInvoiceInfoLnInvoice, type WithdrawInvoiceInfoProps, type WithdrawInvoiceInfoRgbInvoice, type WithdrawLnurlPayData, type WithdrawRouteOption, WithdrawRouteSelector, type WithdrawRouteSelectorProps, type WithdrawRouteSummary, WithdrawSuccess, type WithdrawSuccessProps, buttonVariants, cn, formatDisplayAmountText, getAccountNetworkLabel, getAccountNetworkUi, getAccountStatusUi, getActivityNetworkFilterIcon, getAssetIconUrl, getFallbackAssetIconUrl, toast, useAssetIcon, useToast };
|
|
1840
|
+
export { AccountCapabilitiesCard, type AccountCapabilitiesCardProps, AccountChoiceChip, AccountHeaderIcons, AccountInfoGrid, AccountNetworkNotice, AccountNetworkPicker, AccountNetworkSelector, AccountNotice, type AccountSettingsNetwork, type AccountSettingsProtocol, AccountSettingsRow, AccountSettingsShell, AccountStatusPills, type AccountStatusTabItem, AccountStatusTabs, type AccountStatusTabsProps, ActionTile, type ActionTileProps, ActivityDetailRow, type ActivityDetailRowProps, ActivityFilterBar, type ActivityFilterBarProps, ActivityList, type ActivityListItem, type ActivityListProps, type ActivityNetworkFilterOption, type ActivityNetworkFilterValue, ActivityNetworkFilters, type ActivityNetworkFiltersProps, ActivityRow, type ActivityRowProps, type ActivityStatusOption, type ActivityTypeTabCounts, type ActivityTypeTabValue, ActivityTypeTabs, AlertBanner, type AmountDisplayOptions, type AmountDisplayUnit, AppIcon, type AppIconName, type AppIconProps, ArkadeNetworkIcon, AssetCard, type AssetCardProps, AssetIcon, AssetSelector, type AssetSelectorCategory, type AssetSelectorNetworkOption, type AssetSelectorOption, type AssetSelectorProps, type AssetSelectorQuickAsset, BalanceBreakdown, type BalanceBreakdownAccounts, type BalanceBreakdownAsset, type BalanceBreakdownNodeInfo, type BalanceBreakdownProps, BottomNav, type BottomNavItem, type BottomNavProps, BottomSheet, type BottomSheetAction, type BottomSheetProps, BtcUnifiedReceive, type BtcUnifiedReceiveAddress, type BtcUnifiedReceiveProps, type BtcUnifiedReceiveResult, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CopyIcon, type DepositAccountId, DepositAssetSelection, type DepositAssetSelectionProps, type DepositGeneratedAsset, DepositGeneratedView, type DepositGeneratedViewProps, type DepositGenerationController, type DepositInvoiceAsset, DepositInvoiceGeneration, type DepositInvoiceGenerationProps, type DepositNetworkConfigEntry, DepositNetworkDefaultModal, type DepositNetworkDefaultModalProps, type DepositNetworkKey, type DepositNetworkOption, DepositPreGeneration, type DepositPreGenerationAsset, type DepositPreGenerationProps, type DepositSelectionAsset, DepositSuccessScreen, type DepositSuccessScreenProps, type DepositTransferMethod, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisclosureCard, type DisclosureCardProps, DotPagination, type DotPaginationProps, type DotTone, ErrorBoundary, ErrorCard, type ErrorCardProps, ExpandIcon, ExtensionPageFrame, type ExtensionPageFrameProps, FadeOverlay, type FadeOverlayProps, FilterChipGroup, type FilterChipGroupProps, type FilterChipOption, FilterDropdown, type FilterDropdownOption, type FilterDropdownProps, HeadlineGradient, type HeadlineGradientProps, Icon, type IconName, type IconProps, Icons, InfoPanel, type InfoPanelProps, InlineAction, InlineSelector, type InlineSelectorOption, type InlineSelectorProps, Input, type InputProps, InvoiceStatusBanner, KaleidoScopeHeroAnimation, type KaleidoScopeHeroAnimationProps, Label, LightningNetworkIcon, LiquidNetworkIcon, ListSkeletonRows, type ListSkeletonRowsProps, LoadingCard, type LoadingCardProps, MethodChoiceChip, MetricCard, type MetricCardProps, MobileHeroAnimation, type MobileHeroAnimationProps, NETWORK_CONFIG, NetworkBadge, type NetworkBadgeProps, type NetworkIconProps, NetworkInfoDisclosure, NetworkStatusChip, type NetworkStatusChipProps, type NetworkType, NostrNetworkIcon, NumberInput, type NumberInputProps, OptionSelector, type OptionSelectorOption, type OptionSelectorProps, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, PaidOverlay, QrCode, type QrCodeProps, RecoveryPhraseCard, type RecoveryPhraseCardProps, RgbNetworkIcon, ScrollArea, type ScrollAreaProps, SecretRevealCard, type SecretRevealCardProps, SectionHeader, type SectionHeaderProps, SectionLabel, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SelectableCard, type SelectableCardProps, SettingItem, SettingsActionButton, SettingsSectionCard, type SettingsSectionCardProps, SettingsSelectorRow, type SettingsSelectorRowProps, SettingsStatusPanel, SettingsTile, type SettingsTileProps, Skeleton, type SkeletonProps, type SkeletonTone, SparkNetworkIcon, StatusBadge, StatusIconBadge, type StatusIconBadgeProps, type StatusType, StepperNumberInput, type StepperNumberInputProps, SwapInputCard, type SwapInputCardProps, Switch, SwitchRow, type SwitchRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, ToneBadge, type ToneBadgeProps, TransactionCard, type TransactionCardProps, TransferRouteCard, WalletAssetList, type WalletAssetListEmptyState, type WalletAssetListItem, type WalletAssetListProps, type WithdrawAddressType, WithdrawAmountInput, type WithdrawAmountInputProps, WithdrawConfirmation, type WithdrawConfirmationProps, type WithdrawConfirmationRgbInvoice, type WithdrawDecodedLnInvoice, type WithdrawDecodedRgbInvoice, WithdrawDestinationInput, type WithdrawDestinationInputProps, type WithdrawInvoiceAsset, WithdrawInvoiceInfo, type WithdrawInvoiceInfoLnInvoice, type WithdrawInvoiceInfoProps, type WithdrawInvoiceInfoRgbInvoice, type WithdrawLnurlPayData, type WithdrawRouteOption, WithdrawRouteSelector, type WithdrawRouteSelectorProps, type WithdrawRouteSummary, WithdrawSuccess, type WithdrawSuccessProps, buttonVariants, cn, formatDisplayAmountText, getAccountNetworkLabel, getAccountNetworkUi, getAccountStatusUi, getActivityNetworkFilterIcon, getAssetIconUrl, getFallbackAssetIconUrl, toast, useAssetIcon, useToast };
|
package/dist/web/index.d.ts
CHANGED
|
@@ -726,6 +726,8 @@ interface AssetSelectorOption {
|
|
|
726
726
|
assetId?: string;
|
|
727
727
|
category?: string | null;
|
|
728
728
|
categoryLabel?: string;
|
|
729
|
+
/** Network id matched against the network filter slider; options without one always pass. */
|
|
730
|
+
networkId?: string;
|
|
729
731
|
/** URL of the network mark rendered as a mini-badge over the asset icon. */
|
|
730
732
|
networkIconUrl?: string;
|
|
731
733
|
/** Right-aligned network tag: label pill tinted with `color`, ticker beneath. */
|
|
@@ -738,6 +740,19 @@ interface AssetSelectorCategory {
|
|
|
738
740
|
id: string;
|
|
739
741
|
label: string;
|
|
740
742
|
}
|
|
743
|
+
/** One entry of the single-select network filter slider inside the picker panel. */
|
|
744
|
+
interface AssetSelectorNetworkOption {
|
|
745
|
+
id: string;
|
|
746
|
+
label: string;
|
|
747
|
+
/** Network mark rendered inside the chip; falls back to a lettered dot. */
|
|
748
|
+
iconUrl?: string;
|
|
749
|
+
}
|
|
750
|
+
/** One entry of the quick-asset filter chips (e.g. BTC / USDT / USDC). */
|
|
751
|
+
interface AssetSelectorQuickAsset {
|
|
752
|
+
ticker: string;
|
|
753
|
+
/** Icon URL for the chip; falls back to AssetIcon's local/CDN resolution. */
|
|
754
|
+
iconUrl?: string;
|
|
755
|
+
}
|
|
741
756
|
interface AssetSelectorProps {
|
|
742
757
|
label: string;
|
|
743
758
|
selectedTicker: string;
|
|
@@ -745,6 +760,18 @@ interface AssetSelectorProps {
|
|
|
745
760
|
options: AssetSelectorOption[];
|
|
746
761
|
categories?: AssetSelectorCategory[];
|
|
747
762
|
defaultActiveCategories?: string[];
|
|
763
|
+
/**
|
|
764
|
+
* Single-select network filter rendered as a dropdown button in the panel's
|
|
765
|
+
* top-right corner ("All" by default). Selecting a network keeps only
|
|
766
|
+
* options whose `networkId` matches (options without a `networkId` always
|
|
767
|
+
* pass, mirroring the category convention).
|
|
768
|
+
*/
|
|
769
|
+
networks?: AssetSelectorNetworkOption[];
|
|
770
|
+
/**
|
|
771
|
+
* Quick-asset chips rendered under the search input. Pressing one narrows
|
|
772
|
+
* the list to that ticker; pressing it again clears the filter.
|
|
773
|
+
*/
|
|
774
|
+
quickAssets?: AssetSelectorQuickAsset[];
|
|
748
775
|
networkFilter?: NetworkType | null;
|
|
749
776
|
venueFilter?: string | null;
|
|
750
777
|
disabled?: boolean;
|
|
@@ -754,7 +781,7 @@ interface AssetSelectorProps {
|
|
|
754
781
|
onOpenPanelHeightChange?: (height: number) => void;
|
|
755
782
|
onChange: (id: string) => void;
|
|
756
783
|
}
|
|
757
|
-
declare function AssetSelector({ label, selectedTicker, selectedId, options, categories, defaultActiveCategories, networkFilter, venueFilter, disabled, disabledTicker, disabledId, compact, onOpenPanelHeightChange, onChange, }: AssetSelectorProps): react_jsx_runtime.JSX.Element;
|
|
784
|
+
declare function AssetSelector({ label, selectedTicker, selectedId, options, categories, defaultActiveCategories, networks, quickAssets, networkFilter, venueFilter, disabled, disabledTicker, disabledId, compact, onOpenPanelHeightChange, onChange, }: AssetSelectorProps): react_jsx_runtime.JSX.Element;
|
|
758
785
|
|
|
759
786
|
interface SwapInputCardProps {
|
|
760
787
|
fromTicker: string;
|
|
@@ -766,6 +793,10 @@ interface SwapInputCardProps {
|
|
|
766
793
|
toOptions: AssetSelectorOption[];
|
|
767
794
|
categories?: AssetSelectorCategory[];
|
|
768
795
|
defaultActiveCategories?: string[];
|
|
796
|
+
/** Network filter slider rendered inside the "You Pay" asset picker. */
|
|
797
|
+
fromNetworks?: AssetSelectorNetworkOption[];
|
|
798
|
+
/** Quick-asset chips rendered inside the "You Pay" asset picker. */
|
|
799
|
+
fromQuickAssets?: AssetSelectorQuickAsset[];
|
|
769
800
|
availableText: string;
|
|
770
801
|
showMaxText?: boolean;
|
|
771
802
|
maxText?: string;
|
|
@@ -804,7 +835,7 @@ interface SwapInputCardProps {
|
|
|
804
835
|
onFlip: () => void;
|
|
805
836
|
onSubmit: () => void;
|
|
806
837
|
}
|
|
807
|
-
declare function SwapInputCard({ fromTicker, toTicker, fromSelectedId, toSelectedId, fromInput, fromOptions, toOptions, categories, defaultActiveCategories, availableText, showMaxText, maxText, selectedPercentage, percentageDisabled, hidePercentages, oneWay, fromUnitLabel, fromDisplayUnit, fromUnitIsToggle, receiveAmount, receiveUnitLabel, receiveDisplayUnit, isLoadingQuote, quoteError, quoteRateText, quoteVenueText, quoteVenueTone, quoteFeeText, quoteExpiresText, quoteExpiresUrgent, warning, submitLabel, submitIcon, submitVariant, submitDisabled, onFromTickerChange, onToTickerChange, onFromInputChange, onPercentageClick, onToggleFromUnit, onFlip, onSubmit, }: SwapInputCardProps): react_jsx_runtime.JSX.Element;
|
|
838
|
+
declare function SwapInputCard({ fromTicker, toTicker, fromSelectedId, toSelectedId, fromInput, fromOptions, toOptions, categories, defaultActiveCategories, fromNetworks, fromQuickAssets, availableText, showMaxText, maxText, selectedPercentage, percentageDisabled, hidePercentages, oneWay, fromUnitLabel, fromDisplayUnit, fromUnitIsToggle, receiveAmount, receiveUnitLabel, receiveDisplayUnit, isLoadingQuote, quoteError, quoteRateText, quoteVenueText, quoteVenueTone, quoteFeeText, quoteExpiresText, quoteExpiresUrgent, warning, submitLabel, submitIcon, submitVariant, submitDisabled, onFromTickerChange, onToTickerChange, onFromInputChange, onPercentageClick, onToggleFromUnit, onFlip, onSubmit, }: SwapInputCardProps): react_jsx_runtime.JSX.Element;
|
|
808
839
|
|
|
809
840
|
interface ActivityListItem<TData = unknown> {
|
|
810
841
|
id: string;
|
|
@@ -1806,4 +1837,4 @@ declare function getFallbackAssetIconUrl(seed: string): string;
|
|
|
1806
1837
|
*/
|
|
1807
1838
|
declare function useAssetIcon(ticker: string, cdnBaseUrl?: string): string;
|
|
1808
1839
|
|
|
1809
|
-
export { AccountCapabilitiesCard, type AccountCapabilitiesCardProps, AccountChoiceChip, AccountHeaderIcons, AccountInfoGrid, AccountNetworkNotice, AccountNetworkPicker, AccountNetworkSelector, AccountNotice, type AccountSettingsNetwork, type AccountSettingsProtocol, AccountSettingsRow, AccountSettingsShell, AccountStatusPills, type AccountStatusTabItem, AccountStatusTabs, type AccountStatusTabsProps, ActionTile, type ActionTileProps, ActivityDetailRow, type ActivityDetailRowProps, ActivityFilterBar, type ActivityFilterBarProps, ActivityList, type ActivityListItem, type ActivityListProps, type ActivityNetworkFilterOption, type ActivityNetworkFilterValue, ActivityNetworkFilters, type ActivityNetworkFiltersProps, ActivityRow, type ActivityRowProps, type ActivityStatusOption, type ActivityTypeTabCounts, type ActivityTypeTabValue, ActivityTypeTabs, AlertBanner, type AmountDisplayOptions, type AmountDisplayUnit, AppIcon, type AppIconName, type AppIconProps, ArkadeNetworkIcon, AssetCard, type AssetCardProps, AssetIcon, AssetSelector, type AssetSelectorCategory, type AssetSelectorOption, type AssetSelectorProps, BalanceBreakdown, type BalanceBreakdownAccounts, type BalanceBreakdownAsset, type BalanceBreakdownNodeInfo, type BalanceBreakdownProps, BottomNav, type BottomNavItem, type BottomNavProps, BottomSheet, type BottomSheetAction, type BottomSheetProps, BtcUnifiedReceive, type BtcUnifiedReceiveAddress, type BtcUnifiedReceiveProps, type BtcUnifiedReceiveResult, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CopyIcon, type DepositAccountId, DepositAssetSelection, type DepositAssetSelectionProps, type DepositGeneratedAsset, DepositGeneratedView, type DepositGeneratedViewProps, type DepositGenerationController, type DepositInvoiceAsset, DepositInvoiceGeneration, type DepositInvoiceGenerationProps, type DepositNetworkConfigEntry, DepositNetworkDefaultModal, type DepositNetworkDefaultModalProps, type DepositNetworkKey, type DepositNetworkOption, DepositPreGeneration, type DepositPreGenerationAsset, type DepositPreGenerationProps, type DepositSelectionAsset, DepositSuccessScreen, type DepositSuccessScreenProps, type DepositTransferMethod, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisclosureCard, type DisclosureCardProps, DotPagination, type DotPaginationProps, type DotTone, ErrorBoundary, ErrorCard, type ErrorCardProps, ExpandIcon, ExtensionPageFrame, type ExtensionPageFrameProps, FadeOverlay, type FadeOverlayProps, FilterChipGroup, type FilterChipGroupProps, type FilterChipOption, FilterDropdown, type FilterDropdownOption, type FilterDropdownProps, HeadlineGradient, type HeadlineGradientProps, Icon, type IconName, type IconProps, Icons, InfoPanel, type InfoPanelProps, InlineAction, InlineSelector, type InlineSelectorOption, type InlineSelectorProps, Input, type InputProps, InvoiceStatusBanner, KaleidoScopeHeroAnimation, type KaleidoScopeHeroAnimationProps, Label, LightningNetworkIcon, LiquidNetworkIcon, ListSkeletonRows, type ListSkeletonRowsProps, LoadingCard, type LoadingCardProps, MethodChoiceChip, MetricCard, type MetricCardProps, MobileHeroAnimation, type MobileHeroAnimationProps, NETWORK_CONFIG, NetworkBadge, type NetworkBadgeProps, type NetworkIconProps, NetworkInfoDisclosure, NetworkStatusChip, type NetworkStatusChipProps, type NetworkType, NostrNetworkIcon, NumberInput, type NumberInputProps, OptionSelector, type OptionSelectorOption, type OptionSelectorProps, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, PaidOverlay, QrCode, type QrCodeProps, RecoveryPhraseCard, type RecoveryPhraseCardProps, RgbNetworkIcon, ScrollArea, type ScrollAreaProps, SecretRevealCard, type SecretRevealCardProps, SectionHeader, type SectionHeaderProps, SectionLabel, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SelectableCard, type SelectableCardProps, SettingItem, SettingsActionButton, SettingsSectionCard, type SettingsSectionCardProps, SettingsSelectorRow, type SettingsSelectorRowProps, SettingsStatusPanel, SettingsTile, type SettingsTileProps, Skeleton, type SkeletonProps, type SkeletonTone, SparkNetworkIcon, StatusBadge, StatusIconBadge, type StatusIconBadgeProps, type StatusType, StepperNumberInput, type StepperNumberInputProps, SwapInputCard, type SwapInputCardProps, Switch, SwitchRow, type SwitchRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, ToneBadge, type ToneBadgeProps, TransactionCard, type TransactionCardProps, TransferRouteCard, WalletAssetList, type WalletAssetListEmptyState, type WalletAssetListItem, type WalletAssetListProps, type WithdrawAddressType, WithdrawAmountInput, type WithdrawAmountInputProps, WithdrawConfirmation, type WithdrawConfirmationProps, type WithdrawConfirmationRgbInvoice, type WithdrawDecodedLnInvoice, type WithdrawDecodedRgbInvoice, WithdrawDestinationInput, type WithdrawDestinationInputProps, type WithdrawInvoiceAsset, WithdrawInvoiceInfo, type WithdrawInvoiceInfoLnInvoice, type WithdrawInvoiceInfoProps, type WithdrawInvoiceInfoRgbInvoice, type WithdrawLnurlPayData, type WithdrawRouteOption, WithdrawRouteSelector, type WithdrawRouteSelectorProps, type WithdrawRouteSummary, WithdrawSuccess, type WithdrawSuccessProps, buttonVariants, cn, formatDisplayAmountText, getAccountNetworkLabel, getAccountNetworkUi, getAccountStatusUi, getActivityNetworkFilterIcon, getAssetIconUrl, getFallbackAssetIconUrl, toast, useAssetIcon, useToast };
|
|
1840
|
+
export { AccountCapabilitiesCard, type AccountCapabilitiesCardProps, AccountChoiceChip, AccountHeaderIcons, AccountInfoGrid, AccountNetworkNotice, AccountNetworkPicker, AccountNetworkSelector, AccountNotice, type AccountSettingsNetwork, type AccountSettingsProtocol, AccountSettingsRow, AccountSettingsShell, AccountStatusPills, type AccountStatusTabItem, AccountStatusTabs, type AccountStatusTabsProps, ActionTile, type ActionTileProps, ActivityDetailRow, type ActivityDetailRowProps, ActivityFilterBar, type ActivityFilterBarProps, ActivityList, type ActivityListItem, type ActivityListProps, type ActivityNetworkFilterOption, type ActivityNetworkFilterValue, ActivityNetworkFilters, type ActivityNetworkFiltersProps, ActivityRow, type ActivityRowProps, type ActivityStatusOption, type ActivityTypeTabCounts, type ActivityTypeTabValue, ActivityTypeTabs, AlertBanner, type AmountDisplayOptions, type AmountDisplayUnit, AppIcon, type AppIconName, type AppIconProps, ArkadeNetworkIcon, AssetCard, type AssetCardProps, AssetIcon, AssetSelector, type AssetSelectorCategory, type AssetSelectorNetworkOption, type AssetSelectorOption, type AssetSelectorProps, type AssetSelectorQuickAsset, BalanceBreakdown, type BalanceBreakdownAccounts, type BalanceBreakdownAsset, type BalanceBreakdownNodeInfo, type BalanceBreakdownProps, BottomNav, type BottomNavItem, type BottomNavProps, BottomSheet, type BottomSheetAction, type BottomSheetProps, BtcUnifiedReceive, type BtcUnifiedReceiveAddress, type BtcUnifiedReceiveProps, type BtcUnifiedReceiveResult, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CopyIcon, type DepositAccountId, DepositAssetSelection, type DepositAssetSelectionProps, type DepositGeneratedAsset, DepositGeneratedView, type DepositGeneratedViewProps, type DepositGenerationController, type DepositInvoiceAsset, DepositInvoiceGeneration, type DepositInvoiceGenerationProps, type DepositNetworkConfigEntry, DepositNetworkDefaultModal, type DepositNetworkDefaultModalProps, type DepositNetworkKey, type DepositNetworkOption, DepositPreGeneration, type DepositPreGenerationAsset, type DepositPreGenerationProps, type DepositSelectionAsset, DepositSuccessScreen, type DepositSuccessScreenProps, type DepositTransferMethod, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisclosureCard, type DisclosureCardProps, DotPagination, type DotPaginationProps, type DotTone, ErrorBoundary, ErrorCard, type ErrorCardProps, ExpandIcon, ExtensionPageFrame, type ExtensionPageFrameProps, FadeOverlay, type FadeOverlayProps, FilterChipGroup, type FilterChipGroupProps, type FilterChipOption, FilterDropdown, type FilterDropdownOption, type FilterDropdownProps, HeadlineGradient, type HeadlineGradientProps, Icon, type IconName, type IconProps, Icons, InfoPanel, type InfoPanelProps, InlineAction, InlineSelector, type InlineSelectorOption, type InlineSelectorProps, Input, type InputProps, InvoiceStatusBanner, KaleidoScopeHeroAnimation, type KaleidoScopeHeroAnimationProps, Label, LightningNetworkIcon, LiquidNetworkIcon, ListSkeletonRows, type ListSkeletonRowsProps, LoadingCard, type LoadingCardProps, MethodChoiceChip, MetricCard, type MetricCardProps, MobileHeroAnimation, type MobileHeroAnimationProps, NETWORK_CONFIG, NetworkBadge, type NetworkBadgeProps, type NetworkIconProps, NetworkInfoDisclosure, NetworkStatusChip, type NetworkStatusChipProps, type NetworkType, NostrNetworkIcon, NumberInput, type NumberInputProps, OptionSelector, type OptionSelectorOption, type OptionSelectorProps, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, PaidOverlay, QrCode, type QrCodeProps, RecoveryPhraseCard, type RecoveryPhraseCardProps, RgbNetworkIcon, ScrollArea, type ScrollAreaProps, SecretRevealCard, type SecretRevealCardProps, SectionHeader, type SectionHeaderProps, SectionLabel, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SelectableCard, type SelectableCardProps, SettingItem, SettingsActionButton, SettingsSectionCard, type SettingsSectionCardProps, SettingsSelectorRow, type SettingsSelectorRowProps, SettingsStatusPanel, SettingsTile, type SettingsTileProps, Skeleton, type SkeletonProps, type SkeletonTone, SparkNetworkIcon, StatusBadge, StatusIconBadge, type StatusIconBadgeProps, type StatusType, StepperNumberInput, type StepperNumberInputProps, SwapInputCard, type SwapInputCardProps, Switch, SwitchRow, type SwitchRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, ToneBadge, type ToneBadgeProps, TransactionCard, type TransactionCardProps, TransferRouteCard, WalletAssetList, type WalletAssetListEmptyState, type WalletAssetListItem, type WalletAssetListProps, type WithdrawAddressType, WithdrawAmountInput, type WithdrawAmountInputProps, WithdrawConfirmation, type WithdrawConfirmationProps, type WithdrawConfirmationRgbInvoice, type WithdrawDecodedLnInvoice, type WithdrawDecodedRgbInvoice, WithdrawDestinationInput, type WithdrawDestinationInputProps, type WithdrawInvoiceAsset, WithdrawInvoiceInfo, type WithdrawInvoiceInfoLnInvoice, type WithdrawInvoiceInfoProps, type WithdrawInvoiceInfoRgbInvoice, type WithdrawLnurlPayData, type WithdrawRouteOption, WithdrawRouteSelector, type WithdrawRouteSelectorProps, type WithdrawRouteSummary, WithdrawSuccess, type WithdrawSuccessProps, buttonVariants, cn, formatDisplayAmountText, getAccountNetworkLabel, getAccountNetworkUi, getAccountStatusUi, getActivityNetworkFilterIcon, getAssetIconUrl, getFallbackAssetIconUrl, toast, useAssetIcon, useToast };
|
package/dist/web/index.js
CHANGED
|
@@ -3618,6 +3618,42 @@ function readableTagColor(color) {
|
|
|
3618
3618
|
const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
|
|
3619
3619
|
return luminance < 0.45 ? `color-mix(in srgb, ${color} 45%, white)` : color;
|
|
3620
3620
|
}
|
|
3621
|
+
var chipBaseClass = "shrink-0 rounded-full text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors";
|
|
3622
|
+
var chipActiveClass = "bg-primary/[0.14] text-primary";
|
|
3623
|
+
var chipIdleClass = "bg-surface-card text-text-dimmed hover:text-white/75";
|
|
3624
|
+
function AssetSelectorNetworkMark({ network }) {
|
|
3625
|
+
return network.iconUrl ? /* @__PURE__ */ jsx38("img", { src: network.iconUrl, alt: "", className: "size-4 shrink-0 rounded-full" }) : /* @__PURE__ */ jsx38("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-xxs font-bold uppercase leading-none text-muted-foreground", children: network.label.charAt(0) });
|
|
3626
|
+
}
|
|
3627
|
+
function AssetSelectorNetworkFilterTrigger({
|
|
3628
|
+
activeNetworkOption,
|
|
3629
|
+
open,
|
|
3630
|
+
onClick
|
|
3631
|
+
}) {
|
|
3632
|
+
return /* @__PURE__ */ jsxs25(
|
|
3633
|
+
"button",
|
|
3634
|
+
{
|
|
3635
|
+
type: "button",
|
|
3636
|
+
onClick,
|
|
3637
|
+
className: cn(
|
|
3638
|
+
chipBaseClass,
|
|
3639
|
+
"flex items-center gap-1.5 py-1.5 pl-2 pr-2.5",
|
|
3640
|
+
activeNetworkOption || open ? chipActiveClass : chipIdleClass
|
|
3641
|
+
),
|
|
3642
|
+
children: [
|
|
3643
|
+
activeNetworkOption && /* @__PURE__ */ jsx38(AssetSelectorNetworkMark, { network: activeNetworkOption }),
|
|
3644
|
+
activeNetworkOption ? activeNetworkOption.label : "All",
|
|
3645
|
+
/* @__PURE__ */ jsx38(
|
|
3646
|
+
Icon,
|
|
3647
|
+
{
|
|
3648
|
+
name: "expand_more",
|
|
3649
|
+
size: "xs",
|
|
3650
|
+
className: cn("shrink-0 transition-transform duration-200", open && "rotate-180")
|
|
3651
|
+
}
|
|
3652
|
+
)
|
|
3653
|
+
]
|
|
3654
|
+
}
|
|
3655
|
+
);
|
|
3656
|
+
}
|
|
3621
3657
|
function AssetSelector({
|
|
3622
3658
|
label,
|
|
3623
3659
|
selectedTicker,
|
|
@@ -3625,6 +3661,8 @@ function AssetSelector({
|
|
|
3625
3661
|
options,
|
|
3626
3662
|
categories = [],
|
|
3627
3663
|
defaultActiveCategories,
|
|
3664
|
+
networks = [],
|
|
3665
|
+
quickAssets = [],
|
|
3628
3666
|
networkFilter,
|
|
3629
3667
|
venueFilter,
|
|
3630
3668
|
disabled,
|
|
@@ -3639,16 +3677,25 @@ function AssetSelector({
|
|
|
3639
3677
|
const [activeCategories, setActiveCategories] = useState11(
|
|
3640
3678
|
defaultActiveCategories ?? categories.map((category) => category.id)
|
|
3641
3679
|
);
|
|
3680
|
+
const [activeNetwork, setActiveNetwork] = useState11(null);
|
|
3681
|
+
const [networkMenuOpen, setNetworkMenuOpen] = useState11(false);
|
|
3682
|
+
const [activeQuickAsset, setActiveQuickAsset] = useState11(null);
|
|
3642
3683
|
const selectedKey = selectedId ?? selectedTicker;
|
|
3643
3684
|
const selected = options.find((option) => option.id === selectedKey) ?? options.find((option) => option.ticker === selectedTicker);
|
|
3644
3685
|
const selectedOptionId = selected?.id ?? selectedKey;
|
|
3645
3686
|
const hasCategoryFilters = categories.length > 0;
|
|
3687
|
+
const hasNetworkFilter = networks.length > 0;
|
|
3688
|
+
const hasQuickAssets = quickAssets.length > 0;
|
|
3689
|
+
const activeNetworkOption = networks.find((network) => network.id === activeNetwork) ?? null;
|
|
3646
3690
|
const filtered = options.filter((option) => {
|
|
3647
3691
|
const category = option.category ?? null;
|
|
3648
3692
|
const matchesCategory = !hasCategoryFilters || category === null || activeCategories.includes(category);
|
|
3649
3693
|
const matchesNetwork = !networkFilter || option.network === networkFilter;
|
|
3694
|
+
const matchesNetworkFilter = !activeNetwork || option.networkId == null || option.networkId === activeNetwork;
|
|
3695
|
+
const matchesQuickAsset = !activeQuickAsset || option.ticker.toUpperCase() === activeQuickAsset;
|
|
3650
3696
|
const matchesVenue = !venueFilter || option.venue === venueFilter;
|
|
3651
|
-
if (!matchesCategory || !matchesNetwork || !matchesVenue)
|
|
3697
|
+
if (!matchesCategory || !matchesNetwork || !matchesNetworkFilter || !matchesQuickAsset || !matchesVenue)
|
|
3698
|
+
return false;
|
|
3652
3699
|
if (!search) return true;
|
|
3653
3700
|
const searchValue = search.toLowerCase();
|
|
3654
3701
|
const matchesSearch = option.ticker.toLowerCase().includes(searchValue) || (option.name?.toLowerCase().includes(searchValue) ?? false) || (option.assetId?.toLowerCase().includes(searchValue) ?? false) || (option.network?.toLowerCase().includes(searchValue) ?? false) || (option.networkTag?.label.toLowerCase().includes(searchValue) ?? false) || (option.category?.toLowerCase().includes(searchValue) ?? false);
|
|
@@ -3665,6 +3712,117 @@ function AssetSelector({
|
|
|
3665
3712
|
disabled: option.id === disabledId || option.ticker === disabledTicker
|
|
3666
3713
|
}));
|
|
3667
3714
|
const categoryLabelById = new Map(categories.map((category) => [category.id, category.label]));
|
|
3715
|
+
const networkFilterButton = hasNetworkFilter && /* @__PURE__ */ jsxs25("div", { className: "relative shrink-0", children: [
|
|
3716
|
+
/* @__PURE__ */ jsx38(
|
|
3717
|
+
AssetSelectorNetworkFilterTrigger,
|
|
3718
|
+
{
|
|
3719
|
+
activeNetworkOption,
|
|
3720
|
+
open: networkMenuOpen,
|
|
3721
|
+
onClick: () => setNetworkMenuOpen((value) => !value)
|
|
3722
|
+
}
|
|
3723
|
+
),
|
|
3724
|
+
networkMenuOpen && /* @__PURE__ */ jsx38("div", { className: "absolute right-0 top-full z-10 mt-1.5 w-48 overflow-hidden rounded-xl border border-white/[0.08] bg-popover shadow-popover", children: /* @__PURE__ */ jsxs25("div", { className: "max-h-60 overflow-y-auto p-1", children: [
|
|
3725
|
+
/* @__PURE__ */ jsxs25(
|
|
3726
|
+
"button",
|
|
3727
|
+
{
|
|
3728
|
+
type: "button",
|
|
3729
|
+
onClick: () => {
|
|
3730
|
+
setActiveNetwork(null);
|
|
3731
|
+
setNetworkMenuOpen(false);
|
|
3732
|
+
},
|
|
3733
|
+
className: cn(
|
|
3734
|
+
"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-xs font-semibold transition-colors",
|
|
3735
|
+
activeNetwork === null ? "bg-primary/[0.14] text-primary" : "text-white/75 hover:bg-accent hover:text-white"
|
|
3736
|
+
),
|
|
3737
|
+
children: [
|
|
3738
|
+
/* @__PURE__ */ jsx38(Icon, { name: "hub", size: "xs", className: "shrink-0" }),
|
|
3739
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 flex-1 truncate text-left", children: "All networks" }),
|
|
3740
|
+
activeNetwork === null && /* @__PURE__ */ jsx38(Icon, { name: "check", size: "xs", className: "shrink-0 text-primary" })
|
|
3741
|
+
]
|
|
3742
|
+
}
|
|
3743
|
+
),
|
|
3744
|
+
networks.map((network) => {
|
|
3745
|
+
const isActive = activeNetwork === network.id;
|
|
3746
|
+
return /* @__PURE__ */ jsxs25(
|
|
3747
|
+
"button",
|
|
3748
|
+
{
|
|
3749
|
+
type: "button",
|
|
3750
|
+
onClick: () => {
|
|
3751
|
+
setActiveNetwork(network.id);
|
|
3752
|
+
setNetworkMenuOpen(false);
|
|
3753
|
+
},
|
|
3754
|
+
className: cn(
|
|
3755
|
+
"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-xs font-semibold transition-colors",
|
|
3756
|
+
isActive ? "bg-primary/[0.14] text-primary" : "text-white/75 hover:bg-accent hover:text-white"
|
|
3757
|
+
),
|
|
3758
|
+
children: [
|
|
3759
|
+
/* @__PURE__ */ jsx38(AssetSelectorNetworkMark, { network }),
|
|
3760
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 flex-1 truncate text-left", children: network.label }),
|
|
3761
|
+
isActive && /* @__PURE__ */ jsx38(Icon, { name: "check", size: "xs", className: "shrink-0 text-primary" })
|
|
3762
|
+
]
|
|
3763
|
+
},
|
|
3764
|
+
network.id
|
|
3765
|
+
);
|
|
3766
|
+
})
|
|
3767
|
+
] }) })
|
|
3768
|
+
] });
|
|
3769
|
+
const filterControls = (hasQuickAssets || hasCategoryFilters) && /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
3770
|
+
hasQuickAssets && /* @__PURE__ */ jsx38("div", { className: "mt-3 flex flex-wrap items-center gap-1.5", children: quickAssets.map((quick) => {
|
|
3771
|
+
const tickerKey = quick.ticker.toUpperCase();
|
|
3772
|
+
const isActive = activeQuickAsset === tickerKey;
|
|
3773
|
+
return /* @__PURE__ */ jsxs25(
|
|
3774
|
+
"button",
|
|
3775
|
+
{
|
|
3776
|
+
type: "button",
|
|
3777
|
+
onClick: () => setActiveQuickAsset(isActive ? null : tickerKey),
|
|
3778
|
+
className: cn(
|
|
3779
|
+
chipBaseClass,
|
|
3780
|
+
"flex items-center gap-1.5 py-1 pl-1.5 pr-2.5",
|
|
3781
|
+
isActive ? chipActiveClass : chipIdleClass
|
|
3782
|
+
),
|
|
3783
|
+
children: [
|
|
3784
|
+
quick.iconUrl ? /* @__PURE__ */ jsx38("img", { src: quick.iconUrl, alt: "", className: "size-4 shrink-0 rounded-full" }) : /* @__PURE__ */ jsx38(AssetIcon, { ticker: quick.ticker, size: 16, className: "shrink-0" }),
|
|
3785
|
+
quick.ticker
|
|
3786
|
+
]
|
|
3787
|
+
},
|
|
3788
|
+
tickerKey
|
|
3789
|
+
);
|
|
3790
|
+
}) }),
|
|
3791
|
+
hasCategoryFilters && /* @__PURE__ */ jsxs25("div", { className: "mt-3 flex flex-wrap items-center gap-1.5", children: [
|
|
3792
|
+
/* @__PURE__ */ jsx38(
|
|
3793
|
+
"button",
|
|
3794
|
+
{
|
|
3795
|
+
type: "button",
|
|
3796
|
+
onClick: () => setActiveCategories(categories.map((category) => category.id)),
|
|
3797
|
+
className: cn(
|
|
3798
|
+
chipBaseClass,
|
|
3799
|
+
"px-2.5 py-1",
|
|
3800
|
+
activeCategories.length === categories.length ? chipActiveClass : chipIdleClass
|
|
3801
|
+
),
|
|
3802
|
+
children: "All"
|
|
3803
|
+
}
|
|
3804
|
+
),
|
|
3805
|
+
categories.map((category) => {
|
|
3806
|
+
const isActive = activeCategories.includes(category.id);
|
|
3807
|
+
return /* @__PURE__ */ jsx38(
|
|
3808
|
+
"button",
|
|
3809
|
+
{
|
|
3810
|
+
type: "button",
|
|
3811
|
+
onClick: () => setActiveCategories(
|
|
3812
|
+
(current) => current.includes(category.id) ? current.filter((value) => value !== category.id) : [...current, category.id]
|
|
3813
|
+
),
|
|
3814
|
+
className: cn(
|
|
3815
|
+
chipBaseClass,
|
|
3816
|
+
"px-2.5 py-1",
|
|
3817
|
+
isActive ? chipActiveClass : chipIdleClass
|
|
3818
|
+
),
|
|
3819
|
+
children: category.label
|
|
3820
|
+
},
|
|
3821
|
+
category.id
|
|
3822
|
+
);
|
|
3823
|
+
})
|
|
3824
|
+
] })
|
|
3825
|
+
] });
|
|
3668
3826
|
const renderAssetOption = (option, optionSelected, optionDisabled) => {
|
|
3669
3827
|
const optionCategoryLabel = option.categoryLabel || (option.category ? categoryLabelById.get(option.category) : void 0);
|
|
3670
3828
|
const hasNetworkBadge = Boolean(option.networkIconUrl || option.networkTag);
|
|
@@ -3733,6 +3891,7 @@ function AssetSelector({
|
|
|
3733
3891
|
const closePanel = () => {
|
|
3734
3892
|
setOpen(false);
|
|
3735
3893
|
setSearch("");
|
|
3894
|
+
setNetworkMenuOpen(false);
|
|
3736
3895
|
};
|
|
3737
3896
|
return /* @__PURE__ */ jsxs25("div", { className: "relative w-36 flex-shrink-0", children: [
|
|
3738
3897
|
/* @__PURE__ */ jsx38(
|
|
@@ -3792,7 +3951,7 @@ function AssetSelector({
|
|
|
3792
3951
|
" available"
|
|
3793
3952
|
] })
|
|
3794
3953
|
] }),
|
|
3795
|
-
selected && /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
3954
|
+
networkFilterButton || selected && /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
3796
3955
|
/* @__PURE__ */ jsx38(AssetIcon, { ticker: selected.ticker, logoUri: selected.icon, size: 18 }),
|
|
3797
3956
|
/* @__PURE__ */ jsx38("span", { className: "text-tiny font-semibold text-white", children: selected.ticker })
|
|
3798
3957
|
] })
|
|
@@ -3819,38 +3978,7 @@ function AssetSelector({
|
|
|
3819
3978
|
}
|
|
3820
3979
|
)
|
|
3821
3980
|
] }),
|
|
3822
|
-
|
|
3823
|
-
/* @__PURE__ */ jsx38(
|
|
3824
|
-
"button",
|
|
3825
|
-
{
|
|
3826
|
-
type: "button",
|
|
3827
|
-
onClick: () => setActiveCategories(categories.map((category) => category.id)),
|
|
3828
|
-
className: cn(
|
|
3829
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
3830
|
-
activeCategories.length === categories.length ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
3831
|
-
),
|
|
3832
|
-
children: "All"
|
|
3833
|
-
}
|
|
3834
|
-
),
|
|
3835
|
-
categories.map((category) => {
|
|
3836
|
-
const isActive = activeCategories.includes(category.id);
|
|
3837
|
-
return /* @__PURE__ */ jsx38(
|
|
3838
|
-
"button",
|
|
3839
|
-
{
|
|
3840
|
-
type: "button",
|
|
3841
|
-
onClick: () => setActiveCategories(
|
|
3842
|
-
(current) => current.includes(category.id) ? current.filter((value) => value !== category.id) : [...current, category.id]
|
|
3843
|
-
),
|
|
3844
|
-
className: cn(
|
|
3845
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
3846
|
-
isActive ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
3847
|
-
),
|
|
3848
|
-
children: category.label
|
|
3849
|
-
},
|
|
3850
|
-
category.id
|
|
3851
|
-
);
|
|
3852
|
-
})
|
|
3853
|
-
] })
|
|
3981
|
+
filterControls
|
|
3854
3982
|
] }),
|
|
3855
3983
|
/* @__PURE__ */ jsx38("div", { className: "mx-4 h-px bg-white/[0.06]" }),
|
|
3856
3984
|
/* @__PURE__ */ jsx38(ScrollArea, { className: "min-h-0 flex-1", viewportClassName: "max-h-[56vh] px-2 py-2 pb-6", children: filtered.length === 0 ? /* @__PURE__ */ jsxs25("div", { className: "flex flex-col items-center gap-2 px-4 py-10 text-center text-sm text-white/30", children: [
|
|
@@ -3943,7 +4071,7 @@ function AssetSelector({
|
|
|
3943
4071
|
" available"
|
|
3944
4072
|
] })
|
|
3945
4073
|
] }),
|
|
3946
|
-
selected && /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
4074
|
+
networkFilterButton || selected && /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 rounded-full bg-white/5 px-2.5 py-1", children: [
|
|
3947
4075
|
/* @__PURE__ */ jsx38(AssetIcon, { ticker: selected.ticker, logoUri: selected.icon, size: 18 }),
|
|
3948
4076
|
/* @__PURE__ */ jsx38("span", { className: "text-tiny font-semibold text-white", children: selected.ticker })
|
|
3949
4077
|
] })
|
|
@@ -3970,38 +4098,7 @@ function AssetSelector({
|
|
|
3970
4098
|
}
|
|
3971
4099
|
)
|
|
3972
4100
|
] }),
|
|
3973
|
-
|
|
3974
|
-
/* @__PURE__ */ jsx38(
|
|
3975
|
-
"button",
|
|
3976
|
-
{
|
|
3977
|
-
type: "button",
|
|
3978
|
-
onClick: () => setActiveCategories(categories.map((category) => category.id)),
|
|
3979
|
-
className: cn(
|
|
3980
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
3981
|
-
activeCategories.length === categories.length ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
3982
|
-
),
|
|
3983
|
-
children: "All"
|
|
3984
|
-
}
|
|
3985
|
-
),
|
|
3986
|
-
categories.map((category) => {
|
|
3987
|
-
const isActive = activeCategories.includes(category.id);
|
|
3988
|
-
return /* @__PURE__ */ jsx38(
|
|
3989
|
-
"button",
|
|
3990
|
-
{
|
|
3991
|
-
type: "button",
|
|
3992
|
-
onClick: () => setActiveCategories(
|
|
3993
|
-
(current) => current.includes(category.id) ? current.filter((value) => value !== category.id) : [...current, category.id]
|
|
3994
|
-
),
|
|
3995
|
-
className: cn(
|
|
3996
|
-
"rounded-full px-2.5 py-1 text-tiny font-bold uppercase tracking-wide shadow-inner transition-colors",
|
|
3997
|
-
isActive ? "bg-primary/[0.14] text-primary" : "bg-surface-card text-text-dimmed hover:text-white/75"
|
|
3998
|
-
),
|
|
3999
|
-
children: category.label
|
|
4000
|
-
},
|
|
4001
|
-
category.id
|
|
4002
|
-
);
|
|
4003
|
-
})
|
|
4004
|
-
] })
|
|
4101
|
+
filterControls
|
|
4005
4102
|
] })
|
|
4006
4103
|
] }),
|
|
4007
4104
|
renderOption: ({ option, selected: optionSelected, disabled: optionDisabled }) => {
|
|
@@ -4024,6 +4121,8 @@ function SwapInputCard({
|
|
|
4024
4121
|
toOptions,
|
|
4025
4122
|
categories,
|
|
4026
4123
|
defaultActiveCategories,
|
|
4124
|
+
fromNetworks,
|
|
4125
|
+
fromQuickAssets,
|
|
4027
4126
|
availableText,
|
|
4028
4127
|
showMaxText = false,
|
|
4029
4128
|
maxText,
|
|
@@ -4101,6 +4200,8 @@ function SwapInputCard({
|
|
|
4101
4200
|
options: fromOptions,
|
|
4102
4201
|
categories,
|
|
4103
4202
|
defaultActiveCategories,
|
|
4203
|
+
networks: fromNetworks,
|
|
4204
|
+
quickAssets: fromQuickAssets,
|
|
4104
4205
|
disabledId: toSelectedId,
|
|
4105
4206
|
onChange: onFromTickerChange
|
|
4106
4207
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kaleido-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.107",
|
|
4
4
|
"description": "KaleidoSwap shared UI library — design tokens, web components (Tailwind + Radix), and React Native components extending WDK UI Kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"showcase": "vite --config showcase/vite.config.ts",
|
|
44
44
|
"showcase:build": "npm run generate:css && vite build --config showcase/vite.config.ts",
|
|
45
45
|
"type-check": "tsc --noEmit",
|
|
46
|
+
"test": "node --import tsx --test tests/*.test.tsx",
|
|
46
47
|
"clean": "rm -rf dist"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|