@peerbots/core 0.2.6 → 1.0.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/.changeset/config.json +1 -1
- package/.github/workflows/storybook.yml +9 -1
- package/CHANGELOG.md +94 -0
- package/dist/index.d.mts +643 -131
- package/dist/index.d.ts +643 -131
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
- package/src/charts/DistributionBarChart.tsx +10 -4
- package/src/charts/DistributionHistogram.tsx +13 -5
- package/src/charts/LineGraph.stories.tsx +60 -0
- package/src/charts/LineGraph.tsx +216 -0
- package/src/charts/index.ts +2 -0
- package/src/docs/DesignSystem.mdx +241 -25
- package/src/styles/theme.css +8 -0
- package/src/ui/feedback/Alert.stories.tsx +56 -0
- package/src/ui/feedback/Alert.tsx +168 -0
- package/src/ui/{Dialog.stories.tsx → feedback/Dialog.stories.tsx} +2 -2
- package/src/ui/{Dialog.tsx → feedback/Dialog.tsx} +2 -2
- package/src/ui/feedback/EmptyState.stories.tsx +57 -0
- package/src/ui/feedback/EmptyState.tsx +123 -0
- package/src/ui/feedback/Popover.stories.tsx +130 -0
- package/src/ui/feedback/Popover.tsx +135 -0
- package/src/ui/feedback/Skeleton.stories.tsx +88 -0
- package/src/ui/{Skeleton.tsx → feedback/Skeleton.tsx} +2 -2
- package/src/ui/feedback/Spinner.stories.tsx +77 -0
- package/src/ui/feedback/Spinner.tsx +62 -0
- package/src/ui/{Tooltip.stories.tsx → feedback/Tooltip.stories.tsx} +3 -3
- package/src/ui/{Tooltip.tsx → feedback/Tooltip.tsx} +2 -2
- package/src/ui/feedback/index.ts +7 -0
- package/src/ui/forms/Button.stories.tsx +181 -0
- package/src/ui/forms/Button.tsx +323 -0
- package/src/ui/{Checkbox.stories.tsx → forms/Checkbox.stories.tsx} +2 -2
- package/src/ui/{Checkbox.tsx → forms/Checkbox.tsx} +2 -2
- package/src/ui/forms/ChipGroup.stories.tsx +118 -0
- package/src/ui/forms/ChipGroup.tsx +239 -0
- package/src/ui/{Dropdown.tsx → forms/Dropdown.tsx} +1 -1
- package/src/ui/{Field.stories.tsx → forms/Field.stories.tsx} +3 -3
- package/src/ui/{Field.tsx → forms/Field.tsx} +1 -1
- package/src/ui/{Input.stories.tsx → forms/Input.stories.tsx} +6 -6
- package/src/ui/{Input.tsx → forms/Input.tsx} +1 -1
- package/src/ui/{Label.stories.tsx → forms/Label.stories.tsx} +2 -2
- package/src/ui/{Label.tsx → forms/Label.tsx} +2 -2
- package/src/ui/{NumberField.stories.tsx → forms/NumberField.stories.tsx} +2 -2
- package/src/ui/{NumberField.tsx → forms/NumberField.tsx} +8 -9
- package/src/ui/forms/PeerbotsColorSelector.stories.tsx +49 -0
- package/src/ui/forms/PeerbotsColorSelector.tsx +100 -0
- package/src/ui/{Select.stories.tsx → forms/Select.stories.tsx} +2 -2
- package/src/ui/{Select.tsx → forms/Select.tsx} +5 -3
- package/src/ui/{Slider.stories.tsx → forms/Slider.stories.tsx} +6 -4
- package/src/ui/{Slider.tsx → forms/Slider.tsx} +7 -3
- package/src/ui/forms/SliderWithNumberField.stories.tsx +136 -0
- package/src/ui/{SliderWithNumberField.tsx → forms/SliderWithNumberField.tsx} +19 -7
- package/src/ui/{Switch.stories.tsx → forms/Switch.stories.tsx} +2 -2
- package/src/ui/{Switch.tsx → forms/Switch.tsx} +1 -1
- package/src/ui/{TabRadio.stories.tsx → forms/TabRadio.stories.tsx} +3 -3
- package/src/ui/{TabRadio.tsx → forms/TabRadio.tsx} +1 -1
- package/src/ui/{TextArea.stories.tsx → forms/TextArea.stories.tsx} +5 -3
- package/src/ui/{TextArea.tsx → forms/TextArea.tsx} +1 -1
- package/src/ui/forms/index.ts +15 -0
- package/src/ui/foundations/Anchor.stories.tsx +39 -0
- package/src/ui/foundations/Anchor.tsx +96 -0
- package/src/ui/foundations/CodeBlock.stories.tsx +86 -0
- package/src/ui/foundations/CodeBlock.tsx +148 -0
- package/src/ui/foundations/Colors.stories.tsx +80 -0
- package/src/ui/{Icon.stories.tsx → foundations/Icon.stories.tsx} +1 -1
- package/src/ui/{Icon.tsx → foundations/Icon.tsx} +1 -1
- package/src/ui/{IconRegistry.tsx → foundations/IconRegistry.tsx} +261 -57
- package/src/ui/foundations/SocialLinks.stories.tsx +38 -0
- package/src/ui/foundations/SocialLinks.tsx +117 -0
- package/src/ui/foundations/Typography.stories.tsx +58 -0
- package/src/ui/foundations/Typography.tsx +163 -0
- package/src/ui/foundations/index.ts +6 -0
- package/src/ui/index.ts +7 -27
- package/src/ui/layout/Accordion.stories.tsx +86 -0
- package/src/ui/layout/Accordion.tsx +205 -0
- package/src/ui/layout/Card.stories.tsx +151 -0
- package/src/ui/layout/Card.tsx +124 -0
- package/src/ui/layout/Collapsible.stories.tsx +54 -0
- package/src/ui/layout/Collapsible.tsx +54 -0
- package/src/ui/{Separator.stories.tsx → layout/Separator.stories.tsx} +2 -2
- package/src/ui/{Separator.tsx → layout/Separator.tsx} +1 -1
- package/src/ui/{SettingsPanel.stories.tsx → layout/SettingsPanel.stories.tsx} +5 -5
- package/src/ui/{SettingsPanel.tsx → layout/SettingsPanel.tsx} +33 -29
- package/src/ui/layout/index.ts +5 -0
- package/src/ui/media/Avatar.stories.tsx +89 -0
- package/src/ui/media/Avatar.tsx +122 -0
- package/src/ui/media/Dropzone.stories.tsx +95 -0
- package/src/ui/media/Dropzone.tsx +328 -0
- package/src/ui/media/FileUpload.stories.tsx +62 -0
- package/src/ui/media/FileUpload.tsx +175 -0
- package/src/ui/media/index.ts +3 -0
- package/src/ui/{AuthFormUI.stories.tsx → patterns/AuthFormUI.stories.tsx} +1 -1
- package/src/ui/{AuthFormUI.tsx → patterns/AuthFormUI.tsx} +24 -23
- package/src/ui/patterns/CopyButton.stories.tsx +77 -0
- package/src/ui/patterns/CopyButton.tsx +93 -0
- package/src/ui/patterns/SearchInput.stories.tsx +51 -0
- package/src/ui/patterns/SearchInput.tsx +93 -0
- package/src/ui/patterns/Stepper.stories.tsx +129 -0
- package/src/ui/patterns/Stepper.tsx +295 -0
- package/src/ui/{TabSelection.stories.tsx → patterns/TabSelection.stories.tsx} +1 -1
- package/src/ui/{TabSelection.tsx → patterns/TabSelection.tsx} +2 -2
- package/src/ui/patterns/index.ts +6 -0
- package/src/ui/patterns/useClipboard.ts +75 -0
- package/src/ui/types.ts +48 -0
- package/src/ui/Alert.stories.tsx +0 -41
- package/src/ui/Alert.tsx +0 -72
- package/src/ui/Anchor.stories.tsx +0 -25
- package/src/ui/Anchor.tsx +0 -32
- package/src/ui/Button.stories.tsx +0 -108
- package/src/ui/Button.tsx +0 -121
- package/src/ui/Collapsible.stories.tsx +0 -91
- package/src/ui/Collapsible.tsx +0 -52
- package/src/ui/Colors.stories.tsx +0 -67
- package/src/ui/Popover.tsx +0 -42
- package/src/ui/Skeleton.stories.tsx +0 -43
- package/src/ui/SliderWithNumberField.stories.tsx +0 -101
- package/src/ui/Typography.stories.tsx +0 -87
- package/src/ui/Typography.tsx +0 -80
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Heading, Text } from "./Typography";
|
|
3
|
-
|
|
4
|
-
const meta: Meta = {
|
|
5
|
-
title: "UI/Typography",
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default meta;
|
|
10
|
-
|
|
11
|
-
export const Default: StoryObj = {
|
|
12
|
-
render: () => (
|
|
13
|
-
<div className="pb:space-y-4 pb:max-w-lg">
|
|
14
|
-
<Heading level={2}>Core Typography</Heading>
|
|
15
|
-
<Text>
|
|
16
|
-
The quick brown fox jumps over the lazy dog. This is our standard body
|
|
17
|
-
text used across the application.
|
|
18
|
-
</Text>
|
|
19
|
-
</div>
|
|
20
|
-
),
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Variations: StoryObj = {
|
|
24
|
-
render: () => (
|
|
25
|
-
<div className="pb:flex pb:flex-col pb:gap-12 pb:p-4">
|
|
26
|
-
<div className="pb:space-y-4">
|
|
27
|
-
<Heading
|
|
28
|
-
level={4}
|
|
29
|
-
className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1"
|
|
30
|
-
>
|
|
31
|
-
Headings
|
|
32
|
-
</Heading>
|
|
33
|
-
<div className="pb:space-y-4">
|
|
34
|
-
<Heading level={1}>Heading 1</Heading>
|
|
35
|
-
<Heading level={2}>Heading 2</Heading>
|
|
36
|
-
<Heading level={3}>Heading 3</Heading>
|
|
37
|
-
<Heading level={4}>Heading 4</Heading>
|
|
38
|
-
<Heading level={5}>Heading 5</Heading>
|
|
39
|
-
<Heading level={6}>Heading 6</Heading>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div className="pb:space-y-4">
|
|
44
|
-
<Heading
|
|
45
|
-
level={4}
|
|
46
|
-
className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1"
|
|
47
|
-
>
|
|
48
|
-
Text Variants
|
|
49
|
-
</Heading>
|
|
50
|
-
<div className="pb:space-y-4">
|
|
51
|
-
<div className="pb:space-y-1">
|
|
52
|
-
<Text variant="small" className="pb:italic pb:font-bold">
|
|
53
|
-
Default
|
|
54
|
-
</Text>
|
|
55
|
-
<Text variant="default">
|
|
56
|
-
The quick brown fox jumps over the lazy dog.
|
|
57
|
-
</Text>
|
|
58
|
-
</div>
|
|
59
|
-
<div className="pb:space-y-1">
|
|
60
|
-
<Text variant="small" className="pb:italic pb:font-bold">
|
|
61
|
-
Small
|
|
62
|
-
</Text>
|
|
63
|
-
<Text variant="small">
|
|
64
|
-
The quick brown fox jumps over the lazy dog.
|
|
65
|
-
</Text>
|
|
66
|
-
</div>
|
|
67
|
-
<div className="pb:space-y-1">
|
|
68
|
-
<Text variant="small" className="pb:italic pb:font-bold">
|
|
69
|
-
Muted
|
|
70
|
-
</Text>
|
|
71
|
-
<Text variant="muted">
|
|
72
|
-
The quick brown fox jumps over the lazy dog.
|
|
73
|
-
</Text>
|
|
74
|
-
</div>
|
|
75
|
-
<div className="pb:space-y-1">
|
|
76
|
-
<Text variant="small" className="pb:italic pb:font-bold">
|
|
77
|
-
Error
|
|
78
|
-
</Text>
|
|
79
|
-
<Text variant="error">
|
|
80
|
-
The quick brown fox jumps over the lazy dog.
|
|
81
|
-
</Text>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
),
|
|
87
|
-
};
|
package/src/ui/Typography.tsx
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { clsx, type ClassValue } from "clsx";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
|
|
5
|
-
function cn(...inputs: ClassValue[]) {
|
|
6
|
-
return twMerge(clsx(inputs));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const headingSizes = {
|
|
10
|
-
1: "pb:text-4xl pb:font-bold",
|
|
11
|
-
2: "pb:text-3xl pb:font-bold",
|
|
12
|
-
3: "pb:text-2xl pb:font-bold",
|
|
13
|
-
4: "pb:text-xl pb:font-bold",
|
|
14
|
-
5: "pb:text-lg pb:font-bold",
|
|
15
|
-
6: "pb:text-base pb:font-bold",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const textVariants = {
|
|
19
|
-
default: "pb:text-base pb:text-slate-950",
|
|
20
|
-
muted: "pb:text-sm pb:text-slate-600",
|
|
21
|
-
error: "pb:text-sm pb:text-red-600 pb:font-medium",
|
|
22
|
-
small: "pb:text-xs pb:text-slate-600",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
26
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const Heading = ({
|
|
31
|
-
level = 1,
|
|
32
|
-
className,
|
|
33
|
-
children,
|
|
34
|
-
...props
|
|
35
|
-
}: HeadingProps) => {
|
|
36
|
-
return React.createElement(
|
|
37
|
-
`h${level}`,
|
|
38
|
-
{ className: cn(headingSizes[level], className), ...props },
|
|
39
|
-
children,
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
44
|
-
variant?: "default" | "muted" | "error" | "small";
|
|
45
|
-
as?: React.ElementType;
|
|
46
|
-
children?: React.ReactNode;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const Text = ({
|
|
50
|
-
variant = "default",
|
|
51
|
-
as: Component = "p",
|
|
52
|
-
className,
|
|
53
|
-
children,
|
|
54
|
-
...props
|
|
55
|
-
}: TextProps) => {
|
|
56
|
-
return React.createElement(
|
|
57
|
-
Component,
|
|
58
|
-
{ className: cn(textVariants[variant], className), ...props },
|
|
59
|
-
children,
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const TypographyList = ({ args }: { args: Record<string, unknown> }) => {
|
|
64
|
-
return (
|
|
65
|
-
<div
|
|
66
|
-
className="pb:space-y-4"
|
|
67
|
-
{...(args as React.HTMLAttributes<HTMLDivElement>)}
|
|
68
|
-
>
|
|
69
|
-
<Heading level={1}>Heading 1</Heading>
|
|
70
|
-
<Heading level={2}>Heading 2</Heading>
|
|
71
|
-
<Heading level={3}>Heading 3</Heading>
|
|
72
|
-
<Text>Body text</Text>
|
|
73
|
-
<Text variant="muted">Caption text</Text>
|
|
74
|
-
<Text variant="small">Small text</Text>
|
|
75
|
-
<Text variant="small" as="span">
|
|
76
|
-
Small span text
|
|
77
|
-
</Text>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
};
|