Skip to content

Commit ccb8d60

Browse files
authored
feat: removes isRtl and getDocument helpers from @zendeskgarden/react-theming (#1702)
* feat: removes isRtl and getDocument helpers from @zendeskgarden/react-theming * chore: remove withTheme hook
1 parent 8600905 commit ccb8d60

File tree

9 files changed

+5
-193
lines changed

9 files changed

+5
-193
lines changed

docs/migration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
### Breaking Changes
66

7+
#### @zendeskgarden/react-theming
8+
9+
- Utility function `isRtl` has been removed. Use `props.theme.rtl` instead.
10+
- Utility function `getDocument` has been removed. Use `useDocument` instead.
11+
712
#### @zendeskgarden/react-utilities
813

914
- This package has been removed.

packages/theming/README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,3 @@ import { Notification } from '@zendeskgarden/react-notifications';
5252
<Notification>This notification content will render with RTL layout.</Notification>
5353
</ThemeProvider>;
5454
```
55-
56-
The `withTheme` [HOC](https://reactjs.org/docs/higher-order-components.html)
57-
utility allows any component to interact with its `ThemeProvider`.
58-
59-
```jsx
60-
import { withTheme } from '@zendeskgarden/react-theming';
61-
62-
const Div = ({ theme, children }) => (
63-
<div style={{ direction: theme.rtl ? 'rtl' : 'ltr' }}>{children}</div>
64-
);
65-
66-
const LocalizedComponent = withTheme(Div);
67-
68-
<ThemeProvider theme={{ ...DEFAULT_THEME, rtl: true }}>
69-
<LocalizedComponent>RTL localizable</LocalizedComponent>
70-
</ThemeProvider>;
71-
```

packages/theming/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@
88
export { ThemeProvider } from './elements/ThemeProvider';
99
export { default as DEFAULT_THEME } from './elements/theme';
1010
export { default as PALETTE } from './elements/palette';
11-
export { default as isRtl } from './utils/isRtl';
1211
export {
1312
default as retrieveComponentStyles,
1413
/** `retrieveTheme` is a deprecated usage for v7 compatability */
1514
default as retrieveTheme
1615
} from './utils/retrieveComponentStyles';
17-
export { default as withTheme } from './utils/withTheme';
18-
export { default as getDocument } from './utils/getDocument';
1916
export { getColor } from './utils/getColor';
2017
export { getFocusBoxShadow } from './utils/getFocusBoxShadow';
2118
export { default as getLineHeight } from './utils/getLineHeight';

packages/theming/src/utils/getDocument.spec.ts

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

packages/theming/src/utils/getDocument.ts

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

packages/theming/src/utils/isRtl.spec.ts

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

packages/theming/src/utils/isRtl.ts

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

packages/theming/src/utils/withTheme.spec.tsx

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

packages/theming/src/utils/withTheme.ts

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

0 commit comments

Comments
 (0)