Skip to content

Commit 7383319

Browse files
Rajat ChaudharyRajat Chaudhary
authored andcommitted
fix: issues reported by designer
1 parent b50af5e commit 7383319

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

example/storybook-nativewind/src/components/Alert/Alert.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const AlertMeta: ComponentMeta<typeof Alert> = {
1313
argTypes: {
1414
variant: {
1515
control: 'select',
16-
options: ['solid', 'accent', 'outline'],
16+
options: ['solid', 'outline'],
1717
},
1818
action: {
1919
control: 'select',

example/storybook-nativewind/src/components/Alert/index.nw.stories.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ This is an illustration of **Alert** component.
8080
},
8181
variant: {
8282
control: 'select',
83-
options: ['accent', 'solid', 'outline'],
83+
options: ['solid', 'outline'],
8484
default: 'solid',
8585
},
8686
},
@@ -214,7 +214,7 @@ Alert component is created using View component from react-native. It extends al
214214
</Table.TText>
215215
</Table.TD>
216216
<Table.TD>
217-
<Table.TText>solid | outline | accent</Table.TText>
217+
<Table.TText>solid | outline</Table.TText>
218218
</Table.TD>
219219
<Table.TD>
220220
<Table.TText>solid</Table.TText>

example/storybook-nativewind/src/core-components/nativewind/alert/index.tsx

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,20 @@ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
1414
const SCOPE = 'ALERT';
1515

1616
const alertStyle = tva({
17-
base: 'items-center py-3 px-4 rounded-md flex-row gap-2',
17+
base: 'items-center py-3 px-4 rounded-md flex-row gap-2 border-outline-100',
1818

1919
variants: {
2020
action: {
21-
error: 'bg-background-error border-error-300 ',
22-
warning: 'bg-background-warning border-warning-300',
23-
success: 'bg-background-success border-success-300',
24-
info: 'bg-background-info border-info-300',
25-
muted: 'bg-background-muted border-muted-300',
21+
error: 'bg-background-error',
22+
warning: 'bg-background-warning',
23+
success: 'bg-background-success',
24+
info: 'bg-background-info',
25+
muted: 'bg-background-muted',
2626
},
2727

2828
variant: {
2929
solid: '',
30-
outline: 'border bg-transparent',
31-
accent: 'border-l-4',
30+
outline: 'border bg-background-0',
3231
},
3332
},
3433
});
@@ -72,6 +71,15 @@ const alertTextStyle = tva({
7271
true: 'bg-yellow-500',
7372
},
7473
},
74+
parentVariants: {
75+
action: {
76+
error: 'text-error-800',
77+
warning: 'text-warning-800',
78+
success: 'text-success-800',
79+
info: 'text-info-800',
80+
muted: 'text-muted-800',
81+
},
82+
},
7583
});
7684

7785
const alertIconStyle = tva({
@@ -88,11 +96,11 @@ const alertIconStyle = tva({
8896
},
8997
parentVariants: {
9098
action: {
91-
error: 'text-error-500',
92-
warning: 'text-warning-500',
93-
success: 'text-success-500',
94-
info: 'text-info-500',
95-
muted: 'text-secondary-500',
99+
error: 'text-error-800',
100+
warning: 'text-warning-800',
101+
success: 'text-success-800',
102+
info: 'text-info-800',
103+
muted: 'text-secondary-800',
96104
},
97105
},
98106
});
@@ -214,6 +222,7 @@ const AlertText = React.forwardRef(
214222
}: { className?: string } & IAlertTextProps,
215223
ref?: any
216224
) => {
225+
const { action: parentAction } = useStyleContext(SCOPE);
217226
return (
218227
<UIAlert.Text
219228
// @ts-ignore
@@ -227,6 +236,9 @@ const AlertText = React.forwardRef(
227236
italic,
228237
highlight,
229238
class: className,
239+
parentVariants: {
240+
action: parentAction,
241+
},
230242
})}
231243
{...props}
232244
ref={ref}

0 commit comments

Comments
 (0)