@unicitylabs/sphere-ui 0.1.19 → 0.1.20
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/index.d.ts +20 -5
- package/dist/index.js +26 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
|
+
import { ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, MouseEvent, Ref } from 'react';
|
|
4
4
|
import { ColumnDef } from '@tanstack/react-table';
|
|
5
5
|
export { A as AchievementData, a as AchievementFormApi, Q as QueryKeys, b as QuestData, c as QuestFormApi, T as TrackData, d as TrackFormApi } from './index-DMHfA7fr.js';
|
|
6
6
|
|
|
@@ -388,22 +388,37 @@ interface FeaturedProjectCardProps {
|
|
|
388
388
|
*/
|
|
389
389
|
declare function FeaturedProjectCard({ name, tagline, logoUrl, bannerUrl, accentColor, users, quests, positivePercent, ratingCount, onClick, }: FeaturedProjectCardProps): react_jsx_runtime.JSX.Element;
|
|
390
390
|
|
|
391
|
+
/** Loose typing — dnd-kit listeners/attributes don't fit React's HTMLButtonAttributes due to motion.button overrides. */
|
|
392
|
+
type ButtonExtraProps = {
|
|
393
|
+
className?: string;
|
|
394
|
+
style?: React.CSSProperties;
|
|
395
|
+
} & Record<string, unknown>;
|
|
391
396
|
interface InstalledProjectIconProps {
|
|
392
397
|
name: string;
|
|
393
398
|
logoUrl?: string | null;
|
|
394
399
|
/** Hex like "#FF6F00". Defaults to brand orange. */
|
|
395
400
|
accentColor?: string;
|
|
396
401
|
onClick?: () => void;
|
|
402
|
+
/** Right-click handler. Wallet uses it to toggle a context menu. */
|
|
403
|
+
onContextMenu?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
404
|
+
/** Slot overlaid on the icon tile (absolute top/right). Wallet uses it for the MoreVertical menu button. */
|
|
405
|
+
topRightAction?: ReactNode;
|
|
397
406
|
/** When true, render the name label under the icon (dock vs grid layout). Default true. */
|
|
398
407
|
showLabel?: boolean;
|
|
408
|
+
/** Ref attached to the inner button. Use for dnd-kit `setActivatorNodeRef`. */
|
|
409
|
+
buttonRef?: Ref<HTMLButtonElement>;
|
|
410
|
+
/** Extra props spread on the inner button (e.g. dnd-kit `attributes` + `listeners`). */
|
|
411
|
+
buttonProps?: ButtonExtraProps;
|
|
399
412
|
}
|
|
400
413
|
/**
|
|
401
|
-
* InstalledProjectIcon —
|
|
414
|
+
* InstalledProjectIcon — desktop tile for an installed app/skill.
|
|
402
415
|
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
416
|
+
* Renders the visual (glow + colored tile + logo + label). Behavior is
|
|
417
|
+
* driven entirely by props: pass `onClick` for the primary action,
|
|
418
|
+
* `onContextMenu` for right-click, and `topRightAction` to overlay a
|
|
419
|
+
* small action button (e.g. context-menu trigger) on the tile.
|
|
405
420
|
*/
|
|
406
|
-
declare function InstalledProjectIcon({ name, logoUrl, accentColor, onClick, showLabel, }: InstalledProjectIconProps): react_jsx_runtime.JSX.Element;
|
|
421
|
+
declare function InstalledProjectIcon({ name, logoUrl, accentColor, onClick, onContextMenu, topRightAction, showLabel, buttonRef, buttonProps, }: InstalledProjectIconProps): react_jsx_runtime.JSX.Element;
|
|
407
422
|
|
|
408
423
|
interface QuestPreviewSummary {
|
|
409
424
|
slug: string;
|
package/dist/index.js
CHANGED
|
@@ -1762,7 +1762,7 @@ function MediaGallery({ ownerType, ownerId, items, onChange, uploadFn, max = 10
|
|
|
1762
1762
|
// src/components/media/MarketplaceProjectCard.tsx
|
|
1763
1763
|
import { motion } from "framer-motion";
|
|
1764
1764
|
import { Users, Target, ThumbsUp, Plus, Check } from "lucide-react";
|
|
1765
|
-
import {
|
|
1765
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1766
1766
|
var categoryLabels = {
|
|
1767
1767
|
game: "Game",
|
|
1768
1768
|
defi: "DeFi",
|
|
@@ -1802,19 +1802,18 @@ function MarketplaceProjectCard({
|
|
|
1802
1802
|
className: "no-text-shadow group rounded-2xl border border-neutral-200 dark:border-white/8 hover:border-orange-500/60 dark:hover:border-brand-orange/60 hover:shadow-lg hover:shadow-orange-500/10 dark:hover:shadow-brand-orange/15 transition-all duration-200 cursor-pointer relative overflow-hidden",
|
|
1803
1803
|
children: [
|
|
1804
1804
|
/* @__PURE__ */ jsxs20("div", { className: "relative h-24 overflow-hidden", "data-testid": "banner", children: [
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1805
|
+
/* @__PURE__ */ jsx25(
|
|
1806
|
+
"div",
|
|
1807
|
+
{
|
|
1808
|
+
className: "absolute inset-0 bg-cover bg-center transition-transform duration-500 group-hover:scale-105",
|
|
1809
|
+
style: {
|
|
1810
|
+
backgroundColor: accentColor,
|
|
1811
|
+
backgroundImage: hasBanner ? `url(${bannerUrl})` : void 0
|
|
1811
1812
|
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
} })
|
|
1816
|
-
] }) : /* @__PURE__ */ jsx25("div", { className: "absolute inset-0", style: {
|
|
1817
|
-
background: `linear-gradient(135deg, ${accentColor}cc 0%, ${accentColor}44 100%)`
|
|
1813
|
+
}
|
|
1814
|
+
),
|
|
1815
|
+
/* @__PURE__ */ jsx25("div", { className: "absolute inset-0", style: {
|
|
1816
|
+
background: hasBanner ? `linear-gradient(to bottom, transparent 0%, ${accentColor}66 100%)` : `linear-gradient(135deg, ${accentColor}cc 0%, ${accentColor}44 100%)`
|
|
1818
1817
|
} }),
|
|
1819
1818
|
showInstall && /* @__PURE__ */ jsx25(
|
|
1820
1819
|
"button",
|
|
@@ -1971,18 +1970,26 @@ function InstalledProjectIcon({
|
|
|
1971
1970
|
logoUrl,
|
|
1972
1971
|
accentColor = "#FF6F00",
|
|
1973
1972
|
onClick,
|
|
1974
|
-
|
|
1973
|
+
onContextMenu,
|
|
1974
|
+
topRightAction,
|
|
1975
|
+
showLabel = true,
|
|
1976
|
+
buttonRef,
|
|
1977
|
+
buttonProps
|
|
1975
1978
|
}) {
|
|
1976
1979
|
const [imgError, setImgError] = useState9(false);
|
|
1977
1980
|
return /* @__PURE__ */ jsx27("div", { className: "relative", children: /* @__PURE__ */ jsxs22(
|
|
1978
1981
|
motion3.button,
|
|
1979
1982
|
{
|
|
1983
|
+
ref: buttonRef,
|
|
1980
1984
|
type: "button",
|
|
1981
1985
|
onClick,
|
|
1986
|
+
onContextMenu,
|
|
1982
1987
|
whileHover: { scale: 1.08, y: -4 },
|
|
1983
1988
|
whileTap: { scale: 0.92 },
|
|
1984
1989
|
transition: { duration: 0.05 },
|
|
1985
|
-
|
|
1990
|
+
...buttonProps,
|
|
1991
|
+
className: `flex flex-col items-center gap-2 p-3 rounded-2xl group cursor-pointer relative${buttonProps?.className ? " " + buttonProps.className : ""}`,
|
|
1992
|
+
style: { touchAction: "none", ...buttonProps?.style },
|
|
1986
1993
|
children: [
|
|
1987
1994
|
/* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
1988
1995
|
/* @__PURE__ */ jsx27(
|
|
@@ -2015,12 +2022,13 @@ function InstalledProjectIcon({
|
|
|
2015
2022
|
src: logoUrl,
|
|
2016
2023
|
alt: name,
|
|
2017
2024
|
onError: () => setImgError(true),
|
|
2018
|
-
className: "
|
|
2025
|
+
className: "absolute inset-0 w-full h-full object-cover z-10"
|
|
2019
2026
|
}
|
|
2020
|
-
) : /* @__PURE__ */ jsx27("span", { className: "text-white font-bold text-
|
|
2027
|
+
) : /* @__PURE__ */ jsx27("span", { className: "text-white font-bold text-2xl sm:text-3xl relative z-10", children: name[0] ?? "?" })
|
|
2021
2028
|
]
|
|
2022
2029
|
}
|
|
2023
|
-
)
|
|
2030
|
+
),
|
|
2031
|
+
topRightAction
|
|
2024
2032
|
] }),
|
|
2025
2033
|
showLabel && /* @__PURE__ */ jsx27("span", { className: "text-xs sm:text-sm font-medium text-neutral-500 dark:text-[rgba(255,255,255,0.45)] group-hover:text-neutral-900 dark:group-hover:text-white transition-colors truncate max-w-20 sm:max-w-24 text-center leading-tight", children: name })
|
|
2026
2034
|
]
|