Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-textarea): Add shadow variant of filled appearance #24512

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Adding filled with shadow appearance.",
"packageName": "@fluentui/react-textarea",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const textareaClassNames: SlotClassNames<TextareaSlots>;

// @public
export type TextareaProps = Omit<ComponentProps<Partial<TextareaSlots>, 'textarea'>, 'defaultValue' | 'onChange' | 'size' | 'value'> & {
appearance?: 'outline' | 'filled-darker' | 'filled-lighter';
appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';
defaultValue?: string;
onChange?: (ev: React_2.ChangeEvent<HTMLTextAreaElement>, data: TextareaOnChangeData) => void;
resize?: 'none' | 'horizontal' | 'vertical' | 'both';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type TextareaProps = Omit<
*
* @default outline
*/
appearance?: 'outline' | 'filled-darker' | 'filled-lighter';
appearance?: 'outline' | 'filled-darker' | 'filled-lighter' | 'filled-darker-shadow' | 'filled-lighter-shadow';
sopranopillow marked this conversation as resolved.
Show resolved Hide resolved

/**
* The default value of the Textarea.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ const useRootStyles = makeStyles({
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStrokeInteractive),
},

'filled-darker-shadow': {
backgroundColor: tokens.colorNeutralBackground3,
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStrokeInteractive),
boxShadow: tokens.shadow2,
},

'filled-lighter-shadow': {
backgroundColor: tokens.colorNeutralBackground1,
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorTransparentStrokeInteractive),
boxShadow: tokens.shadow2,
},

outline: {
backgroundColor: tokens.colorNeutralBackground1,
...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const useStyles = makeStyles({
export const Appearance = () => {
const outlineId = useId('textarea-outline');
const filledDarkerId = useId('textarea-filleddarker');
const filledDarkerShadowId = useId('textarea-filleddarkershadow');
const filledLighterId = useId('textarea-filledlighter');
const filledLighterShadowId = useId('textarea-filledlightershadow');
const styles = useStyles();

return (
Expand All @@ -54,6 +56,26 @@ export const Appearance = () => {
<Label htmlFor={filledLighterId}>Textarea with Filled Lighter appearance.</Label>
<Textarea id={filledLighterId} appearance="filled-lighter" placeholder="type here..." resize="both" />
</div>

<div className={styles.filledDarker}>
sopranopillow marked this conversation as resolved.
Show resolved Hide resolved
<Label htmlFor={filledDarkerShadowId}>Textarea with Filled Darker with shadow appearance.</Label>
<Textarea
id={filledDarkerShadowId}
appearance="filled-darker-shadow"
placeholder="type here..."
resize="both"
/>
</div>

<div className={styles.filledLighter}>
<Label htmlFor={filledLighterShadowId}>Textarea with Filled Lighter with shadow appearance.</Label>
<Textarea
id={filledLighterShadowId}
appearance="filled-lighter-shadow"
placeholder="type here..."
resize="both"
/>
</div>
</div>
);
};
Expand Down