{"_id":"@alef-prime/rtl-aware","name":"@alef-prime/rtl-aware","dist-tags":{"alpha":"0.1.0-alpha.0","latest":"0.1.0-alpha.0"},"versions":{"0.1.0-alpha.0":{"name":"@alef-prime/rtl-aware","version":"0.1.0-alpha.0","description":"Tiny helpers to make Hebrew/Arabic-first apps render with the right direction without sprinkling dir={isHE? 'rtl':'ltr'} everywhere. Hook + util + class flip — zero deps.","type":"module","main":"./index.mjs","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.mjs"}},"engines":{"node":">=18"},"peerDependencies":{"react":">=18 <20"},"peerDependenciesMeta":{"react":{"optional":true}},"keywords":["rtl","hebrew","arabic","i18n","direction","react","next","alef-prime"],"homepage":"https://www.n50.io/evolution","repository":{"type":"git","url":"git+https://github.com/Ilya0527/alef-prime-rtl-aware.git"},"license":"MIT","author":{"name":"ALEF-PRIME","url":"Ilya Glikman"},"sideEffects":false,"gitHead":"14922cdfdae5da62a0a56e73f5f3481e975b6527","_id":"@alef-prime/rtl-aware@0.1.0-alpha.0","bugs":{"url":"https://github.com/Ilya0527/alef-prime-rtl-aware/issues"},"_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-HQKq5A9grL0gMcJjC6J3brNj9TRfXbx4+Ii1ynylgmMql0BtFpE3+Iqx2qN+BgBFTgIQkOlHbDEtlFAlBeUEFQ==","shasum":"d9392a88ebc3871920bd674b18afa68a8c5aadb8","tarball":"https://registry.npmjs.org/@alef-prime/rtl-aware/-/rtl-aware-0.1.0-alpha.0.tgz","fileCount":4,"unpackedSize":5964,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFppldUrFGCWjtMs5ECH0e938j/1qXPTqrPHSl9y5jaJAiEA2Vl2Stym3/U7KgbLdytbuR8taq3OgHjk/7ugxmoAki0="}]},"_npmUser":{"name":"n50","email":"ilya0527@gmail.com"},"directories":{},"maintainers":[{"name":"n50","email":"ilya0527@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rtl-aware_0.1.0-alpha.0_1779107629192_0.7516821538129876"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T12:33:49.099Z","0.1.0-alpha.0":"2026-05-18T12:33:49.331Z","modified":"2026-05-18T12:33:49.577Z"},"maintainers":[{"name":"n50","email":"ilya0527@gmail.com"}],"description":"Tiny helpers to make Hebrew/Arabic-first apps render with the right direction without sprinkling dir={isHE? 'rtl':'ltr'} everywhere. Hook + util + class flip — zero deps.","homepage":"https://www.n50.io/evolution","keywords":["rtl","hebrew","arabic","i18n","direction","react","next","alef-prime"],"repository":{"type":"git","url":"git+https://github.com/Ilya0527/alef-prime-rtl-aware.git"},"author":{"name":"ALEF-PRIME","url":"Ilya Glikman"},"bugs":{"url":"https://github.com/Ilya0527/alef-prime-rtl-aware/issues"},"license":"MIT","readme":"# @alef-prime/rtl-aware\n\n> Stop sprinkling `dir={isHE ? \"rtl\" : \"ltr\"}` everywhere.\n\nZero-dep helpers for Hebrew/Arabic/Persian/Urdu-first apps. Detect RTL, set document direction, flip Tailwind directional classes — six functions, ~60 lines of source, no React dependency (but works great with it).\n\n```ts\nimport { isRTL, dirFor, applyDocDir, flipClasses, rtlCx } from \"@alef-prime/rtl-aware\";\n\nisRTL(\"he\");                          // → true\nisRTL(\"ar-SA\");                       // → true\nisRTL(\"ru\");                          // → false\ndirFor(\"he\");                         // → \"rtl\"\n\n// Set <html lang> + <html dir> on the client, returns a cleanup fn:\nconst restore = applyDocDir(\"he\");\n// ... later\nrestore();\n\n// Flip a Tailwind class string from LTR to RTL semantics:\nflipClasses(\"pl-4 mr-2 text-left rounded-l-md\", \"he\");\n// → \"pr-4 ml-2 text-right rounded-r-md\"\n\n// cx-style joiner that also flips for RTL:\nrtlCx(\"he\", \"p-4\", isFocused && \"ml-2 border-l-2\", \"bg-white\");\n// → \"p-4 mr-2 border-r-2 bg-white\"\n```\n\n## What it handles\n\nSymmetry flips for the directional Tailwind utilities most apps actually use:\n\n- `ml-*` ↔ `mr-*`, `pl-*` ↔ `pr-*`\n- `left-*` ↔ `right-*`\n- `text-left` ↔ `text-right`\n- `rounded-l-*` ↔ `rounded-r-*`\n- `border-l-*` ↔ `border-r-*`\n\nFor everything else, use Tailwind's logical properties (`ms-*`, `me-*`, `ps-*`, `pe-*`, `start-*`, `end-*`) — they're better and Tailwind already handles them based on `dir`. This package fills the gap when you can't easily migrate.\n\n## What it does NOT do\n\n- It does NOT replace `@tailwindcss/rtl` or Tailwind's built-in logical-property support. Use those if you can.\n- It does NOT auto-detect lang from browser/navigator. You pass the lang in. Combine with [`@alef-prime/i18n-pick`](https://github.com/Ilya0527/alef-prime-i18n-pick) for that.\n\n## Status: alpha · 0.1.0\n\nBorn from [ALEF-PRIME](https://www.n50.io)'s Hebrew Control Gateway. Sibling of [`@alef-prime/i18n-pick`](https://github.com/Ilya0527/alef-prime-i18n-pick), [`@alef-prime/units`](https://github.com/Ilya0527/alef-prime-units), [`@alef-prime/penalty-ledger`](https://github.com/Ilya0527/alef-prime-penalty-ledger), [`@alef-prime/deploy-verify`](https://github.com/Ilya0527/alef-prime-deploy-verify). MIT.\n","readmeFilename":"README.md","_rev":"1-de24b8305781e2694f9d9d43312c6bf4"}