11import { isScratchProject } from "@t3tools/client-runtime/state/projects" ;
22import { ProjectIconColor , type ProjectIconOverride } from "@t3tools/contracts" ;
33import { isProjectFaviconFallbackUrl } from "@t3tools/shared/projectFavicon" ;
4+ import type { AppSymbolName } from "../components/ui/AppSymbol" ;
45
56export type ProjectIconGlyph =
67 | { readonly kind : "emoji" ; readonly emoji : string }
@@ -66,6 +67,18 @@ export function resolveProjectIconGlyph(
6667 }
6768}
6869
70+ const SYMBOL_BY_LUCIDE_NAME : Partial < Record < string , AppSymbolName > > = {
71+ "message-square-dashed" : "text.bubble" ,
72+ } ;
73+
74+ export function resolveProjectIconSymbol (
75+ projectIcon : ProjectIconOverride | null | undefined ,
76+ ) : { readonly name : AppSymbolName ; readonly color : ProjectIconColor } | null {
77+ if ( projectIcon ?. kind !== "lucide" ) return null ;
78+ const name = SYMBOL_BY_LUCIDE_NAME [ projectIcon . name ] ;
79+ return name ? { name, color : projectIcon . color } : null ;
80+ }
81+
6982export type ProjectChipIcon = { readonly kind : "favicon" ; readonly uri : string } | ProjectIconGlyph ;
7083
7184export function resolveProjectChipIcon (
@@ -87,26 +100,34 @@ export function resolveProjectChipIcon(
87100
88101const PROJECT_ICON_COLOR_CLASSES : Record <
89102 ProjectIconColor ,
90- { readonly text : string ; readonly background : string }
103+ { readonly text : string ; readonly tint : string ; readonly background : string }
91104> = {
92- gray : { text : "text-gray-500" , background : "bg-gray-500/15" } ,
93- red : { text : "text-red-500" , background : "bg-red-500/15" } ,
94- orange : { text : "text-orange-500" , background : "bg-orange-500/15" } ,
95- amber : { text : "text-amber-500" , background : "bg-amber-500/15" } ,
96- yellow : { text : "text-yellow-500" , background : "bg-yellow-500/15" } ,
97- lime : { text : "text-lime-500" , background : "bg-lime-500/15" } ,
98- green : { text : "text-green-500" , background : "bg-green-500/15" } ,
99- emerald : { text : "text-emerald-500" , background : "bg-emerald-500/15" } ,
100- teal : { text : "text-teal-500" , background : "bg-teal-500/15" } ,
101- cyan : { text : "text-cyan-500" , background : "bg-cyan-500/15" } ,
102- sky : { text : "text-sky-500" , background : "bg-sky-500/15" } ,
103- blue : { text : "text-blue-500" , background : "bg-blue-500/15" } ,
104- indigo : { text : "text-indigo-500" , background : "bg-indigo-500/15" } ,
105- violet : { text : "text-violet-500" , background : "bg-violet-500/15" } ,
106- purple : { text : "text-purple-500" , background : "bg-purple-500/15" } ,
107- fuchsia : { text : "text-fuchsia-500" , background : "bg-fuchsia-500/15" } ,
108- pink : { text : "text-pink-500" , background : "bg-pink-500/15" } ,
109- rose : { text : "text-rose-500" , background : "bg-rose-500/15" } ,
105+ gray : { text : "text-gray-500" , tint : "accent-gray-500" , background : "bg-gray-500/15" } ,
106+ red : { text : "text-red-500" , tint : "accent-red-500" , background : "bg-red-500/15" } ,
107+ orange : { text : "text-orange-500" , tint : "accent-orange-500" , background : "bg-orange-500/15" } ,
108+ amber : { text : "text-amber-500" , tint : "accent-amber-500" , background : "bg-amber-500/15" } ,
109+ yellow : { text : "text-yellow-500" , tint : "accent-yellow-500" , background : "bg-yellow-500/15" } ,
110+ lime : { text : "text-lime-500" , tint : "accent-lime-500" , background : "bg-lime-500/15" } ,
111+ green : { text : "text-green-500" , tint : "accent-green-500" , background : "bg-green-500/15" } ,
112+ emerald : {
113+ text : "text-emerald-500" ,
114+ tint : "accent-emerald-500" ,
115+ background : "bg-emerald-500/15" ,
116+ } ,
117+ teal : { text : "text-teal-500" , tint : "accent-teal-500" , background : "bg-teal-500/15" } ,
118+ cyan : { text : "text-cyan-500" , tint : "accent-cyan-500" , background : "bg-cyan-500/15" } ,
119+ sky : { text : "text-sky-500" , tint : "accent-sky-500" , background : "bg-sky-500/15" } ,
120+ blue : { text : "text-blue-500" , tint : "accent-blue-500" , background : "bg-blue-500/15" } ,
121+ indigo : { text : "text-indigo-500" , tint : "accent-indigo-500" , background : "bg-indigo-500/15" } ,
122+ violet : { text : "text-violet-500" , tint : "accent-violet-500" , background : "bg-violet-500/15" } ,
123+ purple : { text : "text-purple-500" , tint : "accent-purple-500" , background : "bg-purple-500/15" } ,
124+ fuchsia : {
125+ text : "text-fuchsia-500" ,
126+ tint : "accent-fuchsia-500" ,
127+ background : "bg-fuchsia-500/15" ,
128+ } ,
129+ pink : { text : "text-pink-500" , tint : "accent-pink-500" , background : "bg-pink-500/15" } ,
130+ rose : { text : "text-rose-500" , tint : "accent-rose-500" , background : "bg-rose-500/15" } ,
110131} ;
111132
112133export function projectIconColorClassNames ( color : ProjectIconColor ) {
0 commit comments