@xenide-io/the-old-ui-theme 0.4.4 → 0.4.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.
Files changed (75) hide show
  1. package/dist/{chunk-54ZR4VL5.mjs → chunk-RZXHZWUB.mjs} +44 -17
  2. package/dist/{index-B5NOyoKS.d.mts → index-Od4pIP4F.d.mts} +7 -1
  3. package/dist/{index-B5NOyoKS.d.ts → index-Od4pIP4F.d.ts} +7 -1
  4. package/dist/index.d.mts +2 -2
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +37 -10
  7. package/dist/index.mjs +1 -1
  8. package/dist/suite.d.mts +152 -41
  9. package/dist/suite.d.ts +152 -41
  10. package/dist/suite.js +1184 -661
  11. package/dist/suite.mjs +1122 -600
  12. package/dist/ui.d.mts +1 -1
  13. package/dist/ui.d.ts +1 -1
  14. package/dist/ui.js +37 -10
  15. package/dist/ui.mjs +1 -1
  16. package/package.json +7 -3
  17. package/src/components/ui/Modal.tsx +70 -26
  18. package/src/styles/suite-skin.css +284 -24
  19. package/src/suite/components/ai-panel.tsx +269 -103
  20. package/src/suite/components/suite-app-layout.tsx +48 -28
  21. package/src/suite/components/suite-layout.tsx +84 -40
  22. package/src/suite/components/suite-mobile-drawer.tsx +35 -22
  23. package/src/suite/components/suite-notification-bell.tsx +9 -3
  24. package/src/suite/components/suite-settings-layout.tsx +82 -0
  25. package/src/suite/components/suite-settings-mobile-nav.tsx +18 -17
  26. package/src/suite/components/suite-skeleton.tsx +3 -3
  27. package/src/suite/components/today-calibrating.tsx +11 -35
  28. package/src/suite/components/today-page-frame.tsx +19 -11
  29. package/src/suite/components/today-ui.tsx +276 -19
  30. package/src/suite/index.ts +41 -25
  31. package/src/suite/lib/apps.ts +32 -2
  32. package/src/suite/lib/use-sidebar-width.ts +114 -0
  33. package/src/components/sections/AccordionShowcase.tsx +0 -45
  34. package/src/components/sections/AlertShowcase.tsx +0 -40
  35. package/src/components/sections/AvatarShowcase.tsx +0 -80
  36. package/src/components/sections/BadgeShowcase.tsx +0 -65
  37. package/src/components/sections/ButtonShowcase.tsx +0 -308
  38. package/src/components/sections/CalendarShowcase.tsx +0 -35
  39. package/src/components/sections/CardShowcase.tsx +0 -159
  40. package/src/components/sections/CodeMockupShowcase.tsx +0 -56
  41. package/src/components/sections/ColorPalette.tsx +0 -117
  42. package/src/components/sections/CommandPaletteShowcase.tsx +0 -48
  43. package/src/components/sections/CountdownShowcase.tsx +0 -43
  44. package/src/components/sections/DiffShowcase.tsx +0 -70
  45. package/src/components/sections/DrawerShowcase.tsx +0 -97
  46. package/src/components/sections/DropdownShowcase.tsx +0 -98
  47. package/src/components/sections/EmptyStateShowcase.tsx +0 -50
  48. package/src/components/sections/FilterChipsShowcase.tsx +0 -98
  49. package/src/components/sections/FormShowcase.tsx +0 -127
  50. package/src/components/sections/HoverCardShowcase.tsx +0 -50
  51. package/src/components/sections/IconShowcase.tsx +0 -121
  52. package/src/components/sections/IndicatorShowcase.tsx +0 -52
  53. package/src/components/sections/KbdShowcase.tsx +0 -57
  54. package/src/components/sections/ModalShowcase.tsx +0 -211
  55. package/src/components/sections/NavigationShowcase.tsx +0 -199
  56. package/src/components/sections/NewComponentsShowcase.tsx +0 -1052
  57. package/src/components/sections/ProductLayoutsShowcase.tsx +0 -78
  58. package/src/components/sections/ProgressShowcase.tsx +0 -82
  59. package/src/components/sections/QuillChartShowcase.tsx +0 -92
  60. package/src/components/sections/QuillDashboardShowcase.tsx +0 -149
  61. package/src/components/sections/SegmentedControlShowcase.tsx +0 -49
  62. package/src/components/sections/SetupThemeShowcase.tsx +0 -262
  63. package/src/components/sections/SidebarShowcase.tsx +0 -152
  64. package/src/components/sections/StackShowcase.tsx +0 -33
  65. package/src/components/sections/StepperShowcase.tsx +0 -37
  66. package/src/components/sections/SuiteShowcase.tsx +0 -669
  67. package/src/components/sections/SwapShowcase.tsx +0 -99
  68. package/src/components/sections/TabShowcase.tsx +0 -84
  69. package/src/components/sections/TableShowcase.tsx +0 -142
  70. package/src/components/sections/TimelineShowcase.tsx +0 -83
  71. package/src/components/sections/ToastShowcase.tsx +0 -108
  72. package/src/components/sections/TooltipShowcase.tsx +0 -38
  73. package/src/components/sections/UtilityShowcase.tsx +0 -81
  74. package/src/styles/excel-themes.css +0 -110
  75. package/src/styles/lemon-primitives.css +0 -550
