Skip to content

Commit

Permalink
feat(react-textarea): Add shadow variant of filled appearance (#24512)
Browse files Browse the repository at this point in the history
* feat: Adding filled with shadow appearance.

* change files

* updating appearance background for filled examples
  • Loading branch information
sopranopillow authored Sep 15, 2022
1 parent 066df30 commit 151520d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
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';

/**
* The default value of the Textarea.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ const useRootStyles = makeStyles({
backgroundColor: tokens.colorNeutralBackground1,
},

'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}>
<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

0 comments on commit 151520d

Please sign in to comment.