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,91 +0,0 @@
|
|
|
1
|
-
import type { MaterialIconName, SfSymbolIconName } from '@roninoss/icons';
|
|
2
|
-
import type { View, ViewProps } from 'react-native';
|
|
3
|
-
|
|
4
|
-
type MaterialIcon = {
|
|
5
|
-
name: MaterialIconName;
|
|
6
|
-
namingScheme?: 'material' | undefined;
|
|
7
|
-
color?: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type SfSymbolIcon = {
|
|
11
|
-
name: SfSymbolIconName;
|
|
12
|
-
namingScheme: 'sfSymbol';
|
|
13
|
-
color?: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
type ContextMenuIcon = SfSymbolIcon | MaterialIcon;
|
|
17
|
-
|
|
18
|
-
type ContextItem = {
|
|
19
|
-
actionKey: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
subTitle?: string;
|
|
22
|
-
state?: { checked: boolean };
|
|
23
|
-
keepOpenOnPress?: boolean;
|
|
24
|
-
// iOS 14 and above
|
|
25
|
-
loading?: boolean;
|
|
26
|
-
destructive?: boolean;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
hidden?: boolean;
|
|
29
|
-
// icon or image, not both image has higher priority
|
|
30
|
-
icon?: ContextMenuIcon;
|
|
31
|
-
// icon or image, not both image has higher priority
|
|
32
|
-
image?: { url?: string; cornerRadius?: number; tint?: string };
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
type ContextMenuSubMenuDropdown = {
|
|
36
|
-
iOSType?: 'dropdown';
|
|
37
|
-
// preferred item size
|
|
38
|
-
iOSItemSize?: 'large';
|
|
39
|
-
destructive?: boolean;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
type ContextMenuSubMenuInline = {
|
|
43
|
-
iOSType: 'inline';
|
|
44
|
-
// preferred item size
|
|
45
|
-
iOSItemSize?: 'small' | 'medium';
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
type ContextSubMenu = (ContextMenuSubMenuDropdown | ContextMenuSubMenuInline) & {
|
|
49
|
-
title: string;
|
|
50
|
-
// Displayed on iOS 15 and above only, used as accessibility hint otherwise
|
|
51
|
-
subTitle?: string;
|
|
52
|
-
// iOS 14 and above only
|
|
53
|
-
loading?: boolean;
|
|
54
|
-
// No items shows nothing
|
|
55
|
-
items: (ContextItem | ContextSubMenu)[];
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
type ContextMenuConfig = {
|
|
59
|
-
title?: string;
|
|
60
|
-
items: (ContextItem | ContextSubMenu)[];
|
|
61
|
-
// preferred item size
|
|
62
|
-
iOSItemSize?: 'small' | 'medium' | 'large';
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
type ContextMenuProps = ContextMenuConfig &
|
|
66
|
-
ViewProps & {
|
|
67
|
-
children: React.ReactNode;
|
|
68
|
-
onItemPress?: (item: Omit<ContextItem, 'icon'>, isUsingActionSheetFallback?: boolean) => void;
|
|
69
|
-
enabled?: boolean;
|
|
70
|
-
iosRenderPreview?: () => React.ReactElement;
|
|
71
|
-
iosOnPressMenuPreview?: () => void;
|
|
72
|
-
renderAuxiliaryPreview?: () => React.ReactElement;
|
|
73
|
-
auxiliaryPreviewPosition?: 'start' | 'center' | 'end';
|
|
74
|
-
materialPortalHost?: string;
|
|
75
|
-
// defaults to 2
|
|
76
|
-
materialSideOffset?: number;
|
|
77
|
-
materialAlignOffset?: number;
|
|
78
|
-
materialAlign?: 'start' | 'center' | 'end';
|
|
79
|
-
materialWidth?: number;
|
|
80
|
-
materialMinWidth?: number;
|
|
81
|
-
materialLoadingText?: string;
|
|
82
|
-
materialSubMenuTitlePlaceholder?: string;
|
|
83
|
-
materialOverlayClassName?: string;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
type ContextMenuRef = React.ElementRef<typeof View> & {
|
|
87
|
-
presentMenu?: () => void;
|
|
88
|
-
dismissMenu?: () => void;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type { ContextMenuProps, ContextMenuConfig, ContextSubMenu, ContextItem, ContextMenuRef };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ContextItem, ContextSubMenu } from './types';
|
|
2
|
-
|
|
3
|
-
function createContextSubMenu(
|
|
4
|
-
subMenu: Omit<ContextSubMenu, 'items'>,
|
|
5
|
-
items: ContextSubMenu['items']
|
|
6
|
-
) {
|
|
7
|
-
return Object.assign(subMenu, { items }) as ContextSubMenu;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function createContextItem(item: ContextItem) {
|
|
11
|
-
return item;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { createContextSubMenu, createContextItem };
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { DrawerContentComponentProps } from '@react-navigation/drawer';
|
|
2
|
-
import { DrawerActions } from '@react-navigation/native';
|
|
3
|
-
import { Icon, IconProps } from '@roninoss/icons';
|
|
4
|
-
import { useNavigation } from 'expo-router';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { Platform, Pressable, ScrollView, View } from 'react-native';
|
|
7
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
-
|
|
9
|
-
import { Button } from '~/components/nativewindui/Button';
|
|
10
|
-
import { Text } from '~/components/nativewindui/Text';
|
|
11
|
-
import { cn } from '~/lib/cn';
|
|
12
|
-
import { useColorScheme } from '~/lib/useColorScheme';
|
|
13
|
-
import { COLORS } from '~/theme/colors';
|
|
14
|
-
|
|
15
|
-
const ANDROID_ACTION_BAR_HEIGHT = 60;
|
|
16
|
-
|
|
17
|
-
type DrawerContentRootProps = React.ComponentPropsWithoutRef<typeof View> & {
|
|
18
|
-
actions?: React.ReactNode;
|
|
19
|
-
};
|
|
20
|
-
function DrawerContentRoot({ actions, children, className, ...props }: DrawerContentRootProps) {
|
|
21
|
-
const insets = useSafeAreaInsets();
|
|
22
|
-
const { colors } = useColorScheme();
|
|
23
|
-
const toggleDrawer = useToggleDrawer();
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<View className={cn('flex-1', className)} {...props}>
|
|
27
|
-
{Platform.OS === 'ios' ? (
|
|
28
|
-
<View
|
|
29
|
-
style={{ paddingTop: insets.top }}
|
|
30
|
-
className="flex-row items-center justify-between px-4 pb-1.5">
|
|
31
|
-
<Pressable className="active:opacity-70" onPress={toggleDrawer}>
|
|
32
|
-
<Icon
|
|
33
|
-
name="close"
|
|
34
|
-
ios={{ name: 'sidebar.leading', weight: 'light' }}
|
|
35
|
-
color={colors.primary}
|
|
36
|
-
/>
|
|
37
|
-
</Pressable>
|
|
38
|
-
{actions}
|
|
39
|
-
</View>
|
|
40
|
-
) : (
|
|
41
|
-
<View style={{ height: insets.top }} />
|
|
42
|
-
)}
|
|
43
|
-
<ScrollView
|
|
44
|
-
contentContainerStyle={{
|
|
45
|
-
paddingBottom:
|
|
46
|
-
insets.bottom + (Platform.OS !== 'ios' && !!actions ? ANDROID_ACTION_BAR_HEIGHT : 0),
|
|
47
|
-
}}>
|
|
48
|
-
{children}
|
|
49
|
-
</ScrollView>
|
|
50
|
-
{Platform.OS === 'android' && !!actions && (
|
|
51
|
-
<View
|
|
52
|
-
style={{ height: insets.bottom + ANDROID_ACTION_BAR_HEIGHT }}
|
|
53
|
-
className="bg-card px-4 pt-1">
|
|
54
|
-
<View className="flex-row items-center justify-between p-3.5">{actions}</View>
|
|
55
|
-
</View>
|
|
56
|
-
)}
|
|
57
|
-
</View>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function DrawerContentSectionTitle({
|
|
62
|
-
type = 'default',
|
|
63
|
-
className,
|
|
64
|
-
...props
|
|
65
|
-
}: React.ComponentPropsWithoutRef<typeof Text> & { type?: 'large' | 'default' }) {
|
|
66
|
-
return (
|
|
67
|
-
<Text
|
|
68
|
-
variant={Platform.OS === 'ios' ? (type === 'large' ? 'largeTitle' : 'title3') : 'footnote'}
|
|
69
|
-
className={cn(
|
|
70
|
-
'ios:font-bold ios:px-4 px-6 pb-2.5 pt-4 font-medium text-card-foreground',
|
|
71
|
-
className
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function DrawerContentSection({
|
|
79
|
-
className,
|
|
80
|
-
...props
|
|
81
|
-
}: React.ComponentPropsWithoutRef<typeof View>) {
|
|
82
|
-
return <View className={cn('gap-1 px-2', className)} {...props} />;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function DrawerContentSectionItem<T extends 'sfSymbol' | 'material'>({
|
|
86
|
-
label,
|
|
87
|
-
icon,
|
|
88
|
-
onPress,
|
|
89
|
-
isActive,
|
|
90
|
-
rightView,
|
|
91
|
-
}: {
|
|
92
|
-
label: string;
|
|
93
|
-
icon: IconProps<T>;
|
|
94
|
-
onPress?: () => void;
|
|
95
|
-
isActive?: boolean;
|
|
96
|
-
rightView?: React.ReactNode;
|
|
97
|
-
}) {
|
|
98
|
-
const { colors } = useColorScheme();
|
|
99
|
-
return (
|
|
100
|
-
<Button
|
|
101
|
-
variant={isActive ? Platform.select({ default: 'tonal', ios: 'primary' }) : 'plain'}
|
|
102
|
-
onPress={onPress}
|
|
103
|
-
className="ios:gap-2 ios:px-2 justify-start gap-3 rounded-lg px-4 py-3.5">
|
|
104
|
-
<Icon
|
|
105
|
-
color={
|
|
106
|
-
isActive
|
|
107
|
-
? Platform.select({ default: colors.foreground, ios: COLORS.white })
|
|
108
|
-
: Platform.select({ default: colors.grey, ios: colors.primary })
|
|
109
|
-
}
|
|
110
|
-
{...icon}
|
|
111
|
-
/>
|
|
112
|
-
<View className="flex-1">
|
|
113
|
-
<Text
|
|
114
|
-
className={cn(
|
|
115
|
-
isActive ? 'ios:text-white dark:text-white' : 'text-card-foreground',
|
|
116
|
-
'android:text-[14px] font-normal'
|
|
117
|
-
)}>
|
|
118
|
-
{label}
|
|
119
|
-
</Text>
|
|
120
|
-
</View>
|
|
121
|
-
{rightView}
|
|
122
|
-
</Button>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function useToggleDrawer() {
|
|
127
|
-
const navigation = useNavigation();
|
|
128
|
-
|
|
129
|
-
return () => {
|
|
130
|
-
navigation.dispatch(DrawerActions.toggleDrawer());
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function getActiveDrawerContentScreen(props: DrawerContentComponentProps) {
|
|
135
|
-
return props.state.routes[props.state.index].name;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export {
|
|
139
|
-
DrawerContentRoot,
|
|
140
|
-
DrawerContentSection,
|
|
141
|
-
DrawerContentSectionItem,
|
|
142
|
-
DrawerContentSectionTitle,
|
|
143
|
-
useToggleDrawer,
|
|
144
|
-
getActiveDrawerContentScreen,
|
|
145
|
-
};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { ICON_MAPPING, type MaterialIconName } from '@roninoss/icons';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
ContextMenuButton,
|
|
6
|
-
MenuAttributes,
|
|
7
|
-
MenuConfig,
|
|
8
|
-
MenuElementConfig,
|
|
9
|
-
OnPressMenuItemEvent,
|
|
10
|
-
} from 'react-native-ios-context-menu';
|
|
11
|
-
|
|
12
|
-
import type {
|
|
13
|
-
DropdownItem,
|
|
14
|
-
DropdownMenuConfig,
|
|
15
|
-
DropdownMenuProps,
|
|
16
|
-
DropdownMenuRef,
|
|
17
|
-
DropdownSubMenu,
|
|
18
|
-
} from './types';
|
|
19
|
-
|
|
20
|
-
const DropdownMenu = React.forwardRef<DropdownMenuRef, DropdownMenuProps>(
|
|
21
|
-
(
|
|
22
|
-
{
|
|
23
|
-
items,
|
|
24
|
-
title,
|
|
25
|
-
iOSItemSize = 'large',
|
|
26
|
-
onItemPress,
|
|
27
|
-
enabled = true,
|
|
28
|
-
materialPortalHost: _materialPortalHost,
|
|
29
|
-
materialSideOffset: _materialSideOffset,
|
|
30
|
-
materialAlignOffset: _materialAlignOffset,
|
|
31
|
-
materialAlign: _materialAlign,
|
|
32
|
-
materialWidth: _materialWidth,
|
|
33
|
-
materialMinWidth: _materialMinWidth,
|
|
34
|
-
materialLoadingText: _materialLoadingText,
|
|
35
|
-
materialSubMenuTitlePlaceholder: _materialSubMenuTitlePlaceholder,
|
|
36
|
-
materialOverlayClassName: _materialOverlayClassName,
|
|
37
|
-
...props
|
|
38
|
-
},
|
|
39
|
-
ref
|
|
40
|
-
) => {
|
|
41
|
-
return (
|
|
42
|
-
<View>
|
|
43
|
-
<ContextMenuButton
|
|
44
|
-
ref={ref as React.LegacyRef<ContextMenuButton>}
|
|
45
|
-
isMenuPrimaryAction
|
|
46
|
-
isContextMenuEnabled={enabled}
|
|
47
|
-
menuConfig={toConfigMenu(items, iOSItemSize, title)}
|
|
48
|
-
onPressMenuItem={toOnPressMenuItem(onItemPress)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
</View>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
DropdownMenu.displayName = 'DropdownMenu';
|
|
57
|
-
|
|
58
|
-
export { DropdownMenu };
|
|
59
|
-
|
|
60
|
-
function toOnPressMenuItem(onItemPress: DropdownMenuProps['onItemPress']): OnPressMenuItemEvent {
|
|
61
|
-
return ({ nativeEvent, isUsingActionSheetFallback }) => {
|
|
62
|
-
onItemPress?.(
|
|
63
|
-
{
|
|
64
|
-
actionKey: nativeEvent.actionKey,
|
|
65
|
-
title: nativeEvent.actionTitle,
|
|
66
|
-
subTitle: nativeEvent.actionSubtitle,
|
|
67
|
-
state: nativeEvent.menuState ? { checked: nativeEvent.menuState === 'on' } : undefined,
|
|
68
|
-
destructive: nativeEvent.menuAttributes?.includes('destructive'),
|
|
69
|
-
disabled: nativeEvent.menuAttributes?.includes('disabled'),
|
|
70
|
-
hidden: nativeEvent.menuAttributes?.includes('hidden'),
|
|
71
|
-
keepOpenOnPress: nativeEvent.menuAttributes?.includes('keepsMenuPresented'),
|
|
72
|
-
loading: false,
|
|
73
|
-
},
|
|
74
|
-
isUsingActionSheetFallback
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function toConfigMenu(
|
|
80
|
-
items: DropdownMenuConfig['items'],
|
|
81
|
-
iOSItemSize: DropdownMenuConfig['iOSItemSize'],
|
|
82
|
-
title: DropdownMenuConfig['title']
|
|
83
|
-
): MenuConfig {
|
|
84
|
-
return {
|
|
85
|
-
menuTitle: title ?? '',
|
|
86
|
-
menuPreferredElementSize: iOSItemSize,
|
|
87
|
-
menuItems: items.map((item) => {
|
|
88
|
-
if ('items' in item) {
|
|
89
|
-
return toConfigSubMenu(item);
|
|
90
|
-
}
|
|
91
|
-
return toConfigItem(item);
|
|
92
|
-
}),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function toConfigSubMenu(subMenu: DropdownSubMenu): MenuElementConfig {
|
|
97
|
-
if (subMenu.loading) {
|
|
98
|
-
return {
|
|
99
|
-
type: 'deferred',
|
|
100
|
-
deferredID: `${subMenu.title ?? ''}-${Date.now()}`,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
menuOptions: subMenu.iOSType === 'inline' ? ['displayInline'] : undefined,
|
|
105
|
-
menuTitle: subMenu.title ?? '',
|
|
106
|
-
menuSubtitle: subMenu.subTitle,
|
|
107
|
-
menuPreferredElementSize: subMenu.iOSItemSize,
|
|
108
|
-
menuItems: subMenu.items.map((item) => {
|
|
109
|
-
if ('items' in item) {
|
|
110
|
-
return toConfigSubMenu(item);
|
|
111
|
-
}
|
|
112
|
-
return toConfigItem(item);
|
|
113
|
-
}),
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function toConfigItem(item: DropdownItem): MenuElementConfig {
|
|
118
|
-
if (item.loading) {
|
|
119
|
-
return {
|
|
120
|
-
type: 'deferred',
|
|
121
|
-
deferredID: `${item.actionKey}-deferred}`,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
const menuAttributes: MenuAttributes[] = [];
|
|
125
|
-
if (item.destructive) {
|
|
126
|
-
menuAttributes.push('destructive');
|
|
127
|
-
}
|
|
128
|
-
if (item.disabled) {
|
|
129
|
-
menuAttributes.push('disabled');
|
|
130
|
-
}
|
|
131
|
-
if (item.hidden) {
|
|
132
|
-
menuAttributes.push('hidden');
|
|
133
|
-
}
|
|
134
|
-
if (item.keepOpenOnPress) {
|
|
135
|
-
menuAttributes.push('keepsMenuPresented');
|
|
136
|
-
}
|
|
137
|
-
return {
|
|
138
|
-
actionKey: item.actionKey,
|
|
139
|
-
actionTitle: item.title ?? '',
|
|
140
|
-
actionSubtitle: item.subTitle,
|
|
141
|
-
menuState: item.state?.checked ? 'on' : 'off',
|
|
142
|
-
menuAttributes,
|
|
143
|
-
discoverabilityTitle: item.subTitle,
|
|
144
|
-
icon: item?.image?.url
|
|
145
|
-
? {
|
|
146
|
-
type: 'IMAGE_REMOTE_URL',
|
|
147
|
-
imageValue: {
|
|
148
|
-
url: item.image.url,
|
|
149
|
-
},
|
|
150
|
-
imageOptions: {
|
|
151
|
-
cornerRadius: item.image.cornerRadius,
|
|
152
|
-
tint: item.image.tint,
|
|
153
|
-
},
|
|
154
|
-
}
|
|
155
|
-
: item.icon
|
|
156
|
-
? {
|
|
157
|
-
iconType: 'SYSTEM',
|
|
158
|
-
iconValue:
|
|
159
|
-
item.icon?.namingScheme === 'sfSymbol'
|
|
160
|
-
? item.icon.name ?? 'questionmark'
|
|
161
|
-
: item.icon.name && item.icon.name in ICON_MAPPING
|
|
162
|
-
? ICON_MAPPING[item.icon.name as MaterialIconName].sfSymbol
|
|
163
|
-
: 'questionmark',
|
|
164
|
-
iconTint: item.icon?.color,
|
|
165
|
-
}
|
|
166
|
-
: undefined,
|
|
167
|
-
};
|
|
168
|
-
}
|