nwui-cli 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -1
- package/build/index.js +33 -17
- package/build/install-component.js +105 -48
- package/build/login.js +14 -11
- package/build/utils/env.js +1 -1
- package/package.json +2 -1
- package/build/cli/src/index.js +0 -41
- package/build/cli/src/install-component.js +0 -42
- package/build/cli/src/login.js +0 -77
- package/build/cli/src/net.js +0 -12
- package/build/cli/src/project-setup.js +0 -1
- package/build/cli/src/prompts.js +0 -119
- package/build/cli/src/utils/local-storage.js +0 -19
- package/build/docs/app/data.js +0 -1380
- package/build/log/index.js +0 -81
- package/build/prompts.js +0 -119
- package/my-expo-app-2/app/+html.tsx +0 -46
- package/my-expo-app-2/app/+not-found.tsx +0 -33
- package/my-expo-app-2/app/_layout.tsx +0 -22
- package/my-expo-app-2/app/details.tsx +0 -17
- package/my-expo-app-2/app/index.tsx +0 -23
- package/my-expo-app-2/app-env.d.ts +0 -2
- package/my-expo-app-2/app.json +0 -48
- package/my-expo-app-2/assets/adaptive-icon.png +0 -0
- package/my-expo-app-2/assets/favicon.png +0 -0
- package/my-expo-app-2/assets/icon.png +0 -0
- package/my-expo-app-2/assets/splash.png +0 -0
- package/my-expo-app-2/babel.config.js +0 -18
- package/my-expo-app-2/cesconfig.json +0 -35
- package/my-expo-app-2/components/Button.tsx +0 -19
- package/my-expo-app-2/components/Container.tsx +0 -9
- package/my-expo-app-2/components/EditScreenInfo.tsx +0 -34
- package/my-expo-app-2/components/ScreenContent.tsx +0 -25
- package/my-expo-app-2/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.ios.tsx +0 -97
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.tsx +0 -264
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/AdaptiveSearchHeader/types.ts +0 -95
- package/my-expo-app-2/components/nativewindui/Alert/Alert.ios.tsx +0 -65
- package/my-expo-app-2/components/nativewindui/Alert/Alert.tsx +0 -291
- package/my-expo-app-2/components/nativewindui/Alert/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/Alert/types.ts +0 -27
- package/my-expo-app-2/components/nativewindui/Badge.tsx +0 -84
- package/my-expo-app-2/components/nativewindui/Button.tsx +0 -156
- package/my-expo-app-2/components/nativewindui/Checkbox.tsx +0 -61
- package/my-expo-app-2/components/nativewindui/ContextMenu/ContextMenu.ios.tsx +0 -221
- package/my-expo-app-2/components/nativewindui/ContextMenu/ContextMenu.tsx +0 -420
- package/my-expo-app-2/components/nativewindui/ContextMenu/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/ContextMenu/types.ts +0 -91
- package/my-expo-app-2/components/nativewindui/ContextMenu/utils.ts +0 -14
- package/my-expo-app-2/components/nativewindui/DrawerContent.tsx +0 -145
- package/my-expo-app-2/components/nativewindui/DropdownMenu/DropdownMenu.ios.tsx +0 -168
- package/my-expo-app-2/components/nativewindui/DropdownMenu/DropdownMenu.tsx +0 -330
- package/my-expo-app-2/components/nativewindui/DropdownMenu/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/DropdownMenu/types.ts +0 -93
- package/my-expo-app-2/components/nativewindui/DropdownMenu/utils.ts +0 -14
- package/my-expo-app-2/components/nativewindui/Form.tsx +0 -125
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/LargeTitleHeader.ios.tsx +0 -99
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/LargeTitleHeader.tsx +0 -288
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/LargeTitleHeader/types.ts +0 -89
- package/my-expo-app-2/components/nativewindui/List.tsx +0 -433
- package/my-expo-app-2/components/nativewindui/SearchInput/SearchInput.ios.tsx +0 -177
- package/my-expo-app-2/components/nativewindui/SearchInput/SearchInput.tsx +0 -86
- package/my-expo-app-2/components/nativewindui/SearchInput/index.tsx +0 -1
- package/my-expo-app-2/components/nativewindui/SearchInput/types.ts +0 -12
- package/my-expo-app-2/components/nativewindui/SegmentedControl/SegmentedControl.ios.tsx +0 -31
- package/my-expo-app-2/components/nativewindui/SegmentedControl/SegmentedControl.tsx +0 -55
- package/my-expo-app-2/components/nativewindui/SegmentedControl/index.ts +0 -1
- package/my-expo-app-2/components/nativewindui/SegmentedControl/types.ts +0 -15
- package/my-expo-app-2/components/nativewindui/Stepper.tsx +0 -62
- package/my-expo-app-2/components/nativewindui/Text.tsx +0 -55
- package/my-expo-app-2/components/nativewindui/TextField/TextField.ios.tsx +0 -85
- package/my-expo-app-2/components/nativewindui/TextField/TextField.tsx +0 -326
- package/my-expo-app-2/components/nativewindui/TextField/index.tsx +0 -1
- package/my-expo-app-2/components/nativewindui/TextField/types.ts +0 -26
- package/my-expo-app-2/components/nativewindui/Toolbar.tsx +0 -116
- package/my-expo-app-2/global.css +0 -3
- package/my-expo-app-2/metro.config.js +0 -12
- package/my-expo-app-2/package-lock.json +0 -19162
- package/my-expo-app-2/package.json +0 -74
- package/my-expo-app-2/prettier.config.js +0 -11
- package/my-expo-app-2/tailwind.config.js +0 -11
- package/my-expo-app-3/app/+html.tsx +0 -46
- package/my-expo-app-3/app/+not-found.tsx +0 -33
- package/my-expo-app-3/app/_layout.tsx +0 -22
- package/my-expo-app-3/app/details.tsx +0 -17
- package/my-expo-app-3/app/index.tsx +0 -23
- package/my-expo-app-3/app-env.d.ts +0 -2
- package/my-expo-app-3/app.json +0 -48
- package/my-expo-app-3/assets/adaptive-icon.png +0 -0
- package/my-expo-app-3/assets/favicon.png +0 -0
- package/my-expo-app-3/assets/icon.png +0 -0
- package/my-expo-app-3/assets/splash.png +0 -0
- package/my-expo-app-3/babel.config.js +0 -18
- package/my-expo-app-3/cesconfig.json +0 -35
- package/my-expo-app-3/components/Button.tsx +0 -19
- package/my-expo-app-3/components/Container.tsx +0 -9
- package/my-expo-app-3/components/EditScreenInfo.tsx +0 -34
- package/my-expo-app-3/components/ScreenContent.tsx +0 -25
- package/my-expo-app-3/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.ios.tsx +0 -97
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.tsx +0 -264
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/AdaptiveSearchHeader/types.ts +0 -95
- package/my-expo-app-3/components/nativewindui/Alert/Alert.ios.tsx +0 -65
- package/my-expo-app-3/components/nativewindui/Alert/Alert.tsx +0 -291
- package/my-expo-app-3/components/nativewindui/Alert/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/Alert/types.ts +0 -27
- package/my-expo-app-3/components/nativewindui/Badge.tsx +0 -84
- package/my-expo-app-3/components/nativewindui/Button.tsx +0 -156
- package/my-expo-app-3/components/nativewindui/Checkbox.tsx +0 -61
- package/my-expo-app-3/components/nativewindui/ContextMenu/ContextMenu.ios.tsx +0 -221
- package/my-expo-app-3/components/nativewindui/ContextMenu/ContextMenu.tsx +0 -420
- package/my-expo-app-3/components/nativewindui/ContextMenu/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/ContextMenu/types.ts +0 -91
- package/my-expo-app-3/components/nativewindui/ContextMenu/utils.ts +0 -14
- package/my-expo-app-3/components/nativewindui/DrawerContent.tsx +0 -145
- package/my-expo-app-3/components/nativewindui/DropdownMenu/DropdownMenu.ios.tsx +0 -168
- package/my-expo-app-3/components/nativewindui/DropdownMenu/DropdownMenu.tsx +0 -330
- package/my-expo-app-3/components/nativewindui/DropdownMenu/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/DropdownMenu/types.ts +0 -93
- package/my-expo-app-3/components/nativewindui/DropdownMenu/utils.ts +0 -14
- package/my-expo-app-3/components/nativewindui/Form.tsx +0 -125
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/LargeTitleHeader.ios.tsx +0 -99
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/LargeTitleHeader.tsx +0 -288
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/LargeTitleHeader/types.ts +0 -89
- package/my-expo-app-3/components/nativewindui/List.tsx +0 -433
- package/my-expo-app-3/components/nativewindui/SearchInput/SearchInput.ios.tsx +0 -177
- package/my-expo-app-3/components/nativewindui/SearchInput/SearchInput.tsx +0 -86
- package/my-expo-app-3/components/nativewindui/SearchInput/index.tsx +0 -1
- package/my-expo-app-3/components/nativewindui/SearchInput/types.ts +0 -12
- package/my-expo-app-3/components/nativewindui/SegmentedControl/SegmentedControl.ios.tsx +0 -31
- package/my-expo-app-3/components/nativewindui/SegmentedControl/SegmentedControl.tsx +0 -55
- package/my-expo-app-3/components/nativewindui/SegmentedControl/index.ts +0 -1
- package/my-expo-app-3/components/nativewindui/SegmentedControl/types.ts +0 -15
- package/my-expo-app-3/components/nativewindui/Stepper.tsx +0 -62
- package/my-expo-app-3/components/nativewindui/Text.tsx +0 -55
- package/my-expo-app-3/components/nativewindui/TextField/TextField.ios.tsx +0 -85
- package/my-expo-app-3/components/nativewindui/TextField/TextField.tsx +0 -326
- package/my-expo-app-3/components/nativewindui/TextField/index.tsx +0 -1
- package/my-expo-app-3/components/nativewindui/TextField/types.ts +0 -26
- package/my-expo-app-3/components/nativewindui/Toolbar.tsx +0 -116
- package/my-expo-app-3/components/nativewindui/examples/selectable-text.tsx +0 -43
- package/my-expo-app-3/components/nativewindui/examples/text.tsx +0 -43
- package/my-expo-app-3/global.css +0 -3
- package/my-expo-app-3/metro.config.js +0 -12
- package/my-expo-app-3/package-lock.json +0 -19141
- package/my-expo-app-3/package.json +0 -73
- package/my-expo-app-3/prettier.config.js +0 -11
- package/my-expo-app-3/tailwind.config.js +0 -11
- package/my-expo-app-test-case/app/+html.tsx +0 -46
- package/my-expo-app-test-case/app/+not-found.tsx +0 -33
- package/my-expo-app-test-case/app/_layout.tsx +0 -22
- package/my-expo-app-test-case/app/details.tsx +0 -17
- package/my-expo-app-test-case/app/index.tsx +0 -23
- package/my-expo-app-test-case/app-env.d.ts +0 -2
- package/my-expo-app-test-case/app.json +0 -48
- package/my-expo-app-test-case/assets/adaptive-icon.png +0 -0
- package/my-expo-app-test-case/assets/favicon.png +0 -0
- package/my-expo-app-test-case/assets/icon.png +0 -0
- package/my-expo-app-test-case/assets/splash.png +0 -0
- package/my-expo-app-test-case/babel.config.js +0 -18
- package/my-expo-app-test-case/cesconfig.json +0 -35
- package/my-expo-app-test-case/components/Button.tsx +0 -19
- package/my-expo-app-test-case/components/Container.tsx +0 -9
- package/my-expo-app-test-case/components/EditScreenInfo.tsx +0 -34
- package/my-expo-app-test-case/components/ScreenContent.tsx +0 -25
- package/my-expo-app-test-case/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.ios.tsx +0 -97
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/AdaptiveSearchHeader.tsx +0 -264
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/AdaptiveSearchHeader/types.ts +0 -95
- package/my-expo-app-test-case/components/nativewindui/Alert/Alert.ios.tsx +0 -65
- package/my-expo-app-test-case/components/nativewindui/Alert/Alert.tsx +0 -291
- package/my-expo-app-test-case/components/nativewindui/Alert/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/Alert/types.ts +0 -27
- package/my-expo-app-test-case/components/nativewindui/Badge.tsx +0 -84
- package/my-expo-app-test-case/components/nativewindui/Button.tsx +0 -156
- package/my-expo-app-test-case/components/nativewindui/Checkbox.tsx +0 -61
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/ContextMenu.ios.tsx +0 -221
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/ContextMenu.tsx +0 -420
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/types.ts +0 -91
- package/my-expo-app-test-case/components/nativewindui/ContextMenu/utils.ts +0 -14
- package/my-expo-app-test-case/components/nativewindui/DrawerContent.tsx +0 -145
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/DropdownMenu.ios.tsx +0 -168
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/DropdownMenu.tsx +0 -330
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/types.ts +0 -93
- package/my-expo-app-test-case/components/nativewindui/DropdownMenu/utils.ts +0 -14
- package/my-expo-app-test-case/components/nativewindui/Form.tsx +0 -125
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/LargeTitleHeader.ios.tsx +0 -99
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/LargeTitleHeader.tsx +0 -288
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/LargeTitleHeader/types.ts +0 -89
- package/my-expo-app-test-case/components/nativewindui/List.tsx +0 -433
- package/my-expo-app-test-case/components/nativewindui/SearchInput/SearchInput.ios.tsx +0 -177
- package/my-expo-app-test-case/components/nativewindui/SearchInput/SearchInput.tsx +0 -86
- package/my-expo-app-test-case/components/nativewindui/SearchInput/index.tsx +0 -1
- package/my-expo-app-test-case/components/nativewindui/SearchInput/types.ts +0 -12
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/SegmentedControl.ios.tsx +0 -31
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/SegmentedControl.tsx +0 -55
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/index.ts +0 -1
- package/my-expo-app-test-case/components/nativewindui/SegmentedControl/types.ts +0 -15
- package/my-expo-app-test-case/components/nativewindui/Stepper.tsx +0 -62
- package/my-expo-app-test-case/components/nativewindui/Text.tsx +0 -55
- package/my-expo-app-test-case/components/nativewindui/TextField/TextField.ios.tsx +0 -85
- package/my-expo-app-test-case/components/nativewindui/TextField/TextField.tsx +0 -326
- package/my-expo-app-test-case/components/nativewindui/TextField/index.tsx +0 -1
- package/my-expo-app-test-case/components/nativewindui/TextField/types.ts +0 -26
- package/my-expo-app-test-case/components/nativewindui/Toolbar.tsx +0 -116
- package/my-expo-app-test-case/components/nativewindui/examples/a-user-created-file.tsx +0 -0
- package/my-expo-app-test-case/components/nativewindui/examples/selectable-text.tsx +0 -43
- package/my-expo-app-test-case/components/nativewindui/examples/text.tsx +0 -43
- package/my-expo-app-test-case/global.css +0 -3
- package/my-expo-app-test-case/metro.config.js +0 -12
- package/my-expo-app-test-case/package-lock.json +0 -19141
- package/my-expo-app-test-case/package.json +0 -73
- package/my-expo-app-test-case/prettier.config.js +0 -11
- package/my-expo-app-test-case/tailwind.config.js +0 -11
- package/no-install/app/+html.tsx +0 -46
- package/no-install/app/+not-found.tsx +0 -25
- package/no-install/app/_layout.tsx +0 -7
- package/no-install/app/details.tsx +0 -20
- package/no-install/app/index.tsx +0 -19
- package/no-install/app-env.d.ts +0 -2
- package/no-install/app.json +0 -41
- package/no-install/assets/adaptive-icon.png +0 -0
- package/no-install/assets/favicon.png +0 -0
- package/no-install/assets/icon.png +0 -0
- package/no-install/assets/splash.png +0 -0
- package/no-install/babel.config.js +0 -13
- package/no-install/cesconfig.json +0 -35
- package/no-install/components/Button.tsx +0 -25
- package/no-install/components/Container.tsx +0 -9
- package/no-install/components/EditScreenInfo.tsx +0 -31
- package/no-install/components/ScreenContent.tsx +0 -29
- package/no-install/components/nativewindui/Slider.tsx +0 -26
- package/no-install/global.css +0 -3
- package/no-install/metro.config.js +0 -10
- package/no-install/package-lock.json +0 -17505
- package/no-install/package.json +0 -59
- package/no-install/prettier.config.js +0 -10
- package/no-install/tailwind.config.js +0 -14
- package/test-app/app/+html.tsx +0 -46
- package/test-app/app/+not-found.tsx +0 -25
- package/test-app/app/_layout.tsx +0 -7
- package/test-app/app/details.tsx +0 -20
- package/test-app/app/index.tsx +0 -19
- package/test-app/app-env.d.ts +0 -2
- package/test-app/app.json +0 -41
- package/test-app/assets/adaptive-icon.png +0 -0
- package/test-app/assets/favicon.png +0 -0
- package/test-app/assets/icon.png +0 -0
- package/test-app/assets/splash.png +0 -0
- package/test-app/babel.config.js +0 -13
- package/test-app/cesconfig.json +0 -35
- package/test-app/components/Button.tsx +0 -25
- package/test-app/components/Container.tsx +0 -9
- package/test-app/components/EditScreenInfo.tsx +0 -31
- package/test-app/components/ScreenContent.tsx +0 -29
- package/test-app/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/test-app/components/nativewindui/Avatar.tsx +0 -133
- package/test-app/components/nativewindui/DatePicker/DatePicker.android.tsx +0 -72
- package/test-app/components/nativewindui/DatePicker/DatePicker.tsx +0 -23
- package/test-app/components/nativewindui/DatePicker/index.ts +0 -1
- package/test-app/components/nativewindui/Picker.tsx +0 -42
- package/test-app/components/nativewindui/ProgressIndicator.tsx +0 -78
- package/test-app/components/nativewindui/Sheet.tsx +0 -52
- package/test-app/components/nativewindui/Slider.tsx +0 -26
- package/test-app/components/nativewindui/Text.tsx +0 -55
- package/test-app/components/nativewindui/Toggle.tsx +0 -20
- package/test-app/global.css +0 -3
- package/test-app/metro.config.js +0 -10
- package/test-app/package.json +0 -64
- package/test-app/prettier.config.js +0 -10
- package/test-app/tailwind.config.js +0 -14
- package/test-no-install/app/+html.tsx +0 -46
- package/test-no-install/app/+not-found.tsx +0 -25
- package/test-no-install/app/_layout.tsx +0 -7
- package/test-no-install/app/details.tsx +0 -20
- package/test-no-install/app/index.tsx +0 -19
- package/test-no-install/app-env.d.ts +0 -2
- package/test-no-install/app.json +0 -41
- package/test-no-install/assets/adaptive-icon.png +0 -0
- package/test-no-install/assets/favicon.png +0 -0
- package/test-no-install/assets/icon.png +0 -0
- package/test-no-install/assets/splash.png +0 -0
- package/test-no-install/babel.config.js +0 -13
- package/test-no-install/cesconfig.json +0 -35
- package/test-no-install/components/Button.tsx +0 -25
- package/test-no-install/components/Container.tsx +0 -9
- package/test-no-install/components/EditScreenInfo.tsx +0 -31
- package/test-no-install/components/ScreenContent.tsx +0 -29
- package/test-no-install/components/nativewindui/ActivityIndicator.tsx +0 -13
- package/test-no-install/components/nativewindui/Avatar.tsx +0 -133
- package/test-no-install/components/nativewindui/DatePicker/DatePicker.android.tsx +0 -72
- package/test-no-install/components/nativewindui/DatePicker/DatePicker.tsx +0 -23
- package/test-no-install/components/nativewindui/DatePicker/index.ts +0 -1
- package/test-no-install/components/nativewindui/Picker.tsx +0 -42
- package/test-no-install/components/nativewindui/ProgressIndicator.tsx +0 -78
- package/test-no-install/components/nativewindui/Sheet.tsx +0 -52
- package/test-no-install/components/nativewindui/Slider.tsx +0 -26
- package/test-no-install/components/nativewindui/Text.tsx +0 -55
- package/test-no-install/components/nativewindui/Toggle.tsx +0 -20
- package/test-no-install/global.css +0 -3
- package/test-no-install/metro.config.js +0 -10
- package/test-no-install/package.json +0 -64
- package/test-no-install/prettier.config.js +0 -10
- package/test-no-install/tailwind.config.js +0 -14
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { useRoute } from '@react-navigation/native';
|
|
2
|
-
import { useAugmentedRef } from '@rn-primitives/hooks';
|
|
3
|
-
import { Portal } from '@rn-primitives/portal';
|
|
4
|
-
import { Icon } from '@roninoss/icons';
|
|
5
|
-
import { Stack, useNavigation } from 'expo-router';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import { BackHandler, TextInput, View } from 'react-native';
|
|
8
|
-
import Animated, {
|
|
9
|
-
FadeIn,
|
|
10
|
-
FadeInRight,
|
|
11
|
-
FadeInUp,
|
|
12
|
-
FadeOut,
|
|
13
|
-
FadeOutRight,
|
|
14
|
-
ZoomIn,
|
|
15
|
-
withTiming,
|
|
16
|
-
} from 'react-native-reanimated';
|
|
17
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
18
|
-
|
|
19
|
-
import type {
|
|
20
|
-
LargeTitleHeaderProps,
|
|
21
|
-
LargeTitleSearchBarRef,
|
|
22
|
-
NativeStackNavigationSearchBarOptions,
|
|
23
|
-
} from './types';
|
|
24
|
-
|
|
25
|
-
import { Button } from '~/components/nativewindui/Button';
|
|
26
|
-
import { Text } from '~/components/nativewindui/Text';
|
|
27
|
-
import { cn } from '~/lib/cn';
|
|
28
|
-
import { useColorScheme } from '~/lib/useColorScheme';
|
|
29
|
-
|
|
30
|
-
const SCREEN_OPTIONS = {
|
|
31
|
-
headerShown: false,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export function LargeTitleHeader(props: LargeTitleHeaderProps) {
|
|
35
|
-
const insets = useSafeAreaInsets();
|
|
36
|
-
const { colors } = useColorScheme();
|
|
37
|
-
const navigation = useNavigation();
|
|
38
|
-
const route = useRoute();
|
|
39
|
-
const id = React.useId();
|
|
40
|
-
const fallbackSearchBarRef = React.useRef<LargeTitleSearchBarRef>(null);
|
|
41
|
-
|
|
42
|
-
const [searchValue, setSearchValue] = React.useState('');
|
|
43
|
-
const [showSearchBar, setShowSearchBar] = React.useState(false);
|
|
44
|
-
|
|
45
|
-
const augmentedRef = useAugmentedRef({
|
|
46
|
-
ref: props.searchBar?.ref ?? fallbackSearchBarRef,
|
|
47
|
-
methods: {
|
|
48
|
-
focus: () => {
|
|
49
|
-
setShowSearchBar(true);
|
|
50
|
-
},
|
|
51
|
-
blur: () => {
|
|
52
|
-
setShowSearchBar(false);
|
|
53
|
-
},
|
|
54
|
-
setText: (text) => {
|
|
55
|
-
setSearchValue(text);
|
|
56
|
-
props.searchBar?.onChangeText?.(text);
|
|
57
|
-
},
|
|
58
|
-
clearText: () => {
|
|
59
|
-
setSearchValue('');
|
|
60
|
-
props.searchBar?.onChangeText?.('');
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
React.useEffect(() => {
|
|
66
|
-
const backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
67
|
-
if (showSearchBar) {
|
|
68
|
-
setShowSearchBar(false);
|
|
69
|
-
setSearchValue('');
|
|
70
|
-
props.searchBar?.onChangeText?.('');
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
return () => {
|
|
77
|
-
backHandler.remove();
|
|
78
|
-
};
|
|
79
|
-
}, [showSearchBar]);
|
|
80
|
-
|
|
81
|
-
function onBlur() {
|
|
82
|
-
setShowSearchBar(false);
|
|
83
|
-
props.searchBar?.onBlur?.();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function onChangeText(text: string) {
|
|
87
|
-
setSearchValue(text);
|
|
88
|
-
props.searchBar?.onChangeText?.(text);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function onSearchBackPress() {
|
|
92
|
-
setShowSearchBar(false);
|
|
93
|
-
setSearchValue('');
|
|
94
|
-
props.searchBar?.onChangeText?.('');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function onClearText() {
|
|
98
|
-
setSearchValue('');
|
|
99
|
-
props.searchBar?.onChangeText?.('');
|
|
100
|
-
props.searchBar?.onCancelButtonPress?.();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const isInlined = props.materialPreset === 'inline';
|
|
104
|
-
const canGoBack = navigation.canGoBack();
|
|
105
|
-
|
|
106
|
-
if (props.shown === false) return null;
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<>
|
|
110
|
-
<Stack.Screen options={Object.assign(props.screen ?? {}, SCREEN_OPTIONS)} />
|
|
111
|
-
{/* Ref is set in View so we can call its methods before the input is mounted */}
|
|
112
|
-
<View ref={augmentedRef as unknown as React.RefObject<View>} />
|
|
113
|
-
<View
|
|
114
|
-
style={{
|
|
115
|
-
paddingTop: insets.top + 14,
|
|
116
|
-
backgroundColor: props.backgroundColor ?? colors.background,
|
|
117
|
-
}}
|
|
118
|
-
className={cn(
|
|
119
|
-
'px-1 shadow-none',
|
|
120
|
-
props.shadowVisible && 'shadow-xl',
|
|
121
|
-
isInlined ? 'pb-4' : 'pb-5'
|
|
122
|
-
)}>
|
|
123
|
-
<View className="flex-row justify-between px-0.5">
|
|
124
|
-
<View className="flex-1 flex-row items-center">
|
|
125
|
-
{!!props.leftView ? (
|
|
126
|
-
<View className="flex-row justify-center gap-4 pl-0.5">
|
|
127
|
-
{props.leftView({ canGoBack, tintColor: colors.foreground })}
|
|
128
|
-
</View>
|
|
129
|
-
) : (
|
|
130
|
-
props.backVisible !== false &&
|
|
131
|
-
canGoBack && (
|
|
132
|
-
<Button
|
|
133
|
-
size="icon"
|
|
134
|
-
variant="plain"
|
|
135
|
-
onPress={() => {
|
|
136
|
-
navigation.goBack();
|
|
137
|
-
}}>
|
|
138
|
-
<Icon name="arrow-left" size={24} color={colors.foreground} />
|
|
139
|
-
</Button>
|
|
140
|
-
)
|
|
141
|
-
)}
|
|
142
|
-
{isInlined && (
|
|
143
|
-
<View className={cn('flex-1', canGoBack ? 'pl-4' : 'pl-3')}>
|
|
144
|
-
<Text variant="title1" numberOfLines={1} className={props.materialTitleClassName}>
|
|
145
|
-
{props.title ?? route.name}
|
|
146
|
-
</Text>
|
|
147
|
-
</View>
|
|
148
|
-
)}
|
|
149
|
-
</View>
|
|
150
|
-
<View className="flex-row justify-center gap-3 pr-2">
|
|
151
|
-
{!!props.searchBar && (
|
|
152
|
-
<Button
|
|
153
|
-
onPress={() => {
|
|
154
|
-
setShowSearchBar(true);
|
|
155
|
-
props.searchBar?.onSearchButtonPress?.();
|
|
156
|
-
}}
|
|
157
|
-
size="icon"
|
|
158
|
-
variant="plain">
|
|
159
|
-
<Icon name="magnify" size={24} color={colors.foreground} />
|
|
160
|
-
</Button>
|
|
161
|
-
)}
|
|
162
|
-
{!!props.rightView && (
|
|
163
|
-
<>{props.rightView({ canGoBack, tintColor: colors.foreground })}</>
|
|
164
|
-
)}
|
|
165
|
-
</View>
|
|
166
|
-
</View>
|
|
167
|
-
{!isInlined && (
|
|
168
|
-
<View className="px-3 pt-6">
|
|
169
|
-
<Text numberOfLines={1} className={cn('text-3xl', props.materialTitleClassName)}>
|
|
170
|
-
{props.title ?? route.name}
|
|
171
|
-
</Text>
|
|
172
|
-
</View>
|
|
173
|
-
)}
|
|
174
|
-
</View>
|
|
175
|
-
{!!props.searchBar && showSearchBar && (
|
|
176
|
-
<Portal name={`large-title:${id}`}>
|
|
177
|
-
<Animated.View exiting={FadeOut} className="absolute bottom-0 left-0 right-0 top-0">
|
|
178
|
-
<View
|
|
179
|
-
style={{ paddingTop: insets.top + 6 }}
|
|
180
|
-
className="bg-background relative z-50 overflow-hidden">
|
|
181
|
-
<Animated.View
|
|
182
|
-
entering={customEntering}
|
|
183
|
-
exiting={customExiting}
|
|
184
|
-
className="bg-muted/25 dark:bg-card absolute bottom-2.5 left-4 right-4 h-14 rounded-full"
|
|
185
|
-
/>
|
|
186
|
-
<View className="pb-2.5">
|
|
187
|
-
<Animated.View
|
|
188
|
-
entering={FadeIn}
|
|
189
|
-
exiting={FadeOut}
|
|
190
|
-
className="h-14 flex-row items-center pl-3.5 pr-5">
|
|
191
|
-
<Animated.View entering={FadeIn} exiting={FadeOut}>
|
|
192
|
-
<Button variant="plain" size="icon" onPress={onSearchBackPress}>
|
|
193
|
-
<Icon color={colors.grey} name={'arrow-left'} size={24} />
|
|
194
|
-
</Button>
|
|
195
|
-
</Animated.View>
|
|
196
|
-
<Animated.View entering={FadeInRight} exiting={FadeOutRight} className="flex-1">
|
|
197
|
-
<TextInput
|
|
198
|
-
autoFocus
|
|
199
|
-
placeholder={props.searchBar.placeholder ?? 'Search...'}
|
|
200
|
-
className="flex-1 rounded-r-full p-2 text-[17px]"
|
|
201
|
-
style={{ color: props.searchBar.textColor ?? colors.foreground }}
|
|
202
|
-
placeholderTextColor={colors.grey2}
|
|
203
|
-
onBlur={onBlur}
|
|
204
|
-
onFocus={props.searchBar?.onFocus}
|
|
205
|
-
value={searchValue}
|
|
206
|
-
onChangeText={onChangeText}
|
|
207
|
-
autoCapitalize={props.searchBar.autoCapitalize}
|
|
208
|
-
keyboardType={searchBarInputTypeToKeyboardType(props.searchBar.inputType)}
|
|
209
|
-
returnKeyType="search"
|
|
210
|
-
blurOnSubmit={props.searchBar.materialBlurOnSubmit}
|
|
211
|
-
onSubmitEditing={props.searchBar.materialOnSubmitEditing}
|
|
212
|
-
/>
|
|
213
|
-
</Animated.View>
|
|
214
|
-
|
|
215
|
-
<View className="flex-row items-center gap-3 pr-0.5">
|
|
216
|
-
{!!searchValue && (
|
|
217
|
-
<Animated.View entering={FadeIn} exiting={FadeOut}>
|
|
218
|
-
<Button size="icon" variant="plain" onPress={onClearText}>
|
|
219
|
-
<Icon color={colors.grey2} name="close" size={24} />
|
|
220
|
-
</Button>
|
|
221
|
-
</Animated.View>
|
|
222
|
-
)}
|
|
223
|
-
{!!props.searchBar.materialRightView && (
|
|
224
|
-
<>
|
|
225
|
-
{props.searchBar.materialRightView({
|
|
226
|
-
canGoBack,
|
|
227
|
-
tintColor: colors.foreground,
|
|
228
|
-
})}
|
|
229
|
-
</>
|
|
230
|
-
)}
|
|
231
|
-
</View>
|
|
232
|
-
</Animated.View>
|
|
233
|
-
</View>
|
|
234
|
-
{isInlined && <Animated.View entering={ZoomIn} className="bg-border h-px" />}
|
|
235
|
-
</View>
|
|
236
|
-
<Animated.View entering={FadeInUp} className="bg-background flex-1 ">
|
|
237
|
-
<View className="bg-muted/25 dark:bg-card flex-1">{props.searchBar.content}</View>
|
|
238
|
-
</Animated.View>
|
|
239
|
-
</Animated.View>
|
|
240
|
-
</Portal>
|
|
241
|
-
)}
|
|
242
|
-
</>
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function searchBarInputTypeToKeyboardType(
|
|
247
|
-
inputType: NativeStackNavigationSearchBarOptions['inputType']
|
|
248
|
-
) {
|
|
249
|
-
switch (inputType) {
|
|
250
|
-
case 'email':
|
|
251
|
-
return 'email-address';
|
|
252
|
-
case 'number':
|
|
253
|
-
return 'numeric';
|
|
254
|
-
case 'phone':
|
|
255
|
-
return 'phone-pad';
|
|
256
|
-
default:
|
|
257
|
-
return 'default';
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
const customEntering = () => {
|
|
262
|
-
'worklet';
|
|
263
|
-
const animations = {
|
|
264
|
-
transform: [{ scale: withTiming(3, { duration: 400 }) }],
|
|
265
|
-
};
|
|
266
|
-
const initialValues = {
|
|
267
|
-
transform: [{ scale: 1 }],
|
|
268
|
-
};
|
|
269
|
-
return {
|
|
270
|
-
initialValues,
|
|
271
|
-
animations,
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
const customExiting = () => {
|
|
275
|
-
'worklet';
|
|
276
|
-
const animations = {
|
|
277
|
-
transform: [{ scale: withTiming(1) }],
|
|
278
|
-
opacity: withTiming(0),
|
|
279
|
-
};
|
|
280
|
-
const initialValues = {
|
|
281
|
-
transform: [{ scale: 3 }],
|
|
282
|
-
opacity: 1,
|
|
283
|
-
};
|
|
284
|
-
return {
|
|
285
|
-
initialValues,
|
|
286
|
-
animations,
|
|
287
|
-
};
|
|
288
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './LargeTitleHeader';
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { Stack } from 'expo-router';
|
|
2
|
-
import type { NativeSyntheticEvent, TextInputSubmitEditingEventData } from 'react-native';
|
|
3
|
-
import type { SearchBarCommands } from 'react-native-screens';
|
|
4
|
-
|
|
5
|
-
type NativeStackNavigationOptions = NonNullable<
|
|
6
|
-
React.ComponentPropsWithoutRef<typeof Stack.Screen>['options']
|
|
7
|
-
>;
|
|
8
|
-
|
|
9
|
-
type ScreenOptions = Pick<
|
|
10
|
-
NativeStackNavigationOptions,
|
|
11
|
-
| 'animation'
|
|
12
|
-
| 'animationDuration'
|
|
13
|
-
| 'contentStyle'
|
|
14
|
-
| 'navigationBarColor'
|
|
15
|
-
| 'animationTypeForReplace'
|
|
16
|
-
| 'autoHideHomeIndicator'
|
|
17
|
-
| 'customAnimationOnGesture'
|
|
18
|
-
| 'gestureEnabled'
|
|
19
|
-
| 'freezeOnBlur'
|
|
20
|
-
| 'fullScreenGestureEnabled'
|
|
21
|
-
| 'gestureDirection'
|
|
22
|
-
| 'navigationBarHidden'
|
|
23
|
-
| 'orientation'
|
|
24
|
-
| 'presentation'
|
|
25
|
-
| 'statusBarTranslucent'
|
|
26
|
-
| 'statusBarStyle'
|
|
27
|
-
| 'statusBarHidden'
|
|
28
|
-
| 'statusBarColor'
|
|
29
|
-
| 'statusBarAnimation'
|
|
30
|
-
| 'title'
|
|
31
|
-
>;
|
|
32
|
-
|
|
33
|
-
type HeaderOptions = Omit<NativeStackNavigationOptions, keyof ScreenOptions>;
|
|
34
|
-
|
|
35
|
-
type NativeStackNavigationSearchBarOptions = NonNullable<HeaderOptions['headerSearchBarOptions']>;
|
|
36
|
-
|
|
37
|
-
type LargeTitleSearchBarRef = Omit<SearchBarCommands, 'blur' | 'toggleCancelButton'>;
|
|
38
|
-
|
|
39
|
-
type LargeTitleHeaderProps = {
|
|
40
|
-
iosBackButtonMenuEnabled?: boolean;
|
|
41
|
-
iosBackButtonTitle?: string;
|
|
42
|
-
iosBackButtonTitleVisible?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Default is 'systemMaterial'
|
|
45
|
-
*/
|
|
46
|
-
iosBlurEffect?: HeaderOptions['headerBlurEffect'] | 'none';
|
|
47
|
-
materialPreset?: 'stack' | 'inline';
|
|
48
|
-
materialTitleClassName?: string;
|
|
49
|
-
backVisible?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* iOS - iosBlurEffect must be set to 'none' for this to work
|
|
52
|
-
* @default iOS: true | Material: false
|
|
53
|
-
*/
|
|
54
|
-
shadowVisible?: boolean;
|
|
55
|
-
leftView?: HeaderOptions['headerLeft'];
|
|
56
|
-
rightView?: HeaderOptions['headerRight'];
|
|
57
|
-
shown?: boolean;
|
|
58
|
-
title?: string;
|
|
59
|
-
backgroundColor?: string;
|
|
60
|
-
screen?: ScreenOptions;
|
|
61
|
-
searchBar?: {
|
|
62
|
-
iosCancelButtonText?: string;
|
|
63
|
-
iosHideWhenScrolling?: boolean;
|
|
64
|
-
iosTintColor?: string;
|
|
65
|
-
materialRightView?: HeaderOptions['headerRight'];
|
|
66
|
-
materialBlurOnSubmit?: boolean;
|
|
67
|
-
materialOnSubmitEditing?:
|
|
68
|
-
| ((e: NativeSyntheticEvent<TextInputSubmitEditingEventData>) => void)
|
|
69
|
-
| undefined;
|
|
70
|
-
autoCapitalize?: NativeStackNavigationSearchBarOptions['autoCapitalize'];
|
|
71
|
-
inputType?: NativeStackNavigationSearchBarOptions['inputType'];
|
|
72
|
-
onBlur?: () => void;
|
|
73
|
-
onCancelButtonPress?: () => void;
|
|
74
|
-
onChangeText?: (text: string) => void;
|
|
75
|
-
onFocus?: () => void;
|
|
76
|
-
onSearchButtonPress?: () => void;
|
|
77
|
-
placeholder?: string;
|
|
78
|
-
ref?: React.RefObject<LargeTitleSearchBarRef>;
|
|
79
|
-
textColor?: string;
|
|
80
|
-
content?: React.ReactNode;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export type {
|
|
85
|
-
NativeStackNavigationOptions,
|
|
86
|
-
LargeTitleSearchBarRef,
|
|
87
|
-
LargeTitleHeaderProps,
|
|
88
|
-
NativeStackNavigationSearchBarOptions,
|
|
89
|
-
};
|