Skip to content

Commit

Permalink
chore(react-tree): removes BaseTreeItem premature generalization (#26302
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bsunderhus authored Jan 12, 2023
1 parent e3377c2 commit ca4ddc8
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 265 deletions.
38 changes: 6 additions & 32 deletions packages/react-components/react-tree/etc/react-tree.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,6 @@ import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';

// @public
export const BaseTreeItem: ForwardRefComponent<BaseTreeItemProps>;

// @public (undocumented)
export const baseTreeItemClassNames: SlotClassNames<BaseTreeItemSlots>;

// @public
export type BaseTreeItemProps = ComponentProps<BaseTreeItemSlots>;

// @public (undocumented)
export type BaseTreeItemSlots = {
root: Slot<'div'>;
};

// @public
export type BaseTreeItemState = ComponentState<BaseTreeItemSlots> & {
open: boolean;
isLeaf: boolean;
};

// @public
export const renderBaseTreeItem_unstable: (state: BaseTreeItemState) => JSX.Element;

// @public (undocumented)
export const renderTree_unstable: (state: TreeState, contextValues: TreeContextValues) => JSX.Element;

Expand Down Expand Up @@ -70,10 +47,11 @@ export const TreeItem: ForwardRefComponent<TreeItemProps>;
export const treeItemClassNames: SlotClassNames<TreeItemSlots>;

// @public
export type TreeItemProps = ComponentProps<Partial<TreeItemSlots>> & BaseTreeItemProps;
export type TreeItemProps = ComponentProps<Partial<TreeItemSlots>>;

// @public (undocumented)
export type TreeItemSlots = BaseTreeItemSlots & {
export type TreeItemSlots = {
root: Slot<'div'>;
expandIcon?: Slot<'span'>;
iconBefore?: Slot<'span'>;
iconAfter?: Slot<'span'>;
Expand All @@ -83,7 +61,9 @@ export type TreeItemSlots = BaseTreeItemSlots & {
};

// @public
export type TreeItemState = ComponentState<TreeItemSlots> & BaseTreeItemState & {
export type TreeItemState = ComponentState<TreeItemSlots> & {
open: boolean;
isLeaf: boolean;
keepActionsOpen: boolean;
};

Expand All @@ -109,12 +89,6 @@ export type TreeState = ComponentState<TreeSlots> & TreeContextValue & {
open: boolean;
};

// @public
export const useBaseTreeItem_unstable: (props: BaseTreeItemProps, ref: React_2.Ref<HTMLDivElement>) => BaseTreeItemState;

// @public
export const useBaseTreeItemStyles_unstable: (state: BaseTreeItemState) => BaseTreeItemState;

// @public
export const useTree_unstable: (props: TreeProps, ref: React_2.Ref<HTMLElement>) => TreeState;

Expand Down
1 change: 0 additions & 1 deletion packages/react-components/react-tree/src/BaseTreeItem.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
import { BaseTreeItemProps, BaseTreeItemSlots, BaseTreeItemState } from '../BaseTreeItem/index';

export type TreeItemSlots = BaseTreeItemSlots & {
export type TreeItemSlots = {
root: Slot<'div'>;
/**
* Expand icon slot,
* by default renders a chevron icon to indicate opening and closing
Expand Down Expand Up @@ -30,15 +30,16 @@ export type TreeItemSlots = BaseTreeItemSlots & {
/**
* TreeItem Props
*/
export type TreeItemProps = ComponentProps<Partial<TreeItemSlots>> & BaseTreeItemProps;
export type TreeItemProps = ComponentProps<Partial<TreeItemSlots>>;

/**
* State used in rendering TreeItem
*/
export type TreeItemState = ComponentState<TreeItemSlots> &
BaseTreeItemState & {
/**
* boolean indicating that actions should remain open due to focus on some portal
*/
keepActionsOpen: boolean;
};
export type TreeItemState = ComponentState<TreeItemSlots> & {
open: boolean;
isLeaf: boolean;
/**
* boolean indicating that actions should remain open due to focus on some portal
*/
keepActionsOpen: boolean;
};
Loading

0 comments on commit ca4ddc8

Please sign in to comment.