diff --git a/change/@fluentui-react-components-fe7cdc8a-1fb6-480e-ab44-957a2668ccc9.json b/change/@fluentui-react-components-fe7cdc8a-1fb6-480e-ab44-957a2668ccc9.json new file mode 100644 index 0000000000000..14f1c5fb6434a --- /dev/null +++ b/change/@fluentui-react-components-fe7cdc8a-1fb6-480e-ab44-957a2668ccc9.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: Add missing Drawer and MessageBar context exports.", + "packageName": "@fluentui/react-components", + "email": "estebanmu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-drawer-921a3490-912a-4d75-a1e1-f7e2641a08c9.json b/change/@fluentui-react-drawer-921a3490-912a-4d75-a1e1-f7e2641a08c9.json new file mode 100644 index 0000000000000..c317ff71f7c68 --- /dev/null +++ b/change/@fluentui-react-drawer-921a3490-912a-4d75-a1e1-f7e2641a08c9.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: Add missing Drawer context exports.", + "packageName": "@fluentui/react-drawer", + "email": "estebanmu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-message-bar-c6ad9203-e841-4ab9-9f8b-510543557f04.json b/change/@fluentui-react-message-bar-c6ad9203-e841-4ab9-9f8b-510543557f04.json new file mode 100644 index 0000000000000..6a86f01407247 --- /dev/null +++ b/change/@fluentui-react-message-bar-c6ad9203-e841-4ab9-9f8b-510543557f04.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: Add missing context exports.", + "packageName": "@fluentui/react-message-bar", + "email": "estebanmu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-swatch-picker-preview-f8485f01-485e-4321-879a-70199576be32.json b/change/@fluentui-react-swatch-picker-preview-f8485f01-485e-4321-879a-70199576be32.json new file mode 100644 index 0000000000000..9983f0be96434 --- /dev/null +++ b/change/@fluentui-react-swatch-picker-preview-f8485f01-485e-4321-879a-70199576be32.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: Add missing SwatchPicker context exports.", + "packageName": "@fluentui/react-swatch-picker-preview", + "email": "estebanmu@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-components/etc/react-components.api.md b/packages/react-components/react-components/etc/react-components.api.md index 4bb29d09ba526..d4b154a9d99d0 100644 --- a/packages/react-components/react-components/etc/react-components.api.md +++ b/packages/react-components/react-components/etc/react-components.api.md @@ -290,6 +290,7 @@ import { drawerBodyClassNames } from '@fluentui/react-drawer'; import { DrawerBodyProps } from '@fluentui/react-drawer'; import { DrawerBodySlots } from '@fluentui/react-drawer'; import { DrawerBodyState } from '@fluentui/react-drawer'; +import { DrawerContextValue } from '@fluentui/react-drawer'; import { DrawerFooter } from '@fluentui/react-drawer'; import { drawerFooterClassNames } from '@fluentui/react-drawer'; import { DrawerFooterProps } from '@fluentui/react-drawer'; @@ -311,6 +312,7 @@ import { DrawerHeaderTitleProps } from '@fluentui/react-drawer'; import { DrawerHeaderTitleSlots } from '@fluentui/react-drawer'; import { DrawerHeaderTitleState } from '@fluentui/react-drawer'; import { DrawerProps } from '@fluentui/react-drawer'; +import { DrawerProvider } from '@fluentui/react-drawer'; import { DrawerSlots } from '@fluentui/react-drawer'; import { DrawerState } from '@fluentui/react-drawer'; import { Dropdown } from '@fluentui/react-combobox'; @@ -1337,6 +1339,8 @@ import { useDividerStyles_unstable } from '@fluentui/react-divider'; import { useDrawer_unstable } from '@fluentui/react-drawer'; import { useDrawerBody_unstable } from '@fluentui/react-drawer'; import { useDrawerBodyStyles_unstable } from '@fluentui/react-drawer'; +import { useDrawerContext_unstable } from '@fluentui/react-drawer'; +import { useDrawerContextValue } from '@fluentui/react-drawer'; import { useDrawerFooter_unstable } from '@fluentui/react-drawer'; import { useDrawerFooterStyles_unstable } from '@fluentui/react-drawer'; import { useDrawerHeader_unstable } from '@fluentui/react-drawer'; @@ -1435,10 +1439,12 @@ import { useMenuTriggerContext_unstable } from '@fluentui/react-menu'; import { useMergedRefs } from '@fluentui/react-utilities'; import { useMessageBar_unstable } from '@fluentui/react-message-bar'; import { useMessageBarActions_unstable } from '@fluentui/react-message-bar'; +import { useMessageBarActionsContextValue_unstable } from '@fluentui/react-message-bar'; import { useMessageBarActionsStyles_unstable } from '@fluentui/react-message-bar'; import { useMessageBarBody_unstable } from '@fluentui/react-message-bar'; import { useMessageBarBodyStyles_unstable } from '@fluentui/react-message-bar'; import { useMessageBarContext } from '@fluentui/react-message-bar'; +import { useMessageBarContextValue_unstable } from '@fluentui/react-message-bar'; import { useMessageBarGroup_unstable } from '@fluentui/react-message-bar'; import { useMessageBarGroupStyles_unstable } from '@fluentui/react-message-bar'; import { useMessageBarStyles_unstable } from '@fluentui/react-message-bar'; @@ -2214,6 +2220,8 @@ export { DrawerBodySlots } export { DrawerBodyState } +export { DrawerContextValue } + export { DrawerFooter } export { drawerFooterClassNames } @@ -2256,6 +2264,8 @@ export { DrawerHeaderTitleState } export { DrawerProps } +export { DrawerProvider } + export { DrawerSlots } export { DrawerState } @@ -4308,6 +4318,10 @@ export { useDrawerBody_unstable } export { useDrawerBodyStyles_unstable } +export { useDrawerContext_unstable } + +export { useDrawerContextValue } + export { useDrawerFooter_unstable } export { useDrawerFooterStyles_unstable } @@ -4504,6 +4518,8 @@ export { useMessageBar_unstable } export { useMessageBarActions_unstable } +export { useMessageBarActionsContextValue_unstable } + export { useMessageBarActionsStyles_unstable } export { useMessageBarBody_unstable } @@ -4512,6 +4528,8 @@ export { useMessageBarBodyStyles_unstable } export { useMessageBarContext } +export { useMessageBarContextValue_unstable } + export { useMessageBarGroup_unstable } export { useMessageBarGroupStyles_unstable } diff --git a/packages/react-components/react-components/src/index.ts b/packages/react-components/react-components/src/index.ts index 0844aa97ebfbb..14ef176925423 100644 --- a/packages/react-components/react-components/src/index.ts +++ b/packages/react-components/react-components/src/index.ts @@ -1425,6 +1425,8 @@ export { useMessageBarGroup_unstable, renderMessageBarGroup_unstable, messageBarGroupClassNames, + useMessageBarContextValue_unstable, + useMessageBarActionsContextValue_unstable, } from '@fluentui/react-message-bar'; export type { MessageBarProps, @@ -1495,6 +1497,9 @@ export { renderDrawerFooter_unstable, useDrawerFooterStyles_unstable, useDrawerFooter_unstable, + DrawerProvider, + useDrawerContextValue, + useDrawerContext_unstable, } from '@fluentui/react-drawer'; export type { @@ -1510,6 +1515,7 @@ export type { DrawerBodyProps, DrawerBodySlots, DrawerBodyState, + DrawerContextValue, DrawerHeaderProps, DrawerHeaderSlots, DrawerHeaderState, diff --git a/packages/react-components/react-drawer/etc/react-drawer.api.md b/packages/react-components/react-drawer/etc/react-drawer.api.md index 3f1e07ff8cb6d..bf6f813b0aff9 100644 --- a/packages/react-components/react-drawer/etc/react-drawer.api.md +++ b/packages/react-components/react-drawer/etc/react-drawer.api.md @@ -36,6 +36,12 @@ export type DrawerBodySlots = { // @public export type DrawerBodyState = ComponentState; +// @public (undocumented) +export type DrawerContextValue = { + scrollState: DrawerScrollState; + setScrollState: (scrollState: DrawerScrollState) => void; +}; + // @public export const DrawerFooter: ForwardRefComponent; @@ -115,6 +121,9 @@ export type DrawerProps = ComponentProps & { type?: 'inline' | 'overlay'; }; +// @public (undocumented) +export const DrawerProvider: React_2.Provider; + // @public (undocumented) export type DrawerSlots = { root: Slot; @@ -192,6 +201,12 @@ export const useDrawerBody_unstable: (props: DrawerBodyProps, ref: React_2.Ref DrawerBodyState; +// @public (undocumented) +export const useDrawerContext_unstable: () => DrawerContextValue; + +// @public (undocumented) +export const useDrawerContextValue: () => DrawerContextValue; + // @public export const useDrawerFooter_unstable: (props: DrawerFooterProps, ref: React_2.Ref) => DrawerFooterState; diff --git a/packages/react-components/react-drawer/src/index.ts b/packages/react-components/react-drawer/src/index.ts index 5848299da72e5..fc9aabb6bb003 100644 --- a/packages/react-components/react-drawer/src/index.ts +++ b/packages/react-components/react-drawer/src/index.ts @@ -1,3 +1,6 @@ +export { DrawerProvider, useDrawerContextValue, useDrawerContext_unstable } from './contexts'; +export type { DrawerContextValue } from './contexts'; + export { Drawer, renderDrawer_unstable, useDrawerStyles_unstable, useDrawer_unstable } from './Drawer'; export type { DrawerProps, DrawerSlots, DrawerState } from './Drawer'; diff --git a/packages/react-components/react-message-bar/etc/react-message-bar.api.md b/packages/react-components/react-message-bar/etc/react-message-bar.api.md index 5277dad3ebe5d..503a7323a5cc8 100644 --- a/packages/react-components/react-message-bar/etc/react-message-bar.api.md +++ b/packages/react-components/react-message-bar/etc/react-message-bar.api.md @@ -55,6 +55,9 @@ export type MessageBarBodyState = ComponentState; // @public (undocumented) export const messageBarClassNames: SlotClassNames; +// @public (undocumented) +export const messageBarContextDefaultValue: MessageBarContextValue; + // @public (undocumented) export const MessageBarContextProvider: React_2.Provider; @@ -129,6 +132,18 @@ export type MessageBarTitleSlots = { // @public export type MessageBarTitleState = ComponentState; +// @internal (undocumented) +export const messageBarTransitionContextDefaultValue: MessageBarTransitionContextValue; + +// @internal +export const MessageBarTransitionContextProvider: React_2.Provider; + +// @public (undocumented) +export type MessageBarTransitionContextValue = { + className: string; + nodeRef: React_2.Ref; +}; + // @public export const renderMessageBar_unstable: (state: MessageBarState, contexts: MessageBarContextValues) => JSX.Element; @@ -150,6 +165,9 @@ export const useMessageBar_unstable: (props: MessageBarProps, ref: React_2.Ref) => MessageBarActionsState; +// @public (undocumented) +export function useMessageBarActionsContextValue_unstable(): MessageBarActionsContextValues; + // @public export const useMessageBarActionsStyles_unstable: (state: MessageBarActionsState) => MessageBarActionsState; @@ -162,6 +180,9 @@ export const useMessageBarBodyStyles_unstable: (state: MessageBarBodyState) => M // @public (undocumented) export const useMessageBarContext: () => MessageBarContextValue; +// @public (undocumented) +export function useMessageBarContextValue_unstable(state: MessageBarState): MessageBarContextValues; + // @public export const useMessageBarGroup_unstable: (props: MessageBarGroupProps, ref: React_2.Ref) => MessageBarGroupState; @@ -177,6 +198,9 @@ export const useMessageBarTitle_unstable: (props: MessageBarTitleProps, ref: Rea // @public export const useMessageBarTitleStyles_unstable: (state: MessageBarTitleState) => MessageBarTitleState; +// @internal (undocumented) +export const useMessageBarTransitionContext: () => MessageBarTransitionContextValue; + // (No @packageDocumentation comment for this package) ``` diff --git a/packages/react-components/react-message-bar/src/components/MessageBar/index.ts b/packages/react-components/react-message-bar/src/components/MessageBar/index.ts index 1b87b685202c5..bd5ef92ccff1d 100644 --- a/packages/react-components/react-message-bar/src/components/MessageBar/index.ts +++ b/packages/react-components/react-message-bar/src/components/MessageBar/index.ts @@ -3,3 +3,4 @@ export * from './MessageBar.types'; export * from './renderMessageBar'; export * from './useMessageBar'; export * from './useMessageBarStyles.styles'; +export * from './useMessageBarContextValues'; diff --git a/packages/react-components/react-message-bar/src/components/MessageBarActions/index.ts b/packages/react-components/react-message-bar/src/components/MessageBarActions/index.ts index d8ba24f39657b..a51d0d9827298 100644 --- a/packages/react-components/react-message-bar/src/components/MessageBarActions/index.ts +++ b/packages/react-components/react-message-bar/src/components/MessageBarActions/index.ts @@ -3,3 +3,4 @@ export * from './MessageBarActions.types'; export * from './renderMessageBarActions'; export * from './useMessageBarActions'; export * from './useMessageBarActionsStyles.styles'; +export * from './useMessageBarActionsContextValues'; diff --git a/packages/react-components/react-message-bar/src/contexts/index.ts b/packages/react-components/react-message-bar/src/contexts/index.ts new file mode 100644 index 0000000000000..da1a1cbe1916a --- /dev/null +++ b/packages/react-components/react-message-bar/src/contexts/index.ts @@ -0,0 +1,2 @@ +export * from './messageBarContext'; +export * from './messageBarTransitionContext'; diff --git a/packages/react-components/react-message-bar/src/index.ts b/packages/react-components/react-message-bar/src/index.ts index 5772df9c6b940..43bb5195e5614 100644 --- a/packages/react-components/react-message-bar/src/index.ts +++ b/packages/react-components/react-message-bar/src/index.ts @@ -2,6 +2,7 @@ export { MessageBar, useMessageBarStyles_unstable, useMessageBar_unstable, + useMessageBarContextValue_unstable, renderMessageBar_unstable, messageBarClassNames, } from './MessageBar'; @@ -23,6 +24,7 @@ export { useMessageBarActionsStyles_unstable, useMessageBarActions_unstable, renderMessageBarActions_unstable, + useMessageBarActionsContextValue_unstable, messageBarActionsClassNames, } from './MessageBarActions'; @@ -38,8 +40,15 @@ export { export type { MessageBarBodyProps, MessageBarBodySlots, MessageBarBodyState } from './MessageBarBody'; -export { MessageBarContextProvider, useMessageBarContext } from './contexts/messageBarContext'; -export type { MessageBarContextValue } from './contexts/messageBarContext'; +export { + MessageBarContextProvider, + messageBarContextDefaultValue, + messageBarTransitionContextDefaultValue, + useMessageBarContext, + MessageBarTransitionContextProvider, + useMessageBarTransitionContext, +} from './contexts'; +export type { MessageBarContextValue, MessageBarTransitionContextValue } from './contexts'; export { MessageBarGroup, useMessageBarGroupStyles_unstable, diff --git a/packages/react-components/react-swatch-picker-preview/etc/react-swatch-picker-preview.api.md b/packages/react-components/react-swatch-picker-preview/etc/react-swatch-picker-preview.api.md index eb11c8742a68e..649efdc84e1d0 100644 --- a/packages/react-components/react-swatch-picker-preview/etc/react-swatch-picker-preview.api.md +++ b/packages/react-components/react-swatch-picker-preview/etc/react-swatch-picker-preview.api.md @@ -8,6 +8,7 @@ import type { ComponentProps } from '@fluentui/react-utilities'; import type { ComponentState } from '@fluentui/react-utilities'; +import type { ContextSelector } from '@fluentui/react-context-selector'; import type { EventData } from '@fluentui/react-utilities'; import type { EventHandler } from '@fluentui/react-utilities'; import type { ForwardRefComponent } from '@fluentui/react-utilities'; @@ -108,6 +109,23 @@ export const SwatchPicker: ForwardRefComponent; // @public (undocumented) export const swatchPickerClassNames: SlotClassNames; +// @public (undocumented) +export const swatchPickerContextDefaultValue: SwatchPickerContextValue; + +// @public +export type SwatchPickerContextValue = Pick & { + isGrid: boolean; + requestSelectionChange: (event: React_2.MouseEvent, data: { + selectedValue: string; + selectedSwatch: string; + }) => void; +}; + +// @public (undocumented) +export type SwatchPickerContextValues = { + swatchPicker: SwatchPickerContextValue; +}; + // @public (undocumented) export type SwatchPickerGridProps = { items: SwatchProps[]; @@ -139,6 +157,9 @@ export type SwatchPickerProps = ComponentProps & { spacing?: 'small' | 'medium'; }; +// @public (undocumented) +export const SwatchPickerProvider: React_2.Provider & React_2.FC>; + // @public export const SwatchPickerRow: ForwardRefComponent; @@ -190,6 +211,12 @@ export const useImageSwatchStyles_unstable: (state: ImageSwatchState) => ImageSw // @public export const useSwatchPicker_unstable: (props: SwatchPickerProps, ref: React_2.Ref) => SwatchPickerState; +// @public (undocumented) +export const useSwatchPickerContextValue_unstable: (selector: ContextSelector) => T; + +// @public (undocumented) +export const useSwatchPickerContextValues: (state: SwatchPickerState) => SwatchPickerContextValues; + // @public export const useSwatchPickerRow_unstable: (props: SwatchPickerRowProps, ref: React_2.Ref) => SwatchPickerRowState; diff --git a/packages/react-components/react-swatch-picker-preview/src/contexts/index.ts b/packages/react-components/react-swatch-picker-preview/src/contexts/index.ts new file mode 100644 index 0000000000000..6a485d0417ac9 --- /dev/null +++ b/packages/react-components/react-swatch-picker-preview/src/contexts/index.ts @@ -0,0 +1 @@ +export * from './swatchPicker'; diff --git a/packages/react-components/react-swatch-picker-preview/src/contexts/swatchPicker.ts b/packages/react-components/react-swatch-picker-preview/src/contexts/swatchPicker.ts index 13128f44eceab..a7cb438fd91bb 100644 --- a/packages/react-components/react-swatch-picker-preview/src/contexts/swatchPicker.ts +++ b/packages/react-components/react-swatch-picker-preview/src/contexts/swatchPicker.ts @@ -1,6 +1,7 @@ import * as React from 'react'; -import { createContext, ContextSelector, useContextSelector, Context } from '@fluentui/react-context-selector'; -import { SwatchPickerProps, SwatchPickerState } from '../components/SwatchPicker/SwatchPicker.types'; +import { createContext, useContextSelector } from '@fluentui/react-context-selector'; +import type { ContextSelector, Context } from '@fluentui/react-context-selector'; +import type { SwatchPickerProps, SwatchPickerState } from '../components/SwatchPicker/SwatchPicker.types'; /** * The context through which individual color controls communicate with the picker. diff --git a/packages/react-components/react-swatch-picker-preview/src/index.ts b/packages/react-components/react-swatch-picker-preview/src/index.ts index 417df711cb2b0..7a4d2157f9c6b 100644 --- a/packages/react-components/react-swatch-picker-preview/src/index.ts +++ b/packages/react-components/react-swatch-picker-preview/src/index.ts @@ -5,6 +5,13 @@ export { useSwatchPicker_unstable, swatchPickerClassNames, } from './SwatchPicker'; +export { + SwatchPickerProvider, + swatchPickerContextDefaultValue, + useSwatchPickerContextValue_unstable, + useSwatchPickerContextValues, +} from './contexts'; +export type { SwatchPickerContextValue, SwatchPickerContextValues } from './contexts'; export type { SwatchPickerProps, SwatchPickerSlots,