@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
|
@@ -63,14 +63,14 @@ export const Variations: Story = {
|
|
|
63
63
|
onChange: () => {},
|
|
64
64
|
},
|
|
65
65
|
render: () => (
|
|
66
|
-
<div className="flex flex-col gap-12 p-4 min-w-[400px]">
|
|
67
|
-
<div className="space-y-4">
|
|
68
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
66
|
+
<div className="pb:flex pb:flex-col pb:gap-12 pb:p-4 pb:min-w-[400px]">
|
|
67
|
+
<div className="pb:space-y-4">
|
|
68
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
69
69
|
Variants
|
|
70
70
|
</Heading>
|
|
71
|
-
<div className="space-y-6">
|
|
72
|
-
<div className="space-y-2">
|
|
73
|
-
<Text variant="small" className="italic">
|
|
71
|
+
<div className="pb:space-y-6">
|
|
72
|
+
<div className="pb:space-y-2">
|
|
73
|
+
<Text variant="small" className="pb:italic">
|
|
74
74
|
Default
|
|
75
75
|
</Text>
|
|
76
76
|
<TabRadioWithState
|
|
@@ -80,8 +80,8 @@ export const Variations: Story = {
|
|
|
80
80
|
onChange={() => {}}
|
|
81
81
|
/>
|
|
82
82
|
</div>
|
|
83
|
-
<div className="space-y-2">
|
|
84
|
-
<Text variant="small" className="italic">
|
|
83
|
+
<div className="pb:space-y-2">
|
|
84
|
+
<Text variant="small" className="pb:italic">
|
|
85
85
|
Primary
|
|
86
86
|
</Text>
|
|
87
87
|
<TabRadioWithState
|
|
@@ -91,8 +91,8 @@ export const Variations: Story = {
|
|
|
91
91
|
onChange={() => {}}
|
|
92
92
|
/>
|
|
93
93
|
</div>
|
|
94
|
-
<div className="space-y-2">
|
|
95
|
-
<Text variant="small" className="italic">
|
|
94
|
+
<div className="pb:space-y-2">
|
|
95
|
+
<Text variant="small" className="pb:italic">
|
|
96
96
|
Danger
|
|
97
97
|
</Text>
|
|
98
98
|
<TabRadioWithState
|
|
@@ -105,8 +105,8 @@ export const Variations: Story = {
|
|
|
105
105
|
</div>
|
|
106
106
|
</div>
|
|
107
107
|
|
|
108
|
-
<div className="space-y-4">
|
|
109
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
108
|
+
<div className="pb:space-y-4">
|
|
109
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
110
110
|
With Icons
|
|
111
111
|
</Heading>
|
|
112
112
|
<TabRadioWithState
|
|
@@ -117,8 +117,8 @@ export const Variations: Story = {
|
|
|
117
117
|
{
|
|
118
118
|
value: "Message",
|
|
119
119
|
label: (
|
|
120
|
-
<div className="flex items-center gap-1">
|
|
121
|
-
<Icon size="sm" className="w-4 h-4">
|
|
120
|
+
<div className="pb:flex pb:items-center pb:gap-1">
|
|
121
|
+
<Icon size="sm" className="pb:w-4 pb:h-4">
|
|
122
122
|
<path
|
|
123
123
|
strokeLinecap="round"
|
|
124
124
|
strokeLinejoin="round"
|
|
@@ -132,8 +132,8 @@ export const Variations: Story = {
|
|
|
132
132
|
{
|
|
133
133
|
value: "Log",
|
|
134
134
|
label: (
|
|
135
|
-
<div className="flex items-center gap-1">
|
|
136
|
-
<Icon size="sm" className="w-4 h-4">
|
|
135
|
+
<div className="pb:flex pb:items-center pb:gap-1">
|
|
136
|
+
<Icon size="sm" className="pb:w-4 pb:h-4">
|
|
137
137
|
<path
|
|
138
138
|
strokeLinecap="round"
|
|
139
139
|
strokeLinejoin="round"
|
package/src/ui/TabRadio.tsx
CHANGED
|
@@ -19,11 +19,11 @@ export interface TabRadioProps<T extends string> {
|
|
|
19
19
|
|
|
20
20
|
const variantStyles = {
|
|
21
21
|
default:
|
|
22
|
-
"data-[pressed]:bg-white data-[pressed]:text-gray-900 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-gray-200",
|
|
22
|
+
"pb:data-[pressed]:bg-white pb:data-[pressed]:text-gray-900 pb:data-[pressed]:shadow-sm pb:data-[pressed]:ring-1 pb:data-[pressed]:ring-gray-200",
|
|
23
23
|
primary:
|
|
24
|
-
"data-[pressed]:bg-primary/20 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-primary",
|
|
24
|
+
"pb:data-[pressed]:bg-primary/20 pb:data-[pressed]:shadow-sm pb:data-[pressed]:ring-1 pb:data-[pressed]:ring-primary",
|
|
25
25
|
danger:
|
|
26
|
-
"data-[pressed]:bg-danger/20 data-[pressed]:shadow-sm data-[pressed]:ring-1 data-[pressed]:ring-danger",
|
|
26
|
+
"pb:data-[pressed]:bg-danger/20 pb:data-[pressed]:shadow-sm pb:data-[pressed]:ring-1 pb:data-[pressed]:ring-danger",
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export function TabRadio<T extends string>({
|
|
@@ -42,7 +42,7 @@ export function TabRadio<T extends string>({
|
|
|
42
42
|
}}
|
|
43
43
|
aria-label={ariaLabel}
|
|
44
44
|
className={cn(
|
|
45
|
-
"inline-flex p-1 space-x-1 bg-gray-100 rounded-lg border border-gray-200",
|
|
45
|
+
"pb:inline-flex pb:p-1 pb:space-x-1 pb:bg-gray-100 pb:rounded-lg pb:border pb:border-gray-200",
|
|
46
46
|
className,
|
|
47
47
|
)}
|
|
48
48
|
>
|
|
@@ -53,9 +53,9 @@ export function TabRadio<T extends string>({
|
|
|
53
53
|
value={option.value}
|
|
54
54
|
disabled={option.disabled}
|
|
55
55
|
className={cn(
|
|
56
|
-
"relative cursor-pointer px-3 py-1.5 text-sm font-medium rounded-md transition-all flex items-center justify-center outline-none",
|
|
57
|
-
"text-gray-600 hover:text-gray-900 hover:bg-gray-200",
|
|
58
|
-
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-gray-600",
|
|
56
|
+
"pb:relative pb:cursor-pointer pb:px-3 pb:py-1.5 pb:text-sm pb:font-medium pb:rounded-md pb:transition-all pb:flex pb:items-center pb:justify-center pb:outline-none",
|
|
57
|
+
"pb:text-gray-600 pb:hover:text-gray-900 pb:hover:bg-gray-200",
|
|
58
|
+
"pb:disabled:opacity-50 pb:disabled:cursor-not-allowed pb:disabled:hover:bg-transparent pb:disabled:hover:text-gray-600",
|
|
59
59
|
variantStyles[variant],
|
|
60
60
|
)}
|
|
61
61
|
>
|
package/src/ui/TabSelection.tsx
CHANGED
|
@@ -25,7 +25,7 @@ export function TabSelection({
|
|
|
25
25
|
}: TabSelectionProps) {
|
|
26
26
|
return (
|
|
27
27
|
<div
|
|
28
|
-
className={`overflow-x-auto max-h-20 text-sm whitespace-nowrap ${className}`}
|
|
28
|
+
className={`pb:overflow-x-auto pb:max-h-20 pb:text-sm pb:whitespace-nowrap ${className}`}
|
|
29
29
|
>
|
|
30
30
|
{tabs.map((tab) => {
|
|
31
31
|
const isActive = tab.id === activeTabId;
|
|
@@ -33,17 +33,17 @@ export function TabSelection({
|
|
|
33
33
|
<div
|
|
34
34
|
key={tab.id}
|
|
35
35
|
className={
|
|
36
|
-
"inline-block align-middle m-1 px-2 py-2 cursor-pointer rounded-sm " +
|
|
36
|
+
"pb:inline-block pb:align-middle pb:m-1 pb:px-2 pb:py-2 pb:cursor-pointer pb:rounded-sm " +
|
|
37
37
|
(isActive
|
|
38
|
-
? "font-bold bg-primary/30"
|
|
39
|
-
: "font-gray-300 bg-gray-200")
|
|
38
|
+
? "pb:font-bold pb:bg-primary/30"
|
|
39
|
+
: "pb:font-gray-300 pb:bg-gray-200")
|
|
40
40
|
}
|
|
41
41
|
onClick={() => onTabClick(tab.id)}
|
|
42
42
|
>
|
|
43
|
-
<span className="inline-block align-middle">{tab.label}</span>
|
|
43
|
+
<span className="pb:inline-block pb:align-middle">{tab.label}</span>
|
|
44
44
|
|
|
45
45
|
{isActive && (tab.onEdit || tab.onClose) && (
|
|
46
|
-
<span className="inline-flex items-center ml-2 align-middle">
|
|
46
|
+
<span className="pb:inline-flex pb:items-center pb:ml-2 pb:align-middle">
|
|
47
47
|
{tab.onEdit && (
|
|
48
48
|
<Button
|
|
49
49
|
variant="ghost"
|
|
@@ -57,7 +57,7 @@ export function TabSelection({
|
|
|
57
57
|
/>
|
|
58
58
|
)}
|
|
59
59
|
{tab.onEdit && tab.onClose && (
|
|
60
|
-
<span className="opacity-10 align-middle mx-1">{" | "}</span>
|
|
60
|
+
<span className="pb:opacity-10 pb:align-middle pb:mx-1">{" | "}</span>
|
|
61
61
|
)}
|
|
62
62
|
{tab.onClose && (
|
|
63
63
|
<Button
|
|
@@ -83,7 +83,7 @@ export function TabSelection({
|
|
|
83
83
|
aria-label="Create New Tab"
|
|
84
84
|
onClick={onAddClick}
|
|
85
85
|
leftIcon={<Icon name="plus" size="sm" />}
|
|
86
|
-
className="m-1 align-middle inline-flex"
|
|
86
|
+
className="pb:m-1 pb:align-middle pb:inline-flex"
|
|
87
87
|
/>
|
|
88
88
|
)}
|
|
89
89
|
</div>
|
|
@@ -20,20 +20,20 @@ export const Default: Story = {
|
|
|
20
20
|
|
|
21
21
|
export const Variations: Story = {
|
|
22
22
|
render: () => (
|
|
23
|
-
<div className="flex flex-col gap-12 p-4 max-w-lg">
|
|
24
|
-
<div className="space-y-4">
|
|
25
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
23
|
+
<div className="pb:flex pb:flex-col pb:gap-12 pb:p-4 pb:max-w-lg">
|
|
24
|
+
<div className="pb:space-y-4">
|
|
25
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
26
26
|
Styles & Sizes
|
|
27
27
|
</Heading>
|
|
28
|
-
<div className="space-y-6">
|
|
29
|
-
<div className="space-y-1">
|
|
30
|
-
<Text variant="small" className="font-bold">
|
|
28
|
+
<div className="pb:space-y-6">
|
|
29
|
+
<div className="pb:space-y-1">
|
|
30
|
+
<Text variant="small" className="pb:font-bold">
|
|
31
31
|
With Predefined Value
|
|
32
32
|
</Text>
|
|
33
33
|
<TextArea defaultValue="This is some predefined text in the textarea." />
|
|
34
34
|
</div>
|
|
35
|
-
<div className="space-y-1">
|
|
36
|
-
<Text variant="small" className="font-bold">
|
|
35
|
+
<div className="pb:space-y-1">
|
|
36
|
+
<Text variant="small" className="pb:font-bold">
|
|
37
37
|
Large (10 rows)
|
|
38
38
|
</Text>
|
|
39
39
|
<TextArea
|
|
@@ -44,12 +44,12 @@ export const Variations: Story = {
|
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
<div className="space-y-4">
|
|
48
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
47
|
+
<div className="pb:space-y-4">
|
|
48
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
49
49
|
States
|
|
50
50
|
</Heading>
|
|
51
|
-
<div className="space-y-1">
|
|
52
|
-
<Text variant="small" className="font-bold">
|
|
51
|
+
<div className="pb:space-y-1">
|
|
52
|
+
<Text variant="small" className="pb:font-bold">
|
|
53
53
|
Disabled
|
|
54
54
|
</Text>
|
|
55
55
|
<TextArea
|
package/src/ui/TextArea.tsx
CHANGED
|
@@ -12,7 +12,7 @@ export const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
12
12
|
ref={ref as React.Ref<HTMLTextAreaElement>}
|
|
13
13
|
id={id}
|
|
14
14
|
className={cn(
|
|
15
|
-
"block w-full rounded-md border-0 px-1.5 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6 bg-primary/10 appearance-none",
|
|
15
|
+
"pb:block pb:w-full pb:rounded-md pb:border-0 pb:px-1.5 pb:py-1.5 pb:text-gray-900 pb:ring-1 pb:ring-inset pb:ring-gray-300 pb:placeholder:text-gray-400 pb:focus:ring-2 pb:focus:ring-inset pb:focus:ring-primary pb:sm:text-sm pb:sm:leading-6 pb:bg-primary/10 pb:appearance-none",
|
|
16
16
|
className,
|
|
17
17
|
)}
|
|
18
18
|
{...(props as ComponentPropsWithoutRef<typeof BaseInput>)}
|
|
@@ -13,7 +13,7 @@ const meta: Meta<typeof Tooltip> = {
|
|
|
13
13
|
},
|
|
14
14
|
decorators: [
|
|
15
15
|
(Story) => (
|
|
16
|
-
<div className="flex h-32 items-center justify-center">
|
|
16
|
+
<div className="pb:flex pb:h-32 pb:items-center pb:justify-center">
|
|
17
17
|
<Story />
|
|
18
18
|
</div>
|
|
19
19
|
),
|
|
@@ -33,34 +33,34 @@ export const Default: Story = {
|
|
|
33
33
|
export const Variations: Story = {
|
|
34
34
|
decorators: [
|
|
35
35
|
(Story) => (
|
|
36
|
-
<div className="p-12">
|
|
36
|
+
<div className="pb:p-12">
|
|
37
37
|
<Story />
|
|
38
38
|
</div>
|
|
39
39
|
),
|
|
40
40
|
],
|
|
41
41
|
render: () => (
|
|
42
|
-
<div className="flex flex-col gap-16">
|
|
43
|
-
<div className="space-y-4">
|
|
44
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
42
|
+
<div className="pb:flex pb:flex-col pb:gap-16">
|
|
43
|
+
<div className="pb:space-y-4">
|
|
44
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
45
45
|
Placements & Triggers
|
|
46
46
|
</Heading>
|
|
47
|
-
<div className="flex flex-wrap gap-8 items-center justify-center">
|
|
47
|
+
<div className="pb:flex pb:flex-wrap pb:gap-8 pb:items-center pb:justify-center">
|
|
48
48
|
<Tooltip content="Tooltip on button">
|
|
49
49
|
<Button>On Button</Button>
|
|
50
50
|
</Tooltip>
|
|
51
51
|
<Tooltip content="Simple span trigger">
|
|
52
|
-
<span className="cursor-help underline decoration-dotted">
|
|
52
|
+
<span className="pb:cursor-help pb:underline pb:decoration-dotted">
|
|
53
53
|
On Text
|
|
54
54
|
</span>
|
|
55
55
|
</Tooltip>
|
|
56
56
|
</div>
|
|
57
57
|
</div>
|
|
58
58
|
|
|
59
|
-
<div className="space-y-4">
|
|
60
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
59
|
+
<div className="pb:space-y-4">
|
|
60
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
61
61
|
Configurations
|
|
62
62
|
</Heading>
|
|
63
|
-
<div className="flex flex-wrap gap-8 items-center justify-center">
|
|
63
|
+
<div className="pb:flex pb:flex-wrap pb:gap-8 pb:items-center pb:justify-center">
|
|
64
64
|
<Tooltip content="I appear slowly" delay="slow">
|
|
65
65
|
<Button variant="secondary">Slow Delay (1s)</Button>
|
|
66
66
|
</Tooltip>
|
|
@@ -70,11 +70,11 @@ export const Variations: Story = {
|
|
|
70
70
|
</div>
|
|
71
71
|
</div>
|
|
72
72
|
|
|
73
|
-
<div className="space-y-4">
|
|
74
|
-
<Heading level={4} className="text-sm font-medium text-black uppercase">
|
|
73
|
+
<div className="pb:space-y-4">
|
|
74
|
+
<Heading level={4} className="pb:text-sm pb:font-medium pb:text-black pb:uppercase">
|
|
75
75
|
Helper Tooltip
|
|
76
76
|
</Heading>
|
|
77
|
-
<div className="flex flex-wrap gap-8 items-center justify-center">
|
|
77
|
+
<div className="pb:flex pb:flex-wrap pb:gap-8 pb:items-center pb:justify-center">
|
|
78
78
|
<HelperTooltip content="I'm a helper" />
|
|
79
79
|
<HelperTooltip content="This is a much longer message that is trying to illustrate what happens when we have a long message for the helper tooltip." />
|
|
80
80
|
</div>
|
package/src/ui/Tooltip.tsx
CHANGED
|
@@ -28,12 +28,12 @@ export function Tooltip({
|
|
|
28
28
|
<BaseTooltip.Positioner sideOffset={8}>
|
|
29
29
|
<BaseTooltip.Popup
|
|
30
30
|
className={cn(
|
|
31
|
-
"z-50 rounded shadow-lg bg-white p-2 text-xs text-center whitespace-normal max-w-xs text-gray-900 border border-gray-200",
|
|
31
|
+
"pb:z-50 pb:rounded pb:shadow-lg pb:bg-white pb:p-2 pb:text-xs pb:text-center pb:whitespace-normal pb:max-w-xs pb:text-gray-900 pb:border pb:border-gray-200",
|
|
32
32
|
className,
|
|
33
33
|
)}
|
|
34
34
|
>
|
|
35
35
|
{content}
|
|
36
|
-
<BaseTooltip.Arrow className="fill-white stroke-gray-200" />
|
|
36
|
+
<BaseTooltip.Arrow className="pb:fill-white pb:stroke-gray-200" />
|
|
37
37
|
</BaseTooltip.Popup>
|
|
38
38
|
</BaseTooltip.Positioner>
|
|
39
39
|
</BaseTooltip.Portal>
|
|
@@ -49,7 +49,7 @@ export interface HelperTooltipProps {
|
|
|
49
49
|
export function HelperTooltip({ content, className }: HelperTooltipProps) {
|
|
50
50
|
return (
|
|
51
51
|
<Tooltip content={content} className={className}>
|
|
52
|
-
<Icon size="md" className="text-gray-500 hover:text-gray-700 cursor-help">
|
|
52
|
+
<Icon size="md" className="pb:text-gray-500 pb:hover:text-gray-700 pb:cursor-help">
|
|
53
53
|
<path
|
|
54
54
|
strokeLinecap="round"
|
|
55
55
|
strokeLinejoin="round"
|
|
@@ -10,7 +10,7 @@ export default meta;
|
|
|
10
10
|
|
|
11
11
|
export const Default: StoryObj = {
|
|
12
12
|
render: () => (
|
|
13
|
-
<div className="space-y-4 max-w-lg">
|
|
13
|
+
<div className="pb:space-y-4 pb:max-w-lg">
|
|
14
14
|
<Heading level={2}>Core Typography</Heading>
|
|
15
15
|
<Text>
|
|
16
16
|
The quick brown fox jumps over the lazy dog. This is our standard body
|
|
@@ -22,15 +22,15 @@ export const Default: StoryObj = {
|
|
|
22
22
|
|
|
23
23
|
export const Variations: StoryObj = {
|
|
24
24
|
render: () => (
|
|
25
|
-
<div className="flex flex-col gap-12 p-4">
|
|
26
|
-
<div className="space-y-4">
|
|
25
|
+
<div className="pb:flex pb:flex-col pb:gap-12 pb:p-4">
|
|
26
|
+
<div className="pb:space-y-4">
|
|
27
27
|
<Heading
|
|
28
28
|
level={4}
|
|
29
|
-
className="text-sm font-medium text-black uppercase tracking-wider border-b pb-1"
|
|
29
|
+
className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1"
|
|
30
30
|
>
|
|
31
31
|
Headings
|
|
32
32
|
</Heading>
|
|
33
|
-
<div className="space-y-4">
|
|
33
|
+
<div className="pb:space-y-4">
|
|
34
34
|
<Heading level={1}>Heading 1</Heading>
|
|
35
35
|
<Heading level={2}>Heading 2</Heading>
|
|
36
36
|
<Heading level={3}>Heading 3</Heading>
|
|
@@ -40,40 +40,40 @@ export const Variations: StoryObj = {
|
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
|
-
<div className="space-y-4">
|
|
43
|
+
<div className="pb:space-y-4">
|
|
44
44
|
<Heading
|
|
45
45
|
level={4}
|
|
46
|
-
className="text-sm font-medium text-black uppercase tracking-wider border-b pb-1"
|
|
46
|
+
className="pb:text-sm pb:font-medium pb:text-black pb:uppercase pb:tracking-wider pb:border-b pb:pb-1"
|
|
47
47
|
>
|
|
48
48
|
Text Variants
|
|
49
49
|
</Heading>
|
|
50
|
-
<div className="space-y-4">
|
|
51
|
-
<div className="space-y-1">
|
|
52
|
-
<Text variant="small" className="italic font-bold">
|
|
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
53
|
Default
|
|
54
54
|
</Text>
|
|
55
55
|
<Text variant="default">
|
|
56
56
|
The quick brown fox jumps over the lazy dog.
|
|
57
57
|
</Text>
|
|
58
58
|
</div>
|
|
59
|
-
<div className="space-y-1">
|
|
60
|
-
<Text variant="small" className="italic font-bold">
|
|
59
|
+
<div className="pb:space-y-1">
|
|
60
|
+
<Text variant="small" className="pb:italic pb:font-bold">
|
|
61
61
|
Small
|
|
62
62
|
</Text>
|
|
63
63
|
<Text variant="small">
|
|
64
64
|
The quick brown fox jumps over the lazy dog.
|
|
65
65
|
</Text>
|
|
66
66
|
</div>
|
|
67
|
-
<div className="space-y-1">
|
|
68
|
-
<Text variant="small" className="italic font-bold">
|
|
67
|
+
<div className="pb:space-y-1">
|
|
68
|
+
<Text variant="small" className="pb:italic pb:font-bold">
|
|
69
69
|
Muted
|
|
70
70
|
</Text>
|
|
71
71
|
<Text variant="muted">
|
|
72
72
|
The quick brown fox jumps over the lazy dog.
|
|
73
73
|
</Text>
|
|
74
74
|
</div>
|
|
75
|
-
<div className="space-y-1">
|
|
76
|
-
<Text variant="small" className="italic font-bold">
|
|
75
|
+
<div className="pb:space-y-1">
|
|
76
|
+
<Text variant="small" className="pb:italic pb:font-bold">
|
|
77
77
|
Error
|
|
78
78
|
</Text>
|
|
79
79
|
<Text variant="error">
|
package/src/ui/Typography.tsx
CHANGED
|
@@ -7,19 +7,19 @@ function cn(...inputs: ClassValue[]) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const headingSizes = {
|
|
10
|
-
1: "text-4xl font-bold",
|
|
11
|
-
2: "text-3xl font-bold",
|
|
12
|
-
3: "text-2xl font-bold",
|
|
13
|
-
4: "text-xl font-bold",
|
|
14
|
-
5: "text-lg font-bold",
|
|
15
|
-
6: "text-base font-bold",
|
|
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
16
|
};
|
|
17
17
|
|
|
18
18
|
const textVariants = {
|
|
19
|
-
default: "text-base text-slate-950",
|
|
20
|
-
muted: "text-sm text-slate-600",
|
|
21
|
-
error: "text-sm text-red-600 font-medium",
|
|
22
|
-
small: "text-xs text-slate-600",
|
|
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
23
|
};
|
|
24
24
|
|
|
25
25
|
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
@@ -63,7 +63,7 @@ export const Text = ({
|
|
|
63
63
|
export const TypographyList = ({ args }: { args: Record<string, unknown> }) => {
|
|
64
64
|
return (
|
|
65
65
|
<div
|
|
66
|
-
className="space-y-4"
|
|
66
|
+
className="pb:space-y-4"
|
|
67
67
|
{...(args as React.HTMLAttributes<HTMLDivElement>)}
|
|
68
68
|
>
|
|
69
69
|
<Heading level={1}>Heading 1</Heading>
|