@kinetixui/ui 0.11.0 → 0.12.0
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/index.d.ts +344 -1
- package/dist/index.js +1705 -2
- package/package.json +5 -2
- package/src/components/color-picker.tsx +352 -0
- package/src/components/data-grid.tsx +304 -0
- package/src/components/diff-viewer.tsx +155 -0
- package/src/components/json-viewer.tsx +168 -0
- package/src/components/kanban-board.tsx +246 -0
- package/src/components/markdown-editor.tsx +288 -0
- package/src/components/message-bubble.tsx +83 -0
- package/src/components/multi-select.tsx +134 -0
- package/src/components/notification-center.tsx +119 -0
- package/src/components/tour.tsx +156 -0
- package/src/components/tree-view.tsx +273 -0
- package/src/components/virtual-list.tsx +92 -0
- package/src/index.ts +20 -0
- package/src/stories/ColorPicker.stories.tsx +28 -0
- package/src/stories/DataGrid.stories.tsx +54 -0
- package/src/stories/DiffViewer.stories.tsx +26 -0
- package/src/stories/JsonViewer.stories.tsx +31 -0
- package/src/stories/KanbanBoard.stories.tsx +44 -0
- package/src/stories/MarkdownEditor.stories.tsx +25 -0
- package/src/stories/MessageBubble.stories.tsx +32 -0
- package/src/stories/MultiSelect.stories.tsx +35 -0
- package/src/stories/NotificationCenter.stories.tsx +41 -0
- package/src/stories/Tour.stories.tsx +70 -0
- package/src/stories/TreeView.stories.tsx +38 -0
- package/src/stories/VirtualList.stories.tsx +36 -0
- package/tailwind.config.ts +2 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { ColorPicker, DiffViewer, JsonViewer, KanbanBoard, Progress } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => {
|
|
8
|
+
const [columns, setColumns] = React.useState<KanbanColumn[]>([
|
|
9
|
+
{
|
|
10
|
+
id: "todo",
|
|
11
|
+
title: "To Do",
|
|
12
|
+
cards: [
|
|
13
|
+
{ id: "1", content: "Design the onboarding flow" },
|
|
14
|
+
{ id: "2", content: "Write API docs for /r/registry.json" },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "in-progress",
|
|
19
|
+
title: "In Progress",
|
|
20
|
+
cards: [{ id: "3", content: "Port ColorPicker to Compose" }],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "done",
|
|
24
|
+
title: "Done",
|
|
25
|
+
cards: [
|
|
26
|
+
{ id: "4", content: "Ship DiffViewer" },
|
|
27
|
+
{ id: "5", content: "Ship JsonViewer" },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
31
|
+
return <KanbanBoard columns={columns} onColumnsChange={setColumns} className="w-full" />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const meta = {
|
|
35
|
+
title: "Data Display/KanbanBoard",
|
|
36
|
+
parameters: {
|
|
37
|
+
layout: "padded",
|
|
38
|
+
docs: { source: { code: "<KanbanBoard\\n columns={columns}\\n onColumnsChange={setColumns}\\n/>", language: "tsx" } },
|
|
39
|
+
},
|
|
40
|
+
} satisfies Meta;
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
|
|
44
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { MarkdownEditor } from "@kinetixui/ui";
|
|
6
|
+
import { Bold } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
const Demo = () => {
|
|
9
|
+
const [text, setText] = React.useState(
|
|
10
|
+
"## Release notes\n\nShipped **MarkdownEditor** — a toolbar over a plain textarea, not `contenteditable`.\n\n- Bold, italic, links\n- Bulleted and numbered lists\n- An optional preview pane",
|
|
11
|
+
);
|
|
12
|
+
return <MarkdownEditor className="w-full" value={text} onChange={setText} rows={8} />;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const meta = {
|
|
16
|
+
title: "Form Inputs/MarkdownEditor",
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: "padded",
|
|
19
|
+
docs: { source: { code: "<MarkdownEditor\\n value={text}\\n onChange={setText}\\n rows={8}\\n/>", language: "tsx" } },
|
|
20
|
+
},
|
|
21
|
+
} satisfies Meta;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { MessageBubble, TypingIndicator } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<div className="flex w-full max-w-sm flex-col gap-1.5">
|
|
9
|
+
<MessageBubble variant="received" timestamp="10:42 AM">
|
|
10
|
+
Hey, are we still on for tomorrow?
|
|
11
|
+
</MessageBubble>
|
|
12
|
+
<MessageBubble variant="sent" timestamp="10:43 AM" status="read">
|
|
13
|
+
Yep! See you at 3.
|
|
14
|
+
</MessageBubble>
|
|
15
|
+
<MessageBubble variant="sent" grouped status="delivered">
|
|
16
|
+
I’ll bring the slides.
|
|
17
|
+
</MessageBubble>
|
|
18
|
+
<TypingIndicator className="mt-1" />
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const meta = {
|
|
23
|
+
title: "Data Display/MessageBubble",
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: "centered",
|
|
26
|
+
docs: { source: { code: "<MessageBubble variant=\"received\" timestamp=\"10:42 AM\">\\n Hey, are we still on for tomorrow?\\n</MessageBubble>\\n<MessageBubble variant=\"sent\" timestamp=\"10:43 AM\" status=\"read\">\\n Yep! See you at 3.\\n</MessageBubble>\\n<TypingIndicator />", language: "tsx" } },
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
|
|
32
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { MultiSelect, Select } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => {
|
|
8
|
+
const [value, setValue] = React.useState(["react", "swiftui"]);
|
|
9
|
+
return (
|
|
10
|
+
<MultiSelect
|
|
11
|
+
className="w-full max-w-sm"
|
|
12
|
+
value={value}
|
|
13
|
+
onValueChange={setValue}
|
|
14
|
+
placeholder="Select platforms…"
|
|
15
|
+
options={[
|
|
16
|
+
{ value: "react", label: "React" },
|
|
17
|
+
{ value: "swiftui", label: "SwiftUI" },
|
|
18
|
+
{ value: "compose", label: "Jetpack Compose" },
|
|
19
|
+
{ value: "flutter", label: "Flutter" },
|
|
20
|
+
]}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const meta = {
|
|
26
|
+
title: "Form Inputs/MultiSelect",
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: "centered",
|
|
29
|
+
docs: { source: { code: "<MultiSelect\\n value={value}\\n onValueChange={setValue}\\n placeholder=\"Select platforms…\"\\n options={[\\n { value: \"react\", label: \"React\" },\\n { value: \"swiftui\", label: \"SwiftUI\" },\\n ]}\\n/>", language: "tsx" } },
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { NotificationCenter, NotificationCenterContent, NotificationCenterTrigger, NotificationItem, PageHeader } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => {
|
|
8
|
+
const [unread, setUnread] = React.useState(2);
|
|
9
|
+
return (
|
|
10
|
+
<NotificationCenter>
|
|
11
|
+
<NotificationCenterTrigger unreadCount={unread} />
|
|
12
|
+
<NotificationCenterContent onMarkAllRead={() => setUnread(0)}>
|
|
13
|
+
<NotificationItem
|
|
14
|
+
unread={unread > 0}
|
|
15
|
+
title="PR #106 merged"
|
|
16
|
+
description="feat(ui): add PageHeader"
|
|
17
|
+
time="2m ago"
|
|
18
|
+
/>
|
|
19
|
+
<NotificationItem
|
|
20
|
+
unread={unread > 1}
|
|
21
|
+
title="Deploy succeeded"
|
|
22
|
+
description="v0.11.0 is live"
|
|
23
|
+
time="1h ago"
|
|
24
|
+
/>
|
|
25
|
+
<NotificationItem title="Welcome to KinetixUI" time="2d ago" />
|
|
26
|
+
</NotificationCenterContent>
|
|
27
|
+
</NotificationCenter>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const meta = {
|
|
32
|
+
title: "Overlays/NotificationCenter",
|
|
33
|
+
parameters: {
|
|
34
|
+
layout: "centered",
|
|
35
|
+
docs: { source: { code: "<NotificationCenter>\\n <NotificationCenterTrigger unreadCount={2} />\\n <NotificationCenterContent onMarkAllRead={markAllRead}>\\n <NotificationItem unread title=\"PR #106 merged\" time=\"2m ago\" />\\n <NotificationItem title=\"Welcome to KinetixUI\" time=\"2d ago\" />\\n </NotificationCenterContent>\\n</NotificationCenter>", language: "tsx" } },
|
|
36
|
+
},
|
|
37
|
+
} satisfies Meta;
|
|
38
|
+
|
|
39
|
+
export default meta;
|
|
40
|
+
|
|
41
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { Button, Tour } from "@kinetixui/ui";
|
|
6
|
+
import { Settings } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
const Demo = () => {
|
|
9
|
+
const [open, setOpen] = React.useState(false);
|
|
10
|
+
const [stepIndex, setStepIndex] = React.useState(0);
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex w-full flex-col items-start gap-4">
|
|
13
|
+
<Button
|
|
14
|
+
size="sm"
|
|
15
|
+
onClick={() => {
|
|
16
|
+
setStepIndex(0);
|
|
17
|
+
setOpen(true);
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
Start tour
|
|
21
|
+
</Button>
|
|
22
|
+
<div className="flex items-center gap-3">
|
|
23
|
+
<Button data-tour-demo="save" variant="Outline" size="sm">
|
|
24
|
+
Save
|
|
25
|
+
</Button>
|
|
26
|
+
<Button data-tour-demo="share" variant="Outline" size="sm">
|
|
27
|
+
Share
|
|
28
|
+
</Button>
|
|
29
|
+
<Button data-tour-demo="settings" variant="Ghost" size="icon" aria-label="Settings">
|
|
30
|
+
<Settings className="size-4" />
|
|
31
|
+
</Button>
|
|
32
|
+
</div>
|
|
33
|
+
<Tour
|
|
34
|
+
open={open}
|
|
35
|
+
onOpenChange={setOpen}
|
|
36
|
+
stepIndex={stepIndex}
|
|
37
|
+
onStepIndexChange={setStepIndex}
|
|
38
|
+
steps={[
|
|
39
|
+
{
|
|
40
|
+
target: '[data-tour-demo="save"]',
|
|
41
|
+
title: "Save your work",
|
|
42
|
+
content: "Changes save automatically, but you can force a save here.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
target: '[data-tour-demo="share"]',
|
|
46
|
+
title: "Invite others",
|
|
47
|
+
content: "Share this project with your team.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
target: '[data-tour-demo="settings"]',
|
|
51
|
+
title: "Fine-tune settings",
|
|
52
|
+
content: "Adjust preferences for this workspace.",
|
|
53
|
+
},
|
|
54
|
+
]}
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const meta = {
|
|
61
|
+
title: "Overlays/Tour",
|
|
62
|
+
parameters: {
|
|
63
|
+
layout: "centered",
|
|
64
|
+
docs: { source: { code: "<Tour\\n open={open}\\n onOpenChange={setOpen}\\n stepIndex={stepIndex}\\n onStepIndexChange={setStepIndex}\\n steps={[\\n { target: '[data-tour=\"save\"]', title: \"Save your work\", content: \"…\" },\\n { target: '[data-tour=\"share\"]', title: \"Invite others\", content: \"…\" },\\n ]}\\n/>", language: "tsx" } },
|
|
65
|
+
},
|
|
66
|
+
} satisfies Meta;
|
|
67
|
+
|
|
68
|
+
export default meta;
|
|
69
|
+
|
|
70
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { TreeItem, TreeView } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => {
|
|
8
|
+
const [selected, setSelected] = React.useState("button.tsx");
|
|
9
|
+
return (
|
|
10
|
+
<TreeView
|
|
11
|
+
className="w-full max-w-xs"
|
|
12
|
+
selected={selected}
|
|
13
|
+
onSelectedChange={setSelected}
|
|
14
|
+
defaultExpanded={["src", "src/components"]}
|
|
15
|
+
>
|
|
16
|
+
<TreeItem value="src" label="src">
|
|
17
|
+
<TreeItem value="src/components" label="components">
|
|
18
|
+
<TreeItem value="button.tsx" label="button.tsx" />
|
|
19
|
+
<TreeItem value="badge.tsx" label="badge.tsx" />
|
|
20
|
+
</TreeItem>
|
|
21
|
+
<TreeItem value="index.ts" label="index.ts" />
|
|
22
|
+
</TreeItem>
|
|
23
|
+
<TreeItem value="readme" label="README.md" />
|
|
24
|
+
</TreeView>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const meta = {
|
|
29
|
+
title: "Navigation/TreeView",
|
|
30
|
+
parameters: {
|
|
31
|
+
layout: "centered",
|
|
32
|
+
docs: { source: { code: "<TreeView selected={selected} onSelectedChange={setSelected} defaultExpanded={[\"src\"]}>\\n <TreeItem value=\"src\" label=\"src\">\\n <TreeItem value=\"index.ts\" label=\"index.ts\" />\\n </TreeItem>\\n <TreeItem value=\"readme\" label=\"README.md\" />\\n</TreeView>", language: "tsx" } },
|
|
33
|
+
},
|
|
34
|
+
} satisfies Meta;
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
|
|
38
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { VirtualList } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => {
|
|
8
|
+
const rows = React.useMemo(
|
|
9
|
+
() => Array.from({ length: 10000 }, (_, i) => ({ id: i, label: `Row ${i + 1}` })),
|
|
10
|
+
[],
|
|
11
|
+
);
|
|
12
|
+
return (
|
|
13
|
+
<VirtualList
|
|
14
|
+
className="w-full max-w-sm rounded-md border"
|
|
15
|
+
items={rows}
|
|
16
|
+
itemHeight={36}
|
|
17
|
+
height={280}
|
|
18
|
+
getItemKey={(row) => row.id}
|
|
19
|
+
renderItem={(row) => (
|
|
20
|
+
<div className="flex h-full items-center border-b px-3 text-sm">{row.label}</div>
|
|
21
|
+
)}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const meta = {
|
|
27
|
+
title: "Data Display/VirtualList",
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: "centered",
|
|
30
|
+
docs: { source: { code: "const rows = Array.from({ length: 10000 }, (_, i) => ({ id: i, label: \\`Row \\${i + 1}\\` }));\\n\\n<VirtualList\\n items={rows}\\n itemHeight={36}\\n height={280}\\n getItemKey={(row) => row.id}\\n renderItem={(row) => <div>{row.label}</div>}\\n/>", language: "tsx" } },
|
|
31
|
+
},
|
|
32
|
+
} satisfies Meta;
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
|
|
36
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
package/tailwind.config.ts
CHANGED
|
@@ -128,12 +128,14 @@ export default {
|
|
|
128
128
|
"accordion-up": { from: { height: "var(--radix-accordion-content-height)" }, to: { height: "0" } },
|
|
129
129
|
"caret-blink": { "0%,70%,100%": { opacity: "1" }, "20%,50%": { opacity: "0" } },
|
|
130
130
|
marquee: { from: { transform: "translateX(0)" }, to: { transform: "translateX(-50%)" } },
|
|
131
|
+
"typing-dot": { "0%,60%,100%": { transform: "translateY(0)", opacity: "0.4" }, "30%": { transform: "translateY(-3px)", opacity: "1" } },
|
|
131
132
|
},
|
|
132
133
|
animation: {
|
|
133
134
|
"accordion-down": "accordion-down 0.2s ease-out",
|
|
134
135
|
"accordion-up": "accordion-up 0.2s ease-out",
|
|
135
136
|
"caret-blink": "caret-blink 1.25s ease-out infinite",
|
|
136
137
|
marquee: "marquee var(--marquee-duration, 32s) linear infinite",
|
|
138
|
+
"typing-dot": "typing-dot 1.2s ease-in-out infinite",
|
|
137
139
|
},
|
|
138
140
|
},
|
|
139
141
|
},
|