@checkstack/ui 1.8.0 → 1.8.2
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/.storybook/main.ts +22 -0
- package/.storybook/manager-head.html +2 -0
- package/.storybook/mock-access-api.ts +5 -0
- package/.storybook/preview.css +5 -0
- package/.storybook/preview.tsx +73 -0
- package/CHANGELOG.md +51 -0
- package/package.json +22 -8
- package/postcss.config.js +6 -0
- package/stories/AccessDenied.stories.tsx +17 -0
- package/stories/AccessGate.stories.tsx +49 -0
- package/stories/Accordion.stories.tsx +56 -0
- package/stories/Alert.stories.tsx +88 -0
- package/stories/AmbientBackground.stories.tsx +28 -0
- package/stories/AnimatedCounter.stories.tsx +41 -0
- package/stories/AnimatedNumber.stories.tsx +39 -0
- package/stories/BackLink.stories.tsx +32 -0
- package/stories/Badge.stories.tsx +37 -0
- package/stories/Button.stories.tsx +57 -0
- package/stories/Card.stories.tsx +39 -0
- package/stories/Checkbox.stories.tsx +45 -0
- package/stories/CodeEditor.stories.tsx +67 -0
- package/stories/ColorPicker.stories.tsx +24 -0
- package/stories/CommandPalette.stories.tsx +36 -0
- package/stories/ConfirmationModal.stories.tsx +40 -0
- package/stories/DateRangeFilter.stories.tsx +30 -0
- package/stories/DateTimePicker.stories.tsx +26 -0
- package/stories/Dialog.stories.tsx +62 -0
- package/stories/DynamicForm.stories.tsx +83 -0
- package/stories/DynamicIcon.stories.tsx +52 -0
- package/stories/EditableText.stories.tsx +29 -0
- package/stories/Feedback.stories.tsx +45 -0
- package/stories/IDELayout.stories.tsx +70 -0
- package/stories/InfoBanner.stories.tsx +41 -0
- package/stories/Input.stories.tsx +29 -0
- package/stories/InstanceScopeBanner.stories.tsx +35 -0
- package/stories/Introduction.mdx +50 -0
- package/stories/Label.stories.tsx +21 -0
- package/stories/LinksEditor.stories.tsx +37 -0
- package/stories/Markdown.stories.tsx +35 -0
- package/stories/Menu.stories.tsx +35 -0
- package/stories/MetricTile.stories.tsx +31 -0
- package/stories/NavItem.stories.tsx +29 -0
- package/stories/NotFound.stories.tsx +17 -0
- package/stories/Page.stories.tsx +29 -0
- package/stories/PageLayout.stories.tsx +59 -0
- package/stories/PaginatedList.stories.tsx +44 -0
- package/stories/Pagination.stories.tsx +31 -0
- package/stories/PerformanceProvider.stories.tsx +33 -0
- package/stories/PluginConfigForm.stories.tsx +64 -0
- package/stories/Popover.stories.tsx +30 -0
- package/stories/SectionHeader.stories.tsx +20 -0
- package/stories/Select.stories.tsx +36 -0
- package/stories/Sheet.stories.tsx +59 -0
- package/stories/Slider.stories.tsx +24 -0
- package/stories/StatusCard.stories.tsx +30 -0
- package/stories/StatusUpdateTimeline.stories.tsx +77 -0
- package/stories/StrategyConfigCard.stories.tsx +57 -0
- package/stories/SubscribeButton.stories.tsx +27 -0
- package/stories/Table.stories.tsx +56 -0
- package/stories/Tabs.stories.tsx +40 -0
- package/stories/TerminalFeed.stories.tsx +47 -0
- package/stories/Textarea.stories.tsx +25 -0
- package/stories/ThemeProvider.stories.tsx +38 -0
- package/stories/Toast.stories.tsx +32 -0
- package/stories/Toggle.stories.tsx +43 -0
- package/stories/Tooltip.stories.tsx +20 -0
- package/stories/UserMenu.stories.tsx +35 -0
- package/tailwind.config.js +74 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Toggle } from "../src/components/Toggle";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Toggle> = {
|
|
6
|
+
title: "Components/Inputs/Toggle",
|
|
7
|
+
component: Toggle,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof Toggle>;
|
|
13
|
+
|
|
14
|
+
const InteractiveToggle = () => {
|
|
15
|
+
const [checked, setChecked] = useState(false);
|
|
16
|
+
return (
|
|
17
|
+
<div className="flex items-center gap-3">
|
|
18
|
+
<Toggle
|
|
19
|
+
checked={checked}
|
|
20
|
+
onCheckedChange={setChecked}
|
|
21
|
+
aria-label="Enable feature"
|
|
22
|
+
/>
|
|
23
|
+
<span className="text-sm">{checked ? "Enabled" : "Disabled"}</span>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Interactive: Story = {
|
|
29
|
+
render: () => <InteractiveToggle />,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Disabled: Story = {
|
|
33
|
+
render: () => (
|
|
34
|
+
<Toggle
|
|
35
|
+
checked
|
|
36
|
+
disabled
|
|
37
|
+
onCheckedChange={() => {
|
|
38
|
+
/* readonly */
|
|
39
|
+
}}
|
|
40
|
+
aria-label="Read-only toggle"
|
|
41
|
+
/>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Tooltip } from "../src/components/Tooltip";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Tooltip> = {
|
|
5
|
+
title: "Components/Overlays/Tooltip",
|
|
6
|
+
component: Tooltip,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof Tooltip>;
|
|
12
|
+
|
|
13
|
+
export const Hover: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<div className="flex items-center gap-2">
|
|
16
|
+
<span className="text-sm">Probe interval</span>
|
|
17
|
+
<Tooltip content="How frequently this check runs against its target." />
|
|
18
|
+
</div>
|
|
19
|
+
),
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { LogOut, Settings } from "lucide-react";
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuItem,
|
|
5
|
+
DropdownMenuLabel,
|
|
6
|
+
DropdownMenuSeparator,
|
|
7
|
+
} from "../src/components/Menu";
|
|
8
|
+
import { UserMenu } from "../src/components/UserMenu";
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof UserMenu> = {
|
|
11
|
+
title: "Components/Navigation/UserMenu",
|
|
12
|
+
component: UserMenu,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof UserMenu>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
user: { name: "Nico", email: "nico@example.com" },
|
|
22
|
+
},
|
|
23
|
+
render: (args) => (
|
|
24
|
+
<UserMenu {...args}>
|
|
25
|
+
<DropdownMenuLabel>{args.user.email}</DropdownMenuLabel>
|
|
26
|
+
<DropdownMenuItem icon={<Settings className="h-4 w-4" />}>
|
|
27
|
+
Settings
|
|
28
|
+
</DropdownMenuItem>
|
|
29
|
+
<DropdownMenuSeparator />
|
|
30
|
+
<DropdownMenuItem icon={<LogOut className="h-4 w-4" />}>
|
|
31
|
+
Sign out
|
|
32
|
+
</DropdownMenuItem>
|
|
33
|
+
</UserMenu>
|
|
34
|
+
),
|
|
35
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import tailwindcssAnimate from "tailwindcss-animate";
|
|
2
|
+
|
|
3
|
+
/** @type {import('tailwindcss').Config} */
|
|
4
|
+
export default {
|
|
5
|
+
darkMode: ["class"],
|
|
6
|
+
content: [
|
|
7
|
+
"./src/**/*.{js,ts,jsx,tsx,mdx}",
|
|
8
|
+
"./.storybook/**/*.{js,ts,jsx,tsx,mdx,html}",
|
|
9
|
+
],
|
|
10
|
+
theme: {
|
|
11
|
+
extend: {
|
|
12
|
+
colors: {
|
|
13
|
+
border: "hsl(var(--border))",
|
|
14
|
+
input: "hsl(var(--input))",
|
|
15
|
+
ring: "hsl(var(--ring))",
|
|
16
|
+
background: "hsl(var(--background))",
|
|
17
|
+
foreground: "hsl(var(--foreground))",
|
|
18
|
+
primary: {
|
|
19
|
+
DEFAULT: "hsl(var(--primary))",
|
|
20
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
21
|
+
},
|
|
22
|
+
secondary: {
|
|
23
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
24
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
25
|
+
},
|
|
26
|
+
destructive: {
|
|
27
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
28
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
29
|
+
},
|
|
30
|
+
muted: {
|
|
31
|
+
DEFAULT: "hsl(var(--muted))",
|
|
32
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
33
|
+
},
|
|
34
|
+
accent: {
|
|
35
|
+
DEFAULT: "hsl(var(--accent))",
|
|
36
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
37
|
+
},
|
|
38
|
+
popover: {
|
|
39
|
+
DEFAULT: "hsl(var(--popover))",
|
|
40
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
41
|
+
},
|
|
42
|
+
card: {
|
|
43
|
+
DEFAULT: "hsl(var(--card))",
|
|
44
|
+
foreground: "hsl(var(--card-foreground))",
|
|
45
|
+
},
|
|
46
|
+
chart: {
|
|
47
|
+
1: "hsl(var(--chart-1))",
|
|
48
|
+
2: "hsl(var(--chart-2))",
|
|
49
|
+
3: "hsl(var(--chart-3))",
|
|
50
|
+
4: "hsl(var(--chart-4))",
|
|
51
|
+
5: "hsl(var(--chart-5))",
|
|
52
|
+
},
|
|
53
|
+
success: {
|
|
54
|
+
DEFAULT: "hsl(var(--success))",
|
|
55
|
+
foreground: "hsl(var(--success-foreground))",
|
|
56
|
+
},
|
|
57
|
+
warning: {
|
|
58
|
+
DEFAULT: "hsl(var(--warning))",
|
|
59
|
+
foreground: "hsl(var(--warning-foreground))",
|
|
60
|
+
},
|
|
61
|
+
info: {
|
|
62
|
+
DEFAULT: "hsl(var(--info))",
|
|
63
|
+
foreground: "hsl(var(--info-foreground))",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
borderRadius: {
|
|
67
|
+
lg: "var(--radius)",
|
|
68
|
+
md: "calc(var(--radius) - 2px)",
|
|
69
|
+
sm: "calc(var(--radius) - 4px)",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
plugins: [tailwindcssAnimate],
|
|
74
|
+
};
|