@codecademy/gamut-styles
17.13.117.13.2-alpha.c910ea.0
dist/utilities/directionIsRtl.d.ts+
dist/utilities/directionIsRtl.d.tsNew file+14
Index: package/dist/utilities/directionIsRtl.d.ts
===================================================================
--- package/dist/utilities/directionIsRtl.d.ts
+++ package/dist/utilities/directionIsRtl.d.ts
@@ -0,0 +1,14 @@
+import type { RefObject } from 'react';
+/**
+ * Resolves whether layout direction is RTL for an element, including JSDOM where
+ * `getComputedStyle(el).direction` is often empty while `dir` is set on the root.
+ */
+export declare function directionIsRtl(el: Element): boolean;
+/**
+ * Returns whether the resolved element’s direction is RTL, and updates when `dir`
+ * changes on the document subtree or after layout (so `ref.current` is current).
+ * Resolution uses {@link directionIsRtl}.
+ *
+ * @param elementRef - Optional ref; when missing or `current` is not an `Element`, uses `document.documentElement`.
+ */
+export declare function useDirectionIsRtl(elementRef?: RefObject<Element | null>): boolean;