@@ -32,7 +32,6 @@ import { getTheme } from '../getTheme'
3232
3333import type { ThemeOrOverride } from '../EmotionTypes'
3434import type { DeterministicIdProviderValue } from '@instructure/ui-react-utils'
35- import type { AsElementType } from '@instructure/shared-types'
3635
3736type InstUIProviderProps = {
3837 children ?: React . ReactNode
@@ -50,32 +49,15 @@ type InstUIProviderProps = {
5049 * specific InstUI components. (generally this is used for deterministic id generation for [SSR](/#server-side-rendering))
5150 */
5251 instanceCounterMap ?: DeterministicIdProviderValue
53- } & (
54- | {
55- /**
56- * The text direction to use in the descendants. If not provided, it uses the following in this priority order:
57- * - The value given in a parent `TextDirectionContext`
58- * - The `dir` prop of `document.documentElement` or its `direction` CSS prop
59- * - The default `ltr`
60- */
61- dir : 'ltr' | 'rtl'
62- /**
63- * @deprecated This prop will be removed in InstUI v11
64- *
65- * The element type to render as
66- */
67- as ?: AsElementType
68- }
69- | {
70- dir ?: never
71- /**
72- * @deprecated This prop will be removed in InstUI v11
73- *
74- * The element type to render as
75- */
76- as ?: never
77- }
78- )
52+
53+ /**
54+ * The text direction to use in the descendants. If not provided, it uses the following in this priority order:
55+ * - The value given in a parent `TextDirectionContext`
56+ * - The `dir` prop of `document.documentElement` or its `direction` CSS prop
57+ * - The default `ltr`
58+ */
59+ dir ?: 'ltr' | 'rtl'
60+ }
7961
8062/**
8163 * ---
@@ -87,8 +69,7 @@ function InstUISettingsProvider({
8769 children,
8870 theme = { } ,
8971 dir,
90- instanceCounterMap,
91- as
72+ instanceCounterMap
9273} : InstUIProviderProps ) {
9374 const finalDir = dir || useContext ( TextDirectionContext )
9475
@@ -109,12 +90,7 @@ function InstUISettingsProvider({
10990 )
11091
11192 if ( dir ) {
112- const Element = as || 'span'
113- providers = < Element dir = { finalDir } > { providers } </ Element >
114- } else if ( as && process . env . NODE_ENV !== 'production' ) {
115- console . warn (
116- "The 'as' property should be used in conjunction with the 'dir' property!"
117- )
93+ providers = < span dir = { finalDir } > { providers } </ span >
11894 }
11995
12096 return providers
0 commit comments