Skip to content

Commit 68bb285

Browse files
committed
feat: remove deprecated left and right util functions
BREAKING CHANGE: these functions were deprecated and are now removed.
1 parent 76d82f3 commit 68bb285

File tree

3 files changed

+1
-37
lines changed

3 files changed

+1
-37
lines changed

packages/orbit-components/src/utils/rtl/__tests__/index.test.ts

-18
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,3 @@ describe("rtlSpacing", () => {
2626
expect(rtl.rtlSpacing("10px 20px 30px")(enabledRTL)).toBe("10px 20px 30px");
2727
});
2828
});
29-
30-
describe("right", () => {
31-
it("should return right when rtl false", () => {
32-
expect(rtl.right(disabledRTL)).toBe("right");
33-
});
34-
it("should return left when rtl true", () => {
35-
expect(rtl.right(enabledRTL)).toBe("left");
36-
});
37-
});
38-
39-
describe("left", () => {
40-
it("should return left when rtl false", () => {
41-
expect(rtl.left(disabledRTL)).toBe("left");
42-
});
43-
it("should return right when rtl true", () => {
44-
expect(rtl.left(enabledRTL)).toBe("right");
45-
});
46-
});
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import type { Theme } from "../../defaultTheme";
2-
import type { RtlSpacing, LeftToRight } from "./types";
3-
4-
const leftToRight: LeftToRight =
5-
(left: string, right: string) =>
6-
({ theme }: { theme: Theme }) =>
7-
theme.rtl ? right : left;
1+
import type { RtlSpacing } from "./types";
82

93
export const rtlSpacing: RtlSpacing =
104
value =>
@@ -13,13 +7,3 @@ export const rtlSpacing: RtlSpacing =
137
const parts = value.split(" ").filter(part => !Number.isNaN(parseFloat(part)) && part);
148
return parts.length === 4 ? [parts[0], parts[3], parts[2], parts[1]].join(" ") : value;
159
};
16-
17-
/**
18-
* @deprecated This function is deprecated. Use `start` properties instead.
19-
*/
20-
export const left = leftToRight("left", "right");
21-
22-
/**
23-
* @deprecated This function is deprecated. Use `end` properties instead.
24-
*/
25-
export const right = leftToRight("right", "left");
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
import type { ThemeProps } from "../../defaultTheme";
22

3-
export type LeftToRight = (left: string, right: string) => (theme: ThemeProps) => string;
4-
53
export type RtlSpacing = (value: string) => (theme: ThemeProps) => string;

0 commit comments

Comments
 (0)