Skip to content

Commit cb233cf

Browse files
authored
Deprecate legacy slots (#3205)
1 parent 2ab691f commit cb233cf

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/_CheckboxOrRadioGroup/slots.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/deprecated/ChoiceFieldset/ChoiceFieldset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import {Box, useSSRSafeId} from '../..'
3-
import createSlots from '../../utils/create-slots'
3+
import createSlots from '../utils/create-slots'
44
import {FormValidationStatus} from '../../utils/types/FormValidationStatus'
55
import ValidationAnimationContainer from '../../_ValidationAnimationContainer'
66
import InputValidation from '../../_InputValidation'

src/deprecated/InputField/slots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import createSlots from '../../utils/create-slots'
1+
import createSlots from '../utils/create-slots'
22

33
export const {Slots, Slot} = createSlots(['Caption', 'Input', 'Label', 'LeadingVisual'])

src/utils/create-slots.tsx renamed to src/deprecated/utils/create-slots.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from 'react'
2-
import {useForceUpdate} from './use-force-update'
3-
import useLayoutEffect from './useIsomorphicLayoutEffect'
2+
import {useForceUpdate} from '../../utils/use-force-update'
3+
import useLayoutEffect from '../../utils/useIsomorphicLayoutEffect'
44

5-
/** createSlots is a factory that can create a
5+
/**
6+
* @deprecated Use the `useSlots` hook instead.
7+
*
8+
* createSlots is a factory that can create a
69
* typesafe Slots + Slot pair to use in a component definition
710
* For example: ActionList.Item uses createSlots to get a Slots wrapper
811
* + Slot component that is used by LeadingVisual, Description

src/__tests__/utils/createSlots.test.tsx renamed to src/deprecated/utils/createSlots.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import {render, waitFor} from '@testing-library/react'
3-
import createSlots from '../../utils/create-slots'
3+
import createSlots from './create-slots'
44

55
// setup a component with slots
66
const {Slots, Slot} = createSlots(['One', 'Two', 'Three'])

0 commit comments

Comments
 (0)