react-native-platform-components 1.4.0 → 1.5.0
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/PlatformComponents.podspec +1 -1
- package/README.md +33 -31
- package/android/src/main/java/com/platformcomponents/PCButtonGroupView.kt +175 -9
- package/android/src/main/java/com/platformcomponents/PCButtonGroupViewManager.kt +52 -2
- package/android/src/main/java/com/platformcomponents/PCButtonSupport.kt +44 -12
- package/android/src/main/java/com/platformcomponents/PCButtonView.kt +187 -5
- package/android/src/main/java/com/platformcomponents/PCButtonViewManager.kt +85 -7
- package/android/src/main/java/com/platformcomponents/PCContextMenuView.kt +41 -151
- package/android/src/main/java/com/platformcomponents/PCContextMenuViewManager.kt +7 -63
- package/android/src/main/java/com/platformcomponents/PCDatePickerView.kt +310 -115
- package/android/src/main/java/com/platformcomponents/PCDatePickerViewManager.kt +23 -3
- package/android/src/main/java/com/platformcomponents/PCExpressive.kt +6 -1
- package/android/src/main/java/com/platformcomponents/PCFloatingActionButtonView.kt +485 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingActionButtonViewManager.kt +109 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingToolbarView.kt +132 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingToolbarViewManager.kt +8 -0
- package/android/src/main/java/com/platformcomponents/PCHaptics.kt +46 -0
- package/android/src/main/java/com/platformcomponents/PCImageLoader.kt +42 -7
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassContainerView.kt +32 -0
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassContainerViewManager.kt +31 -0
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassView.kt +32 -6
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassViewManager.kt +4 -0
- package/android/src/main/java/com/platformcomponents/PCMenuSupport.kt +280 -0
- package/android/src/main/java/com/platformcomponents/PCNavigationBarSupport.kt +332 -0
- package/android/src/main/java/com/platformcomponents/PCNavigationRailView.kt +448 -0
- package/android/src/main/java/com/platformcomponents/PCNavigationRailViewManager.kt +176 -0
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +24 -14
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +14 -2
- package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +371 -39
- package/android/src/main/java/com/platformcomponents/PCSelectionMenuViewManager.kt +18 -4
- package/android/src/main/java/com/platformcomponents/PCTabBarView.kt +397 -0
- package/android/src/main/java/com/platformcomponents/PCTabBarViewManager.kt +182 -0
- package/android/src/main/java/com/platformcomponents/PCTextFieldView.kt +415 -40
- package/android/src/main/java/com/platformcomponents/PCTextFieldViewManager.kt +109 -3
- package/android/src/main/java/com/platformcomponents/PCThemeSupport.kt +37 -0
- package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +4 -0
- package/android/src/main/res/drawable/pc_ic_search.xml +12 -0
- package/android/src/main/res/values/ids.xml +5 -0
- package/android/src/main/res/values/styles.xml +24 -0
- package/ios/PCButton.mm +122 -7
- package/ios/PCButtonGroup.mm +68 -1
- package/ios/PCButtonGroupView.swift +225 -6
- package/ios/PCButtonSupport.swift +181 -10
- package/ios/PCButtonView.swift +297 -14
- package/ios/PCConstants.swift +23 -2
- package/ios/PCContextMenu.mm +28 -110
- package/ios/PCContextMenu.swift +106 -167
- package/ios/PCDatePicker.mm +21 -9
- package/ios/PCDatePickerView.swift +94 -20
- package/ios/PCFloatingActionButton.h +10 -0
- package/ios/PCFloatingActionButton.mm +177 -0
- package/ios/PCFloatingActionButtonView.swift +426 -0
- package/ios/PCFloatingToolbar.mm +27 -0
- package/ios/PCFloatingToolbarView.swift +241 -0
- package/ios/PCHaptics.swift +91 -0
- package/ios/PCImageLoader.swift +76 -12
- package/ios/PCLiquidGlass.mm +36 -0
- package/ios/PCLiquidGlass.swift +221 -114
- package/ios/PCLiquidGlassContainer.h +10 -0
- package/ios/PCLiquidGlassContainer.mm +84 -0
- package/ios/PCLiquidGlassContainer.swift +69 -0
- package/ios/PCMenuItems.h +76 -0
- package/ios/PCMenuSupport.swift +350 -0
- package/ios/PCNavigationRail.h +10 -0
- package/ios/PCNavigationRail.mm +270 -0
- package/ios/PCNavigationRailView.swift +415 -0
- package/ios/PCSegmentedControl.mm +17 -2
- package/ios/PCSegmentedControl.swift +57 -7
- package/ios/PCSelectionMenu.mm +36 -8
- package/ios/PCSelectionMenu.swift +224 -48
- package/ios/PCTabBar.h +10 -0
- package/ios/PCTabBar.mm +285 -0
- package/ios/PCTabBarAccessory.h +10 -0
- package/ios/PCTabBarAccessory.mm +93 -0
- package/ios/PCTabBarAccessoryView.swift +96 -0
- package/ios/PCTabBarView.swift +671 -0
- package/ios/PCTextField.mm +159 -4
- package/ios/PCTextFieldView.swift +603 -57
- package/lib/commonjs/Button.js +73 -1
- package/lib/commonjs/Button.js.map +1 -1
- package/lib/commonjs/ButtonGroup.js +13 -3
- package/lib/commonjs/ButtonGroup.js.map +1 -1
- package/lib/commonjs/ButtonGroupNativeComponent.ts +74 -4
- package/lib/commonjs/ButtonNativeComponent.ts +119 -3
- package/lib/commonjs/ContextMenu.js +9 -48
- package/lib/commonjs/ContextMenu.js.map +1 -1
- package/lib/commonjs/ContextMenuNativeComponent.ts +47 -49
- package/lib/commonjs/DatePicker.js +98 -2
- package/lib/commonjs/DatePicker.js.map +1 -1
- package/lib/commonjs/DatePickerNativeComponent.ts +19 -2
- package/lib/commonjs/FloatingActionButton.js +60 -0
- package/lib/commonjs/FloatingActionButton.js.map +1 -0
- package/lib/commonjs/FloatingActionButtonNativeComponent.ts +58 -0
- package/lib/commonjs/FloatingToolbar.js +9 -1
- package/lib/commonjs/FloatingToolbar.js.map +1 -1
- package/lib/commonjs/FloatingToolbarNativeComponent.ts +16 -0
- package/lib/commonjs/LiquidGlass.js +7 -1
- package/lib/commonjs/LiquidGlass.js.map +1 -1
- package/lib/commonjs/LiquidGlassContainer.js +32 -0
- package/lib/commonjs/LiquidGlassContainer.js.map +1 -0
- package/lib/commonjs/LiquidGlassContainerNativeComponent.ts +17 -0
- package/lib/commonjs/LiquidGlassNativeComponent.ts +8 -0
- package/lib/commonjs/NavigationRail.js +104 -0
- package/lib/commonjs/NavigationRail.js.map +1 -0
- package/lib/commonjs/NavigationRailNativeComponent.ts +107 -0
- package/lib/commonjs/PlatformComponentsProvider.js +18 -0
- package/lib/commonjs/PlatformComponentsProvider.js.map +1 -0
- package/lib/commonjs/SegmentedControl.js +7 -0
- package/lib/commonjs/SegmentedControl.js.map +1 -1
- package/lib/commonjs/SegmentedControlNativeComponent.ts +11 -0
- package/lib/commonjs/SelectionMenu.js +27 -3
- package/lib/commonjs/SelectionMenu.js.map +1 -1
- package/lib/commonjs/SelectionMenuNativeComponent.ts +26 -4
- package/lib/commonjs/SplitButton.js +98 -0
- package/lib/commonjs/SplitButton.js.map +1 -0
- package/lib/commonjs/TabBar.js +203 -0
- package/lib/commonjs/TabBar.js.map +1 -0
- package/lib/commonjs/TabBarAccessoryNativeComponent.ts +19 -0
- package/lib/commonjs/TabBarNativeComponent.ts +145 -0
- package/lib/commonjs/TextField.js +171 -8
- package/lib/commonjs/TextField.js.map +1 -1
- package/lib/commonjs/TextFieldNativeComponent.ts +110 -4
- package/lib/commonjs/focusRegistry.js +2 -1
- package/lib/commonjs/focusRegistry.js.map +1 -1
- package/lib/commonjs/haptics.js +2 -0
- package/lib/commonjs/haptics.js.map +1 -0
- package/lib/commonjs/icons.js +15 -1
- package/lib/commonjs/icons.js.map +1 -1
- package/lib/commonjs/index.js +77 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +156 -92
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/jest.js +910 -0
- package/lib/commonjs/jest.js.map +1 -0
- package/lib/commonjs/menuItems.js +68 -0
- package/lib/commonjs/menuItems.js.map +1 -0
- package/lib/commonjs/selectionIdentifiers.js +18 -0
- package/lib/commonjs/selectionIdentifiers.js.map +1 -0
- package/lib/commonjs/submitBehavior.js +19 -0
- package/lib/commonjs/submitBehavior.js.map +1 -0
- package/lib/commonjs/tabItems.js +49 -0
- package/lib/commonjs/tabItems.js.map +1 -0
- package/lib/commonjs/web/Button.js +170 -0
- package/lib/commonjs/web/Button.js.map +1 -0
- package/lib/commonjs/web/ButtonGroup.js +119 -0
- package/lib/commonjs/web/ButtonGroup.js.map +1 -0
- package/lib/commonjs/web/DatePicker.js +168 -0
- package/lib/commonjs/web/DatePicker.js.map +1 -0
- package/lib/commonjs/web/DateRangePicker.js +137 -0
- package/lib/commonjs/web/DateRangePicker.js.map +1 -0
- package/lib/commonjs/web/Dialog.js +54 -0
- package/lib/commonjs/web/Dialog.js.map +1 -0
- package/lib/commonjs/web/FloatingActionButton.js +98 -0
- package/lib/commonjs/web/FloatingActionButton.js.map +1 -0
- package/lib/commonjs/web/Icon.js +34 -0
- package/lib/commonjs/web/Icon.js.map +1 -0
- package/lib/commonjs/web/NativeTheme.js +28 -0
- package/lib/commonjs/web/NativeTheme.js.map +1 -0
- package/lib/commonjs/web/NavigationRail.js +139 -0
- package/lib/commonjs/web/NavigationRail.js.map +1 -0
- package/lib/commonjs/web/PlatformComponentsProvider.js +51 -0
- package/lib/commonjs/web/PlatformComponentsProvider.js.map +1 -0
- package/lib/commonjs/web/SegmentedControl.js +117 -0
- package/lib/commonjs/web/SegmentedControl.js.map +1 -0
- package/lib/commonjs/web/SelectionMenu.js +142 -0
- package/lib/commonjs/web/SelectionMenu.js.map +1 -0
- package/lib/commonjs/web/SplitButton.js +35 -0
- package/lib/commonjs/web/SplitButton.js.map +1 -0
- package/lib/commonjs/web/TabBar.js +131 -0
- package/lib/commonjs/web/TabBar.js.map +1 -0
- package/lib/commonjs/web/TextField.js +322 -0
- package/lib/commonjs/web/TextField.js.map +1 -0
- package/lib/commonjs/web/components.js +36 -0
- package/lib/commonjs/web/components.js.map +1 -0
- package/lib/commonjs/web/containers.js +121 -0
- package/lib/commonjs/web/containers.js.map +1 -0
- package/lib/commonjs/web/dateInput.js +116 -0
- package/lib/commonjs/web/dateInput.js.map +1 -0
- package/lib/commonjs/web/shared.js +192 -0
- package/lib/commonjs/web/shared.js.map +1 -0
- package/lib/commonjs/webComponents.js +6 -0
- package/lib/commonjs/webComponents.js.map +1 -0
- package/lib/module/Button.js +74 -2
- package/lib/module/Button.js.map +1 -1
- package/lib/module/ButtonGroup.js +13 -3
- package/lib/module/ButtonGroup.js.map +1 -1
- package/lib/module/ButtonGroupNativeComponent.ts +74 -4
- package/lib/module/ButtonNativeComponent.ts +119 -3
- package/lib/module/ContextMenu.js +9 -48
- package/lib/module/ContextMenu.js.map +1 -1
- package/lib/module/ContextMenuNativeComponent.ts +47 -49
- package/lib/module/DatePicker.js +98 -4
- package/lib/module/DatePicker.js.map +1 -1
- package/lib/module/DatePickerNativeComponent.ts +19 -2
- package/lib/module/FloatingActionButton.js +53 -0
- package/lib/module/FloatingActionButton.js.map +1 -0
- package/lib/module/FloatingActionButtonNativeComponent.ts +58 -0
- package/lib/module/FloatingToolbar.js +9 -1
- package/lib/module/FloatingToolbar.js.map +1 -1
- package/lib/module/FloatingToolbarNativeComponent.ts +16 -0
- package/lib/module/LiquidGlass.js +7 -1
- package/lib/module/LiquidGlass.js.map +1 -1
- package/lib/module/LiquidGlassContainer.js +26 -0
- package/lib/module/LiquidGlassContainer.js.map +1 -0
- package/lib/module/LiquidGlassContainerNativeComponent.ts +17 -0
- package/lib/module/LiquidGlassNativeComponent.ts +8 -0
- package/lib/module/NavigationRail.js +99 -0
- package/lib/module/NavigationRail.js.map +1 -0
- package/lib/module/NavigationRailNativeComponent.ts +107 -0
- package/lib/module/PlatformComponentsProvider.js +13 -0
- package/lib/module/PlatformComponentsProvider.js.map +1 -0
- package/lib/module/SegmentedControl.js +9 -1
- package/lib/module/SegmentedControl.js.map +1 -1
- package/lib/module/SegmentedControlNativeComponent.ts +11 -0
- package/lib/module/SelectionMenu.js +27 -3
- package/lib/module/SelectionMenu.js.map +1 -1
- package/lib/module/SelectionMenuNativeComponent.ts +26 -4
- package/lib/module/SplitButton.js +91 -0
- package/lib/module/SplitButton.js.map +1 -0
- package/lib/module/TabBar.js +196 -0
- package/lib/module/TabBar.js.map +1 -0
- package/lib/module/TabBarAccessoryNativeComponent.ts +19 -0
- package/lib/module/TabBarNativeComponent.ts +145 -0
- package/lib/module/TextField.js +172 -9
- package/lib/module/TextField.js.map +1 -1
- package/lib/module/TextFieldNativeComponent.ts +110 -4
- package/lib/module/focusRegistry.js +1 -0
- package/lib/module/focusRegistry.js.map +1 -1
- package/lib/module/haptics.js +2 -0
- package/lib/module/haptics.js.map +1 -0
- package/lib/module/icons.js +15 -1
- package/lib/module/icons.js.map +1 -1
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +12 -87
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/jest.js +840 -0
- package/lib/module/jest.js.map +1 -0
- package/lib/module/menuItems.js +65 -0
- package/lib/module/menuItems.js.map +1 -0
- package/lib/module/selectionIdentifiers.js +14 -0
- package/lib/module/selectionIdentifiers.js.map +1 -0
- package/lib/module/submitBehavior.js +15 -0
- package/lib/module/submitBehavior.js.map +1 -0
- package/lib/module/tabItems.js +45 -0
- package/lib/module/tabItems.js.map +1 -0
- package/lib/module/web/Button.js +164 -0
- package/lib/module/web/Button.js.map +1 -0
- package/lib/module/web/ButtonGroup.js +113 -0
- package/lib/module/web/ButtonGroup.js.map +1 -0
- package/lib/module/web/DatePicker.js +162 -0
- package/lib/module/web/DatePicker.js.map +1 -0
- package/lib/module/web/DateRangePicker.js +131 -0
- package/lib/module/web/DateRangePicker.js.map +1 -0
- package/lib/module/web/Dialog.js +48 -0
- package/lib/module/web/Dialog.js.map +1 -0
- package/lib/module/web/FloatingActionButton.js +94 -0
- package/lib/module/web/FloatingActionButton.js.map +1 -0
- package/lib/module/web/Icon.js +29 -0
- package/lib/module/web/Icon.js.map +1 -0
- package/lib/module/web/NativeTheme.js +23 -0
- package/lib/module/web/NativeTheme.js.map +1 -0
- package/lib/module/web/NavigationRail.js +133 -0
- package/lib/module/web/NavigationRail.js.map +1 -0
- package/lib/module/web/PlatformComponentsProvider.js +44 -0
- package/lib/module/web/PlatformComponentsProvider.js.map +1 -0
- package/lib/module/web/SegmentedControl.js +112 -0
- package/lib/module/web/SegmentedControl.js.map +1 -0
- package/lib/module/web/SelectionMenu.js +137 -0
- package/lib/module/web/SelectionMenu.js.map +1 -0
- package/lib/module/web/SplitButton.js +30 -0
- package/lib/module/web/SplitButton.js.map +1 -0
- package/lib/module/web/TabBar.js +126 -0
- package/lib/module/web/TabBar.js.map +1 -0
- package/lib/module/web/TextField.js +316 -0
- package/lib/module/web/TextField.js.map +1 -0
- package/lib/module/web/components.js +33 -0
- package/lib/module/web/components.js.map +1 -0
- package/lib/module/web/containers.js +112 -0
- package/lib/module/web/containers.js.map +1 -0
- package/lib/module/web/dateInput.js +109 -0
- package/lib/module/web/dateInput.js.map +1 -0
- package/lib/module/web/shared.js +179 -0
- package/lib/module/web/shared.js.map +1 -0
- package/lib/module/webComponents.js +4 -0
- package/lib/module/webComponents.js.map +1 -0
- package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Button.d.ts +111 -3
- package/lib/typescript/commonjs/src/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ButtonGroup.d.ts +21 -6
- package/lib/typescript/commonjs/src/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts +64 -3
- package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts +94 -3
- package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ContextMenu.d.ts +20 -33
- package/lib/typescript/commonjs/src/ContextMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +45 -47
- package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DatePicker.d.ts +74 -1
- package/lib/typescript/commonjs/src/DatePicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +16 -1
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/FloatingActionButton.d.ts +67 -0
- package/lib/typescript/commonjs/src/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/FloatingActionButtonNativeComponent.d.ts +43 -0
- package/lib/typescript/commonjs/src/FloatingActionButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/FloatingToolbar.d.ts +30 -0
- package/lib/typescript/commonjs/src/FloatingToolbar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts +12 -0
- package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LiquidGlass.d.ts +17 -0
- package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LiquidGlassContainer.d.ts +27 -0
- package/lib/typescript/commonjs/src/LiquidGlassContainer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/LiquidGlassContainerNativeComponent.d.ts +13 -0
- package/lib/typescript/commonjs/src/LiquidGlassContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NavigationRail.d.ts +86 -0
- package/lib/typescript/commonjs/src/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NavigationRailNativeComponent.d.ts +81 -0
- package/lib/typescript/commonjs/src/NavigationRailNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/PlatformComponentsProvider.d.ts +6 -0
- package/lib/typescript/commonjs/src/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts +18 -1
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +9 -0
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SelectionMenu.d.ts +44 -2
- package/lib/typescript/commonjs/src/SelectionMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +20 -4
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SplitButton.d.ts +83 -0
- package/lib/typescript/commonjs/src/SplitButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TabBar.d.ts +144 -0
- package/lib/typescript/commonjs/src/TabBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TabBarAccessoryNativeComponent.d.ts +13 -0
- package/lib/typescript/commonjs/src/TabBarAccessoryNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TabBarNativeComponent.d.ts +110 -0
- package/lib/typescript/commonjs/src/TabBarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TextField.d.ts +166 -8
- package/lib/typescript/commonjs/src/TextField.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts +81 -3
- package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/focusRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/haptics.d.ts +20 -0
- package/lib/typescript/commonjs/src/haptics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/icons.d.ts +7 -1
- package/lib/typescript/commonjs/src/icons.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.web.d.ts +25 -254
- package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/jest.d.ts +139 -0
- package/lib/typescript/commonjs/src/jest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/menuItems.d.ts +100 -0
- package/lib/typescript/commonjs/src/menuItems.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/selectionIdentifiers.d.ts +3 -0
- package/lib/typescript/commonjs/src/selectionIdentifiers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/submitBehavior.d.ts +9 -0
- package/lib/typescript/commonjs/src/submitBehavior.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/tabItems.d.ts +55 -0
- package/lib/typescript/commonjs/src/tabItems.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/Button.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/ButtonGroup.d.ts +11 -0
- package/lib/typescript/commonjs/src/web/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/DatePicker.d.ts +14 -0
- package/lib/typescript/commonjs/src/web/DatePicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/DateRangePicker.d.ts +11 -0
- package/lib/typescript/commonjs/src/web/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/Dialog.d.ts +12 -0
- package/lib/typescript/commonjs/src/web/Dialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/FloatingActionButton.d.ts +8 -0
- package/lib/typescript/commonjs/src/web/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/Icon.d.ts +12 -0
- package/lib/typescript/commonjs/src/web/Icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/NativeTheme.d.ts +10 -0
- package/lib/typescript/commonjs/src/web/NativeTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/NavigationRail.d.ts +8 -0
- package/lib/typescript/commonjs/src/web/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/PlatformComponentsProvider.d.ts +10 -0
- package/lib/typescript/commonjs/src/web/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/SegmentedControl.d.ts +8 -0
- package/lib/typescript/commonjs/src/web/SegmentedControl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/SelectionMenu.d.ts +10 -0
- package/lib/typescript/commonjs/src/web/SelectionMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/SplitButton.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/SplitButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/TabBar.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/TabBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/TextField.d.ts +9 -0
- package/lib/typescript/commonjs/src/web/TextField.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/components.d.ts +17 -0
- package/lib/typescript/commonjs/src/web/components.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/containers.d.ts +24 -0
- package/lib/typescript/commonjs/src/web/containers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/dateInput.d.ts +20 -0
- package/lib/typescript/commonjs/src/web/dateInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/shared.d.ts +43 -0
- package/lib/typescript/commonjs/src/web/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/webComponents.d.ts +43 -0
- package/lib/typescript/commonjs/src/webComponents.d.ts.map +1 -0
- package/lib/typescript/module/docs/sidebars.d.ts.map +1 -1
- package/lib/typescript/module/src/Button.d.ts +111 -3
- package/lib/typescript/module/src/Button.d.ts.map +1 -1
- package/lib/typescript/module/src/ButtonGroup.d.ts +21 -6
- package/lib/typescript/module/src/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts +64 -3
- package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/ButtonNativeComponent.d.ts +94 -3
- package/lib/typescript/module/src/ButtonNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/ContextMenu.d.ts +20 -33
- package/lib/typescript/module/src/ContextMenu.d.ts.map +1 -1
- package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +45 -47
- package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/DatePicker.d.ts +74 -1
- package/lib/typescript/module/src/DatePicker.d.ts.map +1 -1
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +16 -1
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/FloatingActionButton.d.ts +67 -0
- package/lib/typescript/module/src/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/module/src/FloatingActionButtonNativeComponent.d.ts +43 -0
- package/lib/typescript/module/src/FloatingActionButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/FloatingToolbar.d.ts +30 -0
- package/lib/typescript/module/src/FloatingToolbar.d.ts.map +1 -1
- package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts +12 -0
- package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/LiquidGlass.d.ts +17 -0
- package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -1
- package/lib/typescript/module/src/LiquidGlassContainer.d.ts +27 -0
- package/lib/typescript/module/src/LiquidGlassContainer.d.ts.map +1 -0
- package/lib/typescript/module/src/LiquidGlassContainerNativeComponent.d.ts +13 -0
- package/lib/typescript/module/src/LiquidGlassContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/NavigationRail.d.ts +86 -0
- package/lib/typescript/module/src/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/module/src/NavigationRailNativeComponent.d.ts +81 -0
- package/lib/typescript/module/src/NavigationRailNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/PlatformComponentsProvider.d.ts +6 -0
- package/lib/typescript/module/src/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/SegmentedControl.d.ts +18 -1
- package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +9 -0
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/SelectionMenu.d.ts +44 -2
- package/lib/typescript/module/src/SelectionMenu.d.ts.map +1 -1
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +20 -4
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/SplitButton.d.ts +83 -0
- package/lib/typescript/module/src/SplitButton.d.ts.map +1 -0
- package/lib/typescript/module/src/TabBar.d.ts +144 -0
- package/lib/typescript/module/src/TabBar.d.ts.map +1 -0
- package/lib/typescript/module/src/TabBarAccessoryNativeComponent.d.ts +13 -0
- package/lib/typescript/module/src/TabBarAccessoryNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/TabBarNativeComponent.d.ts +110 -0
- package/lib/typescript/module/src/TabBarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/TextField.d.ts +166 -8
- package/lib/typescript/module/src/TextField.d.ts.map +1 -1
- package/lib/typescript/module/src/TextFieldNativeComponent.d.ts +81 -3
- package/lib/typescript/module/src/TextFieldNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/focusRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/haptics.d.ts +20 -0
- package/lib/typescript/module/src/haptics.d.ts.map +1 -0
- package/lib/typescript/module/src/icons.d.ts +7 -1
- package/lib/typescript/module/src/icons.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +7 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.web.d.ts +25 -254
- package/lib/typescript/module/src/index.web.d.ts.map +1 -1
- package/lib/typescript/module/src/jest.d.ts +139 -0
- package/lib/typescript/module/src/jest.d.ts.map +1 -0
- package/lib/typescript/module/src/menuItems.d.ts +100 -0
- package/lib/typescript/module/src/menuItems.d.ts.map +1 -0
- package/lib/typescript/module/src/selectionIdentifiers.d.ts +3 -0
- package/lib/typescript/module/src/selectionIdentifiers.d.ts.map +1 -0
- package/lib/typescript/module/src/submitBehavior.d.ts +9 -0
- package/lib/typescript/module/src/submitBehavior.d.ts.map +1 -0
- package/lib/typescript/module/src/tabItems.d.ts +55 -0
- package/lib/typescript/module/src/tabItems.d.ts.map +1 -0
- package/lib/typescript/module/src/web/Button.d.ts +9 -0
- package/lib/typescript/module/src/web/Button.d.ts.map +1 -0
- package/lib/typescript/module/src/web/ButtonGroup.d.ts +11 -0
- package/lib/typescript/module/src/web/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/module/src/web/DatePicker.d.ts +14 -0
- package/lib/typescript/module/src/web/DatePicker.d.ts.map +1 -0
- package/lib/typescript/module/src/web/DateRangePicker.d.ts +11 -0
- package/lib/typescript/module/src/web/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/module/src/web/Dialog.d.ts +12 -0
- package/lib/typescript/module/src/web/Dialog.d.ts.map +1 -0
- package/lib/typescript/module/src/web/FloatingActionButton.d.ts +8 -0
- package/lib/typescript/module/src/web/FloatingActionButton.d.ts.map +1 -0
- package/lib/typescript/module/src/web/Icon.d.ts +12 -0
- package/lib/typescript/module/src/web/Icon.d.ts.map +1 -0
- package/lib/typescript/module/src/web/NativeTheme.d.ts +10 -0
- package/lib/typescript/module/src/web/NativeTheme.d.ts.map +1 -0
- package/lib/typescript/module/src/web/NavigationRail.d.ts +8 -0
- package/lib/typescript/module/src/web/NavigationRail.d.ts.map +1 -0
- package/lib/typescript/module/src/web/PlatformComponentsProvider.d.ts +10 -0
- package/lib/typescript/module/src/web/PlatformComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/web/SegmentedControl.d.ts +8 -0
- package/lib/typescript/module/src/web/SegmentedControl.d.ts.map +1 -0
- package/lib/typescript/module/src/web/SelectionMenu.d.ts +10 -0
- package/lib/typescript/module/src/web/SelectionMenu.d.ts.map +1 -0
- package/lib/typescript/module/src/web/SplitButton.d.ts +9 -0
- package/lib/typescript/module/src/web/SplitButton.d.ts.map +1 -0
- package/lib/typescript/module/src/web/TabBar.d.ts +9 -0
- package/lib/typescript/module/src/web/TabBar.d.ts.map +1 -0
- package/lib/typescript/module/src/web/TextField.d.ts +9 -0
- package/lib/typescript/module/src/web/TextField.d.ts.map +1 -0
- package/lib/typescript/module/src/web/components.d.ts +17 -0
- package/lib/typescript/module/src/web/components.d.ts.map +1 -0
- package/lib/typescript/module/src/web/containers.d.ts +24 -0
- package/lib/typescript/module/src/web/containers.d.ts.map +1 -0
- package/lib/typescript/module/src/web/dateInput.d.ts +20 -0
- package/lib/typescript/module/src/web/dateInput.d.ts.map +1 -0
- package/lib/typescript/module/src/web/shared.d.ts +43 -0
- package/lib/typescript/module/src/web/shared.d.ts.map +1 -0
- package/lib/typescript/module/src/webComponents.d.ts +43 -0
- package/lib/typescript/module/src/webComponents.d.ts.map +1 -0
- package/package.json +32 -2
- package/plugin/build/index.d.ts +3 -2
- package/plugin/build/index.d.ts.map +1 -1
- package/react-native.config.js +3 -0
- package/shared/PCFloatingActionButtonComponentDescriptors-custom.h +22 -0
- package/shared/PCFloatingActionButtonShadowNode-custom.cpp +48 -0
- package/shared/PCFloatingActionButtonShadowNode-custom.h +54 -0
- package/shared/PCFloatingActionButtonState-custom.h +61 -0
- package/shared/PCNavigationRailComponentDescriptors-custom.h +47 -0
- package/shared/PCNavigationRailShadowNode-custom.h +42 -0
- package/shared/PCNavigationRailState-custom.h +62 -0
- package/shared/PCTabBarComponentDescriptors-custom.h +22 -0
- package/shared/PCTabBarShadowNode-custom.cpp +54 -0
- package/shared/PCTabBarShadowNode-custom.h +54 -0
- package/shared/PCTabBarState-custom.h +62 -0
- package/shared/react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h +3 -0
- package/src/Button.tsx +222 -7
- package/src/ButtonGroup.tsx +29 -11
- package/src/ButtonGroupNativeComponent.ts +74 -4
- package/src/ButtonNativeComponent.ts +119 -3
- package/src/ContextMenu.tsx +34 -81
- package/src/ContextMenuNativeComponent.ts +47 -49
- package/src/DatePicker.tsx +182 -4
- package/src/DatePickerNativeComponent.ts +19 -2
- package/src/FloatingActionButton.tsx +121 -0
- package/src/FloatingActionButtonNativeComponent.ts +58 -0
- package/src/FloatingToolbar.tsx +54 -3
- package/src/FloatingToolbarNativeComponent.ts +16 -0
- package/src/LiquidGlass.tsx +24 -1
- package/src/LiquidGlassContainer.tsx +42 -0
- package/src/LiquidGlassContainerNativeComponent.ts +17 -0
- package/src/LiquidGlassNativeComponent.ts +8 -0
- package/src/NavigationRail.tsx +203 -0
- package/src/NavigationRailNativeComponent.ts +107 -0
- package/src/PlatformComponentsProvider.tsx +15 -0
- package/src/SegmentedControl.tsx +31 -1
- package/src/SegmentedControlNativeComponent.ts +11 -0
- package/src/SelectionMenu.tsx +81 -6
- package/src/SelectionMenuNativeComponent.ts +26 -4
- package/src/SplitButton.tsx +198 -0
- package/src/TabBar.tsx +373 -0
- package/src/TabBarAccessoryNativeComponent.ts +19 -0
- package/src/TabBarNativeComponent.ts +145 -0
- package/src/TextField.tsx +428 -14
- package/src/TextFieldNativeComponent.ts +110 -4
- package/src/focusRegistry.ts +1 -0
- package/src/haptics.ts +31 -0
- package/src/icons.ts +28 -1
- package/src/index.tsx +7 -0
- package/src/index.web.tsx +51 -391
- package/src/jest.tsx +958 -0
- package/src/menuItems.ts +152 -0
- package/src/selectionIdentifiers.ts +17 -0
- package/src/submitBehavior.ts +16 -0
- package/src/tabItems.ts +113 -0
- package/src/web/Button.tsx +201 -0
- package/src/web/ButtonGroup.tsx +154 -0
- package/src/web/DatePicker.tsx +204 -0
- package/src/web/DateRangePicker.tsx +135 -0
- package/src/web/Dialog.tsx +54 -0
- package/src/web/FloatingActionButton.tsx +76 -0
- package/src/web/Icon.tsx +33 -0
- package/src/web/NativeTheme.ts +23 -0
- package/src/web/NavigationRail.tsx +148 -0
- package/src/web/PlatformComponentsProvider.tsx +48 -0
- package/src/web/SegmentedControl.tsx +127 -0
- package/src/web/SelectionMenu.tsx +149 -0
- package/src/web/SplitButton.tsx +32 -0
- package/src/web/TabBar.tsx +150 -0
- package/src/web/TextField.tsx +361 -0
- package/src/web/components.tsx +71 -0
- package/src/web/containers.tsx +130 -0
- package/src/web/dateInput.ts +137 -0
- package/src/web/shared.ts +176 -0
- package/src/webComponents.ts +45 -0
- package/android/src/main/java/com/platformcomponents/DateConstraints.kt +0 -83
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NavigationRail = NavigationRail;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _Icon = require("./Icon");
|
|
10
|
+
var _shared = require("./shared");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
// web/NavigationRail.tsx
|
|
14
|
+
|
|
15
|
+
const JUSTIFY = {
|
|
16
|
+
top: 'flex-start',
|
|
17
|
+
center: 'center',
|
|
18
|
+
bottom: 'flex-end'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A vertical `tablist` of `<button>` destinations, icon over label (beside it
|
|
23
|
+
* when expanded), with the header above them.
|
|
24
|
+
*/
|
|
25
|
+
function NavigationRail(props) {
|
|
26
|
+
const {
|
|
27
|
+
items,
|
|
28
|
+
selectedValue,
|
|
29
|
+
onSelect,
|
|
30
|
+
onReselect,
|
|
31
|
+
labelVisibility = 'auto',
|
|
32
|
+
menuGravity = 'top',
|
|
33
|
+
expanded,
|
|
34
|
+
header,
|
|
35
|
+
activeTintColor,
|
|
36
|
+
inactiveTintColor,
|
|
37
|
+
railColor,
|
|
38
|
+
badgeStyle,
|
|
39
|
+
labelStyle,
|
|
40
|
+
maxFontSizeMultiplier,
|
|
41
|
+
android,
|
|
42
|
+
style,
|
|
43
|
+
...viewProps
|
|
44
|
+
} = props;
|
|
45
|
+
const primary = (0, _shared.usePrimaryColor)();
|
|
46
|
+
const activeColor = (0, _shared.cssColor)(activeTintColor) ?? primary;
|
|
47
|
+
const inactiveColor = (0, _shared.cssColor)(inactiveTintColor) ?? 'GrayText';
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
49
|
+
...viewProps,
|
|
50
|
+
style: [{
|
|
51
|
+
alignItems: expanded ? 'stretch' : 'center',
|
|
52
|
+
width: expanded ? 220 : 96,
|
|
53
|
+
paddingVertical: 12,
|
|
54
|
+
gap: 12,
|
|
55
|
+
backgroundColor: (0, _shared.cssColor)(railColor)
|
|
56
|
+
}, style],
|
|
57
|
+
children: [header ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
58
|
+
style: {
|
|
59
|
+
alignItems: 'center'
|
|
60
|
+
},
|
|
61
|
+
children: header
|
|
62
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
|
+
role: "tablist",
|
|
64
|
+
"aria-orientation": "vertical",
|
|
65
|
+
style: {
|
|
66
|
+
flex: 1,
|
|
67
|
+
gap: 4,
|
|
68
|
+
justifyContent: JUSTIFY[menuGravity]
|
|
69
|
+
},
|
|
70
|
+
children: items.map((item, index) => {
|
|
71
|
+
const isSelected = item.value === selectedValue;
|
|
72
|
+
const color = isSelected ? activeColor : inactiveColor;
|
|
73
|
+
const showLabel = labelVisibility !== 'unlabeled' && (labelVisibility !== 'selected' || isSelected);
|
|
74
|
+
const icon = isSelected ? item.selectedIcon ?? item.icon : item.icon;
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
76
|
+
"data-testid": item.testID,
|
|
77
|
+
type: "button",
|
|
78
|
+
role: "tab",
|
|
79
|
+
"aria-selected": isSelected,
|
|
80
|
+
"aria-label": item.accessibilityLabel ?? item.label,
|
|
81
|
+
disabled: item.disabled,
|
|
82
|
+
onClick: () => {
|
|
83
|
+
if (isSelected) onReselect?.(item.value, index);else onSelect?.(item.value, index);
|
|
84
|
+
},
|
|
85
|
+
style: {
|
|
86
|
+
display: 'flex',
|
|
87
|
+
flexDirection: expanded ? 'row' : 'column',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
gap: expanded ? 12 : 4,
|
|
90
|
+
padding: expanded ? '0 12px' : '4px',
|
|
91
|
+
border: 'none',
|
|
92
|
+
fontFamily: 'inherit',
|
|
93
|
+
fontSize: 12,
|
|
94
|
+
fontWeight: isSelected ? 600 : 500,
|
|
95
|
+
color,
|
|
96
|
+
backgroundColor: 'transparent',
|
|
97
|
+
outlineColor: primary,
|
|
98
|
+
opacity: item.disabled ? 0.38 : 1,
|
|
99
|
+
cursor: item.disabled ? 'default' : 'pointer',
|
|
100
|
+
...(0, _shared.cssFont)(labelStyle)
|
|
101
|
+
},
|
|
102
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
103
|
+
style: {
|
|
104
|
+
position: 'relative',
|
|
105
|
+
display: 'flex',
|
|
106
|
+
padding: '4px 16px',
|
|
107
|
+
borderRadius: 16,
|
|
108
|
+
backgroundColor: isSelected ? (0, _shared.cssColor)(android?.indicatorColor) ?? 'rgba(118, 118, 128, 0.16)' : 'transparent'
|
|
109
|
+
},
|
|
110
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
111
|
+
icon: icon,
|
|
112
|
+
color: color,
|
|
113
|
+
size: 24
|
|
114
|
+
}), item.badge !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
115
|
+
style: {
|
|
116
|
+
position: 'absolute',
|
|
117
|
+
top: 0,
|
|
118
|
+
right: 8,
|
|
119
|
+
minWidth: item.badge === '' ? 8 : 16,
|
|
120
|
+
height: item.badge === '' ? 8 : 16,
|
|
121
|
+
padding: item.badge === '' ? 0 : '0 4px',
|
|
122
|
+
boxSizing: 'border-box',
|
|
123
|
+
borderRadius: 8,
|
|
124
|
+
fontSize: 11,
|
|
125
|
+
lineHeight: '16px',
|
|
126
|
+
fontWeight: 600,
|
|
127
|
+
textAlign: 'center',
|
|
128
|
+
backgroundColor: (0, _shared.cssColor)(badgeStyle?.backgroundColor) ?? '#FF3B30',
|
|
129
|
+
color: (0, _shared.cssColor)(badgeStyle?.color) ?? '#fff'
|
|
130
|
+
},
|
|
131
|
+
children: item.badge
|
|
132
|
+
}) : null]
|
|
133
|
+
}), showLabel ? item.label : null]
|
|
134
|
+
}, item.value);
|
|
135
|
+
})
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=NavigationRail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Icon","_shared","_jsxRuntime","e","__esModule","default","JUSTIFY","top","center","bottom","NavigationRail","props","items","selectedValue","onSelect","onReselect","labelVisibility","menuGravity","expanded","header","activeTintColor","inactiveTintColor","railColor","badgeStyle","labelStyle","maxFontSizeMultiplier","android","style","viewProps","primary","usePrimaryColor","activeColor","cssColor","inactiveColor","jsxs","View","alignItems","width","paddingVertical","gap","backgroundColor","children","jsx","role","flex","justifyContent","map","item","index","isSelected","value","color","showLabel","icon","selectedIcon","testID","type","accessibilityLabel","label","disabled","onClick","display","flexDirection","padding","border","fontFamily","fontSize","fontWeight","outlineColor","opacity","cursor","cssFont","position","borderRadius","indicatorColor","Icon","size","badge","undefined","right","minWidth","height","boxSizing","lineHeight","textAlign"],"sourceRoot":"../../../src","sources":["web/NavigationRail.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA8D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAN9D;;AAQA,MAAMG,OAAO,GAAG;EAAEC,GAAG,EAAE,YAAY;EAAEC,MAAM,EAAE,QAAQ;EAAEC,MAAM,EAAE;AAAW,CAAC;;AAE3E;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,KAA0B,EAAsB;EAC7E,MAAM;IACJC,KAAK;IACLC,aAAa;IACbC,QAAQ;IACRC,UAAU;IACVC,eAAe,GAAG,MAAM;IACxBC,WAAW,GAAG,KAAK;IACnBC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,iBAAiB;IACjBC,SAAS;IACTC,UAAU;IACVC,UAAU;IACVC,qBAAqB;IACrBC,OAAO;IACPC,KAAK;IACL,GAAGC;EACL,CAAC,GAAGjB,KAAK;EAET,MAAMkB,OAAO,GAAG,IAAAC,uBAAe,EAAC,CAAC;EACjC,MAAMC,WAAW,GAAG,IAAAC,gBAAQ,EAACZ,eAAe,CAAC,IAAIS,OAAO;EACxD,MAAMI,aAAa,GAAG,IAAAD,gBAAQ,EAACX,iBAAiB,CAAC,IAAI,UAAU;EAE/D,oBACE,IAAAnB,WAAA,CAAAgC,IAAA,EAACnC,YAAA,CAAAoC,IAAI;IAAA,GACCP,SAAS;IACbD,KAAK,EAAE,CACL;MACES,UAAU,EAAElB,QAAQ,GAAG,SAAS,GAAG,QAAQ;MAC3CmB,KAAK,EAAEnB,QAAQ,GAAG,GAAG,GA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3C7B,IAAI,CAAC8B,KAAK,KAAKC,SAAS,gBACvB,IAAA5E,WAAA,CAAAwC,GAAA;cACEf,KAAK,EAAE;gBACL6C,QAAQ,EAAE,UAAU;gBACpBjE,GAAG,EAAE,CAAC;gBACNwE,KAAK,EAAE,CAAC;gBACRC,QAAQ,EAAEjC,IAAI,CAAC8B,KAAK,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE;gBACpCI,MAAM,EAAElC,IAAI,CAAC8B,KAAK,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE;gBAClCd,OAAO,EAAEhB,IAAI,CAAC8B,KAAK,KAAK,EAAE,GAAG,CAAC,GAAG,OAAO;gBACxCK,SAAS,EAAE,YAAY;gBACvBT,YAAY,EAAE,CAAC;gBACfP,QAAQ,EAAE,EAAE;gBACZiB,UAAU,EAAE,MAAM;gBAClBhB,UAAU,EAAE,GAAG;gBACfiB,SAAS,EAAE,QAAQ;gBACnB5C,eAAe,EACb,IAAAR,gBAAQ,EAACT,UAAU,EAAEiB,eAAe,CAAC,IAAI,SAAS;gBACpDW,KAAK,EAAE,IAAAnB,gBAAQ,EAACT,UAAU,EAAE4B,KAAK,CAAC,IAAI;cACxC,CAAE;cAAAV,QAAA,EAEDM,IAAI,CAAC8B;YAAK,CACP,CAAC,GACL,IAAI;UAAA,CACJ,CAAC,EACNzB,SAAS,GAAGL,IAAI,CAACW,KAAK,GAAG,IAAI;QAAA,GAlEzBX,IAAI,CAACG,KAmEJ,CAAC;MAEb,CAAC;IAAC,CACE,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PlatformComponentsProvider = PlatformComponentsProvider;
|
|
7
|
+
exports.useWebComponent = useWebComponent;
|
|
8
|
+
exports.withWebComponent = withWebComponent;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
const WebContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
13
|
+
|
|
14
|
+
/** Replacements apply only to descendants; nested registrations inherit missing entries. */
|
|
15
|
+
function PlatformComponentsProvider({
|
|
16
|
+
web,
|
|
17
|
+
children
|
|
18
|
+
}) {
|
|
19
|
+
const parent = (0, _react.useContext)(WebContext);
|
|
20
|
+
const components = (0, _react.useMemo)(() => {
|
|
21
|
+
if (!web) return parent;
|
|
22
|
+
const merged = {
|
|
23
|
+
...parent
|
|
24
|
+
};
|
|
25
|
+
for (const [name, implementation] of Object.entries(web)) {
|
|
26
|
+
if (implementation !== undefined) Object.assign(merged, {
|
|
27
|
+
[name]: implementation
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return merged;
|
|
31
|
+
}, [parent, web]);
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(WebContext.Provider, {
|
|
33
|
+
value: components,
|
|
34
|
+
children: children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function useWebComponent(name) {
|
|
38
|
+
return (0, _react.useContext)(WebContext)[name];
|
|
39
|
+
}
|
|
40
|
+
function withWebComponent(name, fallback) {
|
|
41
|
+
function WebComponent(props) {
|
|
42
|
+
// The mapped key couples each implementation to its own public props.
|
|
43
|
+
const Component = useWebComponent(name) ?? fallback;
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
WebComponent.displayName = name;
|
|
49
|
+
return WebComponent;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=PlatformComponentsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","WebContext","createContext","PlatformComponentsProvider","web","children","parent","useContext","components","useMemo","merged","name","implementation","entries","undefined","assign","jsx","Provider","value","useWebComponent","withWebComponent","fallback","WebComponent","props","Component","displayName"],"sourceRoot":"../../../src","sources":["web/PlatformComponentsProvider.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkE,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC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AAU,CAAC,CAACU,IAAI,CAAC;AACrC;AAEO,SAASS,gBAAgBA,CAC9BT,IAAU,EACVU,QAA6B,EAC7B;EACA,SAASC,YAAYA,CAACC,KAA8B,EAAsB;IACxE;IACA,MAAMC,SAAS,GAAIL,eAAe,CAACR,IAAI,CAAC,IACtCU,QAAyD;IAC3D,oBAAO,IAAAxC,WAAA,CAAAmC,GAAA,EAACQ,SAAS;MAAA,GAAKD;IAAK,CAAG,CAAC;EACjC;EACAD,YAAY,CAACG,WAAW,GAAGd,IAAI;EAC/B,OAAOW,YAAY;AACrB","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SegmentedControl = SegmentedControl;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _Icon = require("./Icon");
|
|
10
|
+
var _shared = require("./shared");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
// web/SegmentedControl.tsx
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A radio group of `<button>`s in a track, like the iOS segmented control.
|
|
17
|
+
* Like iOS, tapping the selected segment keeps it selected.
|
|
18
|
+
*/
|
|
19
|
+
function SegmentedControl(props) {
|
|
20
|
+
const {
|
|
21
|
+
segments,
|
|
22
|
+
selectedValue,
|
|
23
|
+
onSelect,
|
|
24
|
+
onDeselect,
|
|
25
|
+
disabled,
|
|
26
|
+
labelVisibility = 'auto',
|
|
27
|
+
selectedSegmentColor,
|
|
28
|
+
activeTintColor,
|
|
29
|
+
inactiveTintColor,
|
|
30
|
+
labelStyle,
|
|
31
|
+
maxFontSizeMultiplier,
|
|
32
|
+
badgeStyle,
|
|
33
|
+
ios,
|
|
34
|
+
android,
|
|
35
|
+
style,
|
|
36
|
+
...viewProps
|
|
37
|
+
} = props;
|
|
38
|
+
const primary = (0, _shared.usePrimaryColor)();
|
|
39
|
+
const selectedBackground = (0, _shared.cssColor)(selectedSegmentColor) ?? ios?.selectedSegmentTintColor ?? 'Canvas';
|
|
40
|
+
const activeColor = (0, _shared.cssColor)(activeTintColor) ?? 'CanvasText';
|
|
41
|
+
const inactiveColor = (0, _shared.cssColor)(inactiveTintColor) ?? 'CanvasText';
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
43
|
+
...viewProps,
|
|
44
|
+
role: "radiogroup",
|
|
45
|
+
style: [{
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
padding: 2,
|
|
48
|
+
borderRadius: 9,
|
|
49
|
+
backgroundColor: 'rgba(118, 118, 128, 0.12)'
|
|
50
|
+
}, style],
|
|
51
|
+
children: segments.map((segment, index) => {
|
|
52
|
+
const isSelected = segment.value === selectedValue;
|
|
53
|
+
const isDisabled = disabled || segment.disabled;
|
|
54
|
+
const hasIcon = (0, _shared.webIcon)(segment.icon) !== undefined;
|
|
55
|
+
// Web can show both, so `auto` behaves like `labeled`.
|
|
56
|
+
const showLabel = labelVisibility !== 'unlabeled' || !hasIcon;
|
|
57
|
+
const foreground = isSelected ? activeColor : inactiveColor;
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
59
|
+
"data-testid": segment.testID,
|
|
60
|
+
type: "button",
|
|
61
|
+
role: "radio",
|
|
62
|
+
"aria-checked": isSelected,
|
|
63
|
+
"aria-label": segment.accessibilityLabel ?? segment.label,
|
|
64
|
+
disabled: isDisabled,
|
|
65
|
+
onClick: () => {
|
|
66
|
+
if (!isSelected) onSelect?.(segment.value, index);
|
|
67
|
+
},
|
|
68
|
+
style: {
|
|
69
|
+
position: 'relative',
|
|
70
|
+
flex: 1,
|
|
71
|
+
display: 'flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
gap: 6,
|
|
75
|
+
minHeight: 28,
|
|
76
|
+
padding: '0 12px',
|
|
77
|
+
border: 'none',
|
|
78
|
+
borderRadius: 7,
|
|
79
|
+
fontFamily: 'inherit',
|
|
80
|
+
fontSize: 13,
|
|
81
|
+
fontWeight: isSelected ? 600 : 400,
|
|
82
|
+
color: foreground,
|
|
83
|
+
backgroundColor: isSelected ? selectedBackground : 'transparent',
|
|
84
|
+
boxShadow: isSelected ? '0 1px 3px rgba(0, 0, 0, 0.15)' : 'none',
|
|
85
|
+
outlineColor: primary,
|
|
86
|
+
opacity: isDisabled ? 0.38 : 1,
|
|
87
|
+
cursor: isDisabled || isSelected ? 'default' : 'pointer',
|
|
88
|
+
...(0, _shared.cssFont)(labelStyle)
|
|
89
|
+
},
|
|
90
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
91
|
+
icon: segment.icon,
|
|
92
|
+
color: foreground,
|
|
93
|
+
size: 16
|
|
94
|
+
}), showLabel ? segment.label : null, segment.badge !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
95
|
+
style: {
|
|
96
|
+
position: 'absolute',
|
|
97
|
+
top: -4,
|
|
98
|
+
right: -2,
|
|
99
|
+
minWidth: 16,
|
|
100
|
+
height: 16,
|
|
101
|
+
padding: '0 4px',
|
|
102
|
+
boxSizing: 'border-box',
|
|
103
|
+
borderRadius: 8,
|
|
104
|
+
fontSize: 11,
|
|
105
|
+
lineHeight: '16px',
|
|
106
|
+
fontWeight: 600,
|
|
107
|
+
textAlign: 'center',
|
|
108
|
+
backgroundColor: (0, _shared.cssColor)(badgeStyle?.backgroundColor) ?? '#FF3B30',
|
|
109
|
+
color: (0, _shared.cssColor)(badgeStyle?.color) ?? '#fff'
|
|
110
|
+
},
|
|
111
|
+
children: segment.badge
|
|
112
|
+
}) : null]
|
|
113
|
+
}, segment.value);
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Icon","_shared","_jsxRuntime","e","__esModule","default","SegmentedControl","props","segments","selectedValue","onSelect","onDeselect","disabled","labelVisibility","selectedSegmentColor","activeTintColor","inactiveTintColor","labelStyle","maxFontSizeMultiplier","badgeStyle","ios","android","style","viewProps","primary","usePrimaryColor","selectedBackground","cssColor","selectedSegmentTintColor","activeColor","inactiveColor","jsx","View","role","flexDirection","padding","borderRadius","backgroundColor","children","map","segment","index","isSelected","value","isDisabled","hasIcon","webIcon","icon","undefined","showLabel","foreground","jsxs","testID","type","accessibilityLabel","label","onClick","position","flex","display","alignItems","justifyContent","gap","minHeight","border","fontFamily","fontSize","fontWeight","color","boxShadow","outlineColor","opacity","cursor","cssFont","Icon","size","badge","top","right","minWidth","height","boxSizing","lineHeight","textAlign"],"sourceRoot":"../../../src","sources":["web/SegmentedControl.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAuE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AANvE;;AAQA;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAC9BC,KAA4B,EACR;EACpB,MAAM;IACJC,QAAQ;IACRC,aAAa;IACbC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,eAAe,GAAG,MAAM;IACxBC,oBAAoB;IACpBC,eAAe;IACfC,iBAAiB;IACjBC,UAAU;IACVC,qBAAqB;IACrBC,UAAU;IACVC,GAAG;IACHC,OAAO;IACPC,K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B,GAAG,EAAE,CAAC,CAAC;YACPC,KAAK,EAAE,CAAC,CAAC;YACTC,QAAQ,EAAE,EAAE;YACZC,MAAM,EAAE,EAAE;YACV7C,OAAO,EAAE,OAAO;YAChB8C,SAAS,EAAE,YAAY;YACvB7C,YAAY,EAAE,CAAC;YACf8B,QAAQ,EAAE,EAAE;YACZgB,UAAU,EAAE,MAAM;YAClBf,UAAU,EAAE,GAAG;YACfgB,SAAS,EAAE,QAAQ;YACnB9C,eAAe,EACb,IAAAV,gBAAQ,EAACR,UAAU,EAAEkB,eAAe,CAAC,IAAI,SAAS;YACpD+B,KAAK,EAAE,IAAAzC,gBAAQ,EAACR,UAAU,EAAEiD,KAAK,CAAC,IAAI;UACxC,CAAE;UAAA9B,QAAA,EAEDE,OAAO,CAACoC;QAAK,CACV,CAAC,GACL,IAAI;MAAA,GAzDHpC,OAAO,CAACG,KA0DP,CAAC;IAEb,CAAC;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectionMenu = SelectionMenu;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _Dialog = require("./Dialog");
|
|
10
|
+
var _Icon = require("./Icon");
|
|
11
|
+
var _shared = require("./shared");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
// web/SelectionMenu.tsx
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* `embedded` renders a `<select>` (labels only). `modal` stays headless like on
|
|
18
|
+
* native: while `visible`, it opens the options in a `<dialog>`, with their
|
|
19
|
+
* image icons and subtitles; picking one calls `onSelect`, and Escape or a
|
|
20
|
+
* click outside calls `onRequestClose`. `android.searchable` is ignored.
|
|
21
|
+
*/
|
|
22
|
+
function SelectionMenu(props) {
|
|
23
|
+
const {
|
|
24
|
+
options,
|
|
25
|
+
selected,
|
|
26
|
+
disabled,
|
|
27
|
+
placeholder,
|
|
28
|
+
accessibilityLabel,
|
|
29
|
+
presentation = 'modal',
|
|
30
|
+
visible,
|
|
31
|
+
onSelect,
|
|
32
|
+
onRequestClose,
|
|
33
|
+
ios,
|
|
34
|
+
android,
|
|
35
|
+
...viewProps
|
|
36
|
+
} = props;
|
|
37
|
+
const primary = (0, _shared.usePrimaryColor)();
|
|
38
|
+
const label = accessibilityLabel ?? placeholder ?? 'Select an option';
|
|
39
|
+
const select = index => {
|
|
40
|
+
const option = options[index];
|
|
41
|
+
if (option && !disabled && !option.disabled) onSelect?.(option.data, option.label, index);
|
|
42
|
+
};
|
|
43
|
+
if (presentation === 'embedded') {
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
45
|
+
...viewProps,
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
47
|
+
"aria-label": label,
|
|
48
|
+
value: selected ?? '',
|
|
49
|
+
disabled: disabled,
|
|
50
|
+
onChange: event => {
|
|
51
|
+
const data = (0, _shared.eventValue)(event);
|
|
52
|
+
select(options.findIndex(o => o.data === data));
|
|
53
|
+
},
|
|
54
|
+
style: {
|
|
55
|
+
boxSizing: 'border-box',
|
|
56
|
+
width: '100%',
|
|
57
|
+
minHeight: 40,
|
|
58
|
+
padding: '0 8px',
|
|
59
|
+
border: '1px solid color-mix(in srgb, CanvasText 30%, transparent)',
|
|
60
|
+
borderRadius: 8,
|
|
61
|
+
fontFamily: 'inherit',
|
|
62
|
+
fontSize: 16,
|
|
63
|
+
color: 'inherit',
|
|
64
|
+
backgroundColor: 'transparent',
|
|
65
|
+
accentColor: primary
|
|
66
|
+
},
|
|
67
|
+
children: [selected === null ? /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
68
|
+
value: "",
|
|
69
|
+
disabled: true,
|
|
70
|
+
children: placeholder ?? ''
|
|
71
|
+
}) : null, options.map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
72
|
+
value: option.data,
|
|
73
|
+
disabled: option.disabled,
|
|
74
|
+
children: option.label
|
|
75
|
+
}, option.data))]
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const dismiss = () => onRequestClose?.();
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
81
|
+
...viewProps,
|
|
82
|
+
children: visible && !disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.Dialog, {
|
|
83
|
+
label: label,
|
|
84
|
+
onDismiss: dismiss,
|
|
85
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
86
|
+
role: "listbox",
|
|
87
|
+
"aria-label": label,
|
|
88
|
+
style: {
|
|
89
|
+
display: 'flex',
|
|
90
|
+
flexDirection: 'column',
|
|
91
|
+
minWidth: 200
|
|
92
|
+
},
|
|
93
|
+
children: options.map((option, index) => {
|
|
94
|
+
const isSelected = option.data === selected;
|
|
95
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
96
|
+
type: "button",
|
|
97
|
+
role: "option",
|
|
98
|
+
"aria-selected": isSelected,
|
|
99
|
+
disabled: option.disabled,
|
|
100
|
+
autoFocus: !option.disabled && (isSelected || selected === null && index === options.findIndex(item => !item.disabled)),
|
|
101
|
+
onClick: () => select(index),
|
|
102
|
+
style: {
|
|
103
|
+
display: 'flex',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
gap: 12,
|
|
106
|
+
minHeight: 44,
|
|
107
|
+
padding: '0 12px',
|
|
108
|
+
border: 'none',
|
|
109
|
+
borderRadius: 8,
|
|
110
|
+
fontFamily: 'inherit',
|
|
111
|
+
fontSize: 16,
|
|
112
|
+
fontWeight: isSelected ? 600 : 400,
|
|
113
|
+
textAlign: 'start',
|
|
114
|
+
color: isSelected ? primary : 'inherit',
|
|
115
|
+
backgroundColor: 'transparent',
|
|
116
|
+
cursor: 'pointer'
|
|
117
|
+
},
|
|
118
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
119
|
+
icon: option.icon,
|
|
120
|
+
color: isSelected ? primary : 'CanvasText'
|
|
121
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
122
|
+
style: {
|
|
123
|
+
display: 'flex',
|
|
124
|
+
flexDirection: 'column'
|
|
125
|
+
},
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
127
|
+
children: option.label
|
|
128
|
+
}), option.subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
129
|
+
style: {
|
|
130
|
+
fontSize: 13,
|
|
131
|
+
opacity: 0.7
|
|
132
|
+
},
|
|
133
|
+
children: option.subtitle
|
|
134
|
+
}) : null]
|
|
135
|
+
})]
|
|
136
|
+
}, option.data);
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
}) : null
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=SelectionMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Dialog","_Icon","_shared","_jsxRuntime","e","__esModule","default","SelectionMenu","props","options","selected","disabled","placeholder","accessibilityLabel","presentation","visible","onSelect","onRequestClose","ios","android","viewProps","primary","usePrimaryColor","label","select","index","option","data","jsx","View","children","jsxs","value","onChange","event","eventValue","findIndex","o","style","boxSizing","width","minHeight","padding","border","borderRadius","fontFamily","fontSize","color","backgroundColor","accentColor","map","dismiss","Dialog","onDismiss","role","display","flexDirection","minWidth","isSelected","type","autoFocus","item","onClick","alignItems","gap","fontWeight","textAlign","cursor","Icon","icon","subtitle","opacity"],"sourceRoot":"../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AAM,EAAE;YACV,CAAE;YAAArC,QAAA,gBAEF,IAAA3B,WAAA,CAAAyB,GAAA,EAAC3B,KAAA,CAAAmE,IAAI;cACHC,IAAI,EAAE3C,MAAM,CAAC2C,IAAK;cAClBtB,KAAK,EAAEW,UAAU,GAAGrC,OAAO,GAAG;YAAa,CAC5C,CAAC,eACF,IAAAlB,WAAA,CAAA4B,IAAA;cAAMO,KAAK,EAAE;gBAAEiB,OAAO,EAAE,MAAM;gBAAEC,aAAa,EAAE;cAAS,CAAE;cAAA1B,QAAA,gBACxD,IAAA3B,WAAA,CAAAyB,GAAA;gBAAAE,QAAA,EAAOJ,MAAM,CAACH;cAAK,CAAO,CAAC,EAC1BG,MAAM,CAAC4C,QAAQ,gBACd,IAAAnE,WAAA,CAAAyB,GAAA;gBAAMU,KAAK,EAAE;kBAAEQ,QAAQ,EAAE,EAAE;kBAAEyB,OAAO,EAAE;gBAAI,CAAE;gBAAAzC,QAAA,EACzCJ,MAAM,CAAC4C;cAAQ,CACZ,CAAC,GACL,IAAI;YAAA,CACJ,CAAC;UAAA,GAxCF5C,MAAM,CAACC,IAyCN,CAAC;QAEb,CAAC;MAAC,CACC;IAAC,CACA,CAAC,GACP;EAAI,CACJ,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SplitButton = SplitButton;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Button = require("./Button");
|
|
9
|
+
var _shared = require("./shared");
|
|
10
|
+
var _PlatformComponentsProvider = require("./PlatformComponentsProvider");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
// web/SplitButton.tsx
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The main button alone: browsers have no native menu to attach, so the
|
|
17
|
+
* menu button is left out. Provide a web menu with a `.web.tsx` file in your
|
|
18
|
+
* app.
|
|
19
|
+
*/
|
|
20
|
+
function SplitButton(props) {
|
|
21
|
+
const MainButton = (0, _PlatformComponentsProvider.useWebComponent)('Button') ?? _Button.Button;
|
|
22
|
+
const {
|
|
23
|
+
menu,
|
|
24
|
+
menuAccessibilityLabel,
|
|
25
|
+
onMenuSelect,
|
|
26
|
+
onMenuOpen,
|
|
27
|
+
onMenuClose,
|
|
28
|
+
...buttonProps
|
|
29
|
+
} = props;
|
|
30
|
+
(0, _shared.warnOnce)('SplitButton', 'SplitButton has no web menu; only its main button renders. ' + 'See https://jarx-concepts.github.io/react-native-platform-components/guides/web');
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MainButton, {
|
|
32
|
+
...buttonProps
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=SplitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_Button","_shared","_PlatformComponentsProvider","_jsxRuntime","e","__esModule","default","SplitButton","props","MainButton","useWebComponent","Button","menu","menuAccessibilityLabel","onMenuSelect","onMenuOpen","onMenuClose","buttonProps","warnOnce","jsx"],"sourceRoot":"../../../src","sources":["web/SplitButton.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAA+D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAN/D;;AAQA;AACA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACC,KAAuB,EAAsB;EACvE,MAAMC,UAAU,GAAG,IAAAC,2CAAe,EAAC,QAAQ,CAAC,IAAIC,cAAM;EACtD,MAAM;IACJC,IAAI;IACJC,sBAAsB;IACtBC,YAAY;IACZC,UAAU;IACVC,WAAW;IACX,GAAGC;EACL,CAAC,GAAGT,KAAK;EAET,IAAAU,gBAAQ,EACN,aAAa,EACb,6DAA6D,GAC3D,iFACJ,CAAC;EAED,oBAAO,IAAAf,WAAA,CAAAgB,GAAA,EAACV,UAAU;IAAA,GAAKQ;EAAW,CAAG,CAAC;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TabBar = TabBar;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _Icon = require("./Icon");
|
|
10
|
+
var _shared = require("./shared");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
// web/TabBar.tsx
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A `tablist` of `<button>` tabs, icon over label, with the selected tab's
|
|
17
|
+
* icon in a pill as on the Material navigation bar. An `accessory` is a
|
|
18
|
+
* plain view above the bar.
|
|
19
|
+
*/
|
|
20
|
+
function TabBar(props) {
|
|
21
|
+
const {
|
|
22
|
+
items,
|
|
23
|
+
selectedValue,
|
|
24
|
+
onSelect,
|
|
25
|
+
onReselect,
|
|
26
|
+
labelVisibility = 'auto',
|
|
27
|
+
activeTintColor,
|
|
28
|
+
inactiveTintColor,
|
|
29
|
+
barColor,
|
|
30
|
+
badgeStyle,
|
|
31
|
+
labelStyle,
|
|
32
|
+
maxFontSizeMultiplier,
|
|
33
|
+
minimizeBehavior,
|
|
34
|
+
scrollViewNativeID,
|
|
35
|
+
accessory,
|
|
36
|
+
onAccessoryEnvironmentChange,
|
|
37
|
+
android,
|
|
38
|
+
style,
|
|
39
|
+
...viewProps
|
|
40
|
+
} = props;
|
|
41
|
+
const primary = (0, _shared.usePrimaryColor)();
|
|
42
|
+
const activeColor = (0, _shared.cssColor)(activeTintColor) ?? primary;
|
|
43
|
+
const inactiveColor = (0, _shared.cssColor)(inactiveTintColor) ?? 'GrayText';
|
|
44
|
+
const horizontal = android?.itemLayout === 'horizontal';
|
|
45
|
+
const indicatorRadius = typeof android?.indicatorShape === 'number' ? android.indicatorShape : 16;
|
|
46
|
+
const hasAccessory = accessory !== undefined && accessory !== null && accessory !== false;
|
|
47
|
+
const bar = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
48
|
+
...viewProps,
|
|
49
|
+
role: "tablist",
|
|
50
|
+
style: [{
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
backgroundColor: (0, _shared.cssColor)(barColor) ?? 'rgba(118, 118, 128, 0.08)'
|
|
53
|
+
}, hasAccessory ? null : style],
|
|
54
|
+
children: items.slice(0, 5).map((item, index) => {
|
|
55
|
+
const isSelected = item.value === selectedValue;
|
|
56
|
+
const color = isSelected ? activeColor : inactiveColor;
|
|
57
|
+
const showLabel = labelVisibility === 'labeled' || labelVisibility === 'auto' || labelVisibility === 'selected' && isSelected;
|
|
58
|
+
const icon = isSelected ? item.selectedIcon ?? item.icon : item.icon;
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
60
|
+
"data-testid": item.testID,
|
|
61
|
+
type: "button",
|
|
62
|
+
role: "tab",
|
|
63
|
+
"aria-selected": isSelected,
|
|
64
|
+
"aria-label": item.accessibilityLabel ?? item.label,
|
|
65
|
+
disabled: item.disabled,
|
|
66
|
+
onClick: () => {
|
|
67
|
+
if (isSelected) onReselect?.(item.value, index);else onSelect?.(item.value, index);
|
|
68
|
+
},
|
|
69
|
+
style: {
|
|
70
|
+
flex: 1,
|
|
71
|
+
display: 'flex',
|
|
72
|
+
flexDirection: horizontal ? 'row' : 'column',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
gap: 4,
|
|
76
|
+
padding: '10px 4px',
|
|
77
|
+
border: 'none',
|
|
78
|
+
fontFamily: 'inherit',
|
|
79
|
+
fontSize: 12,
|
|
80
|
+
fontWeight: isSelected ? 600 : 500,
|
|
81
|
+
color,
|
|
82
|
+
backgroundColor: 'transparent',
|
|
83
|
+
outlineColor: primary,
|
|
84
|
+
opacity: item.disabled ? 0.38 : 1,
|
|
85
|
+
cursor: item.disabled ? 'default' : 'pointer',
|
|
86
|
+
...(0, _shared.cssFont)(labelStyle)
|
|
87
|
+
},
|
|
88
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
89
|
+
style: {
|
|
90
|
+
position: 'relative',
|
|
91
|
+
display: 'flex',
|
|
92
|
+
padding: '4px 20px',
|
|
93
|
+
borderRadius: indicatorRadius,
|
|
94
|
+
backgroundColor: isSelected && android?.indicator !== false ? (0, _shared.cssColor)(android?.indicatorColor) ?? 'rgba(118, 118, 128, 0.16)' : 'transparent'
|
|
95
|
+
},
|
|
96
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
97
|
+
icon: icon,
|
|
98
|
+
color: color,
|
|
99
|
+
size: 24
|
|
100
|
+
}), item.badge !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
101
|
+
style: {
|
|
102
|
+
position: 'absolute',
|
|
103
|
+
top: 0,
|
|
104
|
+
right: 12,
|
|
105
|
+
minWidth: item.badge === '' ? 8 : 16,
|
|
106
|
+
height: item.badge === '' ? 8 : 16,
|
|
107
|
+
padding: item.badge === '' ? 0 : '0 4px',
|
|
108
|
+
boxSizing: 'border-box',
|
|
109
|
+
borderRadius: 8,
|
|
110
|
+
fontSize: 11,
|
|
111
|
+
lineHeight: '16px',
|
|
112
|
+
fontWeight: 600,
|
|
113
|
+
textAlign: 'center',
|
|
114
|
+
backgroundColor: (0, _shared.cssColor)(badgeStyle?.backgroundColor) ?? '#FF3B30',
|
|
115
|
+
color: (0, _shared.cssColor)(badgeStyle?.color) ?? '#fff'
|
|
116
|
+
},
|
|
117
|
+
children: item.badge
|
|
118
|
+
}) : null]
|
|
119
|
+
}), showLabel ? item.label : null]
|
|
120
|
+
}, item.value);
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
if (!hasAccessory) return bar;
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
125
|
+
style: style,
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
127
|
+
children: accessory
|
|
128
|
+
}), bar]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=TabBar.js.map
|