Skip to content

Commit a2f2e06

Browse files
authored
Add "neutral" severity style to Input (#2061)
1 parent 4c3bab5 commit a2f2e06

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.changeset/green-rice-brake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@theguild/components': patch
3+
---
4+
5+
Add (missing, so this is a patch) neutral severity to Input

packages/components/src/components/input/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
77
message?: string;
88
}
99

10-
export function Input({ severity, message, ...props }: InputProps) {
10+
export function Input({ severity = 'neutral', message, ...props }: InputProps) {
1111
return (
1212
<div
1313
// todo: discuss colors with designers.
@@ -40,15 +40,18 @@ export function Input({ severity, message, ...props }: InputProps) {
4040
severity === 'critical' && 'bg-critical-dark/10 dark:bg-critical-bright/20',
4141
severity === 'warning' && 'bg-warning-bright/10',
4242
severity === 'positive' && 'bg-positive-dark/10',
43+
severity === 'neutral' && 'bg-blue-100 dark:bg-neutral-800',
4344
)}
4445
>
4546
{message &&
4647
(severity === 'critical' ? (
4748
<p className="py-0.5 text-sm text-critical-dark dark:text-white">{message}</p>
4849
) : severity === 'warning' ? (
4950
<p className="py-0.5 text-sm text-warning-bright">{message}</p>
50-
) : (
51+
) : severity === 'positive' ? (
5152
<p className="py-0.5 text-sm text-positive-dark">{message}</p>
53+
) : (
54+
<p className="py-0.5 text-sm text-green-800">{message}</p>
5255
))}
5356
</div>
5457
</div>

packages/components/src/components/input/input.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ export const Positive: StoryObj<InputProps> = {
9292
},
9393
};
9494

95+
export const Neutral: StoryObj<InputProps> = {
96+
args: {
97+
severity: 'neutral',
98+
message: 'Retrying...',
99+
type: 'email',
100+
101+
},
102+
};
103+
95104
export const Disabled: StoryObj<InputProps> = {
96105
args: {
97106
disabled: true,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type Severity = 'critical' | 'positive' | 'warning';
1+
export type Severity = 'critical' | 'positive' | 'warning' | 'neutral';

0 commit comments

Comments
 (0)