Skip to content

Commit

Permalink
feat(react-tags-preview): add useCustomStyleHook_unstable to all comp…
Browse files Browse the repository at this point in the history
…onents (#29237)

* fix

* chg

* react-provider api change
  • Loading branch information
YuanboXue-Amber authored Sep 22, 2023
1 parent 0327a2d commit 45ab251
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: add custom style hooks for tag components",
"packageName": "@fluentui/react-provider",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: add custom style hooks for tag components",
"packageName": "@fluentui/react-shared-contexts",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: add custom style hooks for tag components",
"packageName": "@fluentui/react-tags-preview",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ export const FluentProvider: React_2.ForwardRefExoticComponent<Omit<ComponentPro
useDrawerHeaderTitleStyles_unstable: (state: unknown) => void;
useDrawerBodyStyles_unstable: (state: unknown) => void;
useDrawerFooterStyles_unstable: (state: unknown) => void;
useInteractionTagStyles_unstable: (state: unknown) => void;
useInteractionTagPrimaryStyles_unstable: (state: unknown) => void;
useInteractionTagSecondaryStyles_unstable: (state: unknown) => void;
useTagStyles_unstable: (state: unknown) => void;
useTagGroupStyles_unstable: (state: unknown) => void;
}> | undefined;
dir?: "ltr" | "rtl" | undefined;
targetDocument?: Document | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ export const CustomStyleHooksContext_unstable: React_2.Context<Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerBodyStyles_unstable: CustomStyleHook;
useDrawerFooterStyles_unstable: CustomStyleHook;
useInteractionTagStyles_unstable: CustomStyleHook;
useInteractionTagPrimaryStyles_unstable: CustomStyleHook;
useInteractionTagSecondaryStyles_unstable: CustomStyleHook;
useTagStyles_unstable: CustomStyleHook;
useTagGroupStyles_unstable: CustomStyleHook;
}> | undefined>;

// @public (undocumented)
Expand Down Expand Up @@ -209,6 +214,11 @@ export type CustomStyleHooksContextValue_unstable = Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerBodyStyles_unstable: CustomStyleHook;
useDrawerFooterStyles_unstable: CustomStyleHook;
useInteractionTagStyles_unstable: CustomStyleHook;
useInteractionTagPrimaryStyles_unstable: CustomStyleHook;
useInteractionTagSecondaryStyles_unstable: CustomStyleHook;
useTagStyles_unstable: CustomStyleHook;
useTagGroupStyles_unstable: CustomStyleHook;
}>;

// @internal (undocumented)
Expand Down Expand Up @@ -304,6 +314,11 @@ export const CustomStyleHooksProvider_unstable: React_2.Provider<Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerBodyStyles_unstable: CustomStyleHook;
useDrawerFooterStyles_unstable: CustomStyleHook;
useInteractionTagStyles_unstable: CustomStyleHook;
useInteractionTagPrimaryStyles_unstable: CustomStyleHook;
useInteractionTagSecondaryStyles_unstable: CustomStyleHook;
useTagStyles_unstable: CustomStyleHook;
useTagGroupStyles_unstable: CustomStyleHook;
}> | undefined>;

// @internal (undocumented)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export type CustomStyleHooksContextValue = Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerBodyStyles_unstable: CustomStyleHook;
useDrawerFooterStyles_unstable: CustomStyleHook;
useInteractionTagStyles_unstable: CustomStyleHook;
useInteractionTagPrimaryStyles_unstable: CustomStyleHook;
useInteractionTagSecondaryStyles_unstable: CustomStyleHook;
useTagStyles_unstable: CustomStyleHook;
useTagGroupStyles_unstable: CustomStyleHook;
}>;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useInteractionTagStyles_unstable } from './useInteractionTagStyles.styl
import { useInteractionTagContextValues_unstable } from './useInteractionTagContextValues';
import type { InteractionTagProps } from './InteractionTag.types';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';

/**
* InteractionTag component - a visual representation of an attribute with primary and secondary actions.
Expand All @@ -14,6 +15,9 @@ export const InteractionTag: ForwardRefComponent<InteractionTagProps> = React.fo
const state = useInteractionTag_unstable(props, ref);

useInteractionTagStyles_unstable(state);

useCustomStyleHook_unstable('useInteractionTagStyles_unstable')(state);

return renderInteractionTag_unstable(state, useInteractionTagContextValues_unstable(state));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { renderInteractionTagPrimary_unstable } from './renderInteractionTagPrim
import { useInteractionTagPrimaryStyles_unstable } from './useInteractionTagPrimaryStyles.styles';
import type { InteractionTagPrimaryProps } from './InteractionTagPrimary.types';
import { useTagAvatarContextValues_unstable } from '../../utils';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';

/**
* InteractionTagPrimary component - used as the first child of the `InteractionTag` component.
Expand All @@ -14,6 +15,9 @@ export const InteractionTagPrimary: ForwardRefComponent<InteractionTagPrimaryPro
const state = useInteractionTagPrimary_unstable(props, ref);

useInteractionTagPrimaryStyles_unstable(state);

useCustomStyleHook_unstable('useInteractionTagPrimaryStyles_unstable')(state);

return renderInteractionTagPrimary_unstable(state, useTagAvatarContextValues_unstable(state));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useInteractionTagSecondary_unstable } from './useInteractionTagSecondar
import { renderInteractionTagSecondary_unstable } from './renderInteractionTagSecondary';
import { useInteractionTagSecondaryStyles_unstable } from './useInteractionTagSecondaryStyles.styles';
import type { InteractionTagSecondaryProps } from './InteractionTagSecondary.types';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';

/**
* InteractionTagSecondary component - used as the second child of the `InteractionTag` component and provides the secondary action, which is dismiss by default.
Expand All @@ -13,6 +14,9 @@ export const InteractionTagSecondary: ForwardRefComponent<InteractionTagSecondar
const state = useInteractionTagSecondary_unstable(props, ref);

useInteractionTagSecondaryStyles_unstable(state);

useCustomStyleHook_unstable('useInteractionTagSecondaryStyles_unstable')(state);

return renderInteractionTagSecondary_unstable(state);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { renderTag_unstable } from './renderTag';
import { useTagStyles_unstable } from './useTagStyles.styles';
import type { TagProps } from './Tag.types';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useTagAvatarContextValues_unstable } from '../../utils';

/**
Expand All @@ -14,6 +15,9 @@ export const Tag: ForwardRefComponent<TagProps> = React.forwardRef((props, ref)
const state = useTag_unstable(props, ref);

useTagStyles_unstable(state);

useCustomStyleHook_unstable('useTagStyles_unstable')(state);

return renderTag_unstable(state, useTagAvatarContextValues_unstable(state));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { renderTagGroup_unstable } from './renderTagGroup';
import { useTagGroupStyles_unstable } from './useTagGroupStyles.styles';
import type { TagGroupProps } from './TagGroup.types';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { useTagGroupContextValues_unstable } from './useTagGroupContextValues';

/**
Expand All @@ -14,6 +15,9 @@ export const TagGroup: ForwardRefComponent<TagGroupProps> = React.forwardRef((pr
const state = useTagGroup_unstable(props, ref);

useTagGroupStyles_unstable(state);

useCustomStyleHook_unstable('useTagGroupStyles_unstable')(state);

return renderTagGroup_unstable(state, useTagGroupContextValues_unstable(state));
});

Expand Down

0 comments on commit 45ab251

Please sign in to comment.