@peerbots/core 0.1.2 → 0.2.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/CHANGELOG.md +14 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +11 -3
- package/src/charts/DistributionBarChart.tsx +2 -2
- package/src/charts/DistributionHistogram.tsx +2 -2
- package/src/docs/DesignSystem.mdx +46 -0
- package/src/styles/theme.css +13 -13
- package/src/ui/Alert.stories.tsx +1 -1
- package/src/ui/Alert.tsx +9 -9
- package/src/ui/Anchor.tsx +1 -1
- package/src/ui/AuthFormUI.stories.tsx +2 -2
- package/src/ui/AuthFormUI.tsx +28 -28
- package/src/ui/BasePanel.stories.tsx +2 -2
- package/src/ui/BasePanel.tsx +5 -5
- package/src/ui/Button.stories.tsx +16 -16
- package/src/ui/Button.tsx +17 -17
- package/src/ui/Checkbox.stories.tsx +6 -6
- package/src/ui/Checkbox.tsx +4 -4
- package/src/ui/Collapsible.stories.tsx +21 -21
- package/src/ui/Collapsible.tsx +3 -3
- package/src/ui/Colors.stories.tsx +23 -23
- package/src/ui/Dialog.stories.tsx +3 -3
- package/src/ui/Dialog.tsx +2 -2
- package/src/ui/Dropdown.tsx +3 -3
- package/src/ui/Field.stories.tsx +19 -19
- package/src/ui/Field.tsx +14 -14
- package/src/ui/Icon.stories.tsx +17 -17
- package/src/ui/Icon.tsx +5 -5
- package/src/ui/Input.stories.tsx +15 -15
- package/src/ui/Input.tsx +8 -8
- package/src/ui/Label.stories.tsx +6 -6
- package/src/ui/Label.tsx +2 -2
- package/src/ui/NumberField.stories.tsx +14 -14
- package/src/ui/NumberField.tsx +9 -9
- package/src/ui/Popover.tsx +2 -2
- package/src/ui/Select.stories.tsx +13 -13
- package/src/ui/Select.tsx +7 -7
- package/src/ui/Separator.stories.tsx +10 -10
- package/src/ui/Separator.tsx +2 -2
- package/src/ui/SettingsPanel.stories.tsx +14 -14
- package/src/ui/SettingsPanel.tsx +5 -5
- package/src/ui/Skeleton.stories.tsx +10 -10
- package/src/ui/Skeleton.tsx +1 -1
- package/src/ui/Slider.stories.tsx +23 -23
- package/src/ui/Slider.tsx +9 -9
- package/src/ui/SliderWithNumberField.stories.tsx +15 -15
- package/src/ui/SliderWithNumberField.tsx +4 -4
- package/src/ui/Switch.stories.tsx +11 -11
- package/src/ui/Switch.tsx +6 -6
- package/src/ui/TabRadio.stories.tsx +16 -16
- package/src/ui/TabRadio.tsx +7 -7
- package/src/ui/TabSelection.stories.tsx +1 -1
- package/src/ui/TabSelection.tsx +8 -8
- package/src/ui/TextArea.stories.tsx +12 -12
- package/src/ui/TextArea.tsx +1 -1
- package/src/ui/Tooltip.stories.tsx +13 -13
- package/src/ui/Tooltip.tsx +3 -3
- package/src/ui/Typography.stories.tsx +16 -16
- package/src/ui/Typography.tsx +11 -11
- package/.changeset/big-loops-drum.md +0 -5
- package/.changeset/deep-brooms-taste.md +0 -5
package/src/ui/AuthFormUI.tsx
CHANGED
|
@@ -44,28 +44,28 @@ export function AuthFormUI({
|
|
|
44
44
|
: "Reset Password";
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<div className="text-left overflow-hidden">
|
|
48
|
-
<Heading level={2} className="text-center mb-2">
|
|
47
|
+
<div className="pb:text-left pb:overflow-hidden">
|
|
48
|
+
<Heading level={2} className="pb:text-center pb:mb-2">
|
|
49
49
|
{title || defaultTitle}
|
|
50
50
|
</Heading>
|
|
51
51
|
|
|
52
|
-
<form className="md:m-10 sm:m-4 space-y-4" action={formAction}>
|
|
52
|
+
<form className="pb:md:m-10 pb:sm:m-4 pb:space-y-4" action={formAction}>
|
|
53
53
|
{description && (
|
|
54
|
-
<Text className="text-center mb-6" variant="muted">
|
|
54
|
+
<Text className="pb:text-center pb:mb-6" variant="muted">
|
|
55
55
|
{description}
|
|
56
56
|
</Text>
|
|
57
57
|
)}
|
|
58
58
|
|
|
59
59
|
{mode === "resetting password" && (
|
|
60
|
-
<Text className="text-center font-bold text-dark-primary">
|
|
60
|
+
<Text className="pb:text-center pb:font-bold pb:text-dark-primary">
|
|
61
61
|
{actionState.message}
|
|
62
62
|
</Text>
|
|
63
63
|
)}
|
|
64
|
-
<Text className="text-center" variant="error">
|
|
64
|
+
<Text className="pb:text-center" variant="error">
|
|
65
65
|
{actionState.error}
|
|
66
66
|
</Text>
|
|
67
67
|
|
|
68
|
-
<div className="space-y-4">
|
|
68
|
+
<div className="pb:space-y-4">
|
|
69
69
|
<Field
|
|
70
70
|
id="email"
|
|
71
71
|
label="Email"
|
|
@@ -105,14 +105,14 @@ export function AuthFormUI({
|
|
|
105
105
|
)}
|
|
106
106
|
</div>
|
|
107
107
|
|
|
108
|
-
<div className="text-center mt-6 space-y-4">
|
|
108
|
+
<div className="pb:text-center pb:mt-6 pb:space-y-4">
|
|
109
109
|
{mode === "signing up" && <SubmitButton label="Sign Up" />}
|
|
110
110
|
{mode === "signing in" && <SubmitButton label="Sign In" />}
|
|
111
111
|
{mode === "resetting password" && (
|
|
112
112
|
<SubmitButton label="Reset Password" />
|
|
113
113
|
)}
|
|
114
114
|
|
|
115
|
-
<div className="text-center text-sm text-gray-500">
|
|
115
|
+
<div className="pb:text-center pb:text-sm pb:text-gray-500">
|
|
116
116
|
{mode === "signing up" && (
|
|
117
117
|
<Text>
|
|
118
118
|
Already have an account?{" "}
|
|
@@ -120,31 +120,31 @@ export function AuthFormUI({
|
|
|
120
120
|
variant="ghost"
|
|
121
121
|
size="sm"
|
|
122
122
|
onClick={() => onModeChange("signing in")}
|
|
123
|
-
className="underline p-0 h-auto hover:bg-transparent"
|
|
123
|
+
className="pb:underline pb:p-0 pb:h-auto pb:hover:bg-transparent"
|
|
124
124
|
>
|
|
125
125
|
Sign in
|
|
126
126
|
</Button>
|
|
127
127
|
</Text>
|
|
128
128
|
)}
|
|
129
129
|
{mode === "signing in" && (
|
|
130
|
-
<div className="flex flex-col gap-2">
|
|
130
|
+
<div className="pb:flex pb:flex-col pb:gap-2">
|
|
131
131
|
<Text>
|
|
132
132
|
Forgot your password?{" "}
|
|
133
133
|
<Button
|
|
134
134
|
variant="ghost"
|
|
135
135
|
size="sm"
|
|
136
136
|
onClick={() => onModeChange("resetting password")}
|
|
137
|
-
className="underline p-0 h-auto hover:bg-transparent"
|
|
137
|
+
className="pb:underline pb:p-0 pb:h-auto pb:hover:bg-transparent"
|
|
138
138
|
>
|
|
139
139
|
Reset password.
|
|
140
140
|
</Button>
|
|
141
141
|
</Text>
|
|
142
|
-
<div className="relative">
|
|
143
|
-
<div className="absolute inset-0 flex items-center">
|
|
144
|
-
<div className="w-full border-t border-gray-300"></div>
|
|
142
|
+
<div className="pb:relative">
|
|
143
|
+
<div className="pb:absolute pb:inset-0 pb:flex pb:items-center">
|
|
144
|
+
<div className="pb:w-full pb:border-t pb:border-gray-300"></div>
|
|
145
145
|
</div>
|
|
146
|
-
<div className="relative flex justify-center text-sm">
|
|
147
|
-
<span className="px-2 bg-white text-gray-500">or</span>
|
|
146
|
+
<div className="pb:relative pb:flex pb:justify-center pb:text-sm">
|
|
147
|
+
<span className="pb:px-2 pb:bg-white pb:text-gray-500">or</span>
|
|
148
148
|
</div>
|
|
149
149
|
</div>
|
|
150
150
|
<Text>
|
|
@@ -153,7 +153,7 @@ export function AuthFormUI({
|
|
|
153
153
|
variant="ghost"
|
|
154
154
|
size="sm"
|
|
155
155
|
onClick={() => onModeChange("signing up")}
|
|
156
|
-
className="underline p-0 h-auto hover:bg-transparent"
|
|
156
|
+
className="pb:underline pb:p-0 pb:h-auto pb:hover:bg-transparent"
|
|
157
157
|
>
|
|
158
158
|
Sign up
|
|
159
159
|
</Button>
|
|
@@ -161,24 +161,24 @@ export function AuthFormUI({
|
|
|
161
161
|
</div>
|
|
162
162
|
)}
|
|
163
163
|
{mode === "resetting password" && (
|
|
164
|
-
<div className="flex flex-col gap-2">
|
|
164
|
+
<div className="pb:flex pb:flex-col pb:gap-2">
|
|
165
165
|
<Text>
|
|
166
166
|
Don't have an account?{" "}
|
|
167
167
|
<Button
|
|
168
168
|
variant="ghost"
|
|
169
169
|
size="sm"
|
|
170
170
|
onClick={() => onModeChange("signing up")}
|
|
171
|
-
className="underline p-0 h-auto hover:bg-transparent"
|
|
171
|
+
className="pb:underline pb:p-0 pb:h-auto pb:hover:bg-transparent"
|
|
172
172
|
>
|
|
173
173
|
Sign up
|
|
174
174
|
</Button>
|
|
175
175
|
</Text>
|
|
176
|
-
<div className="relative">
|
|
177
|
-
<div className="absolute inset-0 flex items-center">
|
|
178
|
-
<div className="w-full border-t border-gray-300"></div>
|
|
176
|
+
<div className="pb:relative">
|
|
177
|
+
<div className="pb:absolute pb:inset-0 pb:flex pb:items-center">
|
|
178
|
+
<div className="pb:w-full pb:border-t pb:border-gray-300"></div>
|
|
179
179
|
</div>
|
|
180
|
-
<div className="relative flex justify-center text-sm">
|
|
181
|
-
<span className="px-2 bg-white text-gray-500">or</span>
|
|
180
|
+
<div className="pb:relative pb:flex pb:justify-center pb:text-sm">
|
|
181
|
+
<span className="pb:px-2 pb:bg-white pb:text-gray-500">or</span>
|
|
182
182
|
</div>
|
|
183
183
|
</div>
|
|
184
184
|
<Text>
|
|
@@ -187,7 +187,7 @@ export function AuthFormUI({
|
|
|
187
187
|
variant="ghost"
|
|
188
188
|
size="sm"
|
|
189
189
|
onClick={() => onModeChange("signing in")}
|
|
190
|
-
className="underline p-0 h-auto hover:bg-transparent"
|
|
190
|
+
className="pb:underline pb:p-0 pb:h-auto pb:hover:bg-transparent"
|
|
191
191
|
>
|
|
192
192
|
Sign In
|
|
193
193
|
</Button>
|
|
@@ -198,12 +198,12 @@ export function AuthFormUI({
|
|
|
198
198
|
</div>
|
|
199
199
|
|
|
200
200
|
{mode !== "resetting password" && onGoogleSignIn && (
|
|
201
|
-
<div className="text-center mt-4">
|
|
201
|
+
<div className="pb:text-center pb:mt-4">
|
|
202
202
|
<Button
|
|
203
203
|
variant="secondary"
|
|
204
204
|
onClick={onGoogleSignIn}
|
|
205
205
|
type="button"
|
|
206
|
-
className="w-full flex items-center justify-center gap-2"
|
|
206
|
+
className="pb:w-full pb:flex pb:items-center pb:justify-center pb:gap-2"
|
|
207
207
|
>
|
|
208
208
|
<Icon name="google" stroke="none" />
|
|
209
209
|
{mode === "signing up" && <span>Sign up with Google</span>}
|
|
@@ -10,7 +10,7 @@ const meta = {
|
|
|
10
10
|
},
|
|
11
11
|
decorators: [
|
|
12
12
|
(Story) => (
|
|
13
|
-
<div className="w-[450px] border border-gray-200 rounded-lg shadow-sm bg-white overflow-hidden p-4">
|
|
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
14
|
<Story />
|
|
15
15
|
</div>
|
|
16
16
|
),
|
|
@@ -27,7 +27,7 @@ export const Default: Story = {
|
|
|
27
27
|
children: (
|
|
28
28
|
<UIText
|
|
29
29
|
variant="small"
|
|
30
|
-
className="p-4 bg-gray-50 rounded-md border border-gray-100 text-black text-center"
|
|
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
31
|
>
|
|
32
32
|
Panel content goes here.
|
|
33
33
|
</UIText>
|
package/src/ui/BasePanel.tsx
CHANGED
|
@@ -30,21 +30,21 @@ export function BasePanel({
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<div className={`space-y-1 p-1 ${className}`}>
|
|
33
|
+
<div className={`pb:space-y-1 pb:p-1 ${className}`}>
|
|
34
34
|
<div
|
|
35
|
-
className={`flex items-center justify-between px-1 mb-1 border
|
|
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
36
|
>
|
|
37
|
-
<Heading level={headingLevel} className="text-lg">
|
|
37
|
+
<Heading level={headingLevel} className="pb:text-lg">
|
|
38
38
|
{title}
|
|
39
39
|
</Heading>
|
|
40
40
|
<Button
|
|
41
41
|
variant="ghost"
|
|
42
42
|
size="sm"
|
|
43
43
|
onClick={handleClose}
|
|
44
|
-
className="p-1 rounded hover:bg-gray-100 h-auto"
|
|
44
|
+
className="pb:p-1 pb:rounded pb:hover:bg-gray-100 pb:h-auto"
|
|
45
45
|
aria-label={`Close ${title} Panel`}
|
|
46
46
|
>
|
|
47
|
-
<Icon size="md" className="h-5 w-5">
|
|
47
|
+
<Icon size="md" className="pb:h-5 pb:w-5">
|
|
48
48
|
<path
|
|
49
49
|
strokeLinecap="round"
|
|
50
50
|
strokeLinejoin="round"
|
|
@@ -37,12 +37,12 @@ export const Default: Story = {
|
|
|
37
37
|
|
|
38
38
|
export const Variations: Story = {
|
|
39
39
|
render: () => (
|
|
40
|
-
<div className="flex flex-col gap-8">
|
|
41
|
-
<div className="space-y-4">
|
|
42
|
-
<Heading level={4} className="text-sm font-medium text-black italic">
|
|
40
|
+
<div className="pb:flex pb:flex-col pb:gap-8">
|
|
41
|
+
<div className="pb:space-y-4">
|
|
42
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:italic">
|
|
43
43
|
Variants
|
|
44
44
|
</Heading>
|
|
45
|
-
<div className="flex flex-wrap gap-4 items-center">
|
|
45
|
+
<div className="pb:flex pb:flex-wrap pb:gap-4 pb:items-center">
|
|
46
46
|
<Button variant="primary">Primary</Button>
|
|
47
47
|
<Button variant="secondary">Secondary</Button>
|
|
48
48
|
<Button variant="danger">Danger</Button>
|
|
@@ -51,32 +51,32 @@ export const Variations: Story = {
|
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
53
|
|
|
54
|
-
<div className="space-y-4">
|
|
55
|
-
<Heading level={4} className="text-sm font-medium text-black italic">
|
|
54
|
+
<div className="pb:space-y-4">
|
|
55
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:italic">
|
|
56
56
|
Sizes
|
|
57
57
|
</Heading>
|
|
58
|
-
<div className="flex flex-wrap gap-4 items-end">
|
|
58
|
+
<div className="pb:flex pb:flex-wrap pb:gap-4 pb:items-end">
|
|
59
59
|
<Button size="sm">Small</Button>
|
|
60
60
|
<Button size="md">Medium</Button>
|
|
61
61
|
<Button size="lg">Large</Button>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
|
-
<div className="space-y-4">
|
|
66
|
-
<Heading level={4} className="text-sm font-medium text-black italic">
|
|
65
|
+
<div className="pb:space-y-4">
|
|
66
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:italic">
|
|
67
67
|
States
|
|
68
68
|
</Heading>
|
|
69
|
-
<div className="flex flex-wrap gap-4 items-center">
|
|
69
|
+
<div className="pb:flex pb:flex-wrap pb:gap-4 pb:items-center">
|
|
70
70
|
<Button isLoading>Loading</Button>
|
|
71
71
|
<Button disabled>Disabled</Button>
|
|
72
72
|
</div>
|
|
73
73
|
</div>
|
|
74
74
|
|
|
75
|
-
<div className="space-y-4">
|
|
76
|
-
<Heading level={4} className="text-sm font-medium text-black italic">
|
|
75
|
+
<div className="pb:space-y-4">
|
|
76
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:italic">
|
|
77
77
|
With Icons
|
|
78
78
|
</Heading>
|
|
79
|
-
<div className="flex flex-wrap gap-4 items-center">
|
|
79
|
+
<div className="pb:flex pb:flex-wrap pb:gap-4 pb:items-center">
|
|
80
80
|
<Button leftIcon={<Icon name="cloudArrowUp" />}>Upload</Button>
|
|
81
81
|
<Button variant="secondary" rightIcon={<Icon name="chevronRight" />}>
|
|
82
82
|
Next
|
|
@@ -84,11 +84,11 @@ export const Variations: Story = {
|
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
|
|
87
|
-
<div className="space-y-4">
|
|
88
|
-
<Heading level={4} className="text-sm font-medium text-black italic">
|
|
87
|
+
<div className="pb:space-y-4">
|
|
88
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:italic">
|
|
89
89
|
Icon Only
|
|
90
90
|
</Heading>
|
|
91
|
-
<div className="flex flex-wrap gap-4 items-center">
|
|
91
|
+
<div className="pb:flex pb:flex-wrap pb:gap-4 pb:items-center">
|
|
92
92
|
<Button size="sm">
|
|
93
93
|
<Icon name="plus" />
|
|
94
94
|
</Button>
|
package/src/ui/Button.tsx
CHANGED
|
@@ -36,21 +36,21 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
36
36
|
|
|
37
37
|
const variants = {
|
|
38
38
|
primary:
|
|
39
|
-
"bg-primary hover:bg-dark-primary text-gray-900 shadow-sm border border-transparent font-bold disabled:bg-gray-400 disabled:hover:bg-gray-300",
|
|
39
|
+
"pb:bg-primary pb:hover:bg-dark-primary pb:text-gray-900 pb:shadow-sm pb:border pb:border-transparent pb:font-bold pb:disabled:bg-gray-400 pb:disabled:hover:bg-gray-300",
|
|
40
40
|
secondary:
|
|
41
|
-
"bg-gray-100 hover:bg-gray-200 text-gray-800 border-gray-200 border font-normal disabled:bg-gray-400 disabled:hover:bg-gray-300",
|
|
41
|
+
"pb:bg-gray-100 pb:hover:bg-gray-200 pb:text-gray-800 pb:border pb:border-gray-200 pb:border pb:font-normal pb:disabled:bg-gray-400 pb:disabled:hover:bg-gray-300",
|
|
42
42
|
danger:
|
|
43
|
-
"bg-danger hover:opacity-80 text-gray-900 shadow-sm border border-transparent font-bold disabled:bg-gray-400 disabled:hover:bg-gray-300",
|
|
43
|
+
"pb:bg-danger pb:hover:opacity-80 pb:text-gray-900 pb:shadow-sm pb:border pb:border-transparent pb:font-bold pb:disabled:bg-gray-400 pb:disabled:hover:bg-gray-300",
|
|
44
44
|
ghost:
|
|
45
|
-
"bg-transparent hover:bg-gray-100 text-gray-700 hover:text-gray-900 font-medium",
|
|
45
|
+
"pb:bg-transparent pb:hover:bg-gray-100 pb:text-gray-700 pb:hover:text-gray-900 pb:font-medium",
|
|
46
46
|
"ghostly-danger":
|
|
47
|
-
"bg-transparent hover:bg-danger/10 text-red-700 border border-red-700 font-medium disabled:border-gray-400 disabled:text-gray-400",
|
|
47
|
+
"pb:bg-transparent pb:hover:bg-danger/10 pb:text-red-700 pb:border pb:border-red-700 pb:font-medium pb:disabled:border-gray-400 pb:disabled:text-gray-400",
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const sizes = {
|
|
51
|
-
sm: isActuallyIconOnly ? "p-1 text-xs" : "px-2 py-1 text-xs",
|
|
52
|
-
md: isActuallyIconOnly ? "p-2 text-sm" : "px-4 py-2 text-sm",
|
|
53
|
-
lg: isActuallyIconOnly ? "p-3 text-base" : "px-6 py-3 text-base",
|
|
51
|
+
sm: isActuallyIconOnly ? "pb:p-1 pb:text-xs" : "pb:px-2 pb:py-1 pb:text-xs",
|
|
52
|
+
md: isActuallyIconOnly ? "pb:p-2 pb:text-sm" : "pb:px-4 pb:py-2 pb:text-sm",
|
|
53
|
+
lg: isActuallyIconOnly ? "pb:p-3 pb:text-base" : "pb:px-6 pb:py-3 pb:text-base",
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
return (
|
|
@@ -59,7 +59,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
59
59
|
render={render}
|
|
60
60
|
nativeButton={nativeButton}
|
|
61
61
|
className={cn(
|
|
62
|
-
"inline-flex items-center justify-center rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed cursor-pointer",
|
|
62
|
+
"pb:inline-flex pb:items-center pb:justify-center pb:rounded-md pb:transition-colors pb:focus:outline-none pb:focus:ring-2 pb:focus:ring-primary pb:focus:ring-offset-2 pb:disabled:cursor-not-allowed pb:cursor-pointer",
|
|
63
63
|
variants[variant],
|
|
64
64
|
sizes[size],
|
|
65
65
|
className,
|
|
@@ -70,15 +70,15 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
70
70
|
{isLoading && (
|
|
71
71
|
<svg
|
|
72
72
|
className={cn(
|
|
73
|
-
"animate-spin h-4 w-4",
|
|
74
|
-
!isActuallyIconOnly && "mr-2
|
|
73
|
+
"pb:animate-spin pb:h-4 pb:w-4",
|
|
74
|
+
!isActuallyIconOnly && "pb:mr-2 pb:-ml-1",
|
|
75
75
|
)}
|
|
76
76
|
xmlns="http://www.w3.org/2000/svg"
|
|
77
77
|
fill="none"
|
|
78
78
|
viewBox="0 0 24 24"
|
|
79
79
|
>
|
|
80
80
|
<circle
|
|
81
|
-
className="opacity-25"
|
|
81
|
+
className="pb:opacity-25"
|
|
82
82
|
cx="12"
|
|
83
83
|
cy="12"
|
|
84
84
|
r="10"
|
|
@@ -86,7 +86,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
86
86
|
strokeWidth="4"
|
|
87
87
|
></circle>
|
|
88
88
|
<path
|
|
89
|
-
className="opacity-75"
|
|
89
|
+
className="pb:opacity-75"
|
|
90
90
|
fill="currentColor"
|
|
91
91
|
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
92
92
|
></path>
|
|
@@ -95,8 +95,8 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
95
95
|
{!isLoading && leftIcon && (
|
|
96
96
|
<span
|
|
97
97
|
className={cn(
|
|
98
|
-
"inline-flex items-center justify-center",
|
|
99
|
-
!isActuallyIconOnly && "mr-2
|
|
98
|
+
"pb:inline-flex pb:items-center pb:justify-center",
|
|
99
|
+
!isActuallyIconOnly && "pb:mr-2 pb:-ml-1",
|
|
100
100
|
)}
|
|
101
101
|
>
|
|
102
102
|
{leftIcon}
|
|
@@ -106,8 +106,8 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
106
106
|
{!isLoading && rightIcon && (
|
|
107
107
|
<span
|
|
108
108
|
className={cn(
|
|
109
|
-
"inline-flex items-center justify-center",
|
|
110
|
-
!isActuallyIconOnly && "ml-2
|
|
109
|
+
"pb:inline-flex pb:items-center pb:justify-center",
|
|
110
|
+
!isActuallyIconOnly && "pb:ml-2 pb:-mr-1",
|
|
111
111
|
)}
|
|
112
112
|
>
|
|
113
113
|
{rightIcon}
|
|
@@ -17,7 +17,7 @@ const StatefulCheckbox = (
|
|
|
17
17
|
) => {
|
|
18
18
|
const [checked, setChecked] = React.useState(props.checked || false);
|
|
19
19
|
return (
|
|
20
|
-
<div className="flex items-center space-x-2">
|
|
20
|
+
<div className="pb:flex pb:items-center pb:space-x-2">
|
|
21
21
|
<Checkbox
|
|
22
22
|
{...props}
|
|
23
23
|
id="terms"
|
|
@@ -26,7 +26,7 @@ const StatefulCheckbox = (
|
|
|
26
26
|
/>
|
|
27
27
|
<label
|
|
28
28
|
htmlFor="terms"
|
|
29
|
-
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
29
|
+
className="pb:text-sm pb:font-medium pb:leading-none peer-disabled:pb:cursor-not-allowed peer-disabled:pb:opacity-70"
|
|
30
30
|
>
|
|
31
31
|
{props.label || "Accept terms and conditions"}
|
|
32
32
|
</label>
|
|
@@ -40,12 +40,12 @@ export const Default: Story = {
|
|
|
40
40
|
|
|
41
41
|
export const Variations: Story = {
|
|
42
42
|
render: () => (
|
|
43
|
-
<div className="flex flex-col gap-8 p-4">
|
|
44
|
-
<div className="space-y-4">
|
|
45
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
43
|
+
<div className="pb:flex pb:flex-col pb:gap-8 pb:p-4">
|
|
44
|
+
<div className="pb:space-y-4">
|
|
45
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
46
46
|
States
|
|
47
47
|
</Heading>
|
|
48
|
-
<div className="flex flex-col gap-4">
|
|
48
|
+
<div className="pb:flex pb:flex-col pb:gap-4">
|
|
49
49
|
<StatefulCheckbox label="Default Unchecked" />
|
|
50
50
|
<StatefulCheckbox label="Default Checked" checked={true} />
|
|
51
51
|
<StatefulCheckbox label="Disabled Unchecked" disabled={true} />
|
package/src/ui/Checkbox.tsx
CHANGED
|
@@ -21,15 +21,15 @@ export const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(
|
|
|
21
21
|
}
|
|
22
22
|
}}
|
|
23
23
|
className={cn(
|
|
24
|
-
"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-gray-300 bg-white shadow-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
25
|
-
"hover:border-primary hover:bg-primary/5",
|
|
26
|
-
"data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-white",
|
|
24
|
+
"pb:flex pb:h-5 pb:w-5 pb:shrink-0 pb:items-center pb:justify-center pb:rounded pb:border pb:border-gray-300 pb:bg-white pb:shadow-sm pb:transition-all pb:focus-visible:outline-none pb:focus-visible:ring-2 pb:focus-visible:ring-primary pb:focus-visible:ring-offset-2 pb:disabled:cursor-not-allowed pb:disabled:opacity-50",
|
|
25
|
+
"pb:hover:border-primary pb:hover:bg-primary/5",
|
|
26
|
+
"pb:data-[state=checked]:bg-primary pb:data-[state=checked]:border-primary pb:data-[state=checked]:text-white",
|
|
27
27
|
className,
|
|
28
28
|
)}
|
|
29
29
|
{...(props as ComponentPropsWithoutRef<typeof BaseCheckbox.Root>)}
|
|
30
30
|
>
|
|
31
31
|
<BaseCheckbox.Indicator>
|
|
32
|
-
<Icon size="sm" strokeWidth={3} className="text-dark-primary">
|
|
32
|
+
<Icon size="sm" strokeWidth={3} className="pb:text-dark-primary">
|
|
33
33
|
<path
|
|
34
34
|
strokeLinecap="round"
|
|
35
35
|
strokeLinejoin="round"
|
|
@@ -16,7 +16,7 @@ export const Default: Story = {
|
|
|
16
16
|
args: {
|
|
17
17
|
title: "Click to expand",
|
|
18
18
|
children: (
|
|
19
|
-
<div className="p-4 bg-gray-50 rounded-md">
|
|
19
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">
|
|
20
20
|
This is the collapsible content. It can contain any elements.
|
|
21
21
|
</div>
|
|
22
22
|
),
|
|
@@ -25,64 +25,64 @@ export const Default: Story = {
|
|
|
25
25
|
|
|
26
26
|
export const Variations: Story = {
|
|
27
27
|
render: () => (
|
|
28
|
-
<div className="flex flex-col gap-8 p-4">
|
|
29
|
-
<div className="space-y-4">
|
|
30
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
28
|
+
<div className="pb:flex pb:flex-col pb:gap-8 pb:p-4">
|
|
29
|
+
<div className="pb:space-y-4">
|
|
30
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
31
31
|
States & Styling
|
|
32
32
|
</Heading>
|
|
33
|
-
<div className="space-y-4">
|
|
33
|
+
<div className="pb:space-y-4">
|
|
34
34
|
<Collapsible title="Initially Open" defaultOpen={true}>
|
|
35
|
-
<div className="p-4 bg-gray-50 rounded-md">
|
|
35
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">
|
|
36
36
|
This content is visible by default.
|
|
37
37
|
</div>
|
|
38
38
|
</Collapsible>
|
|
39
39
|
<Collapsible
|
|
40
|
-
title={<span className="font-bold text-primary">Styled Title</span>}
|
|
41
|
-
className="border border-gray-200 rounded-lg overflow-hidden"
|
|
40
|
+
title={<span className="pb:font-bold pb:text-primary">Styled Title</span>}
|
|
41
|
+
className="pb:border pb:border-gray-200 pb:rounded-lg pb:overflow-hidden"
|
|
42
42
|
>
|
|
43
|
-
<div className="p-4">Custom styled wrapper and title.</div>
|
|
43
|
+
<div className="pb:p-4">Custom styled wrapper and title.</div>
|
|
44
44
|
</Collapsible>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
|
-
<div className="space-y-4">
|
|
49
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
48
|
+
<div className="pb:space-y-4">
|
|
49
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
50
50
|
Variants
|
|
51
51
|
</Heading>
|
|
52
|
-
<div className="space-y-4">
|
|
52
|
+
<div className="pb:space-y-4">
|
|
53
53
|
<Collapsible title="Secondary (Default)" variant="secondary">
|
|
54
|
-
<div className="p-4 bg-gray-50 rounded-md">
|
|
54
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">
|
|
55
55
|
Secondary variant content.
|
|
56
56
|
</div>
|
|
57
57
|
</Collapsible>
|
|
58
58
|
<Collapsible title="Ghost" variant="ghost">
|
|
59
|
-
<div className="p-4 bg-gray-50 rounded-md">
|
|
59
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">
|
|
60
60
|
Ghost variant content.
|
|
61
61
|
</div>
|
|
62
62
|
</Collapsible>
|
|
63
63
|
<Collapsible title="Primary" variant="primary">
|
|
64
|
-
<div className="p-4 bg-gray-50 rounded-md">
|
|
64
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">
|
|
65
65
|
Primary variant content.
|
|
66
66
|
</div>
|
|
67
67
|
</Collapsible>
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
70
|
|
|
71
|
-
<div className="space-y-4">
|
|
72
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
71
|
+
<div className="pb:space-y-4">
|
|
72
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
73
73
|
Sizes
|
|
74
74
|
</Heading>
|
|
75
|
-
<div className="space-y-4">
|
|
75
|
+
<div className="pb:space-y-4">
|
|
76
76
|
<Collapsible title="Small" size="sm">
|
|
77
|
-
<div className="p-4 bg-gray-50 rounded-md">Small size content.</div>
|
|
77
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">Small size content.</div>
|
|
78
78
|
</Collapsible>
|
|
79
79
|
<Collapsible title="Medium (Default)" size="md">
|
|
80
|
-
<div className="p-4 bg-gray-50 rounded-md">
|
|
80
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">
|
|
81
81
|
Medium size content.
|
|
82
82
|
</div>
|
|
83
83
|
</Collapsible>
|
|
84
84
|
<Collapsible title="Large" size="lg">
|
|
85
|
-
<div className="p-4 bg-gray-50 rounded-md">Large size content.</div>
|
|
85
|
+
<div className="pb:p-4 pb:bg-gray-50 pb:rounded-md">Large size content.</div>
|
|
86
86
|
</Collapsible>
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
package/src/ui/Collapsible.tsx
CHANGED
|
@@ -29,11 +29,11 @@ export function Collapsible({
|
|
|
29
29
|
<Button
|
|
30
30
|
variant={variant}
|
|
31
31
|
size={size}
|
|
32
|
-
className="w-full justify-between font-medium"
|
|
32
|
+
className="pb:w-full pb:justify-between pb:font-medium"
|
|
33
33
|
onClick={() => setIsOpen(!isOpen)}
|
|
34
34
|
aria-expanded={isOpen}
|
|
35
35
|
rightIcon={
|
|
36
|
-
<Icon className="h-5 w-5 text-gray-600" strokeWidth="2.5">
|
|
36
|
+
<Icon className="pb:h-5 pb:w-5 pb:text-gray-600" strokeWidth="2.5">
|
|
37
37
|
{isOpen ? (
|
|
38
38
|
<path d="M4.5 15.75l7.5-7.5 7.5 7.5" />
|
|
39
39
|
) : (
|
|
@@ -45,7 +45,7 @@ export function Collapsible({
|
|
|
45
45
|
<span>{title}</span>
|
|
46
46
|
</Button>
|
|
47
47
|
{isOpen && (
|
|
48
|
-
<div className="px-4 pt-4 pb-2 text-sm text-gray-500">{children}</div>
|
|
48
|
+
<div className="pb:px-4 pb:pt-4 pb:pb-2 pb:text-sm pb:text-gray-500">{children}</div>
|
|
49
49
|
)}
|
|
50
50
|
</div>
|
|
51
51
|
);
|
|
@@ -9,42 +9,42 @@ export default meta;
|
|
|
9
9
|
|
|
10
10
|
export const Variations: StoryObj = {
|
|
11
11
|
render: () => (
|
|
12
|
-
<div className="flex flex-col gap-8 p-4 bg-white">
|
|
12
|
+
<div className="pb:flex pb:flex-col pb:gap-8 pb:p-4 pb:bg-white">
|
|
13
13
|
<div>
|
|
14
|
-
<h3 className="text-sm font-medium text-black uppercase tracking-wider border-b pb-1 mb-4">
|
|
14
|
+
<h3 className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1 pb:mb-4">
|
|
15
15
|
Theme Colors
|
|
16
16
|
</h3>
|
|
17
|
-
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">
|
|
18
|
-
<ColorItem name="Primary" variable="var(--color-primary)" />
|
|
19
|
-
<ColorItem name="Secondary" variable="var(--color-secondary)" />
|
|
20
|
-
<ColorItem name="Accent" variable="var(--color-accent)" />
|
|
21
|
-
<ColorItem name="Danger" variable="var(--color-danger)" />
|
|
22
|
-
<ColorItem name="Light BG" variable="var(--color-light-bg)" />
|
|
17
|
+
<div className="pb:grid pb:grid-cols-2 pb:md:grid-cols-3 pb:lg:grid-cols-5 pb:gap-4">
|
|
18
|
+
<ColorItem name="Primary" variable="var(--pb-color-primary)" />
|
|
19
|
+
<ColorItem name="Secondary" variable="var(--pb-color-secondary)" />
|
|
20
|
+
<ColorItem name="Accent" variable="var(--pb-color-accent)" />
|
|
21
|
+
<ColorItem name="Danger" variable="var(--pb-color-danger)" />
|
|
22
|
+
<ColorItem name="Light BG" variable="var(--pb-color-light-bg)" />
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<div>
|
|
27
|
-
<h3 className="text-sm font-medium text-black uppercase tracking-wider border-b pb-1 mb-4">
|
|
27
|
+
<h3 className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1 pb:mb-4">
|
|
28
28
|
Extended Accent Colors
|
|
29
29
|
</h3>
|
|
30
|
-
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
|
31
|
-
<ColorItem name="Accent HC" variable="var(--color-accent-hc)" />
|
|
32
|
-
<ColorItem name="Accent Two" variable="var(--color-accent-two)" />
|
|
30
|
+
<div className="pb:grid pb:grid-cols-2 pb:md:grid-cols-3 pb:lg:grid-cols-4 pb:gap-4">
|
|
31
|
+
<ColorItem name="Accent HC" variable="var(--pb-color-accent-hc)" />
|
|
32
|
+
<ColorItem name="Accent Two" variable="var(--pb-color-accent-two)" />
|
|
33
33
|
<ColorItem
|
|
34
34
|
name="Accent Two HC"
|
|
35
|
-
variable="var(--color-accent-two-hc)"
|
|
35
|
+
variable="var(--pb-color-accent-two-hc)"
|
|
36
36
|
/>
|
|
37
|
-
<ColorItem name="Accent Three" variable="var(--color-accent-three)" />
|
|
37
|
+
<ColorItem name="Accent Three" variable="var(--pb-color-accent-three)" />
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
41
|
<div>
|
|
42
|
-
<h3 className="text-sm font-medium text-black uppercase tracking-wider border-b pb-1 mb-4">
|
|
42
|
+
<h3 className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1 pb:mb-4">
|
|
43
43
|
UI Elements
|
|
44
44
|
</h3>
|
|
45
|
-
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
|
|
46
|
-
<ColorItem name="Sidebar BG" variable="var(--sidebar-bg)" />
|
|
47
|
-
<ColorItem name="Dark Primary" variable="var(--color-dark-primary)" />
|
|
45
|
+
<div className="pb:grid pb:grid-cols-2 pb:md:grid-cols-3 pb:lg:grid-cols-4 pb:gap-4">
|
|
46
|
+
<ColorItem name="Sidebar BG" variable="var(--pb-sidebar-bg)" />
|
|
47
|
+
<ColorItem name="Dark Primary" variable="var(--pb-color-dark-primary)" />
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
50
50
|
</div>
|
|
@@ -53,14 +53,14 @@ export const Variations: StoryObj = {
|
|
|
53
53
|
|
|
54
54
|
function ColorItem({ name, variable }: { name: string; variable: string }) {
|
|
55
55
|
return (
|
|
56
|
-
<div className="flex flex-col gap-2">
|
|
56
|
+
<div className="pb:flex pb:flex-col pb:gap-2">
|
|
57
57
|
<div
|
|
58
|
-
className="h-20 w-full rounded-md shadow-inner border border-gray-100"
|
|
58
|
+
className="pb:h-20 pb:w-full pb:rounded-md pb:shadow-inner pb:border pb:border-gray-100"
|
|
59
59
|
style={{ backgroundColor: variable }}
|
|
60
60
|
/>
|
|
61
|
-
<div className="flex flex-col">
|
|
62
|
-
<span className="text-sm font-bold text-gray-900">{name}</span>
|
|
63
|
-
<code className="text-xs text-gray-500">{variable}</code>
|
|
61
|
+
<div className="pb:flex pb:flex-col">
|
|
62
|
+
<span className="pb:text-sm pb:font-bold pb:text-gray-900">{name}</span>
|
|
63
|
+
<code className="pb:text-xs pb:text-gray-500">{variable}</code>
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
66
66
|
);
|