@peerbots/core 0.2.4 → 0.2.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.
- package/.changeset/config.json +1 -1
- package/CHANGELOG.md +12 -0
- package/package.json +2 -1
- package/src/styles/theme.css +1 -0
- package/src/ui/index.ts +0 -1
- package/src/ui/BasePanel.stories.tsx +0 -36
- package/src/ui/BasePanel.tsx +0 -59
package/.changeset/config.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @peerbots/core
|
|
2
2
|
|
|
3
|
+
## 0.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e8744e4`](https://github.com/PEERbots/peerbots-core/commit/e8744e47d7a64bdf61b6dfcc23311b940e390b3d) Thanks [@sbeleidy](https://github.com/sbeleidy)! - Remove BasePanel since it's more of a peerbots-controller component
|
|
8
|
+
|
|
9
|
+
## 0.2.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`6df88bf`](https://github.com/PEERbots/peerbots-core/commit/6df88bf7a04905024cb6d9cbc1b6505ce3872385) Thanks [@sbeleidy](https://github.com/sbeleidy)! - Fix basepanel border
|
|
14
|
+
|
|
3
15
|
## 0.2.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.6",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"style": "./dist/index.css",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"victory": "^37.3.6"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
+
"@changesets/changelog-github": "^0.6.0",
|
|
60
61
|
"@changesets/cli": "^2.30.0",
|
|
61
62
|
"@chromatic-com/storybook": "^5.1.1",
|
|
62
63
|
"@storybook/addon-a11y": "^10.3.3",
|
package/src/styles/theme.css
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
--color-danger: #e86e8a;
|
|
12
12
|
--color-light-bg: #d8e7eb;
|
|
13
13
|
--sidebar-bg: #f9ffff;
|
|
14
|
+
--color-sidebar-bg: #f9ffff;
|
|
14
15
|
|
|
15
16
|
--background-image-gradient-radial: radial-gradient(var(--tw-gradient-stops));
|
|
16
17
|
--background-image-gradient-conic: conic-gradient(from 180deg at 50% 50%,
|
package/src/ui/index.ts
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { BasePanel } from "./BasePanel";
|
|
3
|
-
import { Text as UIText } from "./Typography";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "UI/BasePanel",
|
|
7
|
-
component: BasePanel,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
},
|
|
11
|
-
decorators: [
|
|
12
|
-
(Story) => (
|
|
13
|
-
<div className="pb:w-[450px] pb:border pb:border-gray-200 pb:rounded-lg pb:shadow-sm pb:bg-white pb:overflow-hidden pb:p-4">
|
|
14
|
-
<Story />
|
|
15
|
-
</div>
|
|
16
|
-
),
|
|
17
|
-
],
|
|
18
|
-
tags: ["autodocs"],
|
|
19
|
-
} satisfies Meta<typeof BasePanel>;
|
|
20
|
-
|
|
21
|
-
export default meta;
|
|
22
|
-
type Story = StoryObj<typeof meta>;
|
|
23
|
-
|
|
24
|
-
export const Default: Story = {
|
|
25
|
-
args: {
|
|
26
|
-
title: "Example Panel",
|
|
27
|
-
children: (
|
|
28
|
-
<UIText
|
|
29
|
-
variant="small"
|
|
30
|
-
className="pb:p-4 pb:bg-gray-50 pb:rounded-md pb:border pb:border-gray-100 pb:text-black pb:text-center"
|
|
31
|
-
>
|
|
32
|
-
Panel content goes here.
|
|
33
|
-
</UIText>
|
|
34
|
-
),
|
|
35
|
-
},
|
|
36
|
-
};
|
package/src/ui/BasePanel.tsx
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { Heading, Button, Icon } from "./";
|
|
3
|
-
|
|
4
|
-
export interface BasePanelProps {
|
|
5
|
-
title: string;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
onClose?: () => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
headerClassName?: string;
|
|
10
|
-
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
11
|
-
setPanel: (panel: string) => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function BasePanel({
|
|
15
|
-
title,
|
|
16
|
-
children,
|
|
17
|
-
onClose,
|
|
18
|
-
className = "",
|
|
19
|
-
headerClassName = "",
|
|
20
|
-
headingLevel = 2,
|
|
21
|
-
setPanel = (panel: string) => { }
|
|
22
|
-
}: BasePanelProps) {
|
|
23
|
-
|
|
24
|
-
const handleClose = () => {
|
|
25
|
-
if (onClose) {
|
|
26
|
-
onClose();
|
|
27
|
-
} else {
|
|
28
|
-
setPanel("None");
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div className={`pb:space-y-1 pb:p-1 ${className}`}>
|
|
34
|
-
<div
|
|
35
|
-
className={`pb:flex pb:items-center pb:justify-between pb:px-1 pb:mb-1 pb:border pb:border-solid pb:border-gray-400 pb:pb-1 ${headerClassName}`}
|
|
36
|
-
>
|
|
37
|
-
<Heading level={headingLevel} className="pb:text-lg">
|
|
38
|
-
{title}
|
|
39
|
-
</Heading>
|
|
40
|
-
<Button
|
|
41
|
-
variant="ghost"
|
|
42
|
-
size="sm"
|
|
43
|
-
onClick={handleClose}
|
|
44
|
-
className="pb:p-1 pb:rounded pb:hover:bg-gray-100 pb:h-auto"
|
|
45
|
-
aria-label={`Close ${title} Panel`}
|
|
46
|
-
>
|
|
47
|
-
<Icon size="md" className="pb:h-5 pb:w-5">
|
|
48
|
-
<path
|
|
49
|
-
strokeLinecap="round"
|
|
50
|
-
strokeLinejoin="round"
|
|
51
|
-
d="M6 18 18 6M6 6l12 12"
|
|
52
|
-
/>
|
|
53
|
-
</Icon>
|
|
54
|
-
</Button>
|
|
55
|
-
</div>
|
|
56
|
-
{children}
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|