@stacksjs/ts-analytics 0.1.6
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/CHANGELOG.md +68 -0
- package/LICENSE.md +21 -0
- package/README.md +361 -0
- package/bin/cli.ts +169 -0
- package/dist/Analytics.d.ts +558 -0
- package/dist/api.d.ts +109 -0
- package/dist/batching.d.ts +93 -0
- package/dist/chunk-2mx7fq49.js +4 -0
- package/dist/chunk-3z29508k.js +204 -0
- package/dist/chunk-deephkz6.js +56 -0
- package/dist/chunk-j261vgyp.js +305 -0
- package/dist/chunk-xga17tz7.js +207 -0
- package/dist/config.d.ts +132 -0
- package/dist/dashboard/components/index.d.ts +80 -0
- package/dist/dashboard/composables/useAnalytics.d.ts +99 -0
- package/dist/dashboard/index.d.ts +110 -0
- package/dist/dashboard/types/index.d.ts +144 -0
- package/dist/dashboard/utils/index.d.ts +81 -0
- package/dist/dynamodb.d.ts +86 -0
- package/dist/funnels.d.ts +104 -0
- package/dist/geolocation.d.ts +96 -0
- package/dist/index.d.ts +371 -0
- package/dist/index.js +10211 -0
- package/dist/infrastructure/cdk.d.ts +60 -0
- package/dist/infrastructure/cloudformation.d.ts +44 -0
- package/dist/infrastructure/index.d.ts +45 -0
- package/dist/infrastructure/setup.d.ts +133 -0
- package/dist/integrations/cloudflare.d.ts +76 -0
- package/dist/integrations/hono.d.ts +60 -0
- package/dist/integrations/index.d.ts +24 -0
- package/dist/integrations/nuxt.d.ts +7 -0
- package/dist/integrations/nuxt.js +42 -0
- package/dist/integrations/runtime/use-ts-analytics.d.ts +18 -0
- package/dist/integrations/runtime/use-ts-analytics.js +17 -0
- package/dist/integrations/stx.d.ts +88 -0
- package/dist/integrations/stx.js +18 -0
- package/dist/lib/crypto-random.d.ts +4 -0
- package/dist/lib/salt.d.ts +16 -0
- package/dist/local.d.ts +56 -0
- package/dist/model-connector.d.ts +145 -0
- package/dist/models/AggregatedStats.d.ts +9 -0
- package/dist/models/CampaignStats.d.ts +9 -0
- package/dist/models/Conversion.d.ts +11 -0
- package/dist/models/CustomEvent.d.ts +11 -0
- package/dist/models/DeviceStats.d.ts +9 -0
- package/dist/models/EventStats.d.ts +9 -0
- package/dist/models/GeoStats.d.ts +9 -0
- package/dist/models/Goal.d.ts +9 -0
- package/dist/models/GoalStats.d.ts +9 -0
- package/dist/models/PageStats.d.ts +11 -0
- package/dist/models/PageView.d.ts +13 -0
- package/dist/models/RealtimeStats.d.ts +9 -0
- package/dist/models/ReferrerStats.d.ts +9 -0
- package/dist/models/Session.d.ts +11 -0
- package/dist/models/Site.d.ts +11 -0
- package/dist/models/index.d.ts +28 -0
- package/dist/models/types.d.ts +60 -0
- package/dist/sqs-buffering.d.ts +243 -0
- package/dist/stacks-integration.d.ts +159 -0
- package/dist/tracking-script.d.ts +71 -0
- package/dist/tracking.d.ts +17 -0
- package/dist/tracking.js +26 -0
- package/dist/types.d.ts +595 -0
- package/dist/utils/geolocation.d.ts +111 -0
- package/dist/utils/user-agent.d.ts +17 -0
- package/dist/version.d.ts +7 -0
- package/package.json +119 -0
- package/src/Analytics.ts +3349 -0
- package/src/api.ts +1286 -0
- package/src/assets/crosswind.css +2220 -0
- package/src/batching.ts +452 -0
- package/src/components/dashboard/index.ts +18 -0
- package/src/config.ts +456 -0
- package/src/dashboard/Dashboard.stx +1517 -0
- package/src/dashboard/components/AlertCard.stx +177 -0
- package/src/dashboard/components/AnalyticsDashboard.stx +354 -0
- package/src/dashboard/components/AnimatedNumber.stx +86 -0
- package/src/dashboard/components/BarChart.stx +220 -0
- package/src/dashboard/components/BrowserBreakdown.stx +98 -0
- package/src/dashboard/components/BrowsersTable.stx +125 -0
- package/src/dashboard/components/CampaignBreakdown.stx +163 -0
- package/src/dashboard/components/CampaignTable.stx +238 -0
- package/src/dashboard/components/CountryList.stx +101 -0
- package/src/dashboard/components/DataTable.stx +226 -0
- package/src/dashboard/components/DateRangePicker.stx +77 -0
- package/src/dashboard/components/DeviceBreakdown.stx +94 -0
- package/src/dashboard/components/DevicesTable.stx +163 -0
- package/src/dashboard/components/DonutChart.stories.ts +55 -0
- package/src/dashboard/components/DonutChart.stx +157 -0
- package/src/dashboard/components/EmptyState.stx +90 -0
- package/src/dashboard/components/EngagementMetrics.stx +183 -0
- package/src/dashboard/components/EventsSection.stx +192 -0
- package/src/dashboard/components/FilterBar.stx +104 -0
- package/src/dashboard/components/FullAnalyticsDashboard.stx +455 -0
- package/src/dashboard/components/FunnelChart.stx +142 -0
- package/src/dashboard/components/GeoTable.stx +337 -0
- package/src/dashboard/components/GoalsPanel.stx +109 -0
- package/src/dashboard/components/Header.stx +39 -0
- package/src/dashboard/components/HeatmapChart.stx +140 -0
- package/src/dashboard/components/LiveActivityFeed.stx +172 -0
- package/src/dashboard/components/MetricComparison.stx +106 -0
- package/src/dashboard/components/MiniStats.stx +96 -0
- package/src/dashboard/components/OSBreakdown.stx +124 -0
- package/src/dashboard/components/PageDetailCard.stx +102 -0
- package/src/dashboard/components/PagesTable.stx +127 -0
- package/src/dashboard/components/ProgressRing.stx +89 -0
- package/src/dashboard/components/RealtimeCounter.stories.ts +45 -0
- package/src/dashboard/components/RealtimeCounter.stx +46 -0
- package/src/dashboard/components/ReferrersTable.stx +180 -0
- package/src/dashboard/components/SparklineChart.stx +160 -0
- package/src/dashboard/components/StatCard.stories.ts +58 -0
- package/src/dashboard/components/StatCard.stx +90 -0
- package/src/dashboard/components/SummaryStats.stx +81 -0
- package/src/dashboard/components/TabNav.stx +66 -0
- package/src/dashboard/components/ThemeSwitcher.stx +124 -0
- package/src/dashboard/components/TimeSeriesChart.stx +106 -0
- package/src/dashboard/components/TopList.stories.ts +58 -0
- package/src/dashboard/components/TopList.stx +74 -0
- package/src/dashboard/components/TrendIndicator.stx +84 -0
- package/src/dashboard/components/heatmap/ClickHeatmap.stx +264 -0
- package/src/dashboard/components/heatmap/ElementClickList.stx +125 -0
- package/src/dashboard/components/heatmap/HeatmapControls.stx +125 -0
- package/src/dashboard/components/heatmap/HeatmapLegend.stx +69 -0
- package/src/dashboard/components/heatmap/PageHeatmap.stx +264 -0
- package/src/dashboard/components/heatmap/ScrollHeatmap.stx +127 -0
- package/src/dashboard/components/heatmap/index.ts +12 -0
- package/src/dashboard/components/index.ts +86 -0
- package/src/dashboard/composables/useAnalytics.ts +465 -0
- package/src/dashboard/demo/DemoApp.stx +370 -0
- package/src/dashboard/demo/index.ts +8 -0
- package/src/dashboard/demo/mockData.ts +234 -0
- package/src/dashboard/index.ts +117 -0
- package/src/dashboard/stx-shim.d.ts +4 -0
- package/src/dashboard/types/index.ts +203 -0
- package/src/dashboard/utils/index.ts +426 -0
- package/src/dynamodb.ts +344 -0
- package/src/funnels.ts +534 -0
- package/src/geolocation.ts +515 -0
- package/src/handlers/alerts.ts +328 -0
- package/src/handlers/annotations.ts +128 -0
- package/src/handlers/api-keys.ts +240 -0
- package/src/handlers/auth.ts +1020 -0
- package/src/handlers/authz.ts +137 -0
- package/src/handlers/collect.ts +724 -0
- package/src/handlers/data.ts +625 -0
- package/src/handlers/experiments.ts +138 -0
- package/src/handlers/funnels.ts +216 -0
- package/src/handlers/goals.ts +218 -0
- package/src/handlers/heatmaps.ts +272 -0
- package/src/handlers/index.ts +56 -0
- package/src/handlers/lib/read-cache.ts +63 -0
- package/src/handlers/misc.ts +486 -0
- package/src/handlers/oauth.ts +233 -0
- package/src/handlers/performance.ts +388 -0
- package/src/handlers/sessions.ts +413 -0
- package/src/handlers/sharing.ts +198 -0
- package/src/handlers/stats.ts +1368 -0
- package/src/handlers/team.ts +161 -0
- package/src/handlers/uptime.ts +283 -0
- package/src/handlers/views.ts +390 -0
- package/src/handlers/webhooks.ts +226 -0
- package/src/heatmap/index.ts +32 -0
- package/src/heatmap/tracking-script.ts +452 -0
- package/src/heatmap/types.ts +79 -0
- package/src/index.ts +387 -0
- package/src/infrastructure/cdk.ts +496 -0
- package/src/infrastructure/cloudformation.ts +595 -0
- package/src/infrastructure/index.ts +48 -0
- package/src/infrastructure/setup.ts +611 -0
- package/src/integrations/cloudflare.ts +732 -0
- package/src/integrations/hono.ts +589 -0
- package/src/integrations/index.ts +27 -0
- package/src/integrations/nuxt.ts +78 -0
- package/src/integrations/runtime/use-ts-analytics.ts +32 -0
- package/src/integrations/stx.ts +138 -0
- package/src/jobs/index.ts +127 -0
- package/src/lib/crypto-random.ts +41 -0
- package/src/lib/ddb-errors.ts +20 -0
- package/src/lib/dynamodb.ts +216 -0
- package/src/lib/email.ts +38 -0
- package/src/lib/ga-import.ts +471 -0
- package/src/lib/ga4-api.ts +244 -0
- package/src/lib/goals.ts +205 -0
- package/src/lib/index.ts +6 -0
- package/src/lib/ingest-counters.ts +123 -0
- package/src/lib/log.ts +36 -0
- package/src/lib/membership.ts +98 -0
- package/src/lib/plans.ts +90 -0
- package/src/lib/quota.ts +46 -0
- package/src/lib/rate-limit.ts +27 -0
- package/src/lib/rollups.ts +472 -0
- package/src/lib/salt.ts +97 -0
- package/src/lib/scheduler.ts +97 -0
- package/src/lib/significance.ts +66 -0
- package/src/lib/site-retention.ts +56 -0
- package/src/local.ts +360 -0
- package/src/model-connector.ts +616 -0
- package/src/models/AggregatedStats.ts +162 -0
- package/src/models/CampaignStats.ts +141 -0
- package/src/models/Conversion.ts +135 -0
- package/src/models/CustomEvent.ts +123 -0
- package/src/models/DeviceStats.ts +105 -0
- package/src/models/EventStats.ts +108 -0
- package/src/models/GeoStats.ts +112 -0
- package/src/models/Goal.ts +105 -0
- package/src/models/GoalStats.ts +106 -0
- package/src/models/PageStats.ts +152 -0
- package/src/models/PageView.ts +277 -0
- package/src/models/RealtimeStats.ts +96 -0
- package/src/models/ReferrerStats.ts +115 -0
- package/src/models/Session.ts +235 -0
- package/src/models/Site.ts +115 -0
- package/src/models/index.ts +50 -0
- package/src/models/orm/index.ts +2043 -0
- package/src/models/types.ts +71 -0
- package/src/router.ts +521 -0
- package/src/sqs-buffering.ts +806 -0
- package/src/stacks-integration.ts +527 -0
- package/src/tracking-script.ts +944 -0
- package/src/tracking.ts +27 -0
- package/src/types/analytics.ts +219 -0
- package/src/types/api.ts +75 -0
- package/src/types/bun-router.d.ts +15 -0
- package/src/types/dashboard.ts +62 -0
- package/src/types/index.ts +66 -0
- package/src/types/stx.d.ts +27 -0
- package/src/types/window.d.ts +101 -0
- package/src/types.ts +911 -0
- package/src/utils/cache.ts +148 -0
- package/src/utils/date.ts +118 -0
- package/src/utils/filters.ts +71 -0
- package/src/utils/geolocation.ts +323 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/response.ts +180 -0
- package/src/utils/timezone-country.ts +242 -0
- package/src/utils/user-agent.ts +110 -0
- package/src/version.ts +7 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics Dashboard Module
|
|
3
|
+
*
|
|
4
|
+
* Vue 3 dashboard components and utilities for displaying
|
|
5
|
+
* privacy-focused analytics data.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```vue
|
|
9
|
+
* <script setup lang="ts">
|
|
10
|
+
* import { AnalyticsDashboard } from '@stacksjs/dynamodb-tooling/analytics/dashboard'
|
|
11
|
+
*
|
|
12
|
+
* const config = {
|
|
13
|
+
* baseUrl: '/api/analytics',
|
|
14
|
+
* siteId: 'my-site',
|
|
15
|
+
* }
|
|
16
|
+
* </script>
|
|
17
|
+
*
|
|
18
|
+
* <template>
|
|
19
|
+
* <AnalyticsDashboard :config="config" />
|
|
20
|
+
* </template>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
// Components - All 31 dashboard components
|
|
25
|
+
// These are string identifiers that reference .stx component files
|
|
26
|
+
export {
|
|
27
|
+
// Alert & activity
|
|
28
|
+
AlertCard,
|
|
29
|
+
// Main dashboards
|
|
30
|
+
AnalyticsDashboard,
|
|
31
|
+
AnimatedNumber,
|
|
32
|
+
BarChart,
|
|
33
|
+
BrowserBreakdown,
|
|
34
|
+
CampaignBreakdown,
|
|
35
|
+
CountryList,
|
|
36
|
+
DataTable,
|
|
37
|
+
DateRangePicker,
|
|
38
|
+
// Breakdown components
|
|
39
|
+
DeviceBreakdown,
|
|
40
|
+
DonutChart,
|
|
41
|
+
EmptyState,
|
|
42
|
+
EngagementMetrics,
|
|
43
|
+
FilterBar,
|
|
44
|
+
FullAnalyticsDashboard,
|
|
45
|
+
FunnelChart,
|
|
46
|
+
// Conversion & engagement
|
|
47
|
+
GoalsPanel,
|
|
48
|
+
HeatmapChart,
|
|
49
|
+
LiveActivityFeed,
|
|
50
|
+
MetricComparison,
|
|
51
|
+
MiniStats,
|
|
52
|
+
OSBreakdown,
|
|
53
|
+
PageDetailCard,
|
|
54
|
+
ProgressRing,
|
|
55
|
+
RealtimeCounter,
|
|
56
|
+
SparklineChart,
|
|
57
|
+
// Core components
|
|
58
|
+
StatCard,
|
|
59
|
+
ThemeSwitcher,
|
|
60
|
+
// Chart components
|
|
61
|
+
TimeSeriesChart,
|
|
62
|
+
// List & table components
|
|
63
|
+
TopList,
|
|
64
|
+
TrendIndicator,
|
|
65
|
+
// Utilities for component resolution
|
|
66
|
+
allComponents,
|
|
67
|
+
componentRegistry,
|
|
68
|
+
getComponentPath,
|
|
69
|
+
} from './components'
|
|
70
|
+
|
|
71
|
+
// Composables
|
|
72
|
+
export {
|
|
73
|
+
AnalyticsClient,
|
|
74
|
+
createAnalyticsComposable,
|
|
75
|
+
createRealtimePoller,
|
|
76
|
+
fetchDashboardData,
|
|
77
|
+
} from './composables/useAnalytics'
|
|
78
|
+
|
|
79
|
+
// Re-export as useAnalytics alias for convenience
|
|
80
|
+
export { createAnalyticsComposable as useAnalytics } from './composables/useAnalytics'
|
|
81
|
+
|
|
82
|
+
// Types
|
|
83
|
+
export type {
|
|
84
|
+
AnalyticsApiConfig,
|
|
85
|
+
ChartProps,
|
|
86
|
+
DashboardSummary,
|
|
87
|
+
DashboardTheme,
|
|
88
|
+
DateRange,
|
|
89
|
+
RealtimeCounterProps,
|
|
90
|
+
RealtimeData,
|
|
91
|
+
StatCardProps,
|
|
92
|
+
TimeSeriesDataPoint,
|
|
93
|
+
TopItem,
|
|
94
|
+
TopListProps,
|
|
95
|
+
} from './types'
|
|
96
|
+
|
|
97
|
+
// Theme
|
|
98
|
+
export { darkTheme, defaultTheme } from './types'
|
|
99
|
+
|
|
100
|
+
// Utilities
|
|
101
|
+
export {
|
|
102
|
+
calculateAxisTicks,
|
|
103
|
+
calculateChange,
|
|
104
|
+
type DateRangePreset,
|
|
105
|
+
dateRangePresets,
|
|
106
|
+
formatCompact,
|
|
107
|
+
formatDate,
|
|
108
|
+
formatDateRange,
|
|
109
|
+
formatDuration,
|
|
110
|
+
formatNumber,
|
|
111
|
+
formatPercentage,
|
|
112
|
+
getDateRangeFromPreset,
|
|
113
|
+
} from './utils'
|
|
114
|
+
|
|
115
|
+
// Re-export with common alias names
|
|
116
|
+
export { calculateChange as calculatePercentageChange } from './utils'
|
|
117
|
+
export { getDateRangeFromPreset as getDateRangePreset } from './utils'
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics Dashboard Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Dashboard Data Types
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
export interface DashboardStats {
|
|
10
|
+
pageViews: number
|
|
11
|
+
uniqueVisitors: number
|
|
12
|
+
sessions: number
|
|
13
|
+
bounceRate: number
|
|
14
|
+
avgSessionDuration: number
|
|
15
|
+
avgPagesPerSession: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StatsChange {
|
|
19
|
+
pageViews: number
|
|
20
|
+
uniqueVisitors: number
|
|
21
|
+
sessions: number
|
|
22
|
+
bounceRate: number
|
|
23
|
+
avgSessionDuration: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface DashboardSummary extends DashboardStats {
|
|
27
|
+
change?: StatsChange
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TimeSeriesDataPoint {
|
|
31
|
+
date: string
|
|
32
|
+
pageViews: number
|
|
33
|
+
uniqueVisitors: number
|
|
34
|
+
sessions: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TopItem {
|
|
38
|
+
name: string
|
|
39
|
+
value: number
|
|
40
|
+
percentage: number
|
|
41
|
+
change?: number
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RealtimeData {
|
|
45
|
+
currentVisitors: number
|
|
46
|
+
pageViewsLastHour: number
|
|
47
|
+
topActivePages: TopItem[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface DeviceBreakdown {
|
|
51
|
+
desktop: number
|
|
52
|
+
mobile: number
|
|
53
|
+
tablet: number
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface BrowserStats {
|
|
57
|
+
name: string
|
|
58
|
+
visitors: number
|
|
59
|
+
percentage: number
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface CountryStats {
|
|
63
|
+
country: string
|
|
64
|
+
countryCode: string
|
|
65
|
+
visitors: number
|
|
66
|
+
percentage: number
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface GoalConversion {
|
|
70
|
+
goalId: string
|
|
71
|
+
goalName: string
|
|
72
|
+
conversions: number
|
|
73
|
+
conversionRate: number
|
|
74
|
+
revenue: number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// Component Props Types
|
|
79
|
+
// ============================================================================
|
|
80
|
+
|
|
81
|
+
export interface StatCardProps {
|
|
82
|
+
title: string
|
|
83
|
+
value: number | string
|
|
84
|
+
change?: number
|
|
85
|
+
changeLabel?: string
|
|
86
|
+
icon?: string
|
|
87
|
+
format?: 'number' | 'percentage' | 'duration' | 'currency'
|
|
88
|
+
loading?: boolean
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface TopListProps {
|
|
92
|
+
title: string
|
|
93
|
+
items: TopItem[]
|
|
94
|
+
loading?: boolean
|
|
95
|
+
showPercentage?: boolean
|
|
96
|
+
maxItems?: number
|
|
97
|
+
emptyMessage?: string
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ChartProps {
|
|
101
|
+
data: TimeSeriesDataPoint[]
|
|
102
|
+
loading?: boolean
|
|
103
|
+
height?: number
|
|
104
|
+
showLegend?: boolean
|
|
105
|
+
metrics?: Array<'pageViews' | 'uniqueVisitors' | 'sessions'>
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface RealtimeCounterProps {
|
|
109
|
+
count: number
|
|
110
|
+
label?: string
|
|
111
|
+
pulseColor?: string
|
|
112
|
+
loading?: boolean
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface DateRangeOption {
|
|
116
|
+
label: string
|
|
117
|
+
value: string
|
|
118
|
+
days: number
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface DateRange {
|
|
122
|
+
start: Date
|
|
123
|
+
end: Date
|
|
124
|
+
preset?: string
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ============================================================================
|
|
128
|
+
// API Types
|
|
129
|
+
// ============================================================================
|
|
130
|
+
|
|
131
|
+
export interface AnalyticsApiConfig {
|
|
132
|
+
baseUrl: string
|
|
133
|
+
siteId: string
|
|
134
|
+
headers?: Record<string, string>
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface FetchOptions {
|
|
138
|
+
startDate?: Date
|
|
139
|
+
endDate?: Date
|
|
140
|
+
period?: 'hour' | 'day' | 'month'
|
|
141
|
+
limit?: number
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ============================================================================
|
|
145
|
+
// Theme Types
|
|
146
|
+
// ============================================================================
|
|
147
|
+
|
|
148
|
+
export interface DashboardTheme {
|
|
149
|
+
primary: string
|
|
150
|
+
secondary: string
|
|
151
|
+
success: string
|
|
152
|
+
warning: string
|
|
153
|
+
danger: string
|
|
154
|
+
background: string
|
|
155
|
+
surface: string
|
|
156
|
+
text: string
|
|
157
|
+
textSecondary: string
|
|
158
|
+
border: string
|
|
159
|
+
chart: {
|
|
160
|
+
pageViews: string
|
|
161
|
+
visitors: string
|
|
162
|
+
sessions: string
|
|
163
|
+
grid: string
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const defaultTheme: DashboardTheme = {
|
|
168
|
+
primary: '#6366f1',
|
|
169
|
+
secondary: '#8b5cf6',
|
|
170
|
+
success: '#22c55e',
|
|
171
|
+
warning: '#f59e0b',
|
|
172
|
+
danger: '#ef4444',
|
|
173
|
+
background: '#ffffff',
|
|
174
|
+
surface: '#f8fafc',
|
|
175
|
+
text: '#1e293b',
|
|
176
|
+
textSecondary: '#64748b',
|
|
177
|
+
border: '#e2e8f0',
|
|
178
|
+
chart: {
|
|
179
|
+
pageViews: '#6366f1',
|
|
180
|
+
visitors: '#22c55e',
|
|
181
|
+
sessions: '#f59e0b',
|
|
182
|
+
grid: '#e2e8f0',
|
|
183
|
+
},
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export const darkTheme: DashboardTheme = {
|
|
187
|
+
primary: '#818cf8',
|
|
188
|
+
secondary: '#a78bfa',
|
|
189
|
+
success: '#4ade80',
|
|
190
|
+
warning: '#fbbf24',
|
|
191
|
+
danger: '#f87171',
|
|
192
|
+
background: '#0f172a',
|
|
193
|
+
surface: '#1e293b',
|
|
194
|
+
text: '#f1f5f9',
|
|
195
|
+
textSecondary: '#94a3b8',
|
|
196
|
+
border: '#334155',
|
|
197
|
+
chart: {
|
|
198
|
+
pageViews: '#818cf8',
|
|
199
|
+
visitors: '#4ade80',
|
|
200
|
+
sessions: '#fbbf24',
|
|
201
|
+
grid: '#334155',
|
|
202
|
+
},
|
|
203
|
+
}
|