Skip to content

Commit dc08847

Browse files
Change files
1 parent 5085838 commit dc08847

File tree

8 files changed

+33
-22
lines changed

8 files changed

+33
-22
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Add Drawer component styles and integrate into CAP theme",
4+
"packageName": "@fluentui-contrib/react-cap-theme",
5+
"email": "olkatruk@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CAP_TOKENS } from '../../theme/CAPTheme';
88
export const useDrawerStyles = makeStyles({
99
root: {
1010
borderRadius: CAP_TOKENS['cap/ctrl/flyout/base-corner'],
11+
boxShadow: CAP_TOKENS['cap/ctrl/flyout/Elevation']
1112
},
1213
});
1314

packages/react-cap-theme/src/components/Drawer/DrawerBody.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CAP_TOKENS } from '../../theme/CAPTheme';
99
export const useDrawerBodyStyles = makeStyles({
1010
root: {
1111
paddingLeft: CAP_TOKENS['cap/ctrl/flyout/body-Padding-Left'],
12-
paddingRight: CAP_TOKENS['cap/ctrl/flyout/body-Padding-Right']
12+
paddingRight: CAP_TOKENS['cap/ctrl/flyout/body-Padding-Right'],
1313
},
1414
});
1515

packages/react-cap-theme/src/components/Drawer/DrawerHeaderTitle.styles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ export function useDrawerHeaderTitleStylesHook(
2525
}
2626

2727
if (state.action) {
28-
state.action.className = mergeClasses(state.action.className, styles.action);
28+
state.action.className = mergeClasses(
29+
state.action.className,
30+
styles.action
31+
);
2932
}
3033

3134
return state;

packages/react-cap-theme/src/components/Drawer/OverlayDrawer.styles.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66

77
export const useOverlayDrawerStyles = makeStyles({
88
root: {},
9-
backdrop: {},
109
});
1110

1211
export function useOverlayDrawerStylesHook(
@@ -16,10 +15,5 @@ export function useOverlayDrawerStylesHook(
1615

1716
state.root.className = mergeClasses(state.root.className, styles.root);
1817

19-
const backdrop = state.root.backdrop;
20-
if (backdrop) {
21-
backdrop.className = mergeClasses(backdrop.className, styles.backdrop);
22-
}
23-
2418
return state;
2519
}

packages/react-cap-theme/src/theme/CAPTheme.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const DrawerTokens = {
108108
'cap/ctrl/flyout/Footer-Padding-bottom': { type: 'dimension' },
109109
'cap/ctrl/flyout/footer-Padding-Left': { type: 'dimension' },
110110
'cap/ctrl/flyout/footer-Padding-Right': { type: 'dimension' },
111-
'fixme/ctrl/drawer/footer/content-alignment': { type: 'alignment'}
111+
'fixme/ctrl/drawer/footer/content-alignment': { type: 'alignment' },
112112
} as const satisfies Record<AllowedTokenName, TokenSchema>;
113113

114114
export const CAPTokensSchema = {
@@ -121,7 +121,7 @@ export const CAPTokensSchema = {
121121
...InputTokens,
122122
...MenuTokens,
123123
...TooltipTokens,
124-
...DrawerTokens
124+
...DrawerTokens,
125125
} as const satisfies { [key: AllowedTokenName]: TokenSchema };
126126

127127
export const CAP_TOKENS = Object.keys(CAPTokensSchema).reduce((acc, key) => {
@@ -190,7 +190,7 @@ export const CAP_THEME_DEFAULTS = {
190190
'cap/ctrl/flyout/Footer-Padding-bottom': tokens.spacingVerticalXL,
191191
'cap/ctrl/flyout/footer-Padding-Left': tokens.spacingHorizontalXL,
192192
'cap/ctrl/flyout/footer-Padding-Right': tokens.spacingHorizontalXL,
193-
'fixme/ctrl/drawer/footer/content-alignment': 'flex-end'
193+
'fixme/ctrl/drawer/footer/content-alignment': 'flex-end',
194194
} as const satisfies CAPTheme;
195195

196196
export const CAP_THEME_TEAMS = {

packages/react-cap-theme/stories/StorybookUtils.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ export const CAPThemeExamples = ({
9494
<div className={styles.themeLabel}>Showing: {selectedTheme.label}</div>
9595
{examples.map((example) => (
9696
<div className={styles.row} key={example.title}>
97-
{example.title && (<div className={styles.example}>{example.title}</div>)}
97+
{example.title && (
98+
<div className={styles.example}>{example.title}</div>
99+
)}
98100
<div className={styles.rendered}>
99101
{renderExample(example, selectedTheme.variant)}
100102
</div>

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ const drawerBodyText = [
1717
'Eum aliquid aperiam, laborum labore excepturi nisi odio deserunt facilis error. Mollitia dolor quidem a.',
1818
].join(' ');
1919

20-
const DrawerContent = ({
21-
onClose,
22-
}: {
23-
onClose: () => void;
24-
}) => (
20+
const DrawerContent = ({ onClose }: { onClose: () => void }) => (
2521
<>
2622
<DrawerHeader>
2723
<DrawerHeaderTitle
@@ -37,7 +33,11 @@ const DrawerContent = ({
3733
Title goes here
3834
</DrawerHeaderTitle>
3935
</DrawerHeader>
40-
<DrawerBody tabIndex={0} role="group" aria-label="Example scrolling content">
36+
<DrawerBody
37+
tabIndex={0}
38+
role="group"
39+
aria-label="Example scrolling content"
40+
>
4141
{drawerBodyText}
4242
</DrawerBody>
4343
<DrawerFooter>
@@ -75,14 +75,18 @@ const PositionExample = ({
7575
);
7676
};
7777

78-
export const CAPDrawerStory = ({ size, position }: { size: DrawerProps['size'], position: DrawerProps['position'] }) => {
78+
export const CAPDrawerStory = ({
79+
size,
80+
position,
81+
}: {
82+
size: DrawerProps['size'];
83+
position: DrawerProps['position'];
84+
}) => {
7985
return (
8086
<CAPThemeExamples
8187
examples={[
8288
{
83-
render: () => (
84-
<PositionExample size={size} position={position} />
85-
),
89+
render: () => <PositionExample size={size} position={position} />,
8690
},
8791
]}
8892
/>

0 commit comments

Comments
 (0)