@xenide-io/the-old-ui-theme 0.5.3 → 0.5.4

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.
Files changed (49) hide show
  1. package/dist/{index-Od4pIP4F.d.mts → Chip-C5hRFAhe.d.mts} +10 -606
  2. package/dist/{index-Od4pIP4F.d.ts → Chip-C5hRFAhe.d.ts} +10 -606
  3. package/dist/{chunk-G53YLHVE.mjs → chunk-E5ZBQYEX.mjs} +59 -9
  4. package/dist/{chunk-VFTZXPXM.mjs → chunk-SBBKXV35.mjs} +144 -79
  5. package/dist/index.d.mts +3 -79
  6. package/dist/index.d.ts +3 -79
  7. package/dist/index.js +524 -3595
  8. package/dist/index.mjs +3 -765
  9. package/dist/suite.d.mts +38 -12
  10. package/dist/suite.d.ts +38 -12
  11. package/dist/suite.js +84 -15
  12. package/dist/suite.mjs +53 -13
  13. package/dist/ui.d.mts +608 -2
  14. package/dist/ui.d.ts +608 -2
  15. package/dist/ui.js +202 -87
  16. package/dist/ui.mjs +2 -2
  17. package/package.json +2 -6
  18. package/scripts/install-theme-dev.sh +60 -0
  19. package/scripts/sync-posthog-icons.mjs +75 -0
  20. package/src/components/ui/Chip.tsx +36 -18
  21. package/src/components/ui/CommandPalette.test.tsx +41 -0
  22. package/src/components/ui/CommandPalette.tsx +58 -9
  23. package/src/components/ui/DropdownMenu.tsx +50 -11
  24. package/src/components/ui/SegmentedControl.tsx +2 -1
  25. package/src/components/ui/SettingsLayout.tsx +19 -5
  26. package/src/components/ui/interaction-primitives.test.tsx +52 -0
  27. package/src/styles/suite-skin.css +17 -35
  28. package/src/suite/components/app-switcher.tsx +32 -25
  29. package/src/suite/components/command-palette-host.tsx +20 -8
  30. package/src/suite/components/suite-app-layout.tsx +1 -1
  31. package/src/suite/components/suite-bottom-nav.tsx +23 -18
  32. package/src/suite/components/suite-layout.test.tsx +44 -0
  33. package/src/suite/components/suite-layout.tsx +3 -3
  34. package/src/suite/components/suite-mobile-drawer.tsx +12 -0
  35. package/src/suite/components/suite-mobile-header.tsx +15 -9
  36. package/src/suite/components/suite-notification-bell.tsx +23 -11
  37. package/src/suite/components/suite-settings-mobile-nav.tsx +2 -0
  38. package/src/suite/components/suite-sidebar.tsx +6 -3
  39. package/src/suite/components/suite-user-menu.tsx +6 -0
  40. package/src/suite/lib/injected.ts +12 -11
  41. package/src/components/charts/index.ts +0 -9
  42. package/src/components/charts/quill/BarChart.tsx +0 -85
  43. package/src/components/charts/quill/FunnelChart.tsx +0 -49
  44. package/src/components/charts/quill/InsightShell.tsx +0 -27
  45. package/src/components/charts/quill/MetricCard.tsx +0 -44
  46. package/src/components/charts/quill/PieChart.tsx +0 -81
  47. package/src/components/charts/quill/Sparkline.tsx +0 -57
  48. package/src/components/charts/quill/TimeSeriesLineChart.tsx +0 -62
  49. package/src/components/charts/quill/index.ts +0 -9
@@ -1,49 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import { useChartTokens } from "@/lib/chart/use-ph-chart-tokens";
5
- import { cn } from "@/lib/cn";
6
-
7
- export interface FunnelStep {
8
- label: string;
9
- count: number;
10
- }
11
-
12
- export interface FunnelChartProps {
13
- steps: FunnelStep[];
14
- className?: string;
15
- }
16
-
17
- export function FunnelChart({ steps, className }: FunnelChartProps) {
18
- const tokens = useChartTokens();
19
-
20
- const maxCount = useMemo(() => Math.max(...steps.map((s) => s.count)), [steps]);
21
-
22
- return (
23
- <div className={cn("space-y-2", className)} suppressHydrationWarning>
24
- {steps.map((step, i) => {
25
- const pct = (step.count / maxCount) * 100;
26
- const prev = i > 0 ? steps[i - 1].count : step.count;
27
- const dropoff = prev > 0 ? ((prev - step.count) / prev) * 100 : 0;
28
-
29
- return (
30
- <div key={step.label} className="space-y-1">
31
- <div className="flex items-center justify-between text-sm">
32
- <span className="font-medium text-ph-ink">{step.label}</span>
33
- <span className="tabular-nums text-ph-subtle">{step.count.toLocaleString()}</span>
34
- </div>
35
- <div className="relative h-8 overflow-hidden rounded-md" style={{ background: tokens.muted }}>
36
- <div
37
- className="h-full rounded-md transition-all duration-500"
38
- style={{ width: `${pct}%`, background: i === 0 ? tokens.series[0] : tokens.series[i % tokens.series.length] }}
39
- />
40
- </div>
41
- {i > 0 && dropoff > 0 && (
42
- <p className="text-xs text-ph-danger">-{dropoff.toFixed(1)}% dropoff</p>
43
- )}
44
- </div>
45
- );
46
- })}
47
- </div>
48
- );
49
- }
@@ -1,27 +0,0 @@
1
- "use client";
2
-
3
- import type { ReactNode } from "react";
4
- import { cn } from "@/lib/cn";
5
-
6
- export interface InsightShellProps {
7
- title: string;
8
- subtitle?: string;
9
- ribbonColor?: string;
10
- children: ReactNode;
11
- className?: string;
12
- }
13
-
14
- export function InsightShell({ title, subtitle, ribbonColor, children, className }: InsightShellProps) {
15
- return (
16
- <div className={cn("ph-insight-shell", className)}>
17
- <div className="flex items-start gap-3 px-4 pt-4">
18
- {ribbonColor && <div className="ph-insight-shell__ribbon" style={{ background: ribbonColor }} />}
19
- <div className="min-w-0 flex-1">
20
- <h3 className="text-sm font-semibold text-ph-ink truncate">{title}</h3>
21
- {subtitle && <p className="text-xs text-ph-mutedtext mt-0.5">{subtitle}</p>}
22
- </div>
23
- </div>
24
- <div className="p-4 pt-3">{children}</div>
25
- </div>
26
- );
27
- }
@@ -1,44 +0,0 @@
1
- "use client";
2
-
3
- import type { ReactNode } from "react";
4
- import { cn } from "@/lib/cn";
5
- import { Sparkline } from "@/components/charts/quill/Sparkline";
6
- import { Badge } from "@/components/ui/Badge";
7
-
8
- export interface MetricCardProps {
9
- value: string | number;
10
- label: string;
11
- change?: { value: number; positive?: boolean };
12
- sparklineData?: number[];
13
- icon?: ReactNode;
14
- className?: string;
15
- }
16
-
17
- export function MetricCard({
18
- value,
19
- label,
20
- change,
21
- sparklineData,
22
- icon,
23
- className,
24
- }: MetricCardProps) {
25
- return (
26
- <div className={cn("ph-metric", className)}>
27
- <div className="ph-metric__header">
28
- {icon && <span className="ph-metric__icon">{icon}</span>}
29
- <span className="ph-metric__label">{label}</span>
30
- {change && (
31
- <Badge variant={change.positive ?? change.value >= 0 ? "success" : "danger"}>
32
- {change.value >= 0 ? "+" : ""}{change.value}%
33
- </Badge>
34
- )}
35
- </div>
36
- <div className="ph-metric__value">{value}</div>
37
- {sparklineData && sparklineData.length > 0 && (
38
- <div className="mt-2">
39
- <Sparkline data={sparklineData} />
40
- </div>
41
- )}
42
- </div>
43
- );
44
- }
@@ -1,81 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import { useChartTokens } from "@/lib/chart/use-ph-chart-tokens";
5
- import { cn } from "@/lib/cn";
6
-
7
- export interface PieChartSlice {
8
- key: string;
9
- label: string;
10
- value: number;
11
- color?: string;
12
- }
13
-
14
- export interface PieChartProps {
15
- slices: PieChartSlice[];
16
- className?: string;
17
- size?: number;
18
- }
19
-
20
- export function PieChart({ slices, className, size = 200 }: PieChartProps) {
21
- const tokens = useChartTokens();
22
-
23
- const { total, segments } = useMemo(() => {
24
- const t = slices.reduce((s, sl) => s + Math.max(0, sl.value), 0);
25
- let cum = 0;
26
- const segs = slices.map((sl, i) => {
27
- const start = cum;
28
- const val = Math.max(0, sl.value);
29
- cum += val;
30
- return {
31
- ...sl,
32
- color: sl.color ?? tokens.series[i % tokens.series.length],
33
- startAngle: (start / t) * 360,
34
- endAngle: (cum / t) * 360,
35
- pct: t > 0 ? (val / t) * 100 : 0,
36
- };
37
- });
38
- return { total: t, segments: segs };
39
- }, [slices, tokens.series]);
40
-
41
- const cx = size / 2;
42
- const cy = size / 2;
43
- const r = size * 0.38;
44
- const ir = r * 0.6;
45
-
46
- const polarToCart = (angleDeg: number, radius: number) => {
47
- const rad = ((angleDeg - 90) * Math.PI) / 180;
48
- return { x: cx + radius * Math.cos(rad), y: cy + radius * Math.sin(rad) };
49
- };
50
-
51
- const describeArc = (start: number, end: number) => {
52
- if (end - start >= 359.9) {
53
- const p1 = polarToCart(start, r);
54
- const p2 = polarToCart(start + 179.9, r);
55
- const p3 = polarToCart(start + 359.9, r);
56
- return `M${p1.x},${p1.y} A${r},${r} 0 0,1 ${p2.x},${p2.y} A${r},${r} 0 0,1 ${p3.x},${p3.y} Z`;
57
- }
58
- const s = polarToCart(start, r);
59
- const e = polarToCart(end, r);
60
- const si = polarToCart(start, ir);
61
- const ei = polarToCart(end, ir);
62
- const large = end - start > 180 ? 1 : 0;
63
- return `M${s.x},${s.y} A${r},${r} 0 ${large},1 ${e.x},${e.y} L${ei.x},${ei.y} A${ir},${ir} 0 ${large},0 ${si.x},${si.y} Z`;
64
- };
65
-
66
- return (
67
- <div className={cn("relative", className)} style={{ width: size, height: size }}>
68
- <svg viewBox={`0 0 ${size} ${size}`} className="h-full w-full" suppressHydrationWarning>
69
- {segments.map((s) => (
70
- <path key={s.key} d={describeArc(s.startAngle, s.endAngle)} fill={s.color}>
71
- <title>{`${s.label}: ${s.pct.toFixed(1)}%`}</title>
72
- </path>
73
- ))}
74
- <circle cx={cx} cy={cy} r={ir} fill="var(--ph-surface)" />
75
- </svg>
76
- <div className="absolute inset-0 flex items-center justify-center pointer-events-none">
77
- <span className="text-lg font-bold text-ph-ink tabular-nums">{slices.length}</span>
78
- </div>
79
- </div>
80
- );
81
- }
@@ -1,57 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import { useChartTokens } from "@/lib/chart/use-ph-chart-tokens";
5
- import { cn } from "@/lib/cn";
6
-
7
- export interface SparklineProps {
8
- data: number[];
9
- color?: string;
10
- className?: string;
11
- width?: number;
12
- height?: number;
13
- strokeWidth?: number;
14
- }
15
-
16
- export function Sparkline({
17
- data,
18
- color,
19
- className,
20
- width = 80,
21
- height = 32,
22
- strokeWidth = 2,
23
- }: SparklineProps) {
24
- const tokens = useChartTokens();
25
- const resolvedColor = color ?? tokens.series[0];
26
-
27
- const path = useMemo(() => {
28
- if (data.length < 2) return "";
29
- const min = Math.min(...data);
30
- const max = Math.max(...data);
31
- const range = max - min || 1;
32
- const xStep = width / (data.length - 1);
33
-
34
- return data
35
- .map((v, i) => {
36
- const x = i * xStep;
37
- const y = height - ((v - min) / range) * (height - 4) - 2;
38
- return `${i === 0 ? "M" : "L"}${x},${y}`;
39
- })
40
- .join(" ");
41
- }, [data, width, height]);
42
-
43
- if (data.length < 2) return null;
44
-
45
- return (
46
- <svg
47
- className={cn("shrink-0", className)}
48
- width={width}
49
- height={height}
50
- viewBox={`0 0 ${width} ${height}`}
51
- aria-hidden
52
- suppressHydrationWarning
53
- >
54
- <path d={path} fill="none" stroke={resolvedColor} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round" />
55
- </svg>
56
- );
57
- }
@@ -1,62 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import { CanvasTrendLineChart } from "@/lib/hog-charts-lite/CanvasTrendLineChart";
5
- import { useChartTokens } from "@/lib/chart/use-ph-chart-tokens";
6
- import { buildHogChartTheme } from "@/lib/hog-charts-lite/build-theme";
7
- import { cn } from "@/lib/cn";
8
-
9
- export interface TimeSeriesLineChartSeries {
10
- key: string;
11
- label: string;
12
- data: number[];
13
- color?: string;
14
- }
15
-
16
- export interface TimeSeriesLineChartProps {
17
- series: TimeSeriesLineChartSeries[];
18
- labels: string[];
19
- className?: string;
20
- showGrid?: boolean;
21
- showCrosshair?: boolean;
22
- height?: number;
23
- }
24
-
25
- export function TimeSeriesLineChart({
26
- series,
27
- labels,
28
- className,
29
- showGrid = true,
30
- showCrosshair = true,
31
- height = 280,
32
- }: TimeSeriesLineChartProps) {
33
- const tokens = useChartTokens();
34
- const theme = useMemo(() => buildHogChartTheme(tokens), [tokens]);
35
-
36
- const resolved = useMemo(
37
- () =>
38
- series.map((s, i) => ({
39
- key: s.key,
40
- label: s.label,
41
- data: s.data,
42
- color: s.color ?? tokens.series[i % tokens.series.length],
43
- })),
44
- [series, tokens.series]
45
- );
46
-
47
- return (
48
- <div
49
- className={cn("relative w-full", className)}
50
- style={{ height, minHeight: 220 }}
51
- >
52
- <CanvasTrendLineChart
53
- labels={labels}
54
- series={resolved}
55
- theme={theme}
56
- showGrid={showGrid}
57
- showCrosshair={showCrosshair}
58
- className="h-full min-h-[220px]"
59
- />
60
- </div>
61
- );
62
- }
@@ -1,9 +0,0 @@
1
- "use client";
2
-
3
- export { TimeSeriesLineChart, type TimeSeriesLineChartProps, type TimeSeriesLineChartSeries } from "./TimeSeriesLineChart";
4
- export { BarChart, type BarChartProps, type BarChartSeries } from "./BarChart";
5
- export { PieChart, type PieChartProps, type PieChartSlice } from "./PieChart";
6
- export { Sparkline, type SparklineProps } from "./Sparkline";
7
- export { MetricCard, type MetricCardProps } from "./MetricCard";
8
- export { FunnelChart, type FunnelChartProps, type FunnelStep } from "./FunnelChart";
9
- export { InsightShell, type InsightShellProps } from "./InsightShell";