@@ -1,159 +0,0 @@
1
- import { Badge, Button, Card, ComponentDocs, ShowcaseWrapper } from "@/components/ui";
2
-
3
- export default function CardShowcase() {
4
- const code = `import { Badge, Button, Card } from "@xenide-io/the-old-ui-theme";
5
-
6
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
7
- <Card
8
- title="Insight saved"
9
- description="A quiet, static surface. Depth is reserved for interactive or elevated content."
10
- actions={
11
- <>
12
- <Button variant="secondary" outline>
13
- Discard
14
- </Button>
15
- <Button variant="primary">Open</Button>
16
- </>
17
- }
18
- />
19
-
20
- <Card
21
- title="With visual"
22
- description="Media sits flush to the card edge with a semantic divider."
23
- media={<div className="flex h-40 items-center justify-center bg-gradient-to-br from-orange-400 via-ph-brand to-ph-blue text-lg font-bold text-white">Hero stripe</div>}
24
- actions={
25
- <Button variant="primary" size="sm">
26
- View funnel
27
- </Button>
28
- }
29
- />
30
-
31
- <Card
32
- title={
33
- <>
34
- Releases <Badge variant="brand">NEW</Badge>
35
- </>
36
- }
37
- description="Dense header row with badge + actions on the trailing edge."
38
- actions={
39
- <>
40
- <Button variant="secondary" size="sm">
41
- Docs
42
- </Button>
43
- <Button variant="primary" size="sm">
44
- Enable
45
- </Button>
46
- </>
47
- }
48
- />
49
-
50
- <Card
51
- variant="highlighted"
52
- title={<span className="text-ph-brand">Highlighted</span>}
53
- description="Use tinted fill + accent border instead of generic neon glass cards."
54
- actions={<Button variant="primary" size="sm">Acknowledge</Button>}
55
- />
56
-
57
- <Card
58
- variant="outlined"
59
- title="Panel inset"
60
- description="Grey trays on canvas — mirrors secondary surfaces in-app."
61
- actions={<Button variant="primary" outline>Inspect</Button>}
62
- />
63
-
64
- <Card
65
- interactive
66
- title="Interactive surface"
67
- description="Hover depth is opt-in for cards containing an action."
68
- actions={<Button variant="tertiary">Review</Button>}
69
- />
70
- </div>`;
71
-
72
- return (
73
- <ShowcaseWrapper
74
- title="Cards"
75
- description="Static by default, with explicit elevated, highlighted, and interactive treatments."
76
- code={code}
77
- filename="CardExample.tsx"
78
- docs={
79
- <ComponentDocs
80
- rows={[
81
- { name: "variant", type: "default | outlined | elevated | highlighted", defaultValue: "default", description: "Controls the default chrome without requiring classes." },
82
- { name: "title", type: "ReactNode", description: "Optional header title." },
83
- { name: "description", type: "ReactNode", description: "Optional supporting copy." },
84
- { name: "actions", type: "ReactNode", description: "Button row rendered with card action spacing." },
85
- { name: "media", type: "ReactNode", description: "Optional visual block rendered above the card body." },
86
- { name: "interactive", type: "boolean", defaultValue: "false", description: "Adds hover and focus-within depth for a card containing an action." },
87
- { name: "titleAs", type: "h2 | h3 | h4", defaultValue: "h3", description: "Selects the semantic heading level without changing the card style." },
88
- ]}
89
- />
90
- }
91
- >
92
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
93
- <Card
94
- title="Insight saved"
95
- description="A quiet, static surface. Depth is reserved for interactive or elevated content."
96
- actions={
97
- <>
98
- <Button variant="secondary" outline>
99
- Discard
100
- </Button>
101
- <Button variant="primary">Open</Button>
102
- </>
103
- }
104
- />
105
-
106
- <Card
107
- title="With visual"
108
- description="Media sits flush to the card edge with a semantic divider."
109
- media={<div className="flex h-40 items-center justify-center bg-gradient-to-br from-orange-400 via-ph-brand to-ph-blue text-lg font-bold text-white">Hero stripe</div>}
110
- actions={
111
- <Button variant="primary" size="sm">
112
- View funnel
113
- </Button>
114
- }
115
- />
116
-
117
- <Card
118
- title={
119
- <>
120
- Releases <Badge variant="brand">NEW</Badge>
121
- </>
122
- }
123
- description="Dense header row with badge + actions on the trailing edge."
124
- actions={
125
- <>
126
- <Button variant="secondary" size="sm">
127
- Docs
128
- </Button>
129
- <Button variant="primary" size="sm">
130
- Enable
131
- </Button>
132
- </>
133
- }
134
- />
135
-
136
- <Card
137
- variant="highlighted"
138
- title={<span className="text-ph-brand">Highlighted</span>}
139
- description="Use tinted fill + accent border instead of generic neon glass cards."
140
- actions={<Button variant="primary" size="sm">Acknowledge</Button>}
141
- />
142
-
143
- <Card
144
- variant="outlined"
145
- title="Panel inset"
146
- description="Grey trays on canvas — mirrors secondary surfaces in-app."
147
- actions={<Button variant="primary" outline>Inspect</Button>}
148
- />
149
-
150
- <Card
151
- interactive
152
- title="Interactive surface"
153
- description="Hover depth is opt-in for cards containing an action."
154
- actions={<Button variant="tertiary">Review</Button>}
155
- />
156
- </div>
157
- </ShowcaseWrapper>
158
- );
159
- }
@@ -1,56 +0,0 @@
1
- import { IconQueryEditor } from "@/components/icons";
2
- import { ComponentDocs, ShowcaseWrapper, Terminal } from "@/components/ui";
3
-
4
- export default function CodeMockupShowcase() {
5
- const code = `import { Terminal } from "the-old-ui";
6
-
7
- <Terminal
8
- title="sandbox · posthog-wizard"
9
- lines={[
10
- { text: "❯ bun add posthog-js", color: "text-neutral-600" },
11
- { text: "● added posthog-js@1...", color: "text-emerald-400" },
12
- { text: "❯ POSTHOG_KEY=...", color: "text-neutral-600" },
13
- ]}
14
- />`;
15
-
16
- return (
17
- <ShowcaseWrapper
18
- title="Terminal capture"
19
- description="Terminal and replay shells for documentation, demos, and embedded developer flows."
20
- code={code}
21
- filename="TerminalExample.tsx"
22
- docs={
23
- <ComponentDocs
24
- rows={[
25
- { name: "title", type: "string", description: "Window title in the header." },
26
- { name: "lines", type: "Array<{ text; color? }>", description: "Terminal lines to render." },
27
- { name: "children", type: "ReactNode", description: "Custom content instead of lines." },
28
- ]}
29
- />
30
- }
31
- >
32
- <div className="space-y-10">
33
- <Terminal
34
- title="sandbox · posthog-wizard"
35
- lines={[
36
- { text: "❯ bun add posthog-js", color: "text-neutral-600" },
37
- { text: "● added posthog-js@1...", color: "text-emerald-400" },
38
- { text: "❯ POSTHOG_KEY=...", color: "text-neutral-600" },
39
- ]}
40
- />
41
-
42
- <div className="rounded-xl border border-ph-border shadow-ph-md">
43
- <header className="relative flex items-center justify-center border-b border-ph-border px-10 py-3 text-[11px] font-semibold text-ph-mutedtext">
44
- <span className="absolute left-5 top-4 h-px w-[88%] rounded-full bg-ph-border opacity-70" />
45
- Replay preview
46
- </header>
47
- <div className="flex flex-col items-center gap-5 bg-ph-toolbar px-6 py-14 text-ph-subtle">
48
- <IconQueryEditor className="h-14 w-14 opacity-50" />
49
- <p className="text-center font-semibold text-ph-ink">Session snapshot shell</p>
50
- <p className="max-w-xs text-center text-xs">Mirrors bordered frame around insight embeds rather than DaisyUI mocks.</p>
51
- </div>
52
- </div>
53
- </div>
54
- </ShowcaseWrapper>
55
- );
56
- }
@@ -1,117 +0,0 @@
1
- import type { CSSProperties } from "react";
2
- import { ShowcaseWrapper } from "@/components/ui";
3
-
4
- const brandSurface: { label: string; token: string; style: CSSProperties; textClass: string }[] = [
5
- { label: "Brand orange", token: "--ph-accent", style: { background: "var(--ph-accent)" }, textClass: "text-white" },
6
- { label: "Brand blue", token: "--ph-blue", style: { background: "var(--ph-blue)" }, textClass: "text-white" },
7
- { label: "Purple accent", token: "--ph-purple", style: { background: "var(--ph-purple)" }, textClass: "text-white" },
8
- { label: "Canvas (3000-50)", token: "--ph-canvas", style: { background: "var(--ph-canvas)" }, textClass: "text-ph-ink ring-1 ring-inset ring-ph-border" },
9
- { label: "Muted surface", token: "--ph-muted", style: { background: "var(--ph-muted)" }, textClass: "text-ph-ink ring-1 ring-inset ring-ph-border" },
10
- { label: "White surface", token: "--ph-surface", style: { background: "var(--ph-surface)" }, textClass: "text-ph-ink ring-1 ring-inset ring-ph-border" },
11
- { label: "Border", token: "--ph-border", style: { background: "var(--ph-border)" }, textClass: "text-ph-ink" },
12
- { label: "Success", token: "--ph-success", style: { background: "var(--ph-success)" }, textClass: "text-white" },
13
- { label: "Warning", token: "--ph-warning", style: { background: "var(--ph-warning)" }, textClass: "text-white" },
14
- { label: "Danger", token: "--ph-danger", style: { background: "var(--ph-danger)" }, textClass: "text-white" },
15
- { label: "Info", token: "--ph-info", style: { background: "var(--ph-info)" }, textClass: "text-white" },
16
- ];
17
-
18
- const dataSeries = [1, 2, 3, 4, 5, 6, 7].map((n) => ({
19
- label: `Data ${n}`,
20
- token: `--ph-data-${n}`,
21
- style: { background: `var(--ph-data-${n})` } as CSSProperties,
22
- textClass: "text-white",
23
- }));
24
-
25
- const productRail = [
26
- { label: "Session replay", token: "--ph-product-session-replay", style: { background: "var(--ph-product-session-replay)" } as CSSProperties },
27
- { label: "Product analytics", token: "--ph-product-product-analytics", style: { background: "var(--ph-product-product-analytics)" } as CSSProperties },
28
- { label: "Data pipeline", token: "--ph-product-data-pipeline", style: { background: "var(--ph-product-data-pipeline)" } as CSSProperties },
29
- { label: "Feature flags", token: "--ph-product-feature-flags", style: { background: "var(--ph-product-feature-flags)" } as CSSProperties },
30
- { label: "Experiments", token: "--ph-product-experiments", style: { background: "var(--ph-product-experiments)" } as CSSProperties },
31
- { label: "Data warehouse", token: "--ph-product-data-warehouse", style: { background: "var(--ph-product-data-warehouse)" } as CSSProperties },
32
- { label: "Surveys", token: "--ph-product-surveys", style: { background: "var(--ph-product-surveys)" } as CSSProperties },
33
- ].map((row) => ({ ...row, textClass: "text-white" }));
34
-
35
- function SwatchGrid({
36
- title,
37
- description,
38
- items,
39
- }: {
40
- title: string;
41
- description: string;
42
- items: { label: string; token: string; style: CSSProperties; textClass: string }[];
43
- }) {
44
- return (
45
- <div>
46
- <h3 className="mb-1 text-xs font-semibold uppercase tracking-wider text-ph-mutedtext">{title}</h3>
47
- <p className="mb-3 text-sm text-ph-subtle">{description}</p>
48
- <div className="grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6">
49
- {items.map((c) => (
50
- <div
51
- key={c.token}
52
- className={`rounded-[var(--ph-radius-app)] p-5 ${c.textClass}`}
53
- style={{
54
- ...c.style,
55
- boxShadow: "var(--ph-shadow-elevation-3000)",
56
- }}
57
- >
58
- <p className="text-sm font-semibold">{c.label}</p>
59
- <p className="mt-1 font-mono text-[11px] opacity-90">{c.token}</p>
60
- </div>
61
- ))}
62
- </div>
63
- </div>
64
- );
65
- }
66
-
67
- export default function ColorPalette() {
68
- const code = `/* CSS variables update with the active theme */
69
-
70
- // Brand & surfaces
71
- background: var(--ph-accent); // Brand orange
72
- background: var(--ph-canvas); // Canvas
73
- background: var(--ph-surface); // White surface
74
- border-color: var(--ph-border); // Hairline borders
75
-
76
- // Semantic status
77
- color: var(--ph-success); // Success green
78
- color: var(--ph-danger); // Danger red
79
- color: var(--ph-warning); // Warning amber
80
- color: var(--ph-info); // Info blue
81
-
82
- // Data series (charts)
83
- background: var(--ph-data-1); // Primary
84
- background: var(--ph-data-2); // Secondary
85
- // ... up to ph-data-7
86
-
87
- // Product rail
88
- background: var(--ph-product-session-replay);
89
- background: var(--ph-product-product-analytics);`;
90
-
91
- return (
92
- <ShowcaseWrapper
93
- title="Colour tokens"
94
- description="Tokens update with the Theme select in the header — surfaces, accents, chart series, and product rail colours all swap together."
95
- code={code}
96
- filename="Tokens.css"
97
- >
98
- <div className="space-y-10">
99
- <SwatchGrid
100
- title="Brand & surfaces"
101
- description="Core UI chrome and semantic status hues."
102
- items={brandSurface}
103
- />
104
- <SwatchGrid
105
- title="Insight data series"
106
- description="Default trend / breakdown palette."
107
- items={dataSeries}
108
- />
109
- <SwatchGrid
110
- title="Product rail"
111
- description="Saturated nav / marketing tiles."
112
- items={productRail}
113
- />
114
- </div>
115
- </ShowcaseWrapper>
116
- );
117
- }
@@ -1,48 +0,0 @@
1
- "use client";
2
-
3
- import { useState } from "react";
4
- import { Button, CommandPalette, ComponentDocs, ShowcaseWrapper } from "@/components/ui";
5
- import { IconSearch, IconBolt, IconTuning, IconHome, IconPerson } from "@/components/icons";
6
-
7
- export default function CommandPaletteShowcase() {
8
- const [isOpen, setIsOpen] = useState(false);
9
-
10
- const items = [
11
- { id: "1", label: "Go to Dashboard", shortcut: "Cmd+D", icon: <IconHome className="h-5 w-5" />, onSelect: () => {} },
12
- { id: "2", label: "Search Events", shortcut: "Cmd+K", icon: <IconSearch className="h-5 w-5" />, onSelect: () => {} },
13
- { id: "3", label: "Run Query", shortcut: "Cmd+R", icon: <IconBolt className="h-5 w-5" />, onSelect: () => {} },
14
- { id: "4", label: "Settings", shortcut: "Cmd+,", icon: <IconTuning className="h-5 w-5" />, onSelect: () => {} },
15
- { id: "5", label: "Profile", icon: <IconPerson className="h-5 w-5" />, onSelect: () => {} },
16
- ];
17
-
18
- const code = `import { Button, CommandPalette } from "the-old-ui";
19
- import { IconSearch, IconBolt, IconTuning, IconHome, IconPerson } from "the-old-ui";
20
-
21
- <div className="ph-panel">
22
- <Button onClick={() => setIsOpen(true)}>Open Command Palette</Button>
23
- <CommandPalette items={items} isOpen={isOpen} onClose={() => setIsOpen(false)} />
24
- </div>`;
25
-
26
- return (
27
- <ShowcaseWrapper
28
- title="Command Palette"
29
- description="Application command launcher with controlled open state and typed item actions."
30
- code={code}
31
- filename="CommandPaletteExample.tsx"
32
- docs={
33
- <ComponentDocs
34
- rows={[
35
- { name: "items", type: "{ id; label; shortcut?; icon?; onSelect }[]", description: "Commands shown in the palette." },
36
- { name: "isOpen", type: "boolean", description: "Controls palette visibility." },
37
- { name: "onClose", type: "() => void", description: "Called by escape, backdrop, or selection." },
38
- ]}
39
- />
40
- }
41
- >
42
- <div className="ph-panel">
43
- <Button onClick={() => setIsOpen(true)}>Open Command Palette</Button>
44
- <CommandPalette items={items} isOpen={isOpen} onClose={() => setIsOpen(false)} />
45
- </div>
46
- </ShowcaseWrapper>
47
- );
48
- }
@@ -1,43 +0,0 @@
1
- import { ShowcaseWrapper } from "@/components/ui";
2
-
3
- export default function CountdownShowcase() {
4
- const code = `
5
-
6
- <div className="ph-panel">
7
- <p className="mb-6 text-sm text-ph-subtle">Static split — swap for synced timers once you plug in real experiment deadlines.</p>
8
- <div className="flex flex-wrap justify-center gap-3 text-ph-ink sm:justify-start">
9
- {[
10
- { v: "04", label: "Days" },
11
- { v: "12", label: "Hrs" },
12
- { v: "33", label: "Min" },
13
- { v: "09", label: "Sec" },
14
- ].map(({ v, label }) => (
15
- <div key={label} className="flex min-w-[4.75rem] flex-col items-center rounded-xl border border-ph-border bg-ph-surface px-4 py-3 shadow-ph">
16
- <span className="text-3xl font-bold tabular-nums">{v}</span>
17
- <span className="text-[11px] font-semibold uppercase tracking-wider text-ph-mutedtext">{label}</span>
18
- </div>
19
- ))}
20
- </div>
21
- </div>`;
22
-
23
- return (
24
- <ShowcaseWrapper title="Countdown motif" code={code} filename="CountdownExample.tsx">
25
- <div className="ph-panel">
26
- <p className="mb-6 text-sm text-ph-subtle">Static split — swap for synced timers once you plug in real experiment deadlines.</p>
27
- <div className="flex flex-wrap justify-center gap-3 text-ph-ink sm:justify-start">
28
- {[
29
- { v: "04", label: "Days" },
30
- { v: "12", label: "Hrs" },
31
- { v: "33", label: "Min" },
32
- { v: "09", label: "Sec" },
33
- ].map(({ v, label }) => (
34
- <div key={label} className="flex min-w-[4.75rem] flex-col items-center rounded-xl border border-ph-border bg-ph-surface px-4 py-3 shadow-ph">
35
- <span className="text-3xl font-bold tabular-nums">{v}</span>
36
- <span className="text-[11px] font-semibold uppercase tracking-wider text-ph-mutedtext">{label}</span>
37
- </div>
38
- ))}
39
- </div>
40
- </div>
41
- </ShowcaseWrapper>
42
- );
43
- }
@@ -1,70 +0,0 @@
1
- "use client";
2
-
3
- import { useState } from "react";
4
- import { ShowcaseWrapper } from "@/components/ui";
5
-
6
- /** Lightweight before/after — PostHog product diffs screenshots in Visual Review Playwright suites. */
7
-
8
- export default function DiffShowcase() {
9
- const [pct, setPct] = useState(50);
10
-
11
- const code = `
12
-
13
- <div className="ph-panel max-w-3xl">
14
- <label className="mb-6 flex items-center gap-4 text-xs font-semibold uppercase tracking-wider text-ph-mutedtext">
15
- Position
16
- <input type="range" min={0} max={100} value={pct} onChange={(e) => setPct(Number(e.target.value))} className="flex-1" />
17
- <span className="tabular-nums text-ph-ink">{pct}%</span>
18
- </label>
19
- <div className="relative aspect-video overflow-hidden rounded-xl border border-ph-border shadow-ph-md">
20
- <div className="absolute inset-0 grid place-content-center bg-ph-toolbar text-xs font-semibold uppercase text-ph-mutedtext">
21
- After · lightened neutral surfaces
22
- </div>
23
- <div
24
- className="absolute inset-y-0 left-0 overflow-hidden bg-ph-muted"
25
- style={{
26
- clipPath: \`inset(0 \${100 - pct}% 0 0)\`,
27
- }}
28
- >
29
- <div className="grid h-full place-content-center text-xs font-semibold uppercase text-ph-ink">
30
- Before · richer contrast rails
31
- </div>
32
- </div>
33
- <span
34
- className="pointer-events-none absolute inset-y-0 w-px bg-ph-surface"
35
- style={{ left: \`\${pct}%\`, boxShadow: "0 0 0 1px hsl(0deg 0% 0% / .15)" }}
36
- />
37
- </div>
38
- </div>`;
39
-
40
- return (
41
- <ShowcaseWrapper title="Diff slider" code={code} filename="DiffExample.tsx">
42
- <div className="ph-panel max-w-3xl">
43
- <label className="mb-6 flex items-center gap-4 text-xs font-semibold uppercase tracking-wider text-ph-mutedtext">
44
- Position
45
- <input type="range" min={0} max={100} value={pct} onChange={(e) => setPct(Number(e.target.value))} className="flex-1" />
46
- <span className="tabular-nums text-ph-ink">{pct}%</span>
47
- </label>
48
- <div className="relative aspect-video overflow-hidden rounded-xl border border-ph-border shadow-ph-md">
49
- <div className="absolute inset-0 grid place-content-center bg-ph-toolbar text-xs font-semibold uppercase text-ph-mutedtext">
50
- After · lightened neutral surfaces
51
- </div>
52
- <div
53
- className="absolute inset-y-0 left-0 overflow-hidden bg-ph-muted"
54
- style={{
55
- clipPath: `inset(0 ${100 - pct}% 0 0)`,
56
- }}
57
- >
58
- <div className="grid h-full place-content-center text-xs font-semibold uppercase text-ph-ink">
59
- Before · richer contrast rails
60
- </div>
61
- </div>
62
- <span
63
- className="pointer-events-none absolute inset-y-0 w-px bg-ph-surface"
64
- style={{ left: `${pct}%`, boxShadow: "0 0 0 1px hsl(0deg 0% 0% / .15)" }}
65
- />
66
- </div>
67
- </div>
68
- </ShowcaseWrapper>
69
- );
70
- }
@@ -1,97 +0,0 @@
1
- "use client";
2
-
3
- import { useState } from "react";
4
- import {
5
- IconCohort,
6
- IconCumulativeChart,
7
- IconFlag,
8
- IconFlask,
9
- IconHome,
10
- IconPanelRight,
11
- IconTuning,
12
- } from "@/components/icons";
13
- import { Button, ComponentDocs, Drawer, ShowcaseWrapper } from "@/components/ui";
14
-
15
- const navItems = [
16
- { icon: IconHome, label: "Dashboard" },
17
- { icon: IconCumulativeChart, label: "Insights" },
18
- { icon: IconCohort, label: "Persons" },
19
- { icon: IconFlag, label: "Feature flags" },
20
- { icon: IconFlask, label: "Experiments" },
21
- { icon: IconTuning, label: "Settings" },
22
- ];
23
-
24
- export default function DrawerShowcase() {
25
- const [open, setOpen] = useState(false);
26
-
27
- const code = `import { IconCohort, IconCumulativeChart, IconFlag, IconFlask, IconHome, IconPanelRight, IconTuning } from "the-old-ui";
28
- import { Button, Drawer } from "the-old-ui";
29
-
30
- <div className="ph-panel">
31
- <Button
32
- variant="primary"
33
- icon={<IconPanelRight className="h-4 w-4" aria-hidden />}
34
- onClick={() => setOpen(true)}
35
- >
36
- Inspect graph
37
- </Button>
38
-
39
- <Drawer open={open} onClose={() => setOpen(false)} title="Insight controls">
40
- <nav className="flex flex-col gap-1 px-3 py-4">
41
- {navItems.map((item) => {
42
- const Icon = item.icon;
43
- return (
44
- <button key={item.label} type="button" className="flex items-center gap-3 rounded-lg px-3 py-2 text-left text-sm font-medium text-ph-subtle transition hover:bg-ph-muted">
45
- <Icon className="h-4 w-4 shrink-0" />
46
- {item.label}
47
- </button>
48
- );
49
- })}
50
- </nav>
51
- </Drawer>
52
- </div>`;
53
-
54
- return (
55
- <ShowcaseWrapper
56
- title="Drawers"
57
- description="Slide-out panels with overlay backdrop — useful for secondary navigation, detail views, or configuration panels."
58
- code={code}
59
- filename="DrawerExample.tsx"
60
- docs={
61
- <ComponentDocs
62
- rows={[
63
- { name: "open", type: "boolean", defaultValue: "false", description: "Controls drawer visibility." },
64
- { name: "onClose", type: "() => void", description: "Called by backdrop and close button." },
65
- { name: "side", type: "left | right", defaultValue: "right", description: "Which side the drawer enters from." },
66
- { name: "size", type: "sm | md | lg", defaultValue: "md", description: "Controls drawer width." },
67
- { name: "title", type: "ReactNode", description: "Optional header title." },
68
- ]}
69
- />
70
- }
71
- >
72
- <div className="ph-panel">
73
- <Button
74
- variant="primary"
75
- icon={<IconPanelRight className="h-4 w-4" aria-hidden />}
76
- onClick={() => setOpen(true)}
77
- >
78
- Inspect graph
79
- </Button>
80
-
81
- <Drawer open={open} onClose={() => setOpen(false)} title="Insight controls">
82
- <nav className="flex flex-col gap-1 px-3 py-4">
83
- {navItems.map((item) => {
84
- const Icon = item.icon;
85
- return (
86
- <button key={item.label} type="button" className="flex items-center gap-3 rounded-lg px-3 py-2 text-left text-sm font-medium text-ph-subtle transition hover:bg-ph-muted">
87
- <Icon className="h-4 w-4 shrink-0" />
88
- {item.label}
89
- </button>
90
- );
91
- })}
92
- </nav>
93
- </Drawer>
94
- </div>
95
- </ShowcaseWrapper>
96
- );
97
- }