first commit
This commit is contained in:
234
src/shared/utils/icons.ts
Normal file
234
src/shared/utils/icons.ts
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* The single icon map for the whole app.
|
||||
*
|
||||
* Astryx resolves exactly 26 SEMANTIC names through the theme's icon registry
|
||||
* (`<Icon icon="search" />`). Everything else must be passed as a component.
|
||||
* Rather than let feature files import from lucide-react ad hoc — which is how
|
||||
* an icon set drifts — every non-semantic glyph is named once, here.
|
||||
*
|
||||
* Rule: `<Icon icon="search" />` for anything in SEMANTIC_ICONS,
|
||||
* `<Icon icon={ICONS.stores} />` for everything else.
|
||||
*/
|
||||
|
||||
import {
|
||||
ArrowRight,
|
||||
BadgeCheck,
|
||||
Bell,
|
||||
BookOpen,
|
||||
Building2,
|
||||
CalendarClock,
|
||||
CalendarDays,
|
||||
Camera,
|
||||
ChartLine,
|
||||
ChevronsUpDown,
|
||||
CircleAlert,
|
||||
CircleHelp,
|
||||
Clock,
|
||||
Code,
|
||||
Coins,
|
||||
Columns3,
|
||||
CreditCard,
|
||||
Disc3,
|
||||
DoorOpen,
|
||||
Download,
|
||||
Expand,
|
||||
Footprints,
|
||||
Gift,
|
||||
Globe,
|
||||
History,
|
||||
IndianRupee,
|
||||
Info,
|
||||
Keyboard,
|
||||
LayoutDashboard,
|
||||
Lightbulb,
|
||||
Lock,
|
||||
LogOut,
|
||||
Maximize2,
|
||||
Megaphone,
|
||||
Menu,
|
||||
MessageSquare,
|
||||
Mic,
|
||||
Minimize2,
|
||||
PanelLeftClose,
|
||||
PanelLeftOpen,
|
||||
PanelRightClose,
|
||||
PanelRightOpen,
|
||||
Paperclip,
|
||||
Plus,
|
||||
Percent,
|
||||
Plug,
|
||||
Route,
|
||||
RotateCw,
|
||||
Send,
|
||||
Settings,
|
||||
ShieldCheck,
|
||||
Shrink,
|
||||
ShoppingBag,
|
||||
ShoppingCart,
|
||||
Sliders,
|
||||
Square,
|
||||
SquarePen,
|
||||
Sparkles,
|
||||
Store,
|
||||
Target,
|
||||
Ticket,
|
||||
TrendingDown,
|
||||
TrendingUp,
|
||||
Trophy,
|
||||
Sun,
|
||||
Moon,
|
||||
User,
|
||||
UserCheck,
|
||||
UserPlus,
|
||||
Users,
|
||||
UserX,
|
||||
} from 'lucide-react';
|
||||
import type {IconType} from '@astryxdesign/core/Icon';
|
||||
|
||||
export const ICONS = {
|
||||
// Expansion & Resize
|
||||
expand: Expand,
|
||||
restore: Shrink,
|
||||
fullscreen: Maximize2,
|
||||
minimize: Minimize2,
|
||||
// Navigation
|
||||
dashboard: LayoutDashboard,
|
||||
commerce: ShoppingCart,
|
||||
stores: Store,
|
||||
lyts: Gift,
|
||||
staff: Users,
|
||||
settings: Settings,
|
||||
|
||||
// Settings Modules
|
||||
business: Building2,
|
||||
roles: ShieldCheck,
|
||||
integrations: Plug,
|
||||
api: Code,
|
||||
security: Lock,
|
||||
preferences: Sliders,
|
||||
|
||||
// Dashboard metrics
|
||||
visitors: Footprints,
|
||||
purchases: ShoppingCart,
|
||||
revenue: IndianRupee,
|
||||
activeRewards: BadgeCheck,
|
||||
conversion: Percent,
|
||||
lyt: Coins,
|
||||
|
||||
// Customer activities.
|
||||
//
|
||||
// One glyph per activity in the loyalty ecosystem. Named with an `activity`
|
||||
// prefix rather than folded into the metric block above because several
|
||||
// collide with an existing concept and must not be merged with it: a `visit`
|
||||
// is a customer walking in, which is not the `visitors` KPI; `activityShop`
|
||||
// is the shop ACTIVITY, while `purchases` is the transaction metric.
|
||||
activityWalk: Footprints,
|
||||
activityVisit: DoorOpen,
|
||||
activitySelfie: Camera,
|
||||
activitySpin: Disc3,
|
||||
activityScratch: Ticket,
|
||||
activityBrand: Megaphone,
|
||||
activityChallenge: Target,
|
||||
activityFriend: UserPlus,
|
||||
activityShop: ShoppingBag,
|
||||
activityEvent: CalendarDays,
|
||||
|
||||
// Store intelligence
|
||||
journey: Route,
|
||||
campaign: Megaphone,
|
||||
insight: Lightbulb,
|
||||
arrowRight: ArrowRight,
|
||||
|
||||
// Dashboard controls
|
||||
compare: Columns3,
|
||||
|
||||
// Trend / delta
|
||||
up: TrendingUp,
|
||||
down: TrendingDown,
|
||||
|
||||
// Loyaly AI
|
||||
ai: Sparkles,
|
||||
analytics: ChartLine,
|
||||
chat: MessageSquare,
|
||||
mic: Mic,
|
||||
send: Send,
|
||||
panelClose: PanelRightClose,
|
||||
panelOpen: PanelRightOpen,
|
||||
newChat: SquarePen,
|
||||
reload: RotateCw,
|
||||
history: History,
|
||||
attach: Paperclip,
|
||||
plus: Plus,
|
||||
stop: Square,
|
||||
|
||||
// Shell
|
||||
// One control drives the sidebar in all three states, so it needs all three
|
||||
// glyphs: the hamburger below the drawer breakpoint, and the panel pair
|
||||
// above it. PanelLeft*, not PanelRight* — those belong to the Loyaly AI rail
|
||||
// on the opposite edge, and pointing both controls the same way would make
|
||||
// the header read as two buttons for one panel.
|
||||
menu: Menu,
|
||||
sidebarOpen: PanelLeftOpen,
|
||||
sidebarClose: PanelLeftClose,
|
||||
notifications: Bell,
|
||||
sun: Sun,
|
||||
moon: Moon,
|
||||
|
||||
// Account menu
|
||||
language: Globe,
|
||||
help: CircleHelp,
|
||||
billing: CreditCard,
|
||||
download: Download,
|
||||
profile: User,
|
||||
signOut: LogOut,
|
||||
switcher: ChevronsUpDown,
|
||||
// Help panel. `info` duplicates a semantic name on purpose: the account menu
|
||||
// config types its icons as components, so it cannot pass the string form.
|
||||
docs: BookOpen,
|
||||
keyboard: Keyboard,
|
||||
info: Info,
|
||||
sessions: Clock,
|
||||
|
||||
// Staff / rewards
|
||||
present: UserCheck,
|
||||
absent: UserX,
|
||||
late: Clock,
|
||||
leaderboard: Trophy,
|
||||
expiry: CalendarClock,
|
||||
alert: CircleAlert,
|
||||
} satisfies Record<string, IconType>;
|
||||
|
||||
export type IconKey = keyof typeof ICONS;
|
||||
|
||||
/**
|
||||
* The names that resolve through the theme registry. Prefer these over an
|
||||
* equivalent lucide import so the icon follows the theme.
|
||||
*/
|
||||
export const SEMANTIC_ICONS = [
|
||||
'close',
|
||||
'chevronDown',
|
||||
'chevronLeft',
|
||||
'chevronRight',
|
||||
'check',
|
||||
'success',
|
||||
'error',
|
||||
'warning',
|
||||
'info',
|
||||
'calendar',
|
||||
'clock',
|
||||
'externalLink',
|
||||
'menu',
|
||||
'moreHorizontal',
|
||||
'search',
|
||||
'arrowUp',
|
||||
'arrowDown',
|
||||
'arrowsUpDown',
|
||||
'funnel',
|
||||
'eyeSlash',
|
||||
'viewColumns',
|
||||
'copy',
|
||||
'checkDouble',
|
||||
'wrench',
|
||||
'stop',
|
||||
'microphone',
|
||||
] as const;
|
||||
Reference in New Issue
Block a user