Skip to content

Commit af6a9cb

Browse files
chore(TimePickerCompat): add custom style hook (#30058)
* add custom style hook * api in provider
1 parent 4dad5d7 commit af6a9cb

8 files changed

+30
-2
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": "fix: add custom style hook for TimePicker compat.",
4+
"packageName": "@fluentui/react-provider",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix: add custom style hook for TimePicker compat.",
4+
"packageName": "@fluentui/react-shared-contexts",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix: add custom style hook for TimePicker compat.",
4+
"packageName": "@fluentui/react-timepicker-compat-preview",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-provider/etc/react-provider.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export const FluentProvider: React_2.ForwardRefExoticComponent<Omit<ComponentPro
148148
useTeachingPopoverPageCountStyles_unstable: (state: unknown) => void;
149149
useTeachingPopoverSurfaceStyles_unstable: (state: unknown) => void;
150150
useTeachingPopoverTitleStyles_unstable: (state: unknown) => void;
151+
useTimePickerCompatStyles_unstable: (state: unknown) => void;
151152
}> | undefined;
152153
dir?: "ltr" | "rtl" | undefined;
153154
targetDocument?: Document | undefined;

packages/react-components/react-shared-contexts/etc/react-shared-contexts.api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export const CustomStyleHooksContext_unstable: React_2.Context<Partial<{
143143
useTeachingPopoverPageCountStyles_unstable: CustomStyleHook;
144144
useTeachingPopoverSurfaceStyles_unstable: CustomStyleHook;
145145
useTeachingPopoverTitleStyles_unstable: CustomStyleHook;
146+
useTimePickerCompatStyles_unstable: CustomStyleHook;
146147
}> | undefined>;
147148

148149
// @public (undocumented)
@@ -267,6 +268,7 @@ export type CustomStyleHooksContextValue_unstable = Partial<{
267268
useTeachingPopoverPageCountStyles_unstable: CustomStyleHook;
268269
useTeachingPopoverSurfaceStyles_unstable: CustomStyleHook;
269270
useTeachingPopoverTitleStyles_unstable: CustomStyleHook;
271+
useTimePickerCompatStyles_unstable: CustomStyleHook;
270272
}>;
271273

272274
// @internal (undocumented)
@@ -391,6 +393,7 @@ export const CustomStyleHooksProvider_unstable: React_2.Provider<Partial<{
391393
useTeachingPopoverPageCountStyles_unstable: CustomStyleHook;
392394
useTeachingPopoverSurfaceStyles_unstable: CustomStyleHook;
393395
useTeachingPopoverTitleStyles_unstable: CustomStyleHook;
396+
useTimePickerCompatStyles_unstable: CustomStyleHook;
394397
}> | undefined>;
395398

396399
// @internal (undocumented)

packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export type CustomStyleHooksContextValue = Partial<{
128128
useTeachingPopoverPageCountStyles_unstable: CustomStyleHook;
129129
useTeachingPopoverSurfaceStyles_unstable: CustomStyleHook;
130130
useTeachingPopoverTitleStyles_unstable: CustomStyleHook;
131+
useTimePickerCompatStyles_unstable: CustomStyleHook;
131132
}>;
132133

133134
/**

packages/react-components/react-timepicker-compat-preview/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@fluentui/keyboard-keys": "^9.0.7",
3737
"@fluentui/react-combobox": "^9.5.33",
3838
"@fluentui/react-jsx-runtime": "^9.0.21",
39+
"@fluentui/react-shared-contexts": "^9.13.1",
3940
"@fluentui/react-theme": "^9.1.16",
4041
"@fluentui/react-utilities": "^9.15.3",
4142
"@griffel/react": "^1.5.14",

packages/react-components/react-timepicker-compat-preview/src/components/TimePicker/TimePicker.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import { useTimePicker_unstable } from './useTimePicker';
44
import { useTimePickerStyles_unstable } from './useTimePickerStyles.styles';
55
import type { TimePickerProps } from './TimePicker.types';
66
import { renderCombobox_unstable, useComboboxContextValues } from '@fluentui/react-combobox';
7+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
78

89
/**
9-
* TimePicker component - TODO: add more docs
10+
* TimePicker Compat component
1011
*/
1112
export const TimePicker: ForwardRefComponent<TimePickerProps> = React.forwardRef((props, ref) => {
1213
const state = useTimePicker_unstable(props, ref);
1314

1415
const contextValues = useComboboxContextValues(state);
1516

1617
useTimePickerStyles_unstable(state);
17-
// TODO customStyles hook
18+
useCustomStyleHook_unstable('useTimePickerCompatStyles_unstable')(state);
1819

1920
return renderCombobox_unstable(state, contextValues);
2021
});

0 commit comments

Comments
 (0)