Skip to content

Commit

Permalink
Compat for react-text
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus committed Jun 28, 2021
1 parent 391f141 commit c2088cb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions packages/react-checkbox/etc/react-checkbox.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
```ts

import { ComponentProps } from '@fluentui/react-utilities';
import { ComponentState } from '@fluentui/react-utilities';
import { ComponentPropsCompat } from '@fluentui/react-utilities';
import { ComponentStateCompat } from '@fluentui/react-utilities';
import * as React_2 from 'react';

// @public
Expand All @@ -15,7 +15,7 @@ export const Checkbox: React_2.ForwardRefExoticComponent<CheckboxProps & React_2
export type CheckboxDefaultedProps = never;

// @public
export interface CheckboxProps extends ComponentProps, React_2.HTMLAttributes<HTMLElement> {
export interface CheckboxProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
}

// @public
Expand All @@ -25,7 +25,7 @@ export type CheckboxShorthandProps = never;
export const checkboxShorthandProps: CheckboxShorthandProps[];

// @public
export interface CheckboxState extends ComponentState<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
export interface CheckboxState extends ComponentStateCompat<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
ref: React_2.Ref<HTMLElement>;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { ComponentProps, ComponentState } from '@fluentui/react-utilities';
import { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities';

/**
* Checkbox Props
*/
export interface CheckboxProps extends ComponentProps, React.HTMLAttributes<HTMLElement> {
export interface CheckboxProps extends ComponentPropsCompat, React.HTMLAttributes<HTMLElement> {
/*
* TODO Add props and slots here
* Any slot property should be listed in the checkboxShorthandProps array below
Expand All @@ -25,7 +25,8 @@ export type CheckboxDefaultedProps = never; // TODO add names of properties with
/**
* State used in rendering Checkbox
*/
export interface CheckboxState extends ComponentState<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
export interface CheckboxState
extends ComponentStateCompat<CheckboxProps, CheckboxShorthandProps, CheckboxDefaultedProps> {
/**
* Ref to the root element
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
import { getSlotsCompat } from '@fluentui/react-utilities';
import { CheckboxState } from './Checkbox.types';
import { checkboxShorthandProps } from './useCheckbox';

/**
* Render the final JSX of Checkbox
*/
export const renderCheckbox = (state: CheckboxState) => {
const { slots, slotProps } = getSlots(state, checkboxShorthandProps);
const { slots, slotProps } = getSlotsCompat(state, checkboxShorthandProps);

return (
<slots.root {...slotProps.root}>
Expand Down
8 changes: 4 additions & 4 deletions packages/react-text/etc/react-text.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
```ts

import { ComponentProps } from '@fluentui/react-utilities';
import { ComponentState } from '@fluentui/react-utilities';
import { ComponentPropsCompat } from '@fluentui/react-utilities';
import { ComponentStateCompat } from '@fluentui/react-utilities';
import * as React_2 from 'react';

// @public
Expand All @@ -20,11 +20,11 @@ export { Text_2 as Text }
export type TextDefaultedProps = never;

// @public
export interface TextProps extends ComponentProps, React_2.HTMLAttributes<HTMLElement> {
export interface TextProps extends ComponentPropsCompat, React_2.HTMLAttributes<HTMLElement> {
}

// @public
export interface TextState extends ComponentState<TextProps, TextDefaultedProps> {
export interface TextState extends ComponentStateCompat<TextProps, TextDefaultedProps> {
ref: React_2.Ref<HTMLElement>;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/react-text/src/components/Text/Text.types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { ComponentProps, ComponentState } from '@fluentui/react-utilities';
import { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities';

/**
* Text Props
*/
export interface TextProps extends ComponentProps, React.HTMLAttributes<HTMLElement> {
export interface TextProps extends ComponentPropsCompat, React.HTMLAttributes<HTMLElement> {
/*
* TODO Add props and slots here
* Any slot property should be listed in the textShorthandProps array below
Expand All @@ -20,7 +20,7 @@ export type TextDefaultedProps = never; // TODO add names of properties with def
/**
* State used in rendering Text
*/
export interface TextState extends ComponentState<TextProps, TextDefaultedProps> {
export interface TextState extends ComponentStateCompat<TextProps, TextDefaultedProps> {
/**
* Ref to the root element
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/react-text/src/components/Text/renderText.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { getSlots } from '@fluentui/react-utilities';
import { getSlotsCompat } from '@fluentui/react-utilities';
import { TextState } from './Text.types';

/**
* Render the final JSX of Text
*/
export const renderText = (state: TextState) => {
const { slots, slotProps } = getSlots(state);
const { slots, slotProps } = getSlotsCompat(state);

return (
<slots.root {...slotProps.root}>
Expand Down

0 comments on commit c2088cb

Please sign in to comment.