Skip to content

Commit 1405b39

Browse files
Add tint appearance to CAP button (#571)
1 parent e19132c commit 1405b39

File tree

7 files changed

+41
-7
lines changed

7 files changed

+41
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Add CAP Button tint appearance and export the button/types from react-cap-theme.",
4+
"packageName": "@fluentui-contrib/react-cap-theme",
5+
"email": "olkatruk@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-cap-theme/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The `@fluentui/react-cap-theme` package implements a `@fluentui/react-components` theme.
1+
The `@fluentui-contrib/react-cap-theme` package implements a `@fluentui/react-components` theme.
22

33
## Component Spec
44

packages/react-cap-theme/src/components/Button/Button.styles.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import {
2-
makeStyles,
3-
mergeClasses,
4-
type ButtonState,
5-
} from '@fluentui/react-components';
1+
import { makeStyles, mergeClasses } from '@fluentui/react-components';
2+
import type { ButtonState } from './Button.types';
63
import { CAP_TOKENS } from '../../theme/CAPTheme';
74

85
export const useButtonStyles = makeStyles({
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use client';
2+
3+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
4+
import { Button as FluentButton } from '@fluentui/react-components';
5+
import type { ButtonProps } from './Button.types';
6+
7+
export const Button = FluentButton as ForwardRefComponent<ButtonProps>;
8+
9+
Button.displayName = 'Button';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type {
2+
ButtonProps as FluentButtonProps,
3+
ButtonState as FluentButtonState,
4+
} from '@fluentui/react-components';
5+
6+
export type ButtonAppearance =
7+
| NonNullable<FluentButtonProps['appearance']>
8+
| 'tint';
9+
10+
export type ButtonProps = Omit<FluentButtonProps, 'appearance'> & {
11+
appearance?: ButtonAppearance;
12+
};
13+
14+
export type ButtonState = Omit<FluentButtonState, 'appearance'> & {
15+
appearance?: ButtonAppearance;
16+
};

packages/react-cap-theme/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ export {
44
CAP_THEME_SHAREPOINT,
55
CAP_THEME_TEAMS,
66
} from './theme/CAPTheme';
7+
export { Button } from './components/Button/Button';
8+
export type {
9+
ButtonProps,
10+
ButtonState,
11+
} from './components/Button/Button.types';

packages/react-cap-theme/stories/components/Button.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { Button, type ButtonProps } from '@fluentui/react-components';
2+
import { Button, type ButtonProps } from '@fluentui-contrib/react-cap-theme';
33
import { CAPThemeExamples, useCAPThemeSelection } from '../StorybookUtils';
44
import {
55
bundleIcon,

0 commit comments

Comments
 (0)