diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e0f121c6..7d992e962 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: rev: v5.0.0 hooks: - id: trailing-whitespace - exclude: ".*json$|.*txt$|.*csv|.*md|.*svg" + exclude: ".*json$|.*txt$|.*csv|.*md|.*svg|frontend/src2/types/emojis.ts" - id: check-merge-conflict - id: check-ast - id: check-json @@ -33,6 +33,7 @@ repos: rev: v3.1.0 hooks: - id: prettier + exclude: "frontend/src2/types/emojis.ts" types_or: [javascript, vue, scss] ci: diff --git a/frontend/src2/charts/components/NumberChart.vue b/frontend/src2/charts/components/NumberChart.vue index 6cd4e8ac0..cf051ab8d 100644 --- a/frontend/src2/charts/components/NumberChart.vue +++ b/frontend/src2/charts/components/NumberChart.vue @@ -1,7 +1,8 @@ + + diff --git a/frontend/src2/index.css b/frontend/src2/index.css index 39b0e050d..ffb7916fb 100644 --- a/frontend/src2/index.css +++ b/frontend/src2/index.css @@ -60,6 +60,10 @@ body { opacity: 0; } -.lucide { - stroke-width: 1.5; +@layer utilities { + .lucide { + stroke-width: 2; + color: theme('colors.foreground'); + fill: none; + } } diff --git a/frontend/src2/types/chart.types.ts b/frontend/src2/types/chart.types.ts index 2a6d59b7a..b29ebc65e 100644 --- a/frontend/src2/types/chart.types.ts +++ b/frontend/src2/types/chart.types.ts @@ -93,7 +93,46 @@ export type NumberColumnOptions = { prefix?: string suffix?: string color?: string -} + icon?: string +} + +import { EMOJIS } from './emojis' + +export const ICONS = [ + 'users', + 'dollar-sign', + 'users-up', + 'trending-up', + 'activity', + 'bar-chart-3', + 'pie-chart', + 'target', + 'award', + 'star', + 'heart', + 'zap', + 'globe', + 'home', + 'box', + 'truck', + 'phone', + 'mail', + 'calendar', + 'clock', + 'percentage', + 'arrow-up-circle', + 'arrow-down-circle', + 'check-circle', + 'alert-triangle', + 'none' +] as const + +export const ALL_ICONS = [...ICONS, ...EMOJIS] as const + +export type IconName = string + +export { iconMap } from './iconMap' + export type DonutChartConfig = { label_column: Dimension diff --git a/frontend/src2/types/emojis.ts b/frontend/src2/types/emojis.ts new file mode 100644 index 000000000..b0dc34265 --- /dev/null +++ b/frontend/src2/types/emojis.ts @@ -0,0 +1,10 @@ +export const EMOJIS = [ + '📊', '📈', '📉', '📋', '💰', 'đŸ’ĩ', '💱', '⭐', '✅', '❌', 'âš ī¸', '🚀', 'đŸ”Ĩ', '💎', + 'đŸ‘Ĩ', '👤', '🏠', '🌍', '📱', 'đŸ’ģ', 'âš™ī¸', '🔧', '📧', '📅', '🕐', '📊', 'đŸŽ¯', + '📈', '📉', '💹', '📊', 'đŸ’ŧ', 'đŸĸ', '🏭', '🛒', 'đŸ›ī¸', 'đŸ’ŗ', 'đŸ’ŗ', '💰', + '📈', '📉', '🎲', 'đŸŽ¯', '🏆', 'đŸĨ‡', 'đŸ’¯', '🔝', '📈', '📉', 'âžĄī¸', 'âŦ†ī¸', 'âŦ‡ī¸', + '✅', '❌', 'âš ī¸', 'â„šī¸', '🔄', 'âŗ', '✅' +] as const; + +export type EmojiName = (typeof EMOJIS)[number]; + diff --git a/frontend/src2/types/iconMap.ts b/frontend/src2/types/iconMap.ts new file mode 100644 index 000000000..387784aa5 --- /dev/null +++ b/frontend/src2/types/iconMap.ts @@ -0,0 +1,32 @@ +import { Users, DollarSign, TrendingUp, Activity, BarChart3, PieChart, Target, Award, Star, Heart, Zap, Globe, Home, Box, Truck, Phone, Mail, Calendar, Clock, Percent, ArrowUpCircle, ArrowDownCircle, CheckCircle, AlertTriangle } from 'lucide-vue-next' +import type { IconName } from './chart.types' + +export const iconMap: Record = { + 'users': Users, + 'dollar-sign': DollarSign, + 'users-up': Users, + 'trending-up': TrendingUp, + 'activity': Activity, + 'bar-chart-3': BarChart3, + 'pie-chart': PieChart, + 'target': Target, + 'award': Award, + 'star': Star, + 'heart': Heart, + 'zap': Zap, + 'globe': Globe, + 'home': Home, + 'box': Box, + 'truck': Truck, + 'phone': Phone, + 'mail': Mail, + 'calendar': Calendar, + 'clock': Clock, + 'percentage': Percent, + 'arrow-up-circle': ArrowUpCircle, + 'arrow-down-circle': ArrowDownCircle, + 'check-circle': CheckCircle, + 'alert-triangle': AlertTriangle, + none: undefined +} +