@xenide-io/the-old-ui-theme 0.4.4 → 0.4.8
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/dist/{chunk-54ZR4VL5.mjs → chunk-RZXHZWUB.mjs} +44 -17
- package/dist/{index-B5NOyoKS.d.mts → index-Od4pIP4F.d.mts} +7 -1
- package/dist/{index-B5NOyoKS.d.ts → index-Od4pIP4F.d.ts} +7 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +37 -10
- package/dist/index.mjs +1 -1
- package/dist/suite.d.mts +152 -41
- package/dist/suite.d.ts +152 -41
- package/dist/suite.js +1366 -671
- package/dist/suite.mjs +1304 -610
- package/dist/ui.d.mts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +37 -10
- package/dist/ui.mjs +1 -1
- package/package.json +7 -3
- package/src/components/ui/Modal.tsx +70 -26
- package/src/styles/suite-skin.css +284 -24
- package/src/suite/components/ai-panel.test.ts +20 -0
- package/src/suite/components/ai-panel.tsx +494 -103
- package/src/suite/components/suite-app-layout.tsx +48 -28
- package/src/suite/components/suite-layout.tsx +84 -40
- package/src/suite/components/suite-mobile-drawer.tsx +35 -22
- package/src/suite/components/suite-notification-bell.tsx +9 -3
- package/src/suite/components/suite-settings-layout.tsx +82 -0
- package/src/suite/components/suite-settings-mobile-nav.tsx +18 -17
- package/src/suite/components/suite-skeleton.tsx +3 -3
- package/src/suite/components/today-calibrating.tsx +11 -35
- package/src/suite/components/today-page-frame.tsx +19 -11
- package/src/suite/components/today-ui.tsx +276 -19
- package/src/suite/index.ts +41 -25
- package/src/suite/lib/apps.ts +32 -2
- package/src/suite/lib/use-sidebar-width.ts +114 -0
- package/src/components/sections/AccordionShowcase.tsx +0 -45
- package/src/components/sections/AlertShowcase.tsx +0 -40
- package/src/components/sections/AvatarShowcase.tsx +0 -80
- package/src/components/sections/BadgeShowcase.tsx +0 -65
- package/src/components/sections/ButtonShowcase.tsx +0 -308
- package/src/components/sections/CalendarShowcase.tsx +0 -35
- package/src/components/sections/CardShowcase.tsx +0 -159
- package/src/components/sections/CodeMockupShowcase.tsx +0 -56
- package/src/components/sections/ColorPalette.tsx +0 -117
- package/src/components/sections/CommandPaletteShowcase.tsx +0 -48
- package/src/components/sections/CountdownShowcase.tsx +0 -43
- package/src/components/sections/DiffShowcase.tsx +0 -70
- package/src/components/sections/DrawerShowcase.tsx +0 -97
- package/src/components/sections/DropdownShowcase.tsx +0 -98
- package/src/components/sections/EmptyStateShowcase.tsx +0 -50
- package/src/components/sections/FilterChipsShowcase.tsx +0 -98
- package/src/components/sections/FormShowcase.tsx +0 -127
- package/src/components/sections/HoverCardShowcase.tsx +0 -50
- package/src/components/sections/IconShowcase.tsx +0 -121
- package/src/components/sections/IndicatorShowcase.tsx +0 -52
- package/src/components/sections/KbdShowcase.tsx +0 -57
- package/src/components/sections/ModalShowcase.tsx +0 -211
- package/src/components/sections/NavigationShowcase.tsx +0 -199
- package/src/components/sections/NewComponentsShowcase.tsx +0 -1052
- package/src/components/sections/ProductLayoutsShowcase.tsx +0 -78
- package/src/components/sections/ProgressShowcase.tsx +0 -82
- package/src/components/sections/QuillChartShowcase.tsx +0 -92
- package/src/components/sections/QuillDashboardShowcase.tsx +0 -149
- package/src/components/sections/SegmentedControlShowcase.tsx +0 -49
- package/src/components/sections/SetupThemeShowcase.tsx +0 -262
- package/src/components/sections/SidebarShowcase.tsx +0 -152
- package/src/components/sections/StackShowcase.tsx +0 -33
- package/src/components/sections/StepperShowcase.tsx +0 -37
- package/src/components/sections/SuiteShowcase.tsx +0 -669
- package/src/components/sections/SwapShowcase.tsx +0 -99
- package/src/components/sections/TabShowcase.tsx +0 -84
- package/src/components/sections/TableShowcase.tsx +0 -142
- package/src/components/sections/TimelineShowcase.tsx +0 -83
- package/src/components/sections/ToastShowcase.tsx +0 -108
- package/src/components/sections/TooltipShowcase.tsx +0 -38
- package/src/components/sections/UtilityShowcase.tsx +0 -81
- package/src/styles/excel-themes.css +0 -110
- package/src/styles/lemon-primitives.css +0 -550
|
@@ -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
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { IconCopy, IconEdit, IconLogout, IconPerson, IconTrash, IconTuning } from "@/components/icons";
|
|
4
|
-
import { DropdownButton, DropdownItem, ShowcaseWrapper } from "@/components/ui";
|
|
5
|
-
|
|
6
|
-
export default function DropdownShowcase() {
|
|
7
|
-
const code = `import { IconCopy, IconEdit, IconLogout, IconPerson, IconTrash, IconTuning } from "@xenide-io/the-old-ui-theme";
|
|
8
|
-
import { DropdownButton, DropdownItem } from "@xenide-io/the-old-ui-theme";
|
|
9
|
-
|
|
10
|
-
<div className="ph-panel space-y-6">
|
|
11
|
-
<p className="text-sm text-ph-subtle">
|
|
12
|
-
Use <code className="ph-kbd">DropdownButton</code> from{" "}
|
|
13
|
-
<code className="ph-kbd">the-old-ui</code> — labelled Lemon triggers +{" "}
|
|
14
|
-
<code className="ph-kbd">DropdownItem</code> menu rows.
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
<div className="flex flex-wrap items-start gap-6">
|
|
18
|
-
<DropdownButton label="Actions" variant="primary">
|
|
19
|
-
<DropdownItem>Refresh cache</DropdownItem>
|
|
20
|
-
<DropdownItem>Export HogQL</DropdownItem>
|
|
21
|
-
<DropdownItem>Jump to inspector</DropdownItem>
|
|
22
|
-
</DropdownButton>
|
|
23
|
-
|
|
24
|
-
<DropdownButton label="Account" variant="secondary">
|
|
25
|
-
<DropdownItem>
|
|
26
|
-
<IconPerson className="h-4 w-4" aria-hidden /> Profile
|
|
27
|
-
</DropdownItem>
|
|
28
|
-
<DropdownItem>
|
|
29
|
-
<IconTuning className="h-4 w-4" aria-hidden /> Project settings
|
|
30
|
-
</DropdownItem>
|
|
31
|
-
<DropdownItem>
|
|
32
|
-
<IconLogout className="h-4 w-4" aria-hidden /> Sign out
|
|
33
|
-
</DropdownItem>
|
|
34
|
-
</DropdownButton>
|
|
35
|
-
|
|
36
|
-
<DropdownButton label="Row menu" variant="accent" outline>
|
|
37
|
-
<DropdownItem>
|
|
38
|
-
<IconEdit className="h-4 w-4" aria-hidden /> Rename
|
|
39
|
-
</DropdownItem>
|
|
40
|
-
<DropdownItem>
|
|
41
|
-
<IconCopy className="h-4 w-4" aria-hidden /> Duplicate key
|
|
42
|
-
</DropdownItem>
|
|
43
|
-
<div className="my-1 h-px bg-ph-border" />
|
|
44
|
-
<DropdownItem className="text-ph-danger">
|
|
45
|
-
<IconTrash className="h-4 w-4" aria-hidden /> Delete
|
|
46
|
-
</DropdownItem>
|
|
47
|
-
</DropdownButton>
|
|
48
|
-
</div>
|
|
49
|
-
</div>`;
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<ShowcaseWrapper
|
|
53
|
-
title="Dropdowns"
|
|
54
|
-
description="Accessible menu buttons with keyboard navigation and automatic viewport-aware side flipping and alignment shifting."
|
|
55
|
-
code={code}
|
|
56
|
-
filename="DropdownExample.tsx"
|
|
57
|
-
>
|
|
58
|
-
<div className="ph-panel space-y-6">
|
|
59
|
-
<p className="text-sm text-ph-subtle">
|
|
60
|
-
Menus prefer the requested side, then flip above or sideways and shift start/end alignment to remain visible.
|
|
61
|
-
</p>
|
|
62
|
-
|
|
63
|
-
<div className="flex flex-wrap items-start gap-6">
|
|
64
|
-
<DropdownButton label="Actions" variant="primary">
|
|
65
|
-
<DropdownItem>Refresh cache</DropdownItem>
|
|
66
|
-
<DropdownItem>Export HogQL</DropdownItem>
|
|
67
|
-
<DropdownItem>Jump to inspector</DropdownItem>
|
|
68
|
-
</DropdownButton>
|
|
69
|
-
|
|
70
|
-
<DropdownButton label="Account" variant="secondary">
|
|
71
|
-
<DropdownItem>
|
|
72
|
-
<IconPerson className="h-4 w-4" aria-hidden /> Profile
|
|
73
|
-
</DropdownItem>
|
|
74
|
-
<DropdownItem>
|
|
75
|
-
<IconTuning className="h-4 w-4" aria-hidden /> Project settings
|
|
76
|
-
</DropdownItem>
|
|
77
|
-
<DropdownItem>
|
|
78
|
-
<IconLogout className="h-4 w-4" aria-hidden /> Sign out
|
|
79
|
-
</DropdownItem>
|
|
80
|
-
</DropdownButton>
|
|
81
|
-
|
|
82
|
-
<DropdownButton label="Row menu" variant="accent" outline>
|
|
83
|
-
<DropdownItem>
|
|
84
|
-
<IconEdit className="h-4 w-4" aria-hidden /> Rename
|
|
85
|
-
</DropdownItem>
|
|
86
|
-
<DropdownItem>
|
|
87
|
-
<IconCopy className="h-4 w-4" aria-hidden /> Duplicate key
|
|
88
|
-
</DropdownItem>
|
|
89
|
-
<div className="my-1 h-px bg-ph-border" />
|
|
90
|
-
<DropdownItem className="text-ph-danger">
|
|
91
|
-
<IconTrash className="h-4 w-4" aria-hidden /> Delete
|
|
92
|
-
</DropdownItem>
|
|
93
|
-
</DropdownButton>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</ShowcaseWrapper>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Button, ComponentDocs, EmptyState, ShowcaseWrapper } from "@/components/ui";
|
|
4
|
-
import { IconBox, IconPlus } from "@/components/icons";
|
|
5
|
-
|
|
6
|
-
export default function EmptyStateShowcase() {
|
|
7
|
-
const code = `import { Button, EmptyState } from "the-old-ui";
|
|
8
|
-
import { IconBox, IconPlus } from "the-old-ui";
|
|
9
|
-
|
|
10
|
-
<EmptyState
|
|
11
|
-
icon={<IconBox className="h-7 w-7" />}
|
|
12
|
-
title="No projects yet"
|
|
13
|
-
description="Get started by creating your first project to organize your analytics."
|
|
14
|
-
action={
|
|
15
|
-
<Button icon={<IconPlus className="h-4 w-4" />}>
|
|
16
|
-
Create Project
|
|
17
|
-
</Button>
|
|
18
|
-
}
|
|
19
|
-
/>`;
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<ShowcaseWrapper
|
|
23
|
-
title="Empty State"
|
|
24
|
-
description="Reusable blank-state component for zero data, filtered results, or onboarding prompts."
|
|
25
|
-
code={code}
|
|
26
|
-
filename="EmptyStateExample.tsx"
|
|
27
|
-
docs={
|
|
28
|
-
<ComponentDocs
|
|
29
|
-
rows={[
|
|
30
|
-
{ name: "icon", type: "ReactNode", description: "Optional visual icon." },
|
|
31
|
-
{ name: "title", type: "string", description: "Primary message." },
|
|
32
|
-
{ name: "description", type: "string", description: "Supporting copy." },
|
|
33
|
-
{ name: "action", type: "ReactNode", description: "Primary CTA slot." },
|
|
34
|
-
]}
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
>
|
|
38
|
-
<EmptyState
|
|
39
|
-
icon={<IconBox className="h-7 w-7" />}
|
|
40
|
-
title="No projects yet"
|
|
41
|
-
description="Get started by creating your first project to organize your analytics."
|
|
42
|
-
action={
|
|
43
|
-
<Button icon={<IconPlus className="h-4 w-4" />}>
|
|
44
|
-
Create Project
|
|
45
|
-
</Button>
|
|
46
|
-
}
|
|
47
|
-
/>
|
|
48
|
-
</ShowcaseWrapper>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
ComponentDocs,
|
|
6
|
-
FilterControls,
|
|
7
|
-
FilterMenu,
|
|
8
|
-
ShowcaseWrapper,
|
|
9
|
-
SortMenu,
|
|
10
|
-
} from "@/components/ui";
|
|
11
|
-
|
|
12
|
-
const statusOptions = [
|
|
13
|
-
{ value: "all", label: "Any status" },
|
|
14
|
-
{ value: "active", label: "Active" },
|
|
15
|
-
{ value: "draft", label: "Draft" },
|
|
16
|
-
{ value: "archived", label: "Archived" },
|
|
17
|
-
] as const;
|
|
18
|
-
|
|
19
|
-
const ownerOptions = [
|
|
20
|
-
{ value: "anyone", label: "Anyone" },
|
|
21
|
-
{ value: "me", label: "Owned by me" },
|
|
22
|
-
{ value: "team", label: "My team" },
|
|
23
|
-
] as const;
|
|
24
|
-
|
|
25
|
-
const sortOptions = [
|
|
26
|
-
{ value: "updated", label: "Recently updated" },
|
|
27
|
-
{ value: "created", label: "Recently created" },
|
|
28
|
-
{ value: "name", label: "Name A-Z" },
|
|
29
|
-
] as const;
|
|
30
|
-
|
|
31
|
-
export default function FilterChipsShowcase() {
|
|
32
|
-
const [status, setStatus] = useState("active");
|
|
33
|
-
const [owner, setOwner] = useState("me");
|
|
34
|
-
const [sort, setSort] = useState("updated");
|
|
35
|
-
|
|
36
|
-
const applied = [
|
|
37
|
-
...(status !== "all"
|
|
38
|
-
? [{ id: "status", label: "Status", value: statusOptions.find((option) => option.value === status)?.label, active: true }]
|
|
39
|
-
: []),
|
|
40
|
-
...(owner !== "anyone"
|
|
41
|
-
? [{ id: "owner", label: "Owner", value: ownerOptions.find((option) => option.value === owner)?.label, active: true }]
|
|
42
|
-
: []),
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
const clear = () => {
|
|
46
|
-
setStatus("all");
|
|
47
|
-
setOwner("anyone");
|
|
48
|
-
setSort("updated");
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const remove = (id: string) => {
|
|
52
|
-
if (id === "status") setStatus("all");
|
|
53
|
-
if (id === "owner") setOwner("anyone");
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const code = `import { FilterControls, FilterMenu, SortMenu } from "@xenide-io/the-old-ui-theme";
|
|
57
|
-
|
|
58
|
-
<FilterControls
|
|
59
|
-
barProps={{ onClear: clearFilters, resultCount: "24 insights" }}
|
|
60
|
-
chipsProps={{ chips: appliedFilters, onRemove: removeFilter }}
|
|
61
|
-
emptyState={<span>No filters applied</span>}
|
|
62
|
-
>
|
|
63
|
-
<FilterMenu label="Status" value={status} options={statusOptions} onValueChange={setStatus} />
|
|
64
|
-
<FilterMenu label="Owner" value={owner} options={ownerOptions} onValueChange={setOwner} />
|
|
65
|
-
<SortMenu label="Sort" value={sort} options={sortOptions} onValueChange={setSort} />
|
|
66
|
-
</FilterControls>`;
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<ShowcaseWrapper
|
|
70
|
-
id="filters"
|
|
71
|
-
title="Filter and sort"
|
|
72
|
-
description="Controlled, URL-ready filter menus, applied chips, sorting, clear-all, and result feedback. Menus flip and shift at viewport edges."
|
|
73
|
-
code={code}
|
|
74
|
-
filename="FilterBarExample.tsx"
|
|
75
|
-
docs={
|
|
76
|
-
<ComponentDocs
|
|
77
|
-
rows={[
|
|
78
|
-
{ name: "FilterControls", type: "FilterControlsProps", description: "Combined filter bar and applied-chip composition without owning state." },
|
|
79
|
-
{ name: "FilterBar", type: "FilterBarProps", description: "Lower-level responsive group for filter, sort, clear, and result controls." },
|
|
80
|
-
{ name: "FilterMenu", type: "FilterMenuProps", description: "Single-choice filter using an adaptive radio menu." },
|
|
81
|
-
{ name: "SortMenu", type: "SortMenuProps", description: "Dedicated sort control kept separate from filter state." },
|
|
82
|
-
{ name: "FilterChips", type: "FilterChipsProps", description: "Applied or toggleable chips with independent keyboard-accessible removal." },
|
|
83
|
-
]}
|
|
84
|
-
/>
|
|
85
|
-
}
|
|
86
|
-
>
|
|
87
|
-
<FilterControls
|
|
88
|
-
barProps={{ onClear: clear, resultCount: "24 insights" }}
|
|
89
|
-
chipsProps={{ chips: applied, onRemove: remove }}
|
|
90
|
-
emptyState={<p className="text-xs text-ph-mutedtext">No filters applied</p>}
|
|
91
|
-
>
|
|
92
|
-
<FilterMenu label="Status" value={status} options={statusOptions} onValueChange={setStatus} />
|
|
93
|
-
<FilterMenu label="Owner" value={owner} options={ownerOptions} onValueChange={setOwner} />
|
|
94
|
-
<SortMenu label="Sort" value={sort} options={sortOptions} onValueChange={setSort} />
|
|
95
|
-
</FilterControls>
|
|
96
|
-
</ShowcaseWrapper>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ComponentDocs,
|
|
3
|
-
Checkbox,
|
|
4
|
-
FileUpload,
|
|
5
|
-
Input,
|
|
6
|
-
Panel,
|
|
7
|
-
Radio,
|
|
8
|
-
Range,
|
|
9
|
-
Rating,
|
|
10
|
-
SearchGroup,
|
|
11
|
-
Select,
|
|
12
|
-
Textarea,
|
|
13
|
-
Toggle,
|
|
14
|
-
ShowcaseWrapper,
|
|
15
|
-
} from "@/components/ui";
|
|
16
|
-
|
|
17
|
-
export default function FormShowcase() {
|
|
18
|
-
const code = `import { Checkbox, FileUpload, Input, Panel, Radio, Range, Rating, SearchGroup, Select, Textarea, Toggle } from "@xenide-io/the-old-ui-theme";
|
|
19
|
-
|
|
20
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
21
|
-
<Panel title="Text inputs" className="space-y-6">
|
|
22
|
-
<Input label="Default" placeholder="Filter events..." />
|
|
23
|
-
<Input label="Error" placeholder="hogql query" error="Malformed identifier near line 12" />
|
|
24
|
-
<Input label="Ghost toolbar field" type="search" placeholder="Search..." variant="ghost" />
|
|
25
|
-
<Input label="Disabled" placeholder="Unavailable" disabled />
|
|
26
|
-
</Panel>
|
|
27
|
-
|
|
28
|
-
<Panel title="Select & textarea" className="space-y-6">
|
|
29
|
-
<Select label="Environment" defaultValue="prod">
|
|
30
|
-
<option value="prod">Production</option>
|
|
31
|
-
<option value="staging">Staging</option>
|
|
32
|
-
<option value="dev">Development</option>
|
|
33
|
-
</Select>
|
|
34
|
-
|
|
35
|
-
<Textarea label="Description" placeholder="Explain the rollout..." />
|
|
36
|
-
|
|
37
|
-
<Checkbox label="Autocapture pageviews" defaultChecked />
|
|
38
|
-
<Checkbox label="Record console logs (disabled product)" disabled />
|
|
39
|
-
|
|
40
|
-
<div className="flex flex-col gap-2">
|
|
41
|
-
<Radio name="cohort" label="Dynamic cohort" defaultChecked />
|
|
42
|
-
<Radio name="cohort" label="Static upload" />
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<Toggle label="Session replay" defaultChecked />
|
|
46
|
-
<Toggle label="Error tracking (disabled)" disabled />
|
|
47
|
-
</Panel>
|
|
48
|
-
|
|
49
|
-
<Panel title="Range, rating, uploads" className="space-y-6 lg:col-span-2">
|
|
50
|
-
<Range label="Sample rate" min={0} max={100} defaultValue={42} minLabel="Off" valueLabel="42%" maxLabel="Full" wrapperClassName="max-w-xl" />
|
|
51
|
-
|
|
52
|
-
<Rating label="Satisfaction" value={4} />
|
|
53
|
-
|
|
54
|
-
<FileUpload label="Source map archive" prompt="Drop tarball or browse" wrapperClassName="max-w-xl" />
|
|
55
|
-
|
|
56
|
-
<SearchGroup label="Grouped search" submitLabel="Search records" />
|
|
57
|
-
</Panel>
|
|
58
|
-
</div>`;
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<ShowcaseWrapper
|
|
62
|
-
title="Inputs & Forms"
|
|
63
|
-
description="Actual exported input components with built-in labels, error states, helper text, disabled state, and size/variant props."
|
|
64
|
-
code={code}
|
|
65
|
-
filename="FormExample.tsx"
|
|
66
|
-
docs={
|
|
67
|
-
<ComponentDocs
|
|
68
|
-
title="Input components"
|
|
69
|
-
rows={[
|
|
70
|
-
{ name: "FormField", type: "component", description: "Shared label, description, error, required-state, and generated-ID composition for custom controls." },
|
|
71
|
-
{ name: "Input", type: "text | search | email | password", description: "Labelled input with error, helperText, size, and variant props." },
|
|
72
|
-
{ name: "Select", type: "select", description: "Labelled select with error, helperText, size, and disabled props." },
|
|
73
|
-
{ name: "Textarea", type: "textarea", description: "Labelled multiline input with the same state props as Input." },
|
|
74
|
-
{ name: "Checkbox", type: "checkbox", description: "Checkbox with label and native input props." },
|
|
75
|
-
{ name: "Radio", type: "radio", description: "Radio item with label and native input props." },
|
|
76
|
-
{ name: "Toggle", type: "switch", description: "Switch-style checkbox with row layout." },
|
|
77
|
-
{ name: "Range", type: "range", description: "Range slider with optional min/value/max labels." },
|
|
78
|
-
{ name: "Rating", type: "rating", description: "Star rating display/control with value, max, and onChange props." },
|
|
79
|
-
{ name: "FileUpload", type: "file", description: "Dropzone-style file input wrapper." },
|
|
80
|
-
{ name: "size", type: "sm | md | lg", defaultValue: "md", description: "Shared density prop for Input, Select, and Textarea." },
|
|
81
|
-
{ name: "variant", type: "default | ghost", defaultValue: "default", description: "Input visual variant. Ghost is useful in toolbar/search contexts." },
|
|
82
|
-
]}
|
|
83
|
-
/>
|
|
84
|
-
}
|
|
85
|
-
>
|
|
86
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
87
|
-
<Panel title="Text inputs" className="space-y-6">
|
|
88
|
-
<Input label="Default" placeholder="Filter events..." />
|
|
89
|
-
<Input label="Error" placeholder="hogql query" error="Malformed identifier near line 12" />
|
|
90
|
-
<Input label="Ghost toolbar field" type="search" placeholder="Search..." variant="ghost" />
|
|
91
|
-
<Input label="Disabled" placeholder="Unavailable" disabled />
|
|
92
|
-
</Panel>
|
|
93
|
-
|
|
94
|
-
<Panel title="Select & textarea" className="space-y-6">
|
|
95
|
-
<Select label="Environment" defaultValue="prod">
|
|
96
|
-
<option value="prod">Production</option>
|
|
97
|
-
<option value="staging">Staging</option>
|
|
98
|
-
<option value="dev">Development</option>
|
|
99
|
-
</Select>
|
|
100
|
-
|
|
101
|
-
<Textarea label="Description" placeholder="Explain the rollout..." />
|
|
102
|
-
|
|
103
|
-
<Checkbox label="Autocapture pageviews" defaultChecked />
|
|
104
|
-
<Checkbox label="Record console logs (disabled product)" disabled />
|
|
105
|
-
|
|
106
|
-
<div className="flex flex-col gap-2">
|
|
107
|
-
<Radio name="cohort" label="Dynamic cohort" defaultChecked />
|
|
108
|
-
<Radio name="cohort" label="Static upload" />
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<Toggle label="Session replay" defaultChecked />
|
|
112
|
-
<Toggle label="Error tracking (disabled)" disabled />
|
|
113
|
-
</Panel>
|
|
114
|
-
|
|
115
|
-
<Panel title="Range, rating, uploads" className="space-y-6 lg:col-span-2">
|
|
116
|
-
<Range label="Sample rate" min={0} max={100} defaultValue={42} minLabel="Off" valueLabel="42%" maxLabel="Full" wrapperClassName="max-w-xl" />
|
|
117
|
-
|
|
118
|
-
<Rating label="Satisfaction" value={4} />
|
|
119
|
-
|
|
120
|
-
<FileUpload label="Source map archive" prompt="Drop tarball or browse" wrapperClassName="max-w-xl" />
|
|
121
|
-
|
|
122
|
-
<SearchGroup label="Grouped search" submitLabel="Search records" />
|
|
123
|
-
</Panel>
|
|
124
|
-
</div>
|
|
125
|
-
</ShowcaseWrapper>
|
|
126
|
-
);
|
|
127
|
-
}
|