From df829bc28b52d5e9994ca9998ca8cc41a4b1689c Mon Sep 17 00:00:00 2001 From: Aziz Becha Date: Wed, 4 Feb 2026 08:07:49 +0100 Subject: [PATCH 1/4] feat: setup import alias --- .eslintrc | 5 +- babel.config.js | 12 ++ example/babel.config.js | 1 + example/tsconfig.json | 5 + package.json | 3 + src/components/Appbar/Appbar.tsx | 5 +- src/components/Button/Button.tsx | 11 +- tsconfig.json | 3 +- yarn.lock | 296 ++++++++++++++++++++++++++++++- 9 files changed, 328 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index 380df91c1e..37c4069213 100644 --- a/.eslintrc +++ b/.eslintrc @@ -35,7 +35,7 @@ "position": "before" }, { - "pattern": "@src/**", + "pattern": "@/**", "group": "internal" } ], @@ -71,7 +71,8 @@ "import/resolver": { "node": { "extensions": [".js", ".ts", ".tsx"] - } + }, + "babel-module": {} } } } diff --git a/babel.config.js b/babel.config.js index f7b3da3b33..d6af860463 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,15 @@ module.exports = { presets: ['module:@react-native/babel-preset'], + plugins: [ + [ + 'module-resolver', + { + root: ['./src'], + extensions: ['.tsx', '.ts', '.js', '.json'], + alias: { + '@': './src', + }, + }, + ], + ], }; diff --git a/example/babel.config.js b/example/babel.config.js index 2908500a54..68600c4074 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -20,6 +20,7 @@ module.exports = function (api) { ), // For development, we want to alias the library to the source [pak.name]: path.join(__dirname, '..', 'src'), + '@': path.join(__dirname, '..', 'src'), }, }, ], diff --git a/example/tsconfig.json b/example/tsconfig.json index 6bf072c662..0b70cc72a2 100644 --- a/example/tsconfig.json +++ b/example/tsconfig.json @@ -1,3 +1,8 @@ { "extends": "../tsconfig", + "compilerOptions": { + "paths": { + "@/*": ["../src/*"] + } + } } \ No newline at end of file diff --git a/package.json b/package.json index fba1bdf4aa..be4307e0e8 100644 --- a/package.json +++ b/package.json @@ -80,12 +80,15 @@ "babel-core": "^7.0.0-bridge.0", "babel-jest": "^29.6.3", "babel-loader": "^8.2.3", + "babel-plugin-module-resolver": "^5.0.0", "babel-test": "^0.1.1", "chalk": "^4.0.0", "commitlint": "^8.3.4", "conventional-changelog-cli": "^2.0.11", "dedent": "^0.7.0", "eslint": "8.31.0", + "eslint-import-resolver-babel-module": "^5.3.1", + "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-local-rules": "^1.3.2", "glob": "^7.1.3", diff --git a/src/components/Appbar/Appbar.tsx b/src/components/Appbar/Appbar.tsx index d59c626769..1a247606e8 100644 --- a/src/components/Appbar/Appbar.tsx +++ b/src/components/Appbar/Appbar.tsx @@ -11,6 +11,9 @@ import { import color from 'color'; +import { useInternalTheme } from '@/core/theming'; +import type { MD3Elevation, ThemeProp } from '@/types'; + import AppbarContent from './AppbarContent'; import { AppbarModes, @@ -21,8 +24,6 @@ import { filterAppbarActions, AppbarChildProps, } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { MD3Elevation, ThemeProp } from '../../types'; import Surface from '../Surface'; export type Props = Omit< diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 2e4d2cf519..f4d11fe72b 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -15,16 +15,17 @@ import { import color from 'color'; +import { useInternalTheme } from '@/core/theming'; +import type { $Omit, ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; +import hasTouchHandler from '@/utils/hasTouchHandler'; +import { splitStyles } from '@/utils/splitStyles'; + import { ButtonMode, getButtonColors, getButtonTouchableRippleStyle, } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $Omit, ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import hasTouchHandler from '../../utils/hasTouchHandler'; -import { splitStyles } from '../../utils/splitStyles'; import ActivityIndicator from '../ActivityIndicator'; import Icon, { IconSource } from '../Icon'; import Surface from '../Surface'; diff --git a/tsconfig.json b/tsconfig.json index c0b7c9cd69..bc2a6011b2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,8 @@ ], "react-native-paper/react-navigation": [ "./src/react-navigation" - ] + ], + "@/*": ["src/*"] }, "allowUnreachableCode": false, "allowUnusedLabels": false, diff --git a/yarn.lock b/yarn.lock index 3920e64583..85f8a64029 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3966,7 +3966,7 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^0.2.3": +"@napi-rs/wasm-runtime@npm:^0.2.11, @napi-rs/wasm-runtime@npm:^0.2.3": version: 0.2.12 resolution: "@napi-rs/wasm-runtime@npm:0.2.12" dependencies: @@ -4164,6 +4164,13 @@ __metadata: languageName: node linkType: hard +"@nolyfill/is-core-module@npm:1.0.39": + version: 1.0.39 + resolution: "@nolyfill/is-core-module@npm:1.0.39" + checksum: 10c0/34ab85fdc2e0250879518841f74a30c276bca4f6c3e13526d2d1fe515e1adf6d46c25fcd5989d22ea056d76f7c39210945180b4859fc83b050e2da411aa86289 + languageName: node + linkType: hard + "@npmcli/agent@npm:^4.0.0": version: 4.0.0 resolution: "@npmcli/agent@npm:4.0.0" @@ -6119,6 +6126,141 @@ __metadata: languageName: node linkType: hard +"@unrs/resolver-binding-android-arm-eabi@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@unrs/resolver-binding-android-arm64@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-android-arm64@npm:1.11.1" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@unrs/resolver-binding-darwin-arm64@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-darwin-arm64@npm:1.11.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@unrs/resolver-binding-darwin-x64@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-darwin-x64@npm:1.11.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@unrs/resolver-binding-freebsd-x64@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-freebsd-x64@npm:1.11.1" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.11.1" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-arm-musleabihf@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-arm-musleabihf@npm:1.11.1" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-arm64-gnu@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-arm64-gnu@npm:1.11.1" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-arm64-musl@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-arm64-musl@npm:1.11.1" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-ppc64-gnu@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-ppc64-gnu@npm:1.11.1" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-riscv64-gnu@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-riscv64-gnu@npm:1.11.1" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-riscv64-musl@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-riscv64-musl@npm:1.11.1" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-s390x-gnu@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-s390x-gnu@npm:1.11.1" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-x64-gnu@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-x64-gnu@npm:1.11.1" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@unrs/resolver-binding-linux-x64-musl@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-linux-x64-musl@npm:1.11.1" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@unrs/resolver-binding-wasm32-wasi@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-wasm32-wasi@npm:1.11.1" + dependencies: + "@napi-rs/wasm-runtime": "npm:^0.2.11" + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@unrs/resolver-binding-win32-arm64-msvc@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-win32-arm64-msvc@npm:1.11.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@unrs/resolver-binding-win32-ia32-msvc@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-win32-ia32-msvc@npm:1.11.1" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@unrs/resolver-binding-win32-x64-msvc@npm:1.11.1": + version: 1.11.1 + resolution: "@unrs/resolver-binding-win32-x64-msvc@npm:1.11.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@urql/core@npm:^5.0.6, @urql/core@npm:^5.1.2": version: 5.2.0 resolution: "@urql/core@npm:5.2.0" @@ -10906,6 +11048,19 @@ __metadata: languageName: node linkType: hard +"eslint-import-resolver-babel-module@npm:^5.3.1": + version: 5.3.2 + resolution: "eslint-import-resolver-babel-module@npm:5.3.2" + dependencies: + pkg-up: "npm:^3.1.0" + resolve: "npm:^1.20.0" + peerDependencies: + "@babel/core": ^7.0.0-0 + babel-plugin-module-resolver: ^3.0.0 || ^4.0.0 || ^5.0.0 + checksum: 10c0/168fc793cc565cb8c27eb69c67872420980a6fcaac4a5b6951bdaa2700c0745c997d282b3c8cce313c423a12933a0f6fcc347a799398f3cf7f91e9e8a35d2d69 + languageName: node + linkType: hard + "eslint-import-resolver-node@npm:^0.3.9": version: 0.3.9 resolution: "eslint-import-resolver-node@npm:0.3.9" @@ -10917,6 +11072,30 @@ __metadata: languageName: node linkType: hard +"eslint-import-resolver-typescript@npm:^3.5.2": + version: 3.10.1 + resolution: "eslint-import-resolver-typescript@npm:3.10.1" + dependencies: + "@nolyfill/is-core-module": "npm:1.0.39" + debug: "npm:^4.4.0" + get-tsconfig: "npm:^4.10.0" + is-bun-module: "npm:^2.0.0" + stable-hash: "npm:^0.0.5" + tinyglobby: "npm:^0.2.13" + unrs-resolver: "npm:^1.6.2" + peerDependencies: + eslint: "*" + eslint-plugin-import: "*" + eslint-plugin-import-x: "*" + peerDependenciesMeta: + eslint-plugin-import: + optional: true + eslint-plugin-import-x: + optional: true + checksum: 10c0/02ba72cf757753ab9250806c066d09082e00807b7b6525d7687e1c0710bc3f6947e39120227fe1f93dabea3510776d86fb3fd769466ba3c46ce67e9f874cb702 + languageName: node + linkType: hard + "eslint-module-utils@npm:^2.12.1": version: 2.12.1 resolution: "eslint-module-utils@npm:2.12.1" @@ -12727,6 +12906,15 @@ __metadata: languageName: node linkType: hard +"get-tsconfig@npm:^4.10.0": + version: 4.13.1 + resolution: "get-tsconfig@npm:4.13.1" + dependencies: + resolve-pkg-maps: "npm:^1.0.0" + checksum: 10c0/75c8ccebc411073338d7b7154f18659480d4888d1b12a74a21507d14c6e3b092e260454efe6ce33b33eaf513d86491b8f16191358fe3e0a682a215febd1846cc + languageName: node + linkType: hard + "get-value@npm:^2.0.3, get-value@npm:^2.0.6": version: 2.0.6 resolution: "get-value@npm:2.0.6" @@ -14288,6 +14476,15 @@ __metadata: languageName: node linkType: hard +"is-bun-module@npm:^2.0.0": + version: 2.0.0 + resolution: "is-bun-module@npm:2.0.0" + dependencies: + semver: "npm:^7.7.1" + checksum: 10c0/7d27a0679cfa5be1f5052650391f9b11040cd70c48d45112e312c56bc6b6ca9c9aea70dcce6cc40b1e8947bfff8567a5c5715d3b066fb478522dab46ea379240 + languageName: node + linkType: hard + "is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" @@ -17499,6 +17696,15 @@ __metadata: languageName: node linkType: hard +"napi-postinstall@npm:^0.3.0": + version: 0.3.4 + resolution: "napi-postinstall@npm:0.3.4" + bin: + napi-postinstall: lib/cli.js + checksum: 10c0/b33d64150828bdade3a5d07368a8b30da22ee393f8dd8432f1b9e5486867be21c84ec443dd875dd3ef3c7401a079a7ab7e2aa9d3538a889abbcd96495d5104fe + languageName: node + linkType: hard + "natural-compare-lite@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare-lite@npm:1.4.0" @@ -20125,6 +20331,7 @@ __metadata: babel-core: "npm:^7.0.0-bridge.0" babel-jest: "npm:^29.6.3" babel-loader: "npm:^8.2.3" + babel-plugin-module-resolver: "npm:^5.0.0" babel-test: "npm:^0.1.1" chalk: "npm:^4.0.0" color: "npm:^3.1.2" @@ -20132,6 +20339,8 @@ __metadata: conventional-changelog-cli: "npm:^2.0.11" dedent: "npm:^0.7.0" eslint: "npm:8.31.0" + eslint-import-resolver-babel-module: "npm:^5.3.1" + eslint-import-resolver-typescript: "npm:^3.5.2" eslint-plugin-flowtype: "npm:^8.0.3" eslint-plugin-local-rules: "npm:^1.3.2" glob: "npm:^7.1.3" @@ -21174,6 +21383,13 @@ __metadata: languageName: node linkType: hard +"resolve-pkg-maps@npm:^1.0.0": + version: 1.0.0 + resolution: "resolve-pkg-maps@npm:1.0.0" + checksum: 10c0/fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab + languageName: node + linkType: hard + "resolve-pkg@npm:2.0.0": version: 2.0.0 resolution: "resolve-pkg@npm:2.0.0" @@ -21714,7 +21930,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.1.3, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": +"semver@npm:^7.1.3, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.7.1": version: 7.7.3 resolution: "semver@npm:7.7.3" bin: @@ -22454,6 +22670,13 @@ __metadata: languageName: node linkType: hard +"stable-hash@npm:^0.0.5": + version: 0.0.5 + resolution: "stable-hash@npm:0.0.5" + checksum: 10c0/ca670cb6d172f1c834950e4ec661e2055885df32fee3ebf3647c5df94993b7c2666a5dbc1c9a62ee11fc5c24928579ec5e81bb5ad31971d355d5a341aab493b3 + languageName: node + linkType: hard + "stable@npm:^0.1.8": version: 0.1.8 resolution: "stable@npm:0.1.8" @@ -23213,7 +23436,7 @@ __metadata: languageName: node linkType: hard -"tinyglobby@npm:^0.2.11, tinyglobby@npm:^0.2.12": +"tinyglobby@npm:^0.2.11, tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.13": version: 0.2.15 resolution: "tinyglobby@npm:0.2.15" dependencies: @@ -24008,6 +24231,73 @@ __metadata: languageName: node linkType: hard +"unrs-resolver@npm:^1.6.2": + version: 1.11.1 + resolution: "unrs-resolver@npm:1.11.1" + dependencies: + "@unrs/resolver-binding-android-arm-eabi": "npm:1.11.1" + "@unrs/resolver-binding-android-arm64": "npm:1.11.1" + "@unrs/resolver-binding-darwin-arm64": "npm:1.11.1" + "@unrs/resolver-binding-darwin-x64": "npm:1.11.1" + "@unrs/resolver-binding-freebsd-x64": "npm:1.11.1" + "@unrs/resolver-binding-linux-arm-gnueabihf": "npm:1.11.1" + "@unrs/resolver-binding-linux-arm-musleabihf": "npm:1.11.1" + "@unrs/resolver-binding-linux-arm64-gnu": "npm:1.11.1" + "@unrs/resolver-binding-linux-arm64-musl": "npm:1.11.1" + "@unrs/resolver-binding-linux-ppc64-gnu": "npm:1.11.1" + "@unrs/resolver-binding-linux-riscv64-gnu": "npm:1.11.1" + "@unrs/resolver-binding-linux-riscv64-musl": "npm:1.11.1" + "@unrs/resolver-binding-linux-s390x-gnu": "npm:1.11.1" + "@unrs/resolver-binding-linux-x64-gnu": "npm:1.11.1" + "@unrs/resolver-binding-linux-x64-musl": "npm:1.11.1" + "@unrs/resolver-binding-wasm32-wasi": "npm:1.11.1" + "@unrs/resolver-binding-win32-arm64-msvc": "npm:1.11.1" + "@unrs/resolver-binding-win32-ia32-msvc": "npm:1.11.1" + "@unrs/resolver-binding-win32-x64-msvc": "npm:1.11.1" + napi-postinstall: "npm:^0.3.0" + dependenciesMeta: + "@unrs/resolver-binding-android-arm-eabi": + optional: true + "@unrs/resolver-binding-android-arm64": + optional: true + "@unrs/resolver-binding-darwin-arm64": + optional: true + "@unrs/resolver-binding-darwin-x64": + optional: true + "@unrs/resolver-binding-freebsd-x64": + optional: true + "@unrs/resolver-binding-linux-arm-gnueabihf": + optional: true + "@unrs/resolver-binding-linux-arm-musleabihf": + optional: true + "@unrs/resolver-binding-linux-arm64-gnu": + optional: true + "@unrs/resolver-binding-linux-arm64-musl": + optional: true + "@unrs/resolver-binding-linux-ppc64-gnu": + optional: true + "@unrs/resolver-binding-linux-riscv64-gnu": + optional: true + "@unrs/resolver-binding-linux-riscv64-musl": + optional: true + "@unrs/resolver-binding-linux-s390x-gnu": + optional: true + "@unrs/resolver-binding-linux-x64-gnu": + optional: true + "@unrs/resolver-binding-linux-x64-musl": + optional: true + "@unrs/resolver-binding-wasm32-wasi": + optional: true + "@unrs/resolver-binding-win32-arm64-msvc": + optional: true + "@unrs/resolver-binding-win32-ia32-msvc": + optional: true + "@unrs/resolver-binding-win32-x64-msvc": + optional: true + checksum: 10c0/c91b112c71a33d6b24e5c708dab43ab80911f2df8ee65b87cd7a18fb5af446708e98c4b415ca262026ad8df326debcc7ca6a801b2935504d87fd6f0b9d70dce1 + languageName: node + linkType: hard + "unset-value@npm:^1.0.0": version: 1.0.0 resolution: "unset-value@npm:1.0.0" From 7284f9693f7eea8566c18010715f677aeb425dd9 Mon Sep 17 00:00:00 2001 From: Aziz Becha Date: Wed, 4 Feb 2026 08:31:34 +0100 Subject: [PATCH 2/4] feat: implement import alias for all components and tests --- src/components/Appbar/AppbarAction.tsx | 12 ++++---- src/components/Appbar/AppbarBackAction.tsx | 5 ++-- src/components/Appbar/AppbarBackIcon.tsx | 2 +- src/components/Appbar/AppbarContent.tsx | 9 +++--- src/components/Appbar/AppbarHeader.tsx | 7 +++-- src/components/Appbar/utils.ts | 6 ++-- src/components/Avatar/AvatarIcon.tsx | 9 +++--- src/components/Avatar/AvatarImage.tsx | 4 +-- src/components/Avatar/AvatarText.tsx | 9 +++--- .../BottomNavigation/BottomNavigation.tsx | 11 +++---- .../BottomNavigation/BottomNavigationBar.tsx | 29 ++++++++++--------- src/components/BottomNavigation/utils.ts | 2 +- src/components/Button/utils.tsx | 6 ++-- src/components/Card/Card.tsx | 11 +++---- src/components/Card/CardActions.tsx | 3 +- src/components/Card/CardCover.tsx | 9 +++--- src/components/Card/CardTitle.tsx | 10 +++---- src/components/Card/utils.tsx | 4 +-- src/components/Checkbox/Checkbox.tsx | 5 ++-- src/components/Checkbox/CheckboxAndroid.tsx | 9 +++--- src/components/Checkbox/CheckboxIOS.tsx | 5 ++-- src/components/Checkbox/CheckboxItem.tsx | 13 +++++---- src/components/Checkbox/utils.ts | 2 +- src/components/Chip/Chip.tsx | 23 ++++++++------- src/components/Chip/helpers.tsx | 4 +-- src/components/DataTable/DataTableCell.tsx | 6 ++-- src/components/DataTable/DataTableHeader.tsx | 6 ++-- .../DataTable/DataTablePagination.tsx | 12 ++++---- src/components/DataTable/DataTableRow.tsx | 8 ++--- src/components/DataTable/DataTableTitle.tsx | 8 ++--- src/components/Dialog/Dialog.tsx | 7 +++-- src/components/Dialog/DialogActions.tsx | 3 +- src/components/Dialog/DialogIcon.tsx | 4 +-- src/components/Dialog/DialogScrollArea.tsx | 2 +- src/components/Dialog/DialogTitle.tsx | 8 ++--- src/components/Drawer/DrawerCollapsedItem.tsx | 10 +++---- src/components/Drawer/DrawerItem.tsx | 10 +++---- src/components/Drawer/DrawerSection.tsx | 10 +++---- src/components/FAB/AnimatedFAB.tsx | 17 ++++++----- src/components/FAB/FAB.tsx | 19 ++++++------ src/components/FAB/FABGroup.tsx | 11 +++---- src/components/FAB/utils.ts | 6 ++-- src/components/HelperText/HelperText.tsx | 7 +++-- src/components/HelperText/utils.ts | 2 +- src/components/IconButton/IconButton.tsx | 17 ++++++----- src/components/IconButton/utils.ts | 2 +- src/components/List/ListAccordion.tsx | 15 +++++----- src/components/List/ListIcon.tsx | 5 ++-- src/components/List/ListImage.tsx | 6 ++-- src/components/List/ListItem.tsx | 11 +++---- src/components/List/ListSection.tsx | 5 ++-- src/components/List/ListSubheader.tsx | 4 +-- src/components/Menu/Menu.tsx | 15 +++++----- src/components/Menu/MenuItem.tsx | 15 +++++----- src/components/Menu/utils.ts | 6 ++-- src/components/Portal/Portal.tsx | 9 +++--- src/components/RadioButton/RadioButton.tsx | 5 ++-- .../RadioButton/RadioButtonAndroid.tsx | 9 +++--- src/components/RadioButton/RadioButtonIOS.tsx | 11 +++---- .../RadioButton/RadioButtonItem.tsx | 13 +++++---- .../SegmentedButtons/SegmentedButtonItem.tsx | 15 +++++----- .../SegmentedButtons/SegmentedButtons.tsx | 6 ++-- src/components/SegmentedButtons/utils.ts | 4 +-- src/components/Switch/Switch.tsx | 5 ++-- src/components/Switch/utils.ts | 4 +-- src/components/TextInput/Addons/Underline.tsx | 2 +- .../TextInput/Adornment/TextInputAffix.tsx | 5 ++-- .../TextInput/Adornment/TextInputIcon.tsx | 9 +++--- src/components/TextInput/Adornment/utils.ts | 2 +- src/components/TextInput/Label/InputLabel.tsx | 3 +- .../TextInput/Label/LabelBackground.tsx | 3 +- src/components/TextInput/TextInput.tsx | 9 +++--- src/components/TextInput/helpers.tsx | 3 +- src/components/ToggleButton/ToggleButton.tsx | 13 +++++---- src/components/ToggleButton/utils.ts | 4 +-- src/components/Tooltip/Tooltip.tsx | 9 +++--- .../TouchableRipple.native.tsx | 13 +++++---- .../TouchableRipple/TouchableRipple.tsx | 13 +++++---- src/components/TouchableRipple/utils.ts | 2 +- src/components/Typography/AnimatedText.tsx | 7 +++-- src/components/Typography/Text.tsx | 7 +++-- src/components/Typography/types.tsx | 2 +- src/components/Typography/v2/StyledText.tsx | 3 +- src/components/Typography/v2/Text.tsx | 4 +-- src/components/__tests__/AnimatedFAB.test.tsx | 3 +- .../__tests__/Appbar/Appbar.test.tsx | 20 ++++++------- src/components/__tests__/Avatar.test.tsx | 3 +- src/components/__tests__/Badge.test.tsx | 3 +- .../__tests__/BottomNavigation.test.tsx | 7 +++-- src/components/__tests__/Button.test.tsx | 5 ++-- src/components/__tests__/Card/Card.test.tsx | 12 ++++---- .../__tests__/Checkbox/Checkbox.test.tsx | 2 +- .../__tests__/Checkbox/CheckboxItem.test.tsx | 2 +- .../__tests__/Checkbox/utils.test.tsx | 4 +-- src/components/__tests__/Chip.test.tsx | 5 ++-- src/components/__tests__/Dialog.test.tsx | 3 +- .../Drawer/DrawerCollapsedItem.test.tsx | 2 +- .../__tests__/Drawer/DrawerSection.test.tsx | 2 +- src/components/__tests__/FAB.test.tsx | 7 +++-- src/components/__tests__/FABGroup.test.tsx | 3 +- src/components/__tests__/HelperText.test.tsx | 3 +- src/components/__tests__/IconButton.test.tsx | 5 ++-- .../__tests__/ListAccordion.test.tsx | 5 ++-- src/components/__tests__/ListItem.test.tsx | 3 +- src/components/__tests__/ListSection.test.tsx | 3 +- src/components/__tests__/Menu.test.tsx | 5 ++-- src/components/__tests__/MenuItem.test.tsx | 5 ++-- src/components/__tests__/Modal.test.tsx | 3 +- .../RadioButton/RadioButton.test.tsx | 4 +-- .../RadioButton/RadioButtonGroup.test.tsx | 2 +- .../RadioButton/RadioButtonItem.test.tsx | 2 +- .../__tests__/SegmentedButton.test.tsx | 5 ++-- src/components/__tests__/Snackbar.test.tsx | 3 +- src/components/__tests__/Surface.test.tsx | 3 +- src/components/__tests__/Switch.test.tsx | 5 ++-- src/components/__tests__/TextInput.test.tsx | 5 ++-- .../__tests__/ToggleButton.test.tsx | 5 ++-- src/components/__tests__/Tooltip.test.tsx | 3 +- .../__tests__/Typography/Caption.test.tsx | 4 +-- .../__tests__/Typography/Text.test.tsx | 10 +++---- src/core/__tests__/PaperProvider.test.tsx | 5 ++-- src/core/__tests__/theming.test.tsx | 3 +- src/react-navigation/__tests__/index.test.tsx | 3 +- .../views/MaterialBottomTabView.tsx | 5 ++-- src/styles/themes/v2/DarkTheme.tsx | 5 ++-- src/styles/themes/v2/LightTheme.tsx | 5 ++-- src/styles/themes/v3/DarkTheme.tsx | 3 +- src/styles/themes/v3/LightTheme.tsx | 5 ++-- src/styles/themes/v3/tokens.tsx | 2 +- 129 files changed, 471 insertions(+), 391 deletions(-) diff --git a/src/components/Appbar/AppbarAction.tsx b/src/components/Appbar/AppbarAction.tsx index bc87e335ba..8005e4a487 100644 --- a/src/components/Appbar/AppbarAction.tsx +++ b/src/components/Appbar/AppbarAction.tsx @@ -8,13 +8,13 @@ import type { } from 'react-native'; import color from 'color'; -import type { ThemeProp } from 'src/types'; -import { useInternalTheme } from '../../core/theming'; -import { black } from '../../styles/themes/v2/colors'; -import { forwardRef } from '../../utils/forwardRef'; -import type { IconSource } from '../Icon'; -import IconButton from '../IconButton/IconButton'; +import type { IconSource } from '@/components/Icon'; +import IconButton from '@/components/IconButton/IconButton'; +import { useInternalTheme } from '@/core/theming'; +import { black } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; export type Props = React.ComponentPropsWithoutRef & { /** diff --git a/src/components/Appbar/AppbarBackAction.tsx b/src/components/Appbar/AppbarBackAction.tsx index 773b0db017..7048ae4a56 100644 --- a/src/components/Appbar/AppbarBackAction.tsx +++ b/src/components/Appbar/AppbarBackAction.tsx @@ -7,10 +7,11 @@ import type { ViewStyle, } from 'react-native'; -import type { $Omit } from './../../types'; +import type { $Omit } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import AppbarAction from './AppbarAction'; import AppbarBackIcon from './AppbarBackIcon'; -import { forwardRef } from '../../utils/forwardRef'; export type Props = $Omit< React.ComponentPropsWithoutRef, diff --git a/src/components/Appbar/AppbarBackIcon.tsx b/src/components/Appbar/AppbarBackIcon.tsx index 7579a3f1a6..f5b670d9ab 100644 --- a/src/components/Appbar/AppbarBackIcon.tsx +++ b/src/components/Appbar/AppbarBackIcon.tsx @@ -18,7 +18,7 @@ const AppbarBackIcon = ({ size, color }: { size: number; color: string }) => { ]} > , diff --git a/src/components/Appbar/utils.ts b/src/components/Appbar/utils.ts index a6c68af2a5..67058deda1 100644 --- a/src/components/Appbar/utils.ts +++ b/src/components/Appbar/utils.ts @@ -2,9 +2,9 @@ import React from 'react'; import type { ColorValue, StyleProp, ViewStyle } from 'react-native'; import { StyleSheet, Animated } from 'react-native'; -import overlay from '../../styles/overlay'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme, ThemeProp } from '../../types'; +import overlay from '@/styles/overlay'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme, ThemeProp } from '@/types'; export type AppbarModes = 'small' | 'medium' | 'large' | 'center-aligned'; diff --git a/src/components/Avatar/AvatarIcon.tsx b/src/components/Avatar/AvatarIcon.tsx index f1a0206f1f..2e042ac585 100644 --- a/src/components/Avatar/AvatarIcon.tsx +++ b/src/components/Avatar/AvatarIcon.tsx @@ -1,10 +1,11 @@ import * as React from 'react'; import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import { white } from '../../styles/themes/v2/colors'; -import type { ThemeProp } from '../../types'; -import getContrastingColor from '../../utils/getContrastingColor'; +import { useInternalTheme } from '@/core/theming'; +import { white } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; +import getContrastingColor from '@/utils/getContrastingColor'; + import Icon, { IconSource } from '../Icon'; const defaultSize = 64; diff --git a/src/components/Avatar/AvatarImage.tsx b/src/components/Avatar/AvatarImage.tsx index 96dbba3869..85e6d7595c 100644 --- a/src/components/Avatar/AvatarImage.tsx +++ b/src/components/Avatar/AvatarImage.tsx @@ -9,8 +9,8 @@ import { ViewStyle, } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; const defaultSize = 64; diff --git a/src/components/Avatar/AvatarText.tsx b/src/components/Avatar/AvatarText.tsx index f93dd894a4..4523bda6ed 100644 --- a/src/components/Avatar/AvatarText.tsx +++ b/src/components/Avatar/AvatarText.tsx @@ -8,10 +8,11 @@ import { ViewStyle, } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import { white } from '../../styles/themes/v2/colors'; -import type { ThemeProp } from '../../types'; -import getContrastingColor from '../../utils/getContrastingColor'; +import { useInternalTheme } from '@/core/theming'; +import { white } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; +import getContrastingColor from '@/utils/getContrastingColor'; + import Text from '../Typography/Text'; const defaultSize = 64; diff --git a/src/components/BottomNavigation/BottomNavigation.tsx b/src/components/BottomNavigation/BottomNavigation.tsx index c4e9b71a60..75576093ff 100644 --- a/src/components/BottomNavigation/BottomNavigation.tsx +++ b/src/components/BottomNavigation/BottomNavigation.tsx @@ -12,13 +12,14 @@ import { import useLatestCallback from 'use-latest-callback'; +import type { IconSource } from '@/components/Icon'; +import { Props as TouchableRippleProps } from '@/components/TouchableRipple/TouchableRipple'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; +import useAnimatedValueArray from '@/utils/useAnimatedValueArray'; + import BottomNavigationBar from './BottomNavigationBar'; import BottomNavigationRouteScreen from './BottomNavigationRouteScreen'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import useAnimatedValueArray from '../../utils/useAnimatedValueArray'; -import type { IconSource } from '../Icon'; -import { Props as TouchableRippleProps } from '../TouchableRipple/TouchableRipple'; export type BaseRoute = { key: string; diff --git a/src/components/BottomNavigation/BottomNavigationBar.tsx b/src/components/BottomNavigation/BottomNavigationBar.tsx index 05264c610a..dca0832183 100644 --- a/src/components/BottomNavigation/BottomNavigationBar.tsx +++ b/src/components/BottomNavigation/BottomNavigationBar.tsx @@ -14,25 +14,26 @@ import { import color from 'color'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import Badge from '@/components/Badge'; +import Icon, { IconSource } from '@/components/Icon'; +import Surface from '@/components/Surface'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import { Props as TouchableRippleProps } from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import overlay from '@/styles/overlay'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; +import useAnimatedValue from '@/utils/useAnimatedValue'; +import useAnimatedValueArray from '@/utils/useAnimatedValueArray'; +import useIsKeyboardShown from '@/utils/useIsKeyboardShown'; +import useLayout from '@/utils/useLayout'; + import { getActiveTintColor, getInactiveTintColor, getLabelColor, } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import overlay from '../../styles/overlay'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { ThemeProp } from '../../types'; -import useAnimatedValue from '../../utils/useAnimatedValue'; -import useAnimatedValueArray from '../../utils/useAnimatedValueArray'; -import useIsKeyboardShown from '../../utils/useIsKeyboardShown'; -import useLayout from '../../utils/useLayout'; -import Badge from '../Badge'; -import Icon, { IconSource } from '../Icon'; -import Surface from '../Surface'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; -import { Props as TouchableRippleProps } from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; type BaseRoute = { key: string; diff --git a/src/components/BottomNavigation/utils.ts b/src/components/BottomNavigation/utils.ts index 93a4d95091..ae62f08722 100644 --- a/src/components/BottomNavigation/utils.ts +++ b/src/components/BottomNavigation/utils.ts @@ -1,7 +1,7 @@ import color from 'color'; import type { InternalTheme } from 'src/types'; -import type { black, white } from '../../styles/themes/v2/colors'; +import type { black, white } from '@/styles/themes/v2/colors'; type BaseProps = { defaultColor: typeof black | typeof white; diff --git a/src/components/Button/utils.tsx b/src/components/Button/utils.tsx index 2c8738c62a..cbbcae24a7 100644 --- a/src/components/Button/utils.tsx +++ b/src/components/Button/utils.tsx @@ -2,9 +2,9 @@ import { StyleSheet, type ViewStyle } from 'react-native'; import color from 'color'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; -import { splitStyles } from '../../utils/splitStyles'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; +import { splitStyles } from '@/utils/splitStyles'; export type ButtonMode = | 'text' diff --git a/src/components/Card/Card.tsx b/src/components/Card/Card.tsx index 848be9fa13..3db4c7f0f6 100644 --- a/src/components/Card/Card.tsx +++ b/src/components/Card/Card.tsx @@ -11,16 +11,17 @@ import { import useLatestCallback from 'use-latest-callback'; +import { useInternalTheme } from '@/core/theming'; +import type { $Omit, ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; +import hasTouchHandler from '@/utils/hasTouchHandler'; +import { splitStyles } from '@/utils/splitStyles'; + import CardActions from './CardActions'; import CardContent from './CardContent'; import CardCover from './CardCover'; import CardTitle from './CardTitle'; import { getCardColors } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $Omit, ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import hasTouchHandler from '../../utils/hasTouchHandler'; -import { splitStyles } from '../../utils/splitStyles'; import Surface from '../Surface'; type CardComposition = { diff --git a/src/components/Card/CardActions.tsx b/src/components/Card/CardActions.tsx index 17cdc39665..bac75aff4d 100644 --- a/src/components/Card/CardActions.tsx +++ b/src/components/Card/CardActions.tsx @@ -3,8 +3,9 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import type { ThemeProp } from 'src/types'; +import { useInternalTheme } from '@/core/theming'; + import { CardActionChildProps } from './utils'; -import { useInternalTheme } from '../../core/theming'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Card/CardCover.tsx b/src/components/Card/CardCover.tsx index e0147381dc..c158a4bb9b 100644 --- a/src/components/Card/CardCover.tsx +++ b/src/components/Card/CardCover.tsx @@ -1,11 +1,12 @@ import * as React from 'react'; import { Image, StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import { grey200 } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; +import { splitStyles } from '@/utils/splitStyles'; + import { getCardCoverStyle } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import { grey200 } from '../../styles/themes/v2/colors'; -import type { ThemeProp } from '../../types'; -import { splitStyles } from '../../utils/splitStyles'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Card/CardTitle.tsx b/src/components/Card/CardTitle.tsx index b3d78fc259..c84a3355b1 100644 --- a/src/components/Card/CardTitle.tsx +++ b/src/components/Card/CardTitle.tsx @@ -7,11 +7,11 @@ import { ViewStyle, } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import type { MD3TypescaleKey, ThemeProp } from '../../types'; -import Text from '../Typography/Text'; -import Caption from '../Typography/v2/Caption'; -import Title from '../Typography/v2/Title'; +import Text from '@/components/Typography/Text'; +import Caption from '@/components/Typography/v2/Caption'; +import Title from '@/components/Typography/v2/Title'; +import { useInternalTheme } from '@/core/theming'; +import type { MD3TypescaleKey, ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Card/utils.tsx b/src/components/Card/utils.tsx index c0f10951c5..7b67417b14 100644 --- a/src/components/Card/utils.tsx +++ b/src/components/Card/utils.tsx @@ -2,8 +2,8 @@ import type { StyleProp, ViewStyle } from 'react-native'; import color from 'color'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; type CardMode = 'elevated' | 'outlined' | 'contained'; diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx index b6cfd9a64b..6140acba4d 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/src/components/Checkbox/Checkbox.tsx @@ -1,10 +1,11 @@ import * as React from 'react'; import { GestureResponderEvent, Platform } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import CheckboxAndroid from './CheckboxAndroid'; import CheckboxIOS from './CheckboxIOS'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; export type Props = { /** diff --git a/src/components/Checkbox/CheckboxAndroid.tsx b/src/components/Checkbox/CheckboxAndroid.tsx index 642602b0fa..cd539b5580 100644 --- a/src/components/Checkbox/CheckboxAndroid.tsx +++ b/src/components/Checkbox/CheckboxAndroid.tsx @@ -6,11 +6,12 @@ import { View, } from 'react-native'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import { useInternalTheme } from '@/core/theming'; +import type { $RemoveChildren, ThemeProp } from '@/types'; + import { getAndroidSelectionControlColor } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $RemoveChildren, ThemeProp } from '../../types'; -import MaterialCommunityIcon from '../MaterialCommunityIcon'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; export type Props = $RemoveChildren & { /** diff --git a/src/components/Checkbox/CheckboxIOS.tsx b/src/components/Checkbox/CheckboxIOS.tsx index e5f2c1a021..bf2564232a 100644 --- a/src/components/Checkbox/CheckboxIOS.tsx +++ b/src/components/Checkbox/CheckboxIOS.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; import { GestureResponderEvent, StyleSheet, View } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { $RemoveChildren, ThemeProp } from '@/types'; + import { getSelectionControlIOSColor } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $RemoveChildren, ThemeProp } from '../../types'; import MaterialCommunityIcon from '../MaterialCommunityIcon'; import TouchableRipple from '../TouchableRipple/TouchableRipple'; diff --git a/src/components/Checkbox/CheckboxItem.tsx b/src/components/Checkbox/CheckboxItem.tsx index 92ea124e62..677952b40c 100644 --- a/src/components/Checkbox/CheckboxItem.tsx +++ b/src/components/Checkbox/CheckboxItem.tsx @@ -10,15 +10,16 @@ import { ViewStyle, } from 'react-native'; +import TouchableRipple, { + Props as TouchableRippleProps, +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp, MD3TypescaleKey } from '@/types'; + import Checkbox from './Checkbox'; import CheckboxAndroid from './CheckboxAndroid'; import CheckboxIOS from './CheckboxIOS'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp, MD3TypescaleKey } from '../../types'; -import TouchableRipple, { - Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; export type Props = { /** diff --git a/src/components/Checkbox/utils.ts b/src/components/Checkbox/utils.ts index 81677d46b2..de4f840d9a 100644 --- a/src/components/Checkbox/utils.ts +++ b/src/components/Checkbox/utils.ts @@ -1,6 +1,6 @@ import color from 'color'; -import type { InternalTheme } from '../../types'; +import type { InternalTheme } from '@/types'; const getAndroidCheckedColor = ({ theme, diff --git a/src/components/Chip/Chip.tsx b/src/components/Chip/Chip.tsx index 0e48e5c145..5cb46769a3 100644 --- a/src/components/Chip/Chip.tsx +++ b/src/components/Chip/Chip.tsx @@ -16,19 +16,20 @@ import { import useLatestCallback from 'use-latest-callback'; -import { ChipAvatarProps, getChipColors } from './helpers'; -import { useInternalTheme } from '../../core/theming'; -import { white } from '../../styles/themes/v2/colors'; -import type { $Omit, EllipsizeProp, ThemeProp } from '../../types'; -import hasTouchHandler from '../../utils/hasTouchHandler'; -import type { IconSource } from '../Icon'; -import Icon from '../Icon'; -import MaterialCommunityIcon from '../MaterialCommunityIcon'; -import Surface from '../Surface'; +import Icon from '@/components/Icon'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; +import Surface from '@/components/Surface'; import TouchableRipple, { Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import { white } from '@/styles/themes/v2/colors'; +import type { $Omit, EllipsizeProp, ThemeProp } from '@/types'; +import hasTouchHandler from '@/utils/hasTouchHandler'; + +import { ChipAvatarProps, getChipColors } from './helpers'; +import type { IconSource } from '../Icon'; export type Props = $Omit, 'mode'> & { /** diff --git a/src/components/Chip/helpers.tsx b/src/components/Chip/helpers.tsx index 47d0993c86..5f486f796c 100644 --- a/src/components/Chip/helpers.tsx +++ b/src/components/Chip/helpers.tsx @@ -2,8 +2,8 @@ import type { ColorValue, StyleProp, ViewStyle } from 'react-native'; import color from 'color'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; export type ChipAvatarProps = { style?: StyleProp; diff --git a/src/components/DataTable/DataTableCell.tsx b/src/components/DataTable/DataTableCell.tsx index 8601e501a5..4f9020eac4 100644 --- a/src/components/DataTable/DataTableCell.tsx +++ b/src/components/DataTable/DataTableCell.tsx @@ -7,9 +7,9 @@ import { GestureResponderEvent, } from 'react-native'; -import type { $RemoveChildren } from '../../types'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import type { $RemoveChildren } from '@/types'; export type Props = $RemoveChildren & { /** diff --git a/src/components/DataTable/DataTableHeader.tsx b/src/components/DataTable/DataTableHeader.tsx index 853956e878..8c765292c4 100644 --- a/src/components/DataTable/DataTableHeader.tsx +++ b/src/components/DataTable/DataTableHeader.tsx @@ -3,9 +3,9 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import color from 'color'; -import { useInternalTheme } from '../../core/theming'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { ThemeProp } from '../../types'; +import { useInternalTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/DataTable/DataTablePagination.tsx b/src/components/DataTable/DataTablePagination.tsx index dd72dbe54f..43f758b705 100644 --- a/src/components/DataTable/DataTablePagination.tsx +++ b/src/components/DataTable/DataTablePagination.tsx @@ -11,12 +11,12 @@ import { import color from 'color'; import type { ThemeProp } from 'src/types'; -import { useInternalTheme } from '../../core/theming'; -import Button from '../Button/Button'; -import IconButton from '../IconButton/IconButton'; -import MaterialCommunityIcon from '../MaterialCommunityIcon'; -import Menu from '../Menu/Menu'; -import Text from '../Typography/Text'; +import Button from '@/components/Button/Button'; +import IconButton from '@/components/IconButton/IconButton'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; +import Menu from '@/components/Menu/Menu'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; export type Props = React.ComponentPropsWithRef & PaginationControlsProps & diff --git a/src/components/DataTable/DataTableRow.tsx b/src/components/DataTable/DataTableRow.tsx index 54402f3805..dd7d8c783e 100644 --- a/src/components/DataTable/DataTableRow.tsx +++ b/src/components/DataTable/DataTableRow.tsx @@ -10,10 +10,10 @@ import { import color from 'color'; -import { useInternalTheme } from '../../core/theming'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { $RemoveChildren, ThemeProp } from '../../types'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import { useInternalTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { $RemoveChildren, ThemeProp } from '@/types'; export type Props = $RemoveChildren & { /** diff --git a/src/components/DataTable/DataTableTitle.tsx b/src/components/DataTable/DataTableTitle.tsx index 6402e67506..5f3d87c4f4 100644 --- a/src/components/DataTable/DataTableTitle.tsx +++ b/src/components/DataTable/DataTableTitle.tsx @@ -13,10 +13,10 @@ import { import color from 'color'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import MaterialCommunityIcon from '../MaterialCommunityIcon'; -import Text from '../Typography/Text'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Dialog/Dialog.tsx b/src/components/Dialog/Dialog.tsx index 32cc1e4a99..98e03bd37a 100644 --- a/src/components/Dialog/Dialog.tsx +++ b/src/components/Dialog/Dialog.tsx @@ -9,14 +9,15 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import { useInternalTheme } from '@/core/theming'; +import overlay from '@/styles/overlay'; +import type { ThemeProp } from '@/types'; + import DialogActions from './DialogActions'; import DialogContent from './DialogContent'; import DialogIcon from './DialogIcon'; import DialogScrollArea from './DialogScrollArea'; import DialogTitle from './DialogTitle'; -import { useInternalTheme } from '../../core/theming'; -import overlay from '../../styles/overlay'; -import type { ThemeProp } from '../../types'; import Modal from '../Modal'; import { DialogChildProps } from './utils'; diff --git a/src/components/Dialog/DialogActions.tsx b/src/components/Dialog/DialogActions.tsx index cabebd2fe2..d6bd79aa6b 100644 --- a/src/components/Dialog/DialogActions.tsx +++ b/src/components/Dialog/DialogActions.tsx @@ -3,8 +3,9 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import type { ThemeProp } from 'src/types'; +import { useInternalTheme } from '@/core/theming'; + import { DialogActionChildProps } from './utils'; -import { useInternalTheme } from '../../core/theming'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Dialog/DialogIcon.tsx b/src/components/Dialog/DialogIcon.tsx index ad5841b93a..64dafa06b2 100644 --- a/src/components/Dialog/DialogIcon.tsx +++ b/src/components/Dialog/DialogIcon.tsx @@ -3,8 +3,8 @@ import { StyleSheet, View } from 'react-native'; import type { ThemeProp } from 'src/types'; -import { useInternalTheme } from '../../core/theming'; -import Icon, { IconSource } from '../Icon'; +import Icon, { IconSource } from '@/components/Icon'; +import { useInternalTheme } from '@/core/theming'; export type Props = { /** diff --git a/src/components/Dialog/DialogScrollArea.tsx b/src/components/Dialog/DialogScrollArea.tsx index 66fdcef6a0..968408f82d 100644 --- a/src/components/Dialog/DialogScrollArea.tsx +++ b/src/components/Dialog/DialogScrollArea.tsx @@ -3,7 +3,7 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import type { ThemeProp } from 'src/types'; -import { useInternalTheme } from '../../core/theming'; +import { useInternalTheme } from '@/core/theming'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Dialog/DialogTitle.tsx b/src/components/Dialog/DialogTitle.tsx index 9953fc506c..7762f89e8b 100644 --- a/src/components/Dialog/DialogTitle.tsx +++ b/src/components/Dialog/DialogTitle.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; import { StyleProp, StyleSheet, TextStyle } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import Text from '../Typography/Text'; -import Title from '../Typography/v2/Title'; +import Text from '@/components/Typography/Text'; +import Title from '@/components/Typography/v2/Title'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Drawer/DrawerCollapsedItem.tsx b/src/components/Drawer/DrawerCollapsedItem.tsx index b224c2b639..cb13fee3ad 100644 --- a/src/components/Drawer/DrawerCollapsedItem.tsx +++ b/src/components/Drawer/DrawerCollapsedItem.tsx @@ -12,11 +12,11 @@ import { ViewStyle, } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import Badge from '../Badge'; -import Icon, { IconSource } from '../Icon'; -import Text from '../Typography/Text'; +import Badge from '@/components/Badge'; +import Icon, { IconSource } from '@/components/Icon'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Drawer/DrawerItem.tsx b/src/components/Drawer/DrawerItem.tsx index 49f3367bec..68bc465f7c 100644 --- a/src/components/Drawer/DrawerItem.tsx +++ b/src/components/Drawer/DrawerItem.tsx @@ -11,13 +11,13 @@ import { import color from 'color'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import Icon, { IconSource } from '../Icon'; +import Icon, { IconSource } from '@/components/Icon'; import TouchableRipple, { Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Drawer/DrawerSection.tsx b/src/components/Drawer/DrawerSection.tsx index ed79c5e054..615ba98543 100644 --- a/src/components/Drawer/DrawerSection.tsx +++ b/src/components/Drawer/DrawerSection.tsx @@ -3,11 +3,11 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import color from 'color'; -import { useInternalTheme } from '../../core/theming'; -import { MD3Colors } from '../../styles/themes/v3/tokens'; -import type { ThemeProp } from '../../types'; -import Divider from '../Divider'; -import Text from '../Typography/Text'; +import Divider from '@/components/Divider'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import { MD3Colors } from '@/styles/themes/v3/tokens'; +import type { ThemeProp } from '@/types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/FAB/AnimatedFAB.tsx b/src/components/FAB/AnimatedFAB.tsx index ecfe7e1c60..49824c8a57 100644 --- a/src/components/FAB/AnimatedFAB.tsx +++ b/src/components/FAB/AnimatedFAB.tsx @@ -22,16 +22,17 @@ import { import color from 'color'; -import { getCombinedStyles, getFABColors, getLabelSizeWeb } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $Omit, $RemoveChildren, ThemeProp } from '../../types'; -import type { IconSource } from '../Icon'; -import Icon from '../Icon'; -import Surface from '../Surface'; +import type { IconSource } from '@/components/Icon'; +import Icon from '@/components/Icon'; +import Surface from '@/components/Surface'; import TouchableRipple, { Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import AnimatedText from '../Typography/AnimatedText'; +} from '@/components/TouchableRipple/TouchableRipple'; +import AnimatedText from '@/components/Typography/AnimatedText'; +import { useInternalTheme } from '@/core/theming'; +import type { $Omit, $RemoveChildren, ThemeProp } from '@/types'; + +import { getCombinedStyles, getFABColors, getLabelSizeWeb } from './utils'; export type AnimatedFABIconMode = 'static' | 'dynamic'; export type AnimatedFABAnimateFrom = 'left' | 'right'; diff --git a/src/components/FAB/FAB.tsx b/src/components/FAB/FAB.tsx index 70777798ec..c8ac8fe04b 100644 --- a/src/components/FAB/FAB.tsx +++ b/src/components/FAB/FAB.tsx @@ -11,16 +11,17 @@ import { ViewStyle, } from 'react-native'; +import ActivityIndicator from '@/components/ActivityIndicator'; +import CrossFadeIcon from '@/components/CrossFadeIcon'; +import Icon, { IconSource } from '@/components/Icon'; +import Surface from '@/components/Surface'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { $Omit, $RemoveChildren, ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import { getExtendedFabStyle, getFABColors, getFabStyle } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $Omit, $RemoveChildren, ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import ActivityIndicator from '../ActivityIndicator'; -import CrossFadeIcon from '../CrossFadeIcon'; -import Icon, { IconSource } from '../Icon'; -import Surface from '../Surface'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; type FABSize = 'small' | 'medium' | 'large'; diff --git a/src/components/FAB/FABGroup.tsx b/src/components/FAB/FABGroup.tsx index ca263e3499..6d4025f52b 100644 --- a/src/components/FAB/FABGroup.tsx +++ b/src/components/FAB/FABGroup.tsx @@ -13,13 +13,14 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import Card from '@/components/Card/Card'; +import type { IconSource } from '@/components/Icon'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import FAB from './FAB'; import { getFABGroupColors } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import Card from '../Card/Card'; -import type { IconSource } from '../Icon'; -import Text from '../Typography/Text'; const AnimatedPressable = Animated.createAnimatedComponent(Pressable); diff --git a/src/components/FAB/utils.ts b/src/components/FAB/utils.ts index e87d24019f..92a3db0109 100644 --- a/src/components/FAB/utils.ts +++ b/src/components/FAB/utils.ts @@ -9,9 +9,9 @@ import { import color from 'color'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; -import getContrastingColor from '../../utils/getContrastingColor'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; +import getContrastingColor from '@/utils/getContrastingColor'; type GetCombinedStylesProps = { isAnimatedFromRight: boolean; diff --git a/src/components/HelperText/HelperText.tsx b/src/components/HelperText/HelperText.tsx index 8043968cff..742df1b449 100644 --- a/src/components/HelperText/HelperText.tsx +++ b/src/components/HelperText/HelperText.tsx @@ -7,10 +7,11 @@ import { TextStyle, } from 'react-native'; +import AnimatedText from '@/components/Typography/AnimatedText'; +import { useInternalTheme } from '@/core/theming'; +import type { $Omit, ThemeProp } from '@/types'; + import { getTextColor } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $Omit, ThemeProp } from '../../types'; -import AnimatedText from '../Typography/AnimatedText'; export type Props = $Omit< $Omit, 'padding'>, diff --git a/src/components/HelperText/utils.ts b/src/components/HelperText/utils.ts index 4134175416..da7ca03062 100644 --- a/src/components/HelperText/utils.ts +++ b/src/components/HelperText/utils.ts @@ -1,6 +1,6 @@ import color from 'color'; -import type { InternalTheme } from '../../types'; +import type { InternalTheme } from '@/types'; type BaseProps = { theme: InternalTheme; diff --git a/src/components/IconButton/IconButton.tsx b/src/components/IconButton/IconButton.tsx index 47a87901ca..e2e7d8d033 100644 --- a/src/components/IconButton/IconButton.tsx +++ b/src/components/IconButton/IconButton.tsx @@ -9,15 +9,16 @@ import { ColorValue, } from 'react-native'; +import ActivityIndicator from '@/components/ActivityIndicator'; +import CrossFadeIcon from '@/components/CrossFadeIcon'; +import Icon, { IconSource } from '@/components/Icon'; +import Surface from '@/components/Surface'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import { useInternalTheme } from '@/core/theming'; +import type { $RemoveChildren, ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import { getIconButtonColor } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $RemoveChildren, ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import ActivityIndicator from '../ActivityIndicator'; -import CrossFadeIcon from '../CrossFadeIcon'; -import Icon, { IconSource } from '../Icon'; -import Surface from '../Surface'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; const PADDING = 8; diff --git a/src/components/IconButton/utils.ts b/src/components/IconButton/utils.ts index e5e9d86145..c3044e08ae 100644 --- a/src/components/IconButton/utils.ts +++ b/src/components/IconButton/utils.ts @@ -2,7 +2,7 @@ import type { ColorValue } from 'react-native'; import color from 'color'; -import type { InternalTheme } from '../../types'; +import type { InternalTheme } from '@/types'; type IconButtonMode = 'outlined' | 'contained' | 'contained-tonal'; diff --git a/src/components/List/ListAccordion.tsx b/src/components/List/ListAccordion.tsx index 75505c7367..276ba60305 100644 --- a/src/components/List/ListAccordion.tsx +++ b/src/components/List/ListAccordion.tsx @@ -14,16 +14,17 @@ import { PressableAndroidRippleConfig, } from 'react-native'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; +import TouchableRipple, { + Props as TouchableRippleProps, +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import { ListAccordionGroupContext } from './ListAccordionGroup'; import type { ListChildProps, Style } from './utils'; import { getAccordionColors, getLeftStyles } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import MaterialCommunityIcon from '../MaterialCommunityIcon'; -import TouchableRipple, { - Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; export type Props = { /** diff --git a/src/components/List/ListIcon.tsx b/src/components/List/ListIcon.tsx index f1c7194c43..b3e509b716 100644 --- a/src/components/List/ListIcon.tsx +++ b/src/components/List/ListIcon.tsx @@ -1,8 +1,9 @@ import * as React from 'react'; import { View, ViewStyle, StyleSheet, StyleProp } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import Icon, { IconSource } from '../Icon'; export type Props = { diff --git a/src/components/List/ListImage.tsx b/src/components/List/ListImage.tsx index 9839be7b02..54e501aad2 100644 --- a/src/components/List/ListImage.tsx +++ b/src/components/List/ListImage.tsx @@ -7,8 +7,8 @@ import { ImageStyle, } from 'react-native'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; export type Props = { source: ImageSourcePropType; @@ -31,7 +31,7 @@ export type Props = { * const MyComponent = () => ( * <> * - * + * * * ); * diff --git a/src/components/List/ListItem.tsx b/src/components/List/ListItem.tsx index 467eb9b67a..040941fa3c 100644 --- a/src/components/List/ListItem.tsx +++ b/src/components/List/ListItem.tsx @@ -12,12 +12,13 @@ import { import color from 'color'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { $RemoveChildren, EllipsizeProp, ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import { Style, getLeftStyles, getRightStyles } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $RemoveChildren, EllipsizeProp, ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; type Title = | React.ReactNode diff --git a/src/components/List/ListSection.tsx b/src/components/List/ListSection.tsx index 59640c70da..449df4630c 100644 --- a/src/components/List/ListSection.tsx +++ b/src/components/List/ListSection.tsx @@ -7,9 +7,10 @@ import { ViewStyle, } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import ListSubheader from './ListSubheader'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; export type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/List/ListSubheader.tsx b/src/components/List/ListSubheader.tsx index 038b86a86e..548432a549 100644 --- a/src/components/List/ListSubheader.tsx +++ b/src/components/List/ListSubheader.tsx @@ -4,8 +4,8 @@ import { StyleProp, StyleSheet, TextStyle } from 'react-native'; import color from 'color'; import type { ThemeProp } from 'src/types'; -import { useInternalTheme } from '../../core/theming'; -import Text from '../Typography/Text'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; export type Props = React.ComponentProps & { /** diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 9b53403b9d..ab219235e2 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -21,14 +21,15 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import Portal from '@/components/Portal/Portal'; +import Surface from '@/components/Surface'; +import { useInternalTheme } from '@/core/theming'; +import type { MD3Elevation, ThemeProp } from '@/types'; +import { ElevationLevels } from '@/types'; +import { addEventListener } from '@/utils/addEventListener'; +import { BackHandler } from '@/utils/BackHandler/BackHandler'; + import MenuItem from './MenuItem'; -import { useInternalTheme } from '../../core/theming'; -import type { MD3Elevation, ThemeProp } from '../../types'; -import { ElevationLevels } from '../../types'; -import { addEventListener } from '../../utils/addEventListener'; -import { BackHandler } from '../../utils/BackHandler/BackHandler'; -import Portal from '../Portal/Portal'; -import Surface from '../Surface'; export type Props = { /** diff --git a/src/components/Menu/MenuItem.tsx b/src/components/Menu/MenuItem.tsx index 4b8eb3740a..75fecb2934 100644 --- a/src/components/Menu/MenuItem.tsx +++ b/src/components/Menu/MenuItem.tsx @@ -11,19 +11,20 @@ import { ViewStyle, } from 'react-native'; +import Icon, { IconSource } from '@/components/Icon'; +import TouchableRipple, { + Props as TouchableRippleProps, +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import { getContentMaxWidth, getMenuItemColor, MAX_WIDTH, MIN_WIDTH, } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import Icon, { IconSource } from '../Icon'; -import TouchableRipple, { - Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; export type Props = { /** diff --git a/src/components/Menu/utils.ts b/src/components/Menu/utils.ts index c1b6189ba4..ee69359c16 100644 --- a/src/components/Menu/utils.ts +++ b/src/components/Menu/utils.ts @@ -2,9 +2,9 @@ import type { ColorValue } from 'react-native'; import color from 'color'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; -import type { IconSource } from '../Icon'; +import type { IconSource } from '@/components/Icon'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; export const MIN_WIDTH = 112; export const MAX_WIDTH = 280; diff --git a/src/components/Portal/Portal.tsx b/src/components/Portal/Portal.tsx index d44caf96d6..894fe4adf4 100644 --- a/src/components/Portal/Portal.tsx +++ b/src/components/Portal/Portal.tsx @@ -2,13 +2,14 @@ import * as React from 'react'; import type { InternalTheme } from 'src/types'; -import PortalConsumer from './PortalConsumer'; -import PortalHost, { PortalContext, PortalMethods } from './PortalHost'; import { Consumer as SettingsConsumer, Provider as SettingsProvider, -} from '../../core/settings'; -import { ThemeProvider, withInternalTheme } from '../../core/theming'; +} from '@/core/settings'; +import { ThemeProvider, withInternalTheme } from '@/core/theming'; + +import PortalConsumer from './PortalConsumer'; +import PortalHost, { PortalContext, PortalMethods } from './PortalHost'; export type Props = { /** diff --git a/src/components/RadioButton/RadioButton.tsx b/src/components/RadioButton/RadioButton.tsx index e43fa9c695..9e8ed8c63c 100644 --- a/src/components/RadioButton/RadioButton.tsx +++ b/src/components/RadioButton/RadioButton.tsx @@ -1,10 +1,11 @@ import * as React from 'react'; import { GestureResponderEvent, Platform } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import RadioButtonAndroid from './RadioButtonAndroid'; import RadioButtonIOS from './RadioButtonIOS'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; export type Props = { /** diff --git a/src/components/RadioButton/RadioButtonAndroid.tsx b/src/components/RadioButton/RadioButtonAndroid.tsx index 515efe5eff..fb4c11260c 100644 --- a/src/components/RadioButton/RadioButtonAndroid.tsx +++ b/src/components/RadioButton/RadioButtonAndroid.tsx @@ -1,12 +1,13 @@ import * as React from 'react'; import { Animated, StyleSheet, View } from 'react-native'; +import { getAndroidSelectionControlColor } from '@/components/Checkbox/utils'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import { useInternalTheme } from '@/core/theming'; +import type { $RemoveChildren, ThemeProp } from '@/types'; + import { RadioButtonContext, RadioButtonContextType } from './RadioButtonGroup'; import { handlePress, isChecked } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $RemoveChildren, ThemeProp } from '../../types'; -import { getAndroidSelectionControlColor } from '../Checkbox/utils'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; export type Props = $RemoveChildren & { /** diff --git a/src/components/RadioButton/RadioButtonIOS.tsx b/src/components/RadioButton/RadioButtonIOS.tsx index 64bdde5e44..dd76697c6f 100644 --- a/src/components/RadioButton/RadioButtonIOS.tsx +++ b/src/components/RadioButton/RadioButtonIOS.tsx @@ -1,13 +1,14 @@ import * as React from 'react'; import { GestureResponderEvent, StyleSheet, View } from 'react-native'; +import { getSelectionControlIOSColor } from '@/components/Checkbox/utils'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; +import TouchableRipple from '@/components/TouchableRipple/TouchableRipple'; +import { useInternalTheme } from '@/core/theming'; +import type { $RemoveChildren, ThemeProp } from '@/types'; + import { RadioButtonContext, RadioButtonContextType } from './RadioButtonGroup'; import { handlePress, isChecked } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { $RemoveChildren, ThemeProp } from '../../types'; -import { getSelectionControlIOSColor } from '../Checkbox/utils'; -import MaterialCommunityIcon from '../MaterialCommunityIcon'; -import TouchableRipple from '../TouchableRipple/TouchableRipple'; export type Props = $RemoveChildren & { /** diff --git a/src/components/RadioButton/RadioButtonItem.tsx b/src/components/RadioButton/RadioButtonItem.tsx index a68be63e18..fc48de47bd 100644 --- a/src/components/RadioButton/RadioButtonItem.tsx +++ b/src/components/RadioButton/RadioButtonItem.tsx @@ -10,17 +10,18 @@ import { ViewStyle, } from 'react-native'; +import TouchableRipple, { + Props as TouchableRippleProps, +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp, MD3TypescaleKey } from '@/types'; + import RadioButton from './RadioButton'; import RadioButtonAndroid from './RadioButtonAndroid'; import { RadioButtonContext, RadioButtonContextType } from './RadioButtonGroup'; import RadioButtonIOS from './RadioButtonIOS'; import { handlePress, isChecked } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp, MD3TypescaleKey } from '../../types'; -import TouchableRipple, { - Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; export type Props = { /** diff --git a/src/components/SegmentedButtons/SegmentedButtonItem.tsx b/src/components/SegmentedButtons/SegmentedButtonItem.tsx index 92623d249c..9dc213bd78 100644 --- a/src/components/SegmentedButtons/SegmentedButtonItem.tsx +++ b/src/components/SegmentedButtons/SegmentedButtonItem.tsx @@ -14,18 +14,19 @@ import { import color from 'color'; import type { ThemeProp } from 'src/types'; +import type { IconSource } from '@/components/Icon'; +import Icon from '@/components/Icon'; +import TouchableRipple, { + Props as TouchableRippleProps, +} from '@/components/TouchableRipple/TouchableRipple'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; + import { getSegmentedButtonBorderRadius, getSegmentedButtonColors, getSegmentedButtonDensityPadding, } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { IconSource } from '../Icon'; -import Icon from '../Icon'; -import TouchableRipple, { - Props as TouchableRippleProps, -} from '../TouchableRipple/TouchableRipple'; -import Text from '../Typography/Text'; export type Props = { /** diff --git a/src/components/SegmentedButtons/SegmentedButtons.tsx b/src/components/SegmentedButtons/SegmentedButtons.tsx index 3cca92351a..6734bb5592 100644 --- a/src/components/SegmentedButtons/SegmentedButtons.tsx +++ b/src/components/SegmentedButtons/SegmentedButtons.tsx @@ -8,12 +8,12 @@ import { ViewStyle, } from 'react-native'; -import type { ThemeProp } from 'src/types'; +import type { IconSource } from '@/components/Icon'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; import SegmentedButtonItem from './SegmentedButtonItem'; import { getDisabledSegmentedButtonStyle } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { IconSource } from '../Icon'; type ConditionalValue = | { diff --git a/src/components/SegmentedButtons/utils.ts b/src/components/SegmentedButtons/utils.ts index 254f0ebc95..249160c0e1 100644 --- a/src/components/SegmentedButtons/utils.ts +++ b/src/components/SegmentedButtons/utils.ts @@ -2,8 +2,8 @@ import { StyleSheet, ViewStyle } from 'react-native'; import color from 'color'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; type BaseProps = { theme: InternalTheme; diff --git a/src/components/Switch/Switch.tsx b/src/components/Switch/Switch.tsx index 04b0fef0c6..5d463c412d 100644 --- a/src/components/Switch/Switch.tsx +++ b/src/components/Switch/Switch.tsx @@ -7,9 +7,10 @@ import { ViewStyle, } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import { getSwitchColor } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; const version = NativeModules.PlatformConstants ? NativeModules.PlatformConstants.reactNativeVersion diff --git a/src/components/Switch/utils.ts b/src/components/Switch/utils.ts index 2994495af9..b860ed035c 100644 --- a/src/components/Switch/utils.ts +++ b/src/components/Switch/utils.ts @@ -9,8 +9,8 @@ import { grey700, white, black, -} from '../../styles/themes/v2/colors'; -import type { InternalTheme } from '../../types'; +} from '@/styles/themes/v2/colors'; +import type { InternalTheme } from '@/types'; type BaseProps = { theme: InternalTheme; diff --git a/src/components/TextInput/Addons/Underline.tsx b/src/components/TextInput/Addons/Underline.tsx index 184cbe63b5..af94dd17aa 100644 --- a/src/components/TextInput/Addons/Underline.tsx +++ b/src/components/TextInput/Addons/Underline.tsx @@ -3,7 +3,7 @@ import { Animated, StyleSheet, StyleProp, ViewStyle } from 'react-native'; import type { ThemeProp } from 'src/types'; -import { useInternalTheme } from '../../../core/theming'; +import { useInternalTheme } from '@/core/theming'; type UnderlineProps = { parentState: { diff --git a/src/components/TextInput/Adornment/TextInputAffix.tsx b/src/components/TextInput/Adornment/TextInputAffix.tsx index 22062449ac..b4dd64bcef 100644 --- a/src/components/TextInput/Adornment/TextInputAffix.tsx +++ b/src/components/TextInput/Adornment/TextInputAffix.tsx @@ -12,10 +12,11 @@ import { ViewStyle, } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; + import { AdornmentSide } from './enums'; import { getTextColor } from './utils'; -import { useInternalTheme } from '../../../core/theming'; -import type { ThemeProp } from '../../../types'; import { getConstants } from '../helpers'; export type Props = { diff --git a/src/components/TextInput/Adornment/TextInputIcon.tsx b/src/components/TextInput/Adornment/TextInputIcon.tsx index bd38ca64ab..8632691288 100644 --- a/src/components/TextInput/Adornment/TextInputIcon.tsx +++ b/src/components/TextInput/Adornment/TextInputIcon.tsx @@ -8,11 +8,12 @@ import { ViewStyle, } from 'react-native'; +import type { IconSource } from '@/components/Icon'; +import IconButton from '@/components/IconButton/IconButton'; +import { useInternalTheme } from '@/core/theming'; +import type { $Omit, ThemeProp } from '@/types'; + import { getIconColor } from './utils'; -import { useInternalTheme } from '../../../core/theming'; -import type { $Omit, ThemeProp } from '../../../types'; -import type { IconSource } from '../../Icon'; -import IconButton from '../../IconButton/IconButton'; import { ICON_SIZE } from '../constants'; import { getConstants } from '../helpers'; diff --git a/src/components/TextInput/Adornment/utils.ts b/src/components/TextInput/Adornment/utils.ts index e7dae2b487..677fa19f2e 100644 --- a/src/components/TextInput/Adornment/utils.ts +++ b/src/components/TextInput/Adornment/utils.ts @@ -1,6 +1,6 @@ import color from 'color'; -import type { InternalTheme } from '../../../types'; +import type { InternalTheme } from '@/types'; type BaseProps = { theme: InternalTheme; diff --git a/src/components/TextInput/Label/InputLabel.tsx b/src/components/TextInput/Label/InputLabel.tsx index f0818f98f0..149ac75249 100644 --- a/src/components/TextInput/Label/InputLabel.tsx +++ b/src/components/TextInput/Label/InputLabel.tsx @@ -8,7 +8,8 @@ import { View, } from 'react-native'; -import AnimatedText from '../../Typography/AnimatedText'; +import AnimatedText from '@/components/Typography/AnimatedText'; + import { getConstants } from '../helpers'; import type { InputLabelProps } from '../types'; diff --git a/src/components/TextInput/Label/LabelBackground.tsx b/src/components/TextInput/Label/LabelBackground.tsx index 409606d208..0394545e21 100644 --- a/src/components/TextInput/Label/LabelBackground.tsx +++ b/src/components/TextInput/Label/LabelBackground.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import { Animated, StyleSheet } from 'react-native'; -import AnimatedText from '../../Typography/AnimatedText'; +import AnimatedText from '@/components/Typography/AnimatedText'; + import type { LabelBackgroundProps } from '../types'; const LabelBackground = ({ diff --git a/src/components/TextInput/TextInput.tsx b/src/components/TextInput/TextInput.tsx index 7c289d9152..2cc88cea17 100644 --- a/src/components/TextInput/TextInput.tsx +++ b/src/components/TextInput/TextInput.tsx @@ -10,6 +10,11 @@ import { TextLayoutEventData, } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; +import { roundLayoutSize } from '@/utils/roundLayoutSize'; + import TextInputAffix, { Props as TextInputAffixProps, } from './Adornment/TextInputAffix'; @@ -19,10 +24,6 @@ import TextInputIcon, { import TextInputFlat from './TextInputFlat'; import TextInputOutlined from './TextInputOutlined'; import type { RenderProps, TextInputLabelProp } from './types'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import { roundLayoutSize } from '../../utils/roundLayoutSize'; const BLUR_ANIMATION_DURATION = 180; const FOCUS_ANIMATION_DURATION = 150; diff --git a/src/components/TextInput/helpers.tsx b/src/components/TextInput/helpers.tsx index 4a5da1d24a..905f307ea2 100644 --- a/src/components/TextInput/helpers.tsx +++ b/src/components/TextInput/helpers.tsx @@ -2,6 +2,8 @@ import { Platform } from 'react-native'; import color from 'color'; +import type { InternalTheme } from '@/types'; + import { AdornmentSide, AdornmentType } from './Adornment/enums'; import type { AdornmentConfig } from './Adornment/types'; import { @@ -27,7 +29,6 @@ import { MD3_OUTLINED_INPUT_OFFSET, } from './constants'; import type { TextInputLabelProp } from './types'; -import type { InternalTheme } from '../../types'; type PaddingProps = { height: number | null; diff --git a/src/components/ToggleButton/ToggleButton.tsx b/src/components/ToggleButton/ToggleButton.tsx index bfdd3fca5c..fb3a4fc68f 100644 --- a/src/components/ToggleButton/ToggleButton.tsx +++ b/src/components/ToggleButton/ToggleButton.tsx @@ -11,14 +11,15 @@ import { import color from 'color'; +import type { IconSource } from '@/components/Icon'; +import IconButton from '@/components/IconButton/IconButton'; +import { useInternalTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import { ToggleButtonGroupContext } from './ToggleButtonGroup'; import { getToggleButtonColor } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import { black, white } from '../../styles/themes/v2/colors'; -import type { ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import type { IconSource } from '../Icon'; -import IconButton from '../IconButton/IconButton'; export type Props = { /** diff --git a/src/components/ToggleButton/utils.ts b/src/components/ToggleButton/utils.ts index 79c22665ad..f0a0008e65 100644 --- a/src/components/ToggleButton/utils.ts +++ b/src/components/ToggleButton/utils.ts @@ -1,7 +1,7 @@ import color from 'color'; -import { tokens } from '../../styles/themes/v3/tokens'; -import type { InternalTheme } from '../../types'; +import { tokens } from '@/styles/themes/v3/tokens'; +import type { InternalTheme } from '@/types'; export const getToggleButtonColor = ({ theme, diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/Tooltip/Tooltip.tsx index f5a483db5a..c77cb3434b 100644 --- a/src/components/Tooltip/Tooltip.tsx +++ b/src/components/Tooltip/Tooltip.tsx @@ -11,11 +11,12 @@ import { import type { ThemeProp } from 'src/types'; +import Portal from '@/components/Portal/Portal'; +import Text from '@/components/Typography/Text'; +import { useInternalTheme } from '@/core/theming'; +import { addEventListener } from '@/utils/addEventListener'; + import { getTooltipPosition, Measurement, TooltipChildProps } from './utils'; -import { useInternalTheme } from '../../core/theming'; -import { addEventListener } from '../../utils/addEventListener'; -import Portal from '../Portal/Portal'; -import Text from '../Typography/Text'; export type Props = { /** diff --git a/src/components/TouchableRipple/TouchableRipple.native.tsx b/src/components/TouchableRipple/TouchableRipple.native.tsx index 1cb17b4068..bdb418dc83 100644 --- a/src/components/TouchableRipple/TouchableRipple.native.tsx +++ b/src/components/TouchableRipple/TouchableRipple.native.tsx @@ -10,14 +10,15 @@ import { ColorValue, } from 'react-native'; -import type { PressableProps } from './Pressable'; +import { Settings, SettingsContext } from '@/core/settings'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; +import hasTouchHandler from '@/utils/hasTouchHandler'; + import { Pressable } from './Pressable'; +import type { PressableProps } from './Pressable'; import { getTouchableRippleColors } from './utils'; -import { Settings, SettingsContext } from '../../core/settings'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import hasTouchHandler from '../../utils/hasTouchHandler'; const ANDROID_VERSION_LOLLIPOP = 21; const ANDROID_VERSION_PIE = 28; diff --git a/src/components/TouchableRipple/TouchableRipple.tsx b/src/components/TouchableRipple/TouchableRipple.tsx index ecf848da32..fbb5f4401d 100644 --- a/src/components/TouchableRipple/TouchableRipple.tsx +++ b/src/components/TouchableRipple/TouchableRipple.tsx @@ -11,14 +11,15 @@ import { import color from 'color'; -import type { PressableProps, PressableStateCallbackType } from './Pressable'; +import { Settings, SettingsContext } from '@/core/settings'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; +import hasTouchHandler from '@/utils/hasTouchHandler'; + import { Pressable } from './Pressable'; +import type { PressableProps, PressableStateCallbackType } from './Pressable'; import { getTouchableRippleColors } from './utils'; -import { Settings, SettingsContext } from '../../core/settings'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; -import hasTouchHandler from '../../utils/hasTouchHandler'; export type Props = PressableProps & { /** diff --git a/src/components/TouchableRipple/utils.ts b/src/components/TouchableRipple/utils.ts index 29c2b18e25..82402ae90c 100644 --- a/src/components/TouchableRipple/utils.ts +++ b/src/components/TouchableRipple/utils.ts @@ -2,7 +2,7 @@ import type { ColorValue } from 'react-native'; import color from 'color'; -import type { InternalTheme } from '../../types'; +import type { InternalTheme } from '@/types'; const getUnderlayColor = ({ theme, diff --git a/src/components/Typography/AnimatedText.tsx b/src/components/Typography/AnimatedText.tsx index 6504ad4b92..ba6f6caec4 100644 --- a/src/components/Typography/AnimatedText.tsx +++ b/src/components/Typography/AnimatedText.tsx @@ -9,10 +9,11 @@ import { Text, } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import type { VariantProp } from './types'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; type Props = React.ComponentPropsWithRef & { /** diff --git a/src/components/Typography/Text.tsx b/src/components/Typography/Text.tsx index 17c29b69c0..cae091122d 100644 --- a/src/components/Typography/Text.tsx +++ b/src/components/Typography/Text.tsx @@ -8,12 +8,13 @@ import { TextStyle, } from 'react-native'; +import { useInternalTheme } from '@/core/theming'; +import type { ThemeProp } from '@/types'; +import { forwardRef } from '@/utils/forwardRef'; + import AnimatedText from './AnimatedText'; import type { VariantProp } from './types'; import StyledText from './v2/StyledText'; -import { useInternalTheme } from '../../core/theming'; -import type { ThemeProp } from '../../types'; -import { forwardRef } from '../../utils/forwardRef'; export type Props = React.ComponentProps & { /** diff --git a/src/components/Typography/types.tsx b/src/components/Typography/types.tsx index 61a6dc7c1e..d6ebbd36c8 100644 --- a/src/components/Typography/types.tsx +++ b/src/components/Typography/types.tsx @@ -1,4 +1,4 @@ -import type { MD3TypescaleKey } from '../../types'; +import type { MD3TypescaleKey } from '@/types'; export type VariantProp = | (T extends string ? (string extends T ? never : T) : never) diff --git a/src/components/Typography/v2/StyledText.tsx b/src/components/Typography/v2/StyledText.tsx index 5d976ff267..d479337798 100644 --- a/src/components/Typography/v2/StyledText.tsx +++ b/src/components/Typography/v2/StyledText.tsx @@ -4,8 +4,9 @@ import { I18nManager, StyleProp, StyleSheet, TextStyle } from 'react-native'; import color from 'color'; import type { ThemeProp } from 'src/types'; +import { useInternalTheme } from '@/core/theming'; + import Text from './Text'; -import { useInternalTheme } from '../../../core/theming'; type Props = React.ComponentProps & { alpha?: number; diff --git a/src/components/Typography/v2/Text.tsx b/src/components/Typography/v2/Text.tsx index 8114915189..645c2e7632 100644 --- a/src/components/Typography/v2/Text.tsx +++ b/src/components/Typography/v2/Text.tsx @@ -8,8 +8,8 @@ import { import type { MD2Theme } from 'src/types'; -import { useInternalTheme } from '../../../core/theming'; -import { forwardRef } from '../../../utils/forwardRef'; +import { useInternalTheme } from '@/core/theming'; +import { forwardRef } from '@/utils/forwardRef'; type Props = React.ComponentProps & { style?: StyleProp; diff --git a/src/components/__tests__/AnimatedFAB.test.tsx b/src/components/__tests__/AnimatedFAB.test.tsx index a31f6d5fb4..9c2e9e75cf 100644 --- a/src/components/__tests__/AnimatedFAB.test.tsx +++ b/src/components/__tests__/AnimatedFAB.test.tsx @@ -6,7 +6,8 @@ import { Animated, StyleSheet } from 'react-native'; import { fireEvent, render } from '@testing-library/react-native'; import { act } from 'react-test-renderer'; -import { MD3Colors } from '../../styles/themes/v3/tokens'; +import { MD3Colors } from '@/styles/themes/v3/tokens'; + import AnimatedFAB from '../FAB/AnimatedFAB'; const styles = StyleSheet.create({ diff --git a/src/components/__tests__/Appbar/Appbar.test.tsx b/src/components/__tests__/Appbar/Appbar.test.tsx index 6f76dab75b..9dbd818754 100644 --- a/src/components/__tests__/Appbar/Appbar.test.tsx +++ b/src/components/__tests__/Appbar/Appbar.test.tsx @@ -4,21 +4,21 @@ import { Animated, Platform } from 'react-native'; import { act, render } from '@testing-library/react-native'; import mockSafeAreaContext from 'react-native-safe-area-context/jest/mock'; -import PaperProvider from '../../../core/PaperProvider'; -import { getTheme } from '../../../core/theming'; -import overlay from '../../../styles/overlay'; -import { tokens } from '../../../styles/themes/v3/tokens'; -import Appbar from '../../Appbar'; +import Appbar from '@/components/Appbar'; import { getAppbarBackgroundColor, getAppbarBorders, modeTextVariant, renderAppbarContent as utilRenderAppbarContent, -} from '../../Appbar/utils'; -import Menu from '../../Menu/Menu'; -import Searchbar from '../../Searchbar'; -import Tooltip from '../../Tooltip/Tooltip'; -import Text from '../../Typography/Text'; +} from '@/components/Appbar/utils'; +import Menu from '@/components/Menu/Menu'; +import Searchbar from '@/components/Searchbar'; +import Tooltip from '@/components/Tooltip/Tooltip'; +import Text from '@/components/Typography/Text'; +import PaperProvider from '@/core/PaperProvider'; +import { getTheme } from '@/core/theming'; +import overlay from '@/styles/overlay'; +import { tokens } from '@/styles/themes/v3/tokens'; const renderAppbarContent = utilRenderAppbarContent as ( props: Parameters[0] diff --git a/src/components/__tests__/Avatar.test.tsx b/src/components/__tests__/Avatar.test.tsx index 96d69582b6..0291ed1f2a 100644 --- a/src/components/__tests__/Avatar.test.tsx +++ b/src/components/__tests__/Avatar.test.tsx @@ -3,7 +3,8 @@ import { StyleSheet } from 'react-native'; import { fireEvent, render } from '@testing-library/react-native'; -import { red500 } from '../../styles/themes/v2/colors'; +import { red500 } from '@/styles/themes/v2/colors'; + import * as Avatar from '../Avatar/Avatar'; const styles = StyleSheet.create({ diff --git a/src/components/__tests__/Badge.test.tsx b/src/components/__tests__/Badge.test.tsx index 32730659a1..f94624dcc6 100644 --- a/src/components/__tests__/Badge.test.tsx +++ b/src/components/__tests__/Badge.test.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { render } from '@testing-library/react-native'; -import { red500 } from '../../styles/themes/v2/colors'; +import { red500 } from '@/styles/themes/v2/colors'; + import Badge from '../Badge'; it('renders badge', () => { diff --git a/src/components/__tests__/BottomNavigation.test.tsx b/src/components/__tests__/BottomNavigation.test.tsx index 43c1e9383b..191983d81b 100644 --- a/src/components/__tests__/BottomNavigation.test.tsx +++ b/src/components/__tests__/BottomNavigation.test.tsx @@ -4,9 +4,10 @@ import { Animated, Easing, Platform, StyleSheet } from 'react-native'; import { act, fireEvent, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { red300 } from '../../styles/themes/v2/colors'; -import { MD3Colors } from '../../styles/themes/v3/tokens'; +import { getTheme } from '@/core/theming'; +import { red300 } from '@/styles/themes/v2/colors'; +import { MD3Colors } from '@/styles/themes/v3/tokens'; + import BottomNavigation from '../BottomNavigation/BottomNavigation'; import BottomNavigationRouteScreen from '../BottomNavigation/BottomNavigationRouteScreen'; import { diff --git a/src/components/__tests__/Button.test.tsx b/src/components/__tests__/Button.test.tsx index 8917eaca92..9872834075 100644 --- a/src/components/__tests__/Button.test.tsx +++ b/src/components/__tests__/Button.test.tsx @@ -4,8 +4,9 @@ import { Animated, StyleSheet } from 'react-native'; import { act, fireEvent, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { black, pink500, white } from '../../styles/themes/v2/colors'; +import { getTheme } from '@/core/theming'; +import { black, pink500, white } from '@/styles/themes/v2/colors'; + import Button from '../Button/Button'; import { getButtonColors } from '../Button/utils'; diff --git a/src/components/__tests__/Card/Card.test.tsx b/src/components/__tests__/Card/Card.test.tsx index 3da4aa2c51..1a54ff35ff 100644 --- a/src/components/__tests__/Card/Card.test.tsx +++ b/src/components/__tests__/Card/Card.test.tsx @@ -4,12 +4,12 @@ import { Animated, StyleSheet, Text } from 'react-native'; import { act, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../../core/theming'; -import { black, white } from '../../../styles/themes/v2/colors'; -import { MD3Colors } from '../../../styles/themes/v3/tokens'; -import Button from '../../Button/Button'; -import Card from '../../Card/Card'; -import { getCardColors, getCardCoverStyle } from '../../Card/utils'; +import Button from '@/components/Button/Button'; +import Card from '@/components/Card/Card'; +import { getCardColors, getCardCoverStyle } from '@/components/Card/utils'; +import { getTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; +import { MD3Colors } from '@/styles/themes/v3/tokens'; const styles = StyleSheet.create({ customBorderRadius: { diff --git a/src/components/__tests__/Checkbox/Checkbox.test.tsx b/src/components/__tests__/Checkbox/Checkbox.test.tsx index efa819007e..8185576931 100644 --- a/src/components/__tests__/Checkbox/Checkbox.test.tsx +++ b/src/components/__tests__/Checkbox/Checkbox.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { render } from '@testing-library/react-native'; -import Checkbox from '../../Checkbox'; +import Checkbox from '@/components/Checkbox'; it('renders checked Checkbox with onPress', () => { const tree = render( diff --git a/src/components/__tests__/Checkbox/CheckboxItem.test.tsx b/src/components/__tests__/Checkbox/CheckboxItem.test.tsx index cfb6007b5c..4ae8665e6a 100644 --- a/src/components/__tests__/Checkbox/CheckboxItem.test.tsx +++ b/src/components/__tests__/Checkbox/CheckboxItem.test.tsx @@ -3,7 +3,7 @@ import { Platform } from 'react-native'; import { act, fireEvent, render } from '@testing-library/react-native'; -import Checkbox from '../../Checkbox'; +import Checkbox from '@/components/Checkbox'; it('renders unchecked', () => { const tree = render( diff --git a/src/components/__tests__/Checkbox/utils.test.tsx b/src/components/__tests__/Checkbox/utils.test.tsx index 580e3dbedf..13018d0fbd 100644 --- a/src/components/__tests__/Checkbox/utils.test.tsx +++ b/src/components/__tests__/Checkbox/utils.test.tsx @@ -1,10 +1,10 @@ import color from 'color'; -import { getTheme } from '../../../core/theming'; import { getAndroidSelectionControlColor, getSelectionControlIOSColor, -} from '../../Checkbox/utils'; +} from '@/components/Checkbox/utils'; +import { getTheme } from '@/core/theming'; describe('getAndroidSelectionControlColor - ripple color', () => { it('should return correct disabled color, for theme version 3', () => { diff --git a/src/components/__tests__/Chip.test.tsx b/src/components/__tests__/Chip.test.tsx index ca3055e35b..7f0f1a7508 100644 --- a/src/components/__tests__/Chip.test.tsx +++ b/src/components/__tests__/Chip.test.tsx @@ -4,8 +4,9 @@ import { Animated } from 'react-native'; import { act, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { black, white } from '../../styles/themes/v2/colors'; +import { getTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; + import Chip from '../Chip/Chip'; import { getChipColors } from '../Chip/helpers'; diff --git a/src/components/__tests__/Dialog.test.tsx b/src/components/__tests__/Dialog.test.tsx index 8f7e327a72..ba1c6dc895 100644 --- a/src/components/__tests__/Dialog.test.tsx +++ b/src/components/__tests__/Dialog.test.tsx @@ -9,7 +9,8 @@ import { import { act, fireEvent, render } from '@testing-library/react-native'; -import Dialog from '../../components/Dialog/Dialog'; +import Dialog from '@/components/Dialog/Dialog'; + import Button from '../Button/Button'; interface BackHandlerStatic extends RNBackHandlerStatic { diff --git a/src/components/__tests__/Drawer/DrawerCollapsedItem.test.tsx b/src/components/__tests__/Drawer/DrawerCollapsedItem.test.tsx index bc3b32885a..607ea9775a 100644 --- a/src/components/__tests__/Drawer/DrawerCollapsedItem.test.tsx +++ b/src/components/__tests__/Drawer/DrawerCollapsedItem.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { render } from '@testing-library/react-native'; -import DrawerCollapsedItem from '../../Drawer/DrawerCollapsedItem'; +import DrawerCollapsedItem from '@/components/Drawer/DrawerCollapsedItem'; describe('DrawerCollapsedItem', () => { it('should have regular outline if label is specified', () => { diff --git a/src/components/__tests__/Drawer/DrawerSection.test.tsx b/src/components/__tests__/Drawer/DrawerSection.test.tsx index e74cf362c6..715b3be524 100644 --- a/src/components/__tests__/Drawer/DrawerSection.test.tsx +++ b/src/components/__tests__/Drawer/DrawerSection.test.tsx @@ -3,7 +3,7 @@ import { View } from 'react-native'; import { render } from '@testing-library/react-native'; -import DrawerSection from '../../Drawer/DrawerSection'; +import DrawerSection from '@/components/Drawer/DrawerSection'; describe('DrawerSection', () => { it('renders properly', () => { diff --git a/src/components/__tests__/FAB.test.tsx b/src/components/__tests__/FAB.test.tsx index d59639efc1..bfef3f997b 100644 --- a/src/components/__tests__/FAB.test.tsx +++ b/src/components/__tests__/FAB.test.tsx @@ -5,9 +5,10 @@ import { fireEvent, render } from '@testing-library/react-native'; import color from 'color'; import { act } from 'react-test-renderer'; -import { getTheme } from '../../core/theming'; -import { black, white } from '../../styles/themes/v2/colors'; -import getContrastingColor from '../../utils/getContrastingColor'; +import { getTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; +import getContrastingColor from '@/utils/getContrastingColor'; + import FAB from '../FAB'; import { getFABColors } from '../FAB/utils'; diff --git a/src/components/__tests__/FABGroup.test.tsx b/src/components/__tests__/FABGroup.test.tsx index 50cc0a7173..9a4aff6cab 100644 --- a/src/components/__tests__/FABGroup.test.tsx +++ b/src/components/__tests__/FABGroup.test.tsx @@ -4,7 +4,8 @@ import { Animated } from 'react-native'; import { act, fireEvent, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; +import { getTheme } from '@/core/theming'; + import FAB from '../FAB'; import { getFABGroupColors } from '../FAB/utils'; diff --git a/src/components/__tests__/HelperText.test.tsx b/src/components/__tests__/HelperText.test.tsx index ce16526776..81c35db1a0 100644 --- a/src/components/__tests__/HelperText.test.tsx +++ b/src/components/__tests__/HelperText.test.tsx @@ -2,7 +2,8 @@ import React from 'react'; import { render } from '@testing-library/react-native'; -import { getTheme } from '../../core/theming'; +import { getTheme } from '@/core/theming'; + import HelperText from '../HelperText/HelperText'; describe('HelperText', () => { diff --git a/src/components/__tests__/IconButton.test.tsx b/src/components/__tests__/IconButton.test.tsx index 381ea5ae24..0d50633bc2 100644 --- a/src/components/__tests__/IconButton.test.tsx +++ b/src/components/__tests__/IconButton.test.tsx @@ -4,8 +4,9 @@ import { Animated, StyleSheet } from 'react-native'; import { act, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { pink500 } from '../../styles/themes/v2/colors'; +import { getTheme } from '@/core/theming'; +import { pink500 } from '@/styles/themes/v2/colors'; + import IconButton from '../IconButton/IconButton'; import { getIconButtonColor } from '../IconButton/utils'; diff --git a/src/components/__tests__/ListAccordion.test.tsx b/src/components/__tests__/ListAccordion.test.tsx index 0c24538348..c73c2ff260 100644 --- a/src/components/__tests__/ListAccordion.test.tsx +++ b/src/components/__tests__/ListAccordion.test.tsx @@ -4,8 +4,9 @@ import { StyleSheet, View } from 'react-native'; import { render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { red500 } from '../../styles/themes/v2/colors'; +import { getTheme } from '@/core/theming'; +import { red500 } from '@/styles/themes/v2/colors'; + import ListAccordion from '../List/ListAccordion'; import ListAccordionGroup from '../List/ListAccordionGroup'; import ListIcon from '../List/ListIcon'; diff --git a/src/components/__tests__/ListItem.test.tsx b/src/components/__tests__/ListItem.test.tsx index 036697f9ec..b99e39cbe4 100644 --- a/src/components/__tests__/ListItem.test.tsx +++ b/src/components/__tests__/ListItem.test.tsx @@ -4,7 +4,8 @@ import { Text, View } from 'react-native'; import { fireEvent, render } from '@testing-library/react-native'; -import { red500 } from '../../styles/themes/v2/colors'; +import { red500 } from '@/styles/themes/v2/colors'; + import Chip from '../Chip/Chip'; import IconButton from '../IconButton/IconButton'; import ListIcon from '../List/ListIcon'; diff --git a/src/components/__tests__/ListSection.test.tsx b/src/components/__tests__/ListSection.test.tsx index 8cc1578b8f..d92cf06d4c 100644 --- a/src/components/__tests__/ListSection.test.tsx +++ b/src/components/__tests__/ListSection.test.tsx @@ -3,7 +3,8 @@ import { StyleSheet } from 'react-native'; import { render } from '@testing-library/react-native'; -import { red500 } from '../../styles/themes/v2/colors'; +import { red500 } from '@/styles/themes/v2/colors'; + import ListIcon from '../List/ListIcon'; import ListItem from '../List/ListItem'; import ListSection from '../List/ListSection'; diff --git a/src/components/__tests__/Menu.test.tsx b/src/components/__tests__/Menu.test.tsx index 68e73661e6..afc782983d 100644 --- a/src/components/__tests__/Menu.test.tsx +++ b/src/components/__tests__/Menu.test.tsx @@ -3,8 +3,9 @@ import { Animated, Dimensions, StyleSheet, View } from 'react-native'; import { act, render, screen, waitFor } from '@testing-library/react-native'; -import { getTheme } from '../../core/theming'; -import { MD3Elevation } from '../../types'; +import { getTheme } from '@/core/theming'; +import { MD3Elevation } from '@/types'; + import Button from '../Button/Button'; import Menu, { ELEVATION_LEVELS_MAP } from '../Menu/Menu'; import Portal from '../Portal/Portal'; diff --git a/src/components/__tests__/MenuItem.test.tsx b/src/components/__tests__/MenuItem.test.tsx index 7413f43622..672970092f 100644 --- a/src/components/__tests__/MenuItem.test.tsx +++ b/src/components/__tests__/MenuItem.test.tsx @@ -3,8 +3,9 @@ import * as React from 'react'; import { render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { black, white } from '../../styles/themes/v2/colors'; +import { getTheme } from '@/core/theming'; +import { black, white } from '@/styles/themes/v2/colors'; + import Menu from '../Menu/Menu'; import { getMenuItemColor } from '../Menu/utils'; diff --git a/src/components/__tests__/Modal.test.tsx b/src/components/__tests__/Modal.test.tsx index 32161d5b84..f07f80a563 100644 --- a/src/components/__tests__/Modal.test.tsx +++ b/src/components/__tests__/Modal.test.tsx @@ -8,7 +8,8 @@ import { import { act, fireEvent, render } from '@testing-library/react-native'; -import { MD3LightTheme } from '../../styles/themes'; +import { MD3LightTheme } from '@/styles/themes'; + import Modal from '../Modal'; jest.mock('react-native-safe-area-context', () => ({ diff --git a/src/components/__tests__/RadioButton/RadioButton.test.tsx b/src/components/__tests__/RadioButton/RadioButton.test.tsx index ecba6bf851..9b1fbf160d 100644 --- a/src/components/__tests__/RadioButton/RadioButton.test.tsx +++ b/src/components/__tests__/RadioButton/RadioButton.test.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { render } from '@testing-library/react-native'; -import RadioButton from '../../RadioButton'; -import { RadioButtonContext } from '../../RadioButton/RadioButtonGroup'; +import RadioButton from '@/components/RadioButton'; +import { RadioButtonContext } from '@/components/RadioButton/RadioButtonGroup'; describe('RadioButton', () => { describe('on default platform', () => { diff --git a/src/components/__tests__/RadioButton/RadioButtonGroup.test.tsx b/src/components/__tests__/RadioButton/RadioButtonGroup.test.tsx index 2b431102cb..7514377ac1 100644 --- a/src/components/__tests__/RadioButton/RadioButtonGroup.test.tsx +++ b/src/components/__tests__/RadioButton/RadioButtonGroup.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { render } from '@testing-library/react-native'; -import RadioButton from '../../RadioButton'; +import RadioButton from '@/components/RadioButton'; describe('RadioButtonGroup', () => { it('renders properly', () => { diff --git a/src/components/__tests__/RadioButton/RadioButtonItem.test.tsx b/src/components/__tests__/RadioButton/RadioButtonItem.test.tsx index 84e7b52971..6506f3294a 100644 --- a/src/components/__tests__/RadioButton/RadioButtonItem.test.tsx +++ b/src/components/__tests__/RadioButton/RadioButtonItem.test.tsx @@ -3,7 +3,7 @@ import { Platform } from 'react-native'; import { act, fireEvent, render } from '@testing-library/react-native'; -import RadioButton from '../../RadioButton'; +import RadioButton from '@/components/RadioButton'; it('renders unchecked', () => { const tree = render( diff --git a/src/components/__tests__/SegmentedButton.test.tsx b/src/components/__tests__/SegmentedButton.test.tsx index d36babb5bb..aa197406b0 100644 --- a/src/components/__tests__/SegmentedButton.test.tsx +++ b/src/components/__tests__/SegmentedButton.test.tsx @@ -3,8 +3,9 @@ import * as React from 'react'; import { render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { black } from '../../styles/themes/v2/colors'; +import { getTheme } from '@/core/theming'; +import { black } from '@/styles/themes/v2/colors'; + import SegmentedButtons from '../SegmentedButtons/SegmentedButtons'; import { getDisabledSegmentedButtonStyle, diff --git a/src/components/__tests__/Snackbar.test.tsx b/src/components/__tests__/Snackbar.test.tsx index f520faa466..0c67ccb48f 100644 --- a/src/components/__tests__/Snackbar.test.tsx +++ b/src/components/__tests__/Snackbar.test.tsx @@ -3,7 +3,8 @@ import { Animated, StyleSheet, Text, View } from 'react-native'; import { act, render } from '@testing-library/react-native'; -import { red200, white } from '../../styles/themes/v2/colors'; +import { red200, white } from '@/styles/themes/v2/colors'; + import Snackbar from '../Snackbar'; const styles = StyleSheet.create({ diff --git a/src/components/__tests__/Surface.test.tsx b/src/components/__tests__/Surface.test.tsx index 8d8e639779..3027e5f676 100644 --- a/src/components/__tests__/Surface.test.tsx +++ b/src/components/__tests__/Surface.test.tsx @@ -4,7 +4,8 @@ import { Platform } from 'react-native'; import { render } from '@testing-library/react-native'; -import { getTheme } from '../../core/theming'; +import { getTheme } from '@/core/theming'; + import Surface from '../Surface'; describe('Surface', () => { diff --git a/src/components/__tests__/Switch.test.tsx b/src/components/__tests__/Switch.test.tsx index e475b9a166..6c8c49aaf2 100644 --- a/src/components/__tests__/Switch.test.tsx +++ b/src/components/__tests__/Switch.test.tsx @@ -4,7 +4,7 @@ import { Platform } from 'react-native'; import { render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; +import { getTheme } from '@/core/theming'; import { white, black, @@ -13,7 +13,8 @@ import { grey800, pink500, grey700, -} from '../../styles/themes/v2/colors'; +} from '@/styles/themes/v2/colors'; + import Switch from '../Switch/Switch'; import { getSwitchColor } from '../Switch/utils'; diff --git a/src/components/__tests__/TextInput.test.tsx b/src/components/__tests__/TextInput.test.tsx index e190a537d6..24e599dd45 100644 --- a/src/components/__tests__/TextInput.test.tsx +++ b/src/components/__tests__/TextInput.test.tsx @@ -5,8 +5,9 @@ import { I18nManager, Platform, StyleSheet, Text, View } from 'react-native'; import { fireEvent, render } from '@testing-library/react-native'; import color from 'color'; -import { DefaultTheme, getTheme, ThemeProvider } from '../../core/theming'; -import { red500 } from '../../styles/themes/v2/colors'; +import { DefaultTheme, getTheme, ThemeProvider } from '@/core/theming'; +import { red500 } from '@/styles/themes/v2/colors'; + import { getFlatInputColors, getOutlinedInputColors, diff --git a/src/components/__tests__/ToggleButton.test.tsx b/src/components/__tests__/ToggleButton.test.tsx index 3ab234d0f3..cb16409be4 100644 --- a/src/components/__tests__/ToggleButton.test.tsx +++ b/src/components/__tests__/ToggleButton.test.tsx @@ -4,8 +4,9 @@ import { Animated } from 'react-native'; import { act, render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '../../core/theming'; -import { tokens } from '../../styles/themes/v3/tokens'; +import { getTheme } from '@/core/theming'; +import { tokens } from '@/styles/themes/v3/tokens'; + import ToggleButton from '../ToggleButton'; import { getToggleButtonColor } from '../ToggleButton/utils'; diff --git a/src/components/__tests__/Tooltip.test.tsx b/src/components/__tests__/Tooltip.test.tsx index 075b534ba6..813d87873c 100644 --- a/src/components/__tests__/Tooltip.test.tsx +++ b/src/components/__tests__/Tooltip.test.tsx @@ -4,7 +4,8 @@ import { Dimensions, Text, View, Platform } from 'react-native'; import { act, fireEvent, render } from '@testing-library/react-native'; import type { ReactTestInstance } from 'react-test-renderer'; -import PaperProvider from '../../core/PaperProvider'; +import PaperProvider from '@/core/PaperProvider'; + import Tooltip from '../Tooltip/Tooltip'; const mockedRemoveEventListener = jest.fn(); diff --git a/src/components/__tests__/Typography/Caption.test.tsx b/src/components/__tests__/Typography/Caption.test.tsx index b85bee50d4..a383cccb1e 100644 --- a/src/components/__tests__/Typography/Caption.test.tsx +++ b/src/components/__tests__/Typography/Caption.test.tsx @@ -3,8 +3,8 @@ import { StyleSheet } from 'react-native'; import { render } from '@testing-library/react-native'; -import { red500 } from '../../../styles/themes/v2/colors'; -import Caption from '../../Typography/v2/Caption'; +import Caption from '@/components/Typography/v2/Caption'; +import { red500 } from '@/styles/themes/v2/colors'; const style = StyleSheet.create({ caption: { diff --git a/src/components/__tests__/Typography/Text.test.tsx b/src/components/__tests__/Typography/Text.test.tsx index 2560920322..3faa05e233 100644 --- a/src/components/__tests__/Typography/Text.test.tsx +++ b/src/components/__tests__/Typography/Text.test.tsx @@ -2,11 +2,11 @@ import * as React from 'react'; import { render } from '@testing-library/react-native'; -import PaperProvider from '../../../core/PaperProvider'; -import configureFonts from '../../../styles/fonts'; -import { MD3LightTheme } from '../../../styles/themes'; -import { tokens } from '../../../styles/themes/v3/tokens'; -import Text, { customText } from '../../Typography/Text'; +import Text, { customText } from '@/components/Typography/Text'; +import PaperProvider from '@/core/PaperProvider'; +import configureFonts from '@/styles/fonts'; +import { MD3LightTheme } from '@/styles/themes'; +import { tokens } from '@/styles/themes/v3/tokens'; const content = 'Something rendered as a child content'; diff --git a/src/core/__tests__/PaperProvider.test.tsx b/src/core/__tests__/PaperProvider.test.tsx index 11c4beff49..faee08d5dd 100644 --- a/src/core/__tests__/PaperProvider.test.tsx +++ b/src/core/__tests__/PaperProvider.test.tsx @@ -13,8 +13,9 @@ import { MD2DarkTheme, MD3LightTheme, MD3DarkTheme, -} from '../../styles/themes'; -import type { ThemeProp } from '../../types'; +} from '@/styles/themes'; +import type { ThemeProp } from '@/types'; + import PaperProvider from '../PaperProvider'; import { useTheme } from '../theming'; diff --git a/src/core/__tests__/theming.test.tsx b/src/core/__tests__/theming.test.tsx index 7b069cd482..948061eae3 100644 --- a/src/core/__tests__/theming.test.tsx +++ b/src/core/__tests__/theming.test.tsx @@ -1,4 +1,5 @@ -import { MD3DarkTheme, MD3LightTheme } from '../../styles/themes'; +import { MD3DarkTheme, MD3LightTheme } from '@/styles/themes'; + import { adaptNavigationTheme } from '../theming'; const NavigationLightTheme = { diff --git a/src/react-navigation/__tests__/index.test.tsx b/src/react-navigation/__tests__/index.test.tsx index a04495639d..45b0b1eceb 100644 --- a/src/react-navigation/__tests__/index.test.tsx +++ b/src/react-navigation/__tests__/index.test.tsx @@ -4,7 +4,8 @@ import { Button, Text, View } from 'react-native'; import { NavigationContainer, ParamListBase } from '@react-navigation/native'; import { fireEvent, render } from '@testing-library/react-native'; -import PaperProvider from '../../core/PaperProvider'; +import PaperProvider from '@/core/PaperProvider'; + import { createMaterialBottomTabNavigator, MaterialBottomTabScreenProps, diff --git a/src/react-navigation/views/MaterialBottomTabView.tsx b/src/react-navigation/views/MaterialBottomTabView.tsx index df846ae2fb..efff7a6f5c 100644 --- a/src/react-navigation/views/MaterialBottomTabView.tsx +++ b/src/react-navigation/views/MaterialBottomTabView.tsx @@ -10,8 +10,9 @@ import { useLinkBuilder, } from '@react-navigation/native'; -import BottomNavigation from '../../components/BottomNavigation/BottomNavigation'; -import MaterialCommunityIcon from '../../components/MaterialCommunityIcon'; +import BottomNavigation from '@/components/BottomNavigation/BottomNavigation'; +import MaterialCommunityIcon from '@/components/MaterialCommunityIcon'; + import type { MaterialBottomTabDescriptorMap, MaterialBottomTabNavigationConfig, diff --git a/src/styles/themes/v2/DarkTheme.tsx b/src/styles/themes/v2/DarkTheme.tsx index 9eaa576dcb..0b9448804e 100644 --- a/src/styles/themes/v2/DarkTheme.tsx +++ b/src/styles/themes/v2/DarkTheme.tsx @@ -1,9 +1,10 @@ import color from 'color'; +import configureFonts from '@/styles/fonts'; +import type { Fonts, MD2Theme } from '@/types'; + import { black, pinkA100, white } from './colors'; import { MD2LightTheme } from './LightTheme'; -import type { Fonts, MD2Theme } from '../../../types'; -import configureFonts from '../../fonts'; export const MD2DarkTheme: MD2Theme = { ...MD2LightTheme, diff --git a/src/styles/themes/v2/LightTheme.tsx b/src/styles/themes/v2/LightTheme.tsx index 8566bdcc40..bca80e4788 100644 --- a/src/styles/themes/v2/LightTheme.tsx +++ b/src/styles/themes/v2/LightTheme.tsx @@ -1,8 +1,9 @@ import color from 'color'; +import configureFonts from '@/styles/fonts'; +import type { Fonts, MD2Theme } from '@/types'; + import { black, pinkA400, white } from './colors'; -import type { Fonts, MD2Theme } from '../../../types'; -import configureFonts from '../../fonts'; export const MD2LightTheme: MD2Theme = { dark: false, diff --git a/src/styles/themes/v3/DarkTheme.tsx b/src/styles/themes/v3/DarkTheme.tsx index 9823e677bd..113a6db4df 100644 --- a/src/styles/themes/v3/DarkTheme.tsx +++ b/src/styles/themes/v3/DarkTheme.tsx @@ -1,8 +1,9 @@ import color from 'color'; +import type { MD3Theme } from '@/types'; + import { MD3LightTheme } from './LightTheme'; import { MD3Colors, tokens } from './tokens'; -import type { MD3Theme } from '../../../types'; const { palette, opacity } = tokens.md.ref; diff --git a/src/styles/themes/v3/LightTheme.tsx b/src/styles/themes/v3/LightTheme.tsx index 99e0d11ab4..8c3d84b6ab 100644 --- a/src/styles/themes/v3/LightTheme.tsx +++ b/src/styles/themes/v3/LightTheme.tsx @@ -1,8 +1,9 @@ import color from 'color'; +import configureFonts from '@/styles/fonts'; +import type { MD3Theme } from '@/types'; + import { MD3Colors, tokens } from './tokens'; -import type { MD3Theme } from '../../../types'; -import configureFonts from '../../fonts'; const { palette, opacity } = tokens.md.ref; diff --git a/src/styles/themes/v3/tokens.tsx b/src/styles/themes/v3/tokens.tsx index d008944d86..519c5aca3a 100644 --- a/src/styles/themes/v3/tokens.tsx +++ b/src/styles/themes/v3/tokens.tsx @@ -1,6 +1,6 @@ import { Platform } from 'react-native'; -import type { Font } from '../../../types'; +import type { Font } from '@/types'; const ref = { palette: { From 6d53c5ac183185ad68e4cef46890c69247ef89ea Mon Sep 17 00:00:00 2001 From: Aziz Becha Date: Wed, 4 Feb 2026 08:45:09 +0100 Subject: [PATCH 3/4] refactor: more import alias --- src/components/MaterialCommunityIcon.tsx | 2 +- src/components/__tests__/SegmentedButton.test.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/MaterialCommunityIcon.tsx b/src/components/MaterialCommunityIcon.tsx index 52719bdbe1..97bb15f7a3 100644 --- a/src/components/MaterialCommunityIcon.tsx +++ b/src/components/MaterialCommunityIcon.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { ComponentProps } from 'react'; import { StyleSheet, Text, Platform, Role, ViewProps } from 'react-native'; -import { black } from '../styles/themes/v2/colors'; +import { black } from '@/styles/themes/v2/colors'; export type IconProps = { name: ComponentProps['name']; diff --git a/src/components/__tests__/SegmentedButton.test.tsx b/src/components/__tests__/SegmentedButton.test.tsx index aa197406b0..6371ef1519 100644 --- a/src/components/__tests__/SegmentedButton.test.tsx +++ b/src/components/__tests__/SegmentedButton.test.tsx @@ -3,14 +3,13 @@ import * as React from 'react'; import { render } from '@testing-library/react-native'; import color from 'color'; -import { getTheme } from '@/core/theming'; -import { black } from '@/styles/themes/v2/colors'; - -import SegmentedButtons from '../SegmentedButtons/SegmentedButtons'; +import SegmentedButtons from '@/components/SegmentedButtons/SegmentedButtons'; import { getDisabledSegmentedButtonStyle, getSegmentedButtonColors, -} from '../SegmentedButtons/utils'; +} from '@/components/SegmentedButtons/utils'; +import { getTheme } from '@/core/theming'; +import { black } from '@/styles/themes/v2/colors'; it('renders segmented button', () => { const tree = render( From 8518db06a7682a5fd5996f1a3705175cc251c216 Mon Sep 17 00:00:00 2001 From: Aziz Becha Date: Wed, 4 Feb 2026 09:01:40 +0100 Subject: [PATCH 4/4] fix: add alias to docs config to build correctly --- docs/plugins/docusaurus-react-native-plugin.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/plugins/docusaurus-react-native-plugin.js b/docs/plugins/docusaurus-react-native-plugin.js index 3a05c223bc..ae43f675fc 100644 --- a/docs/plugins/docusaurus-react-native-plugin.js +++ b/docs/plugins/docusaurus-react-native-plugin.js @@ -8,6 +8,7 @@ module.exports = function () { mergeStrategy: { 'resolve.extensions': 'prepend' }, resolve: { alias: { + '@': path.resolve(__dirname, '../../src'), react: path.resolve('node_modules/react'), 'react-native$': 'react-native-web', 'react-native-paper': path.resolve('../src'),