@xenide-io/the-old-ui-theme 0.5.2 → 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 (59) hide show
  1. package/README.md +47 -34
  2. package/dist/{index-Od4pIP4F.d.mts → Chip-C5hRFAhe.d.mts} +10 -606
  3. package/dist/{index-Od4pIP4F.d.ts → Chip-C5hRFAhe.d.ts} +10 -606
  4. package/dist/{chunk-G53YLHVE.mjs → chunk-E5ZBQYEX.mjs} +59 -9
  5. package/dist/{chunk-RZXHZWUB.mjs → chunk-SBBKXV35.mjs} +174 -222
  6. package/dist/index.d.mts +4 -80
  7. package/dist/index.d.ts +4 -80
  8. package/dist/index.js +562 -3746
  9. package/dist/index.mjs +3 -765
  10. package/dist/suite.d.mts +56 -25
  11. package/dist/suite.d.ts +56 -25
  12. package/dist/suite.js +248 -107
  13. package/dist/suite.mjs +217 -105
  14. package/dist/ui.d.mts +608 -2
  15. package/dist/ui.d.ts +608 -2
  16. package/dist/ui.js +232 -230
  17. package/dist/ui.mjs +2 -2
  18. package/package.json +2 -6
  19. package/scripts/install-theme-dev.sh +60 -0
  20. package/scripts/sync-posthog-icons.mjs +75 -0
  21. package/src/app/globals.css +1 -0
  22. package/src/components/ui/Chip.tsx +36 -18
  23. package/src/components/ui/CommandPalette.test.tsx +41 -0
  24. package/src/components/ui/CommandPalette.tsx +58 -9
  25. package/src/components/ui/DropdownMenu.tsx +50 -11
  26. package/src/components/ui/SegmentedControl.tsx +2 -1
  27. package/src/components/ui/SettingsLayout.tsx +19 -5
  28. package/src/components/ui/ThemeSwitcher.tsx +12 -3
  29. package/src/components/ui/interaction-primitives.test.tsx +52 -0
  30. package/src/styles/suite-skin.css +53 -1
  31. package/src/styles/themes.css +445 -1656
  32. package/src/suite/components/app-switcher.tsx +32 -25
  33. package/src/suite/components/command-palette-host.tsx +20 -8
  34. package/src/suite/components/suite-app-layout.tsx +31 -10
  35. package/src/suite/components/suite-bottom-nav.tsx +23 -18
  36. package/src/suite/components/suite-layout.test.tsx +44 -0
  37. package/src/suite/components/suite-layout.tsx +3 -3
  38. package/src/suite/components/suite-mobile-drawer.tsx +12 -0
  39. package/src/suite/components/suite-mobile-header.tsx +15 -9
  40. package/src/suite/components/suite-notification-bell.tsx +23 -11
  41. package/src/suite/components/suite-settings-mobile-nav.tsx +2 -0
  42. package/src/suite/components/suite-sidebar.tsx +54 -43
  43. package/src/suite/components/suite-user-menu.tsx +54 -26
  44. package/src/suite/components/today-page-frame.tsx +1 -1
  45. package/src/suite/icons/app-accents.ts +38 -43
  46. package/src/suite/icons/glyph-parts.tsx +16 -9
  47. package/src/suite/icons/glyphs.ts +130 -99
  48. package/src/suite/lib/apps.ts +1 -1
  49. package/src/suite/lib/injected.ts +12 -11
  50. package/src/suite/lib/use-sidebar-width.ts +23 -8
  51. package/src/components/charts/index.ts +0 -9
  52. package/src/components/charts/quill/BarChart.tsx +0 -85
  53. package/src/components/charts/quill/FunnelChart.tsx +0 -49
  54. package/src/components/charts/quill/InsightShell.tsx +0 -27
  55. package/src/components/charts/quill/MetricCard.tsx +0 -44
  56. package/src/components/charts/quill/PieChart.tsx +0 -81
  57. package/src/components/charts/quill/Sparkline.tsx +0 -57
  58. package/src/components/charts/quill/TimeSeriesLineChart.tsx +0 -62
  59. package/src/components/charts/quill/index.ts +0 -9
@@ -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";