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 @@
|
|
|
1
|
+
{"version":3,"names":["inputTypeForMode","mode","pad","n","width","String","padStart","formatInputValue","date","type","Number","isFinite","getTime","month","getFullYear","getMonth","day","getDate","time","getHours","getMinutes","parseInputValue","value","base","hasBase","result","Date","setHours","monthMatch","exec","year","setFullYear","dayMatch","timeMatch","test","hours","minutes","seconds","inputValueNumber","setSeconds","isWithinInputBounds","minDate","maxDate","min","NaN","max"],"sourceRoot":"../../../src","sources":["web/dateInput.ts"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;;AAGA;;AAGA;AACO,SAASA,gBAAgBA,CAC9BC,IAAgC,EACjB;EACf,QAAQA,IAAI;IACV,KAAK,MAAM;IACX,KAAK,gBAAgB;MACnB,OAAO,MAAM;IACf,KAAK,aAAa;MAChB,OAAO,gBAAgB;IACzB,KAAK,cAAc;MACjB,OAAO,OAAO;IAChB;MACE,OAAO,MAAM;EACjB;AACF;AAEA,MAAMC,GAAG,GAAGA,CAACC,CAAS,EAAEC,KAAK,GAAG,CAAC,KAAKC,MAAM,CAACF,CAAC,CAAC,CAACG,QAAQ,CAACF,KAAK,EAAE,GAAG,CAAC;;AAEpE;AACO,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@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BUTTON_SIZES = exports.BUTTON_BASE = void 0;
|
|
7
|
+
exports.buttonColors = buttonColors;
|
|
8
|
+
exports.cssColor = cssColor;
|
|
9
|
+
exports.cssFont = cssFont;
|
|
10
|
+
exports.eventValue = eventValue;
|
|
11
|
+
exports.resetWarnings = resetWarnings;
|
|
12
|
+
exports.setThemePrimary = setThemePrimary;
|
|
13
|
+
exports.usePrimaryColor = usePrimaryColor;
|
|
14
|
+
exports.warnOnce = warnOnce;
|
|
15
|
+
exports.webIcon = webIcon;
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
// web/shared.ts
|
|
18
|
+
//
|
|
19
|
+
// Helpers shared by the web implementations. The web entry point renders
|
|
20
|
+
// through react-native-web: `style` and the rest of the view props go on a
|
|
21
|
+
// `View`, and the browser's own controls (`<button>`, `<input>`, `<select>`,
|
|
22
|
+
// `<dialog>`) are rendered inside it.
|
|
23
|
+
|
|
24
|
+
/** A CSS style object for a DOM element. */
|
|
25
|
+
|
|
26
|
+
/** The Material 3 baseline primary color, used until a theme is set. */
|
|
27
|
+
const DEFAULT_PRIMARY = '#6750A4';
|
|
28
|
+
let themePrimary;
|
|
29
|
+
const themeListeners = new Set();
|
|
30
|
+
|
|
31
|
+
/** Sets the brand color the web components use; `undefined` restores the default. */
|
|
32
|
+
function setThemePrimary(primary) {
|
|
33
|
+
if (primary === themePrimary) return;
|
|
34
|
+
themePrimary = primary;
|
|
35
|
+
themeListeners.forEach(listener => listener());
|
|
36
|
+
}
|
|
37
|
+
function subscribeTheme(listener) {
|
|
38
|
+
themeListeners.add(listener);
|
|
39
|
+
return () => {
|
|
40
|
+
themeListeners.delete(listener);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function getThemePrimary() {
|
|
44
|
+
return themePrimary ?? DEFAULT_PRIMARY;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The current brand color, from `setNativeTheme` / `useNativeTheme`. */
|
|
48
|
+
function usePrimaryColor() {
|
|
49
|
+
return (0, _react.useSyncExternalStore)(subscribeTheme, getThemePrimary, getThemePrimary);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A color prop as CSS. `PlatformColor` and `DynamicColorIOS` have no web
|
|
54
|
+
* equivalent and fall back to the default.
|
|
55
|
+
*/
|
|
56
|
+
function cssColor(color) {
|
|
57
|
+
return typeof color === 'string' ? color : undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A label font as CSS. */
|
|
61
|
+
function cssFont(labelStyle) {
|
|
62
|
+
if (!labelStyle) return {};
|
|
63
|
+
return {
|
|
64
|
+
fontFamily: labelStyle.fontFamily,
|
|
65
|
+
fontSize: labelStyle.fontSize,
|
|
66
|
+
fontWeight: labelStyle.fontWeight,
|
|
67
|
+
fontStyle: labelStyle.fontStyle
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The image to draw for an icon on web. Only `{ type: 'image' }` sources
|
|
73
|
+
* render: SF Symbols and Android drawables don't exist in a browser.
|
|
74
|
+
*/
|
|
75
|
+
function webIcon(icon) {
|
|
76
|
+
if (icon === undefined || typeof icon === 'string') return undefined;
|
|
77
|
+
const candidates = 'type' in icon ? [icon] : [icon.ios, icon.android];
|
|
78
|
+
for (const source of candidates) {
|
|
79
|
+
if (source && typeof source !== 'string' && source.type === 'image') {
|
|
80
|
+
return {
|
|
81
|
+
source: source.source,
|
|
82
|
+
tinted: source.tinted !== false
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
const warned = new Set();
|
|
89
|
+
function isDev() {
|
|
90
|
+
if (typeof __DEV__ !== 'undefined') return __DEV__;
|
|
91
|
+
return typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Logs a development warning once per key. */
|
|
95
|
+
function warnOnce(key, message) {
|
|
96
|
+
if (warned.has(key) || !isDev()) return;
|
|
97
|
+
warned.add(key);
|
|
98
|
+
console.warn(`react-native-platform-components: ${message}`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Resets `warnOnce`; for tests. */
|
|
102
|
+
function resetWarnings() {
|
|
103
|
+
warned.clear();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The value of the form control that fired a DOM event. */
|
|
107
|
+
function eventValue(event) {
|
|
108
|
+
return event.target.value;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Styles for the variants shared by Button and ButtonGroup. */
|
|
112
|
+
function buttonColors(variant, primary, color, tintColor) {
|
|
113
|
+
switch (variant) {
|
|
114
|
+
// Glass is an iOS 26 material; browsers get the Android mapping.
|
|
115
|
+
case 'tonal':
|
|
116
|
+
case 'glass':
|
|
117
|
+
case 'clearGlass':
|
|
118
|
+
return {
|
|
119
|
+
backgroundColor: color ?? `color-mix(in srgb, ${primary} 18%, Canvas)`,
|
|
120
|
+
color: tintColor ?? 'CanvasText',
|
|
121
|
+
border: 'none'
|
|
122
|
+
};
|
|
123
|
+
case 'outlined':
|
|
124
|
+
return {
|
|
125
|
+
backgroundColor: color ?? 'transparent',
|
|
126
|
+
color: tintColor ?? primary,
|
|
127
|
+
border: '1px solid color-mix(in srgb, CanvasText 30%, transparent)'
|
|
128
|
+
};
|
|
129
|
+
case 'text':
|
|
130
|
+
return {
|
|
131
|
+
backgroundColor: color ?? 'transparent',
|
|
132
|
+
color: tintColor ?? primary,
|
|
133
|
+
border: 'none'
|
|
134
|
+
};
|
|
135
|
+
case 'elevated':
|
|
136
|
+
return {
|
|
137
|
+
backgroundColor: color ?? 'Canvas',
|
|
138
|
+
color: tintColor ?? primary,
|
|
139
|
+
border: 'none',
|
|
140
|
+
boxShadow: '0 1px 3px rgba(0, 0, 0, 0.3)'
|
|
141
|
+
};
|
|
142
|
+
default:
|
|
143
|
+
return {
|
|
144
|
+
backgroundColor: color ?? primary,
|
|
145
|
+
color: tintColor ?? '#fff',
|
|
146
|
+
border: 'none'
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Height and horizontal padding for each button size. */
|
|
152
|
+
const BUTTON_SIZES = exports.BUTTON_SIZES = {
|
|
153
|
+
xsmall: {
|
|
154
|
+
height: 32,
|
|
155
|
+
padding: 12,
|
|
156
|
+
fontSize: 14
|
|
157
|
+
},
|
|
158
|
+
small: {
|
|
159
|
+
height: 40,
|
|
160
|
+
padding: 16,
|
|
161
|
+
fontSize: 14
|
|
162
|
+
},
|
|
163
|
+
medium: {
|
|
164
|
+
height: 56,
|
|
165
|
+
padding: 24,
|
|
166
|
+
fontSize: 16
|
|
167
|
+
},
|
|
168
|
+
large: {
|
|
169
|
+
height: 96,
|
|
170
|
+
padding: 48,
|
|
171
|
+
fontSize: 24
|
|
172
|
+
},
|
|
173
|
+
xlarge: {
|
|
174
|
+
height: 136,
|
|
175
|
+
padding: 64,
|
|
176
|
+
fontSize: 32
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** Base style of a `<button>` rendered by these components. */
|
|
181
|
+
const BUTTON_BASE = exports.BUTTON_BASE = {
|
|
182
|
+
display: 'inline-flex',
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
justifyContent: 'center',
|
|
185
|
+
gap: 8,
|
|
186
|
+
boxSizing: 'border-box',
|
|
187
|
+
fontFamily: 'inherit',
|
|
188
|
+
fontWeight: 500,
|
|
189
|
+
cursor: 'pointer',
|
|
190
|
+
whiteSpace: 'nowrap'
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","DEFAULT_PRIMARY","themePrimary","themeListeners","Set","setThemePrimary","primary","forEach","listener","subscribeTheme","add","delete","getThemePrimary","usePrimaryColor","useSyncExternalStore","cssColor","color","undefined","cssFont","labelStyle","fontFamily","fontSize","fontWeight","fontStyle","webIcon","icon","candidates","ios","android","source","type","tinted","warned","isDev","__DEV__","process","env","NODE_ENV","warnOnce","key","message","has","console","warn","resetWarnings","clear","eventValue","event","target","value","buttonColors","variant","tintColor","backgroundColor","border","boxShadow","BUTTON_SIZES","exports","xsmall","height","padding","small","medium","large","xlarge","BUTTON_BASE","display","alignItems","justifyContent","gap","boxSizing","cursor","whiteSpace"],"sourceRoot":"../../../src","sources":["web/shared.ts"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;AACA;;AAOA;;AAGA;AACA,MAAMC,eAAe,GAAG,SAAS;AAEjC,IAAIC,YAAgC;AACpC,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAa,CAAC;;AAE5C;AACO,SAASC,eAAeA,CAACC,OAA2B,EAAQ;EACjE,IAAIA,OAAO,KAAKJ,YAAY,EAAE;EAC9BA,YAAY,GAAGI,OAAO;EACtBH,cAAc,CAACI,OAAO,CAAEC,QAAQ,IAAKA,QAAQ,CAAC,CAAC,CAAC;AAClD;AAEA,SAASC,cAAcA,CAACD,QAAoB,EAAc;EACxDL,cAAc,CAACO,GAAG,CAACF,QAAQ,CAAC;EAC5B,OAAO,MAAM;IACXL,cAAc,CAACQ,MAAM,CAACH,QAAQ,CAAC;EACjC,CAAC;AACH;AAEA,SAASI,eAAeA,CAAA,EAAW;EACjC,OAAOV,YAAY,IAAID,eAAe;AACxC;;AAEA;AACO,SAASY,eAAeA,CAAA,EAAW;EACxC,OAAO,IAAAC,2BAAoB,EAACL,cAAc,EAAEG,eAAe,EAAEA,eAAe,CAAC;AAC/E;;AAEA;AACA;AACA;AACA;AACO,SAASG,QAAQA,CAACC,KAA6B,EAAsB;EAC1E,OAAO,OAAOA,KAAK,KAAK,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D,YAAA,GAAG;EACFE,MAAM,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE,EAAE;IAAEvC,QAAQ,EAAE;EAAG,CAAC;EACjDwC,KAAK,EAAE;IAAEF,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE,EAAE;IAAEvC,QAAQ,EAAE;EAAG,CAAC;EAChDyC,MAAM,EAAE;IAAEH,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE,EAAE;IAAEvC,QAAQ,EAAE;EAAG,CAAC;EACjD0C,KAAK,EAAE;IAAEJ,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE,EAAE;IAAEvC,QAAQ,EAAE;EAAG,CAAC;EAChD2C,MAAM,EAAE;IAAEL,MAAM,EAAE,GAAG;IAAEC,OAAO,EAAE,EAAE;IAAEvC,QAAQ,EAAE;EAAG;AACnD,CAAC;;AAED;AACO,MAAM4C,WAAqB,GAAAR,OAAA,CAAAQ,WAAA,GAAG;EACnCC,OAAO,EAAE,aAAa;EACtBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,GAAG,EAAE,CAAC;EACNC,SAAS,EAAE,YAAY;EACvBlD,UAAU,EAAE,SAAS;EACrBE,UAAU,EAAE,GAAG;EACfiD,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE;AACd,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["webComponents.ts"],"mappings":"","ignoreList":[]}
|
package/lib/module/Button.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
// Button.tsx
|
|
4
|
-
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
5
5
|
import NativeButton from './ButtonNativeComponent';
|
|
6
6
|
import { resolveIcon } from "./icons.js";
|
|
7
7
|
import { normalizeLabelStyle } from "./labelStyle.js";
|
|
8
|
+
import { flattenMenuActions } from "./menuItems.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Emphasis of the button, from highest to lowest.
|
|
@@ -16,6 +17,14 @@ import { normalizeLabelStyle } from "./labelStyle.js";
|
|
|
16
17
|
* | `outlined` | Outlined button | `.bordered()` |
|
|
17
18
|
* | `text` | Text button | `.plain()` |
|
|
18
19
|
* | `elevated` | Elevated button | `.gray()` |
|
|
20
|
+
* | `glass` | Filled tonal button | `.glass()` (iOS 26+), else `.gray()` |
|
|
21
|
+
* | `prominentGlass` | Filled button | `.prominentGlass()` (iOS 26+), else `.filled()` |
|
|
22
|
+
* | `clearGlass` | Filled tonal button | `.clearGlass()` (iOS 26+), else `.gray()` |
|
|
23
|
+
* | `prominentClearGlass` | Filled button | `.prominentClearGlass()` (iOS 26+), else `.filled()` |
|
|
24
|
+
*
|
|
25
|
+
* The glass variants are the iOS 26 Liquid Glass buttons; `color` tints
|
|
26
|
+
* the prominent glass and `tintColor` colors the label and icon. Clear glass
|
|
27
|
+
* is more transparent, for buttons over photos and other rich content.
|
|
19
28
|
*/
|
|
20
29
|
|
|
21
30
|
/**
|
|
@@ -27,43 +36,106 @@ import { normalizeLabelStyle } from "./labelStyle.js";
|
|
|
27
36
|
* Corner shape. `round` is a pill; `square` keeps rounded corners. Unset
|
|
28
37
|
* means the platform default (round on Android, dynamic on iOS).
|
|
29
38
|
*/
|
|
39
|
+
|
|
40
|
+
/** Where the icon sits relative to the label. */
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* An animated SF Symbol effect (iOS 17+). `wiggle`, `rotate` and `breathe`
|
|
44
|
+
* need iOS 18; on earlier versions they do nothing.
|
|
45
|
+
*/
|
|
30
46
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
47
|
export function Button(props) {
|
|
32
48
|
const {
|
|
33
49
|
label,
|
|
34
50
|
icon,
|
|
51
|
+
iconPosition,
|
|
35
52
|
variant,
|
|
36
53
|
size,
|
|
37
54
|
shape,
|
|
55
|
+
cornerRadius,
|
|
38
56
|
disabled,
|
|
57
|
+
loading,
|
|
39
58
|
color,
|
|
40
59
|
tintColor,
|
|
60
|
+
disabledColor,
|
|
61
|
+
disabledTintColor,
|
|
41
62
|
labelStyle,
|
|
63
|
+
maxFontSizeMultiplier,
|
|
42
64
|
accessibilityLabel,
|
|
65
|
+
haptics,
|
|
43
66
|
onPress,
|
|
67
|
+
selected,
|
|
68
|
+
onSelectedChange,
|
|
69
|
+
menu,
|
|
70
|
+
onMenuSelect,
|
|
71
|
+
onMenuOpen,
|
|
72
|
+
onMenuClose,
|
|
73
|
+
ios,
|
|
44
74
|
android,
|
|
75
|
+
accessibilityState,
|
|
45
76
|
...viewProps
|
|
46
77
|
} = props;
|
|
47
78
|
const nativeIcon = useMemo(() => resolveIcon(icon), [icon]);
|
|
48
79
|
const nativeLabelStyle = useMemo(() => normalizeLabelStyle(labelStyle), [labelStyle]);
|
|
80
|
+
const nativeMenu = useMemo(() => menu ? flattenMenuActions(menu) : [], [menu]);
|
|
49
81
|
const handlePress = useCallback(() => {
|
|
82
|
+
if (loading) return;
|
|
50
83
|
onPress?.();
|
|
51
|
-
}, [onPress]);
|
|
84
|
+
}, [onPress, loading]);
|
|
85
|
+
|
|
86
|
+
// Controlled toggle, like React Native's Switch: every press re-renders
|
|
87
|
+
// with a new event count, so native applies `selected` again and a state
|
|
88
|
+
// the parent didn't take goes back.
|
|
89
|
+
const [selectedEventCount, setSelectedEventCount] = useState(0);
|
|
90
|
+
const handleSelectedChange = useCallback(e => {
|
|
91
|
+
setSelectedEventCount(count => count + 1);
|
|
92
|
+
onSelectedChange?.(e.nativeEvent.selected);
|
|
93
|
+
}, [onSelectedChange]);
|
|
94
|
+
const handleMenuSelect = useCallback(e => {
|
|
95
|
+
onMenuSelect?.(e.nativeEvent.id, e.nativeEvent.title);
|
|
96
|
+
}, [onMenuSelect]);
|
|
97
|
+
const handleMenuOpen = useCallback(() => onMenuOpen?.(), [onMenuOpen]);
|
|
98
|
+
const handleMenuClose = useCallback(() => onMenuClose?.(), [onMenuClose]);
|
|
99
|
+
const nativeIOS = useMemo(() => ({
|
|
100
|
+
symbolEffect: ios?.symbolEffect ?? '',
|
|
101
|
+
symbolEffectTrigger: ios?.symbolEffectTrigger === undefined ? '' : String(ios.symbolEffectTrigger)
|
|
102
|
+
}), [ios?.symbolEffect, ios?.symbolEffectTrigger]);
|
|
103
|
+
const isToggle = selected !== undefined;
|
|
104
|
+
const mergedAccessibilityState = useMemo(() => loading ? {
|
|
105
|
+
...accessibilityState,
|
|
106
|
+
busy: true
|
|
107
|
+
} : accessibilityState, [loading, accessibilityState]);
|
|
52
108
|
return /*#__PURE__*/_jsx(NativeButton, {
|
|
53
109
|
label: label ?? '',
|
|
54
110
|
icon: nativeIcon,
|
|
111
|
+
iconPosition: iconPosition ?? 'leading',
|
|
55
112
|
variant: variant ?? 'filled',
|
|
56
113
|
size: size ?? 'small',
|
|
57
114
|
shape: shape ?? '',
|
|
115
|
+
cornerRadius: cornerRadius ?? -1,
|
|
58
116
|
interactivity: disabled ? 'disabled' : 'enabled',
|
|
117
|
+
loading: loading ? 'true' : 'false',
|
|
59
118
|
color: color,
|
|
60
119
|
foregroundColor: tintColor,
|
|
120
|
+
disabledColor: disabledColor,
|
|
121
|
+
disabledForegroundColor: disabledTintColor,
|
|
61
122
|
androidRippleColor: android?.rippleColor,
|
|
62
123
|
androidStrokeColor: android?.strokeColor,
|
|
63
124
|
androidMaterial: android?.material ?? 'expressive',
|
|
64
125
|
labelStyle: nativeLabelStyle,
|
|
126
|
+
maxFontSizeMultiplier: maxFontSizeMultiplier ?? 0,
|
|
65
127
|
spokenLabel: accessibilityLabel ?? '',
|
|
128
|
+
selected: isToggle ? selected ? 'true' : 'false' : '',
|
|
129
|
+
selectedEventCount: selectedEventCount,
|
|
130
|
+
menu: nativeMenu,
|
|
131
|
+
ios: nativeIOS,
|
|
132
|
+
haptics: haptics ?? '',
|
|
66
133
|
onButtonPress: onPress ? handlePress : undefined,
|
|
134
|
+
onSelectedChange: isToggle ? handleSelectedChange : undefined,
|
|
135
|
+
onMenuSelect: onMenuSelect ? handleMenuSelect : undefined,
|
|
136
|
+
onMenuOpen: onMenuOpen ? handleMenuOpen : undefined,
|
|
137
|
+
onMenuClose: onMenuClose ? handleMenuClose : undefined,
|
|
138
|
+
accessibilityState: mergedAccessibilityState,
|
|
67
139
|
...viewProps
|
|
68
140
|
});
|
|
69
141
|
}
|
package/lib/module/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","NativeButton","resolveIcon","normalizeLabelStyle","jsx","_jsx","Button","props","label","icon","variant","size","shape","disabled","color","tintColor","labelStyle","accessibilityLabel","onPress","android","viewProps","nativeIcon","nativeLabelStyle","handlePress","interactivity","foregroundColor","androidRippleColor","rippleColor","androidStrokeColor","strokeColor","androidMaterial","material","spokenLabel","onButtonPress"
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useState","NativeButton","resolveIcon","normalizeLabelStyle","flattenMenuActions","jsx","_jsx","Button","props","label","icon","iconPosition","variant","size","shape","cornerRadius","disabled","loading","color","tintColor","disabledColor","disabledTintColor","labelStyle","maxFontSizeMultiplier","accessibilityLabel","haptics","onPress","selected","onSelectedChange","menu","onMenuSelect","onMenuOpen","onMenuClose","ios","android","accessibilityState","viewProps","nativeIcon","nativeLabelStyle","nativeMenu","handlePress","selectedEventCount","setSelectedEventCount","handleSelectedChange","e","count","nativeEvent","handleMenuSelect","id","title","handleMenuOpen","handleMenuClose","nativeIOS","symbolEffect","symbolEffectTrigger","undefined","String","isToggle","mergedAccessibilityState","busy","interactivity","foregroundColor","disabledForegroundColor","androidRippleColor","rippleColor","androidStrokeColor","strokeColor","androidMaterial","material","spokenLabel","onButtonPress"],"sourceRoot":"../../src","sources":["Button.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ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gBAAgB,GAAGQ,SAAU;IAC1DxB,UAAU,EAAEA,UAAU,GAAGmB,cAAc,GAAGK,SAAU;IACpDvB,WAAW,EAAEA,WAAW,GAAGmB,eAAe,GAAGI,SAAU;IACvDpB,kBAAkB,EAAEuB,wBAAyB;IAAA,GACzCtB;EAAS,CACd,CAAC;AAEN","ignoreList":[]}
|
|
@@ -14,7 +14,14 @@ import { normalizeLabelStyle } from "./labelStyle.js";
|
|
|
14
14
|
* - `multiple`: any number of buttons can be selected.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* What happens to buttons that don't fit the group's width.
|
|
19
|
+
*
|
|
20
|
+
* - `none` (default): they are clipped.
|
|
21
|
+
* - `menu`: the trailing ones move into an overflow menu. Android: the
|
|
22
|
+
* `MaterialButtonGroup` overflow menu. iOS: a "…" button with a `UIMenu`.
|
|
23
|
+
* - `wrap`: they wrap onto more rows (Android only; iOS clips them).
|
|
24
|
+
*/
|
|
18
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
26
|
export function ButtonGroup(props) {
|
|
20
27
|
const {
|
|
@@ -31,6 +38,8 @@ export function ButtonGroup(props) {
|
|
|
31
38
|
color,
|
|
32
39
|
tintColor,
|
|
33
40
|
labelStyle,
|
|
41
|
+
overflow,
|
|
42
|
+
haptics,
|
|
34
43
|
onPress,
|
|
35
44
|
onSelectionChange,
|
|
36
45
|
android,
|
|
@@ -62,9 +71,8 @@ export function ButtonGroup(props) {
|
|
|
62
71
|
onSelectionChange?.([...e.nativeEvent.values]);
|
|
63
72
|
}, [onSelectionChange]);
|
|
64
73
|
const nativeAndroid = useMemo(() => ({
|
|
65
|
-
overflow: android?.overflow ?? 'none',
|
|
66
74
|
material: android?.material ?? 'expressive'
|
|
67
|
-
}), [android]);
|
|
75
|
+
}), [android?.material]);
|
|
68
76
|
const isConnected = connected ?? selectionMode !== 'none';
|
|
69
77
|
const isSelectionRequired = selectionRequired ?? (selectionMode === 'single' ? true : false);
|
|
70
78
|
return /*#__PURE__*/_jsx(NativeButtonGroup, {
|
|
@@ -83,6 +91,8 @@ export function ButtonGroup(props) {
|
|
|
83
91
|
androidRippleColor: android?.rippleColor,
|
|
84
92
|
androidStrokeColor: android?.strokeColor,
|
|
85
93
|
labelStyle: nativeLabelStyle,
|
|
94
|
+
overflow: overflow ?? android?.overflow ?? 'none',
|
|
95
|
+
haptics: haptics ?? '',
|
|
86
96
|
onButtonPress: onPress ? handlePress : undefined,
|
|
87
97
|
onGroupSelectionChange: onSelectionChange ? handleSelectionChange : undefined,
|
|
88
98
|
android: nativeAndroid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","NativeButtonGroup","resolveIcon","normalizeLabelStyle","jsx","_jsx","ButtonGroup","props","buttons","variant","size","shape","connected","spacing","selection","selectedValues","selectionRequired","disabled","color","tintColor","labelStyle","onPress","onSelectionChange","android","viewProps","selectionMode","nativeButtons","map","button","label","value","accessibilityLabel","icon","nativeSelectedValues","slice","nativeLabelStyle","handlePress","e","index","nativeEvent","handleSelectionChange","values","nativeAndroid","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","NativeButtonGroup","resolveIcon","normalizeLabelStyle","jsx","_jsx","ButtonGroup","props","buttons","variant","size","shape","connected","spacing","selection","selectedValues","selectionRequired","disabled","color","tintColor","labelStyle","overflow","haptics","onPress","onSelectionChange","android","viewProps","selectionMode","nativeButtons","map","button","label","value","accessibilityLabel","icon","nativeSelectedValues","slice","nativeLabelStyle","handlePress","e","index","nativeEvent","handleSelectionChange","values","nativeAndroid","material","isConnected","isSelectionRequired","interactivity","foregroundColor","androidRippleColor","rippleColor","androidStrokeColor","strokeColor","onButtonPress","undefined","onGroupSelectionChange"],"sourceRoot":"../../src","sources":["ButtonGroup.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAInD,OAAOC,iBAAiB,MAIj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AE+B,mBAAmB,GAAG,MAAM,GAAG,OAAQ;IAC1DC,aAAa,EAAE/B,QAAQ,GAAG,UAAU,GAAG,SAAU;IACjDC,KAAK,EAAEA,KAAM;IACb+B,eAAe,EAAE9B,SAAU;IAC3B+B,kBAAkB,EAAEzB,OAAO,EAAE0B,WAAY;IACzCC,kBAAkB,EAAE3B,OAAO,EAAE4B,WAAY;IACzCjC,UAAU,EAAEiB,gBAAiB;IAC7BhB,QAAQ,EAAEA,QAAQ,IAAII,OAAO,EAAEJ,QAAQ,IAAI,MAAO;IAClDC,OAAO,EAAEA,OAAO,IAAI,EAAG;IACvBgC,aAAa,EAAE/B,OAAO,GAAGe,WAAW,GAAGiB,SAAU;IACjDC,sBAAsB,EACpBhC,iBAAiB,GAAGkB,qBAAqB,GAAGa,SAC7C;IACD9B,OAAO,EAAEmB,aAAc;IAAA,GACnBlB;EAAS,CACd,CAAC;AAEN","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@ export type ButtonGroupButton = Readonly<{
|
|
|
13
13
|
disabled: string; // 'enabled' | 'disabled'
|
|
14
14
|
iconType: string; // '' | 'sfSymbol' | 'drawable' | 'image'
|
|
15
15
|
iconName: string; // SF Symbol (iOS) or drawable resource name (Android)
|
|
16
|
+
iconRequest: string;
|
|
16
17
|
iconUri: string; // Resolved image URI when iconType === 'image'
|
|
17
18
|
iconScale: Double; // Resolved image scale when iconType === 'image'
|
|
18
19
|
iconTinted: string; // 'true' | 'false' — draw the image as a tinted template
|
|
@@ -46,13 +47,46 @@ export type ButtonGroupLabelStyleProps = Readonly<{
|
|
|
46
47
|
fontStyle?: string; // 'normal' | 'italic'
|
|
47
48
|
}>;
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* One item of the split button's menu, the shape of `ContextMenuItem` (see
|
|
52
|
+
* menuItems.ts). Every field is set; empty strings mean "none" and flags are
|
|
53
|
+
* 'true' | 'false'.
|
|
54
|
+
*/
|
|
55
|
+
export type ButtonGroupMenuItem = Readonly<{
|
|
56
|
+
id: string;
|
|
57
|
+
title: string;
|
|
58
|
+
subtitle: string;
|
|
59
|
+
/** Index of the parent submenu or section; -1 at the top level */
|
|
60
|
+
parent: Int32;
|
|
61
|
+
/** 'action' | 'menu' | 'section' */
|
|
62
|
+
kind: string;
|
|
63
|
+
/** '' | 'sfSymbol' | 'drawable' | 'image' */
|
|
64
|
+
iconType: string;
|
|
65
|
+
iconName: string;
|
|
66
|
+
iconRequest: string;
|
|
67
|
+
iconUri: string;
|
|
68
|
+
iconScale: Double;
|
|
69
|
+
iconTinted: string;
|
|
70
|
+
imageColor: string;
|
|
71
|
+
destructive: string;
|
|
72
|
+
disabled: string;
|
|
73
|
+
keepsMenuPresented: string;
|
|
74
|
+
/** '' | 'off' | 'on' | 'mixed' */
|
|
75
|
+
state: string;
|
|
76
|
+
/** The action's own haptics; '' = the component's */
|
|
77
|
+
haptics: string;
|
|
78
|
+
}>;
|
|
79
|
+
|
|
80
|
+
/** Event emitted when a split button menu item is picked. */
|
|
81
|
+
export type ButtonGroupMenuSelectEvent = Readonly<{
|
|
82
|
+
id: string;
|
|
83
|
+
title: string;
|
|
84
|
+
}>;
|
|
85
|
+
|
|
49
86
|
/**
|
|
50
87
|
* Android-specific configuration.
|
|
51
88
|
*/
|
|
52
89
|
export type ButtonGroupAndroidProps = Readonly<{
|
|
53
|
-
/** What happens to buttons that don't fit: 'none' | 'menu' | 'wrap' */
|
|
54
|
-
overflow?: string;
|
|
55
|
-
|
|
56
90
|
/** Material style: 'm3' | 'expressive' */
|
|
57
91
|
material?: string;
|
|
58
92
|
}>;
|
|
@@ -61,7 +95,10 @@ export interface ButtonGroupNativeProps extends ViewProps {
|
|
|
61
95
|
/** Buttons to display. */
|
|
62
96
|
buttons: ReadonlyArray<ButtonGroupButton>;
|
|
63
97
|
|
|
64
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated' | 'glass' |
|
|
100
|
+
* 'prominentGlass' | 'clearGlass' | 'prominentClearGlass'
|
|
101
|
+
*/
|
|
65
102
|
variant?: string;
|
|
66
103
|
|
|
67
104
|
/** 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' */
|
|
@@ -103,6 +140,30 @@ export interface ButtonGroupNativeProps extends ViewProps {
|
|
|
103
140
|
/** Label font. */
|
|
104
141
|
labelStyle?: ButtonGroupLabelStyleProps;
|
|
105
142
|
|
|
143
|
+
/**
|
|
144
|
+
* What happens to buttons that don't fit: 'none' | 'menu' | 'wrap'
|
|
145
|
+
* ('wrap' is Android only)
|
|
146
|
+
*/
|
|
147
|
+
overflow?: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* 'true' | 'false': a split button, the first button joined to a trailing
|
|
151
|
+
* button that opens `menu` (SplitButton).
|
|
152
|
+
*/
|
|
153
|
+
split?: string;
|
|
154
|
+
|
|
155
|
+
/** The split button's menu, flattened (see ButtonGroupMenuItem). */
|
|
156
|
+
menu?: ReadonlyArray<ButtonGroupMenuItem>;
|
|
157
|
+
|
|
158
|
+
/** Screen-reader label of the split button's menu button. */
|
|
159
|
+
menuAccessibilityLabel?: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Haptic played when a button is pressed: '' (none added) | 'none' | 'selection' |
|
|
163
|
+
* 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error'
|
|
164
|
+
*/
|
|
165
|
+
haptics?: string;
|
|
166
|
+
|
|
106
167
|
/** Fired when a button is pressed. */
|
|
107
168
|
onButtonPress?: BubblingEventHandler<ButtonGroupPressEvent>;
|
|
108
169
|
|
|
@@ -113,6 +174,15 @@ export interface ButtonGroupNativeProps extends ViewProps {
|
|
|
113
174
|
*/
|
|
114
175
|
onGroupSelectionChange?: BubblingEventHandler<ButtonGroupSelectionEvent>;
|
|
115
176
|
|
|
177
|
+
/** Fired when a split button menu item is picked. */
|
|
178
|
+
onMenuSelect?: BubblingEventHandler<ButtonGroupMenuSelectEvent>;
|
|
179
|
+
|
|
180
|
+
/** Fired when the split button's menu opens. */
|
|
181
|
+
onMenuOpen?: BubblingEventHandler<Readonly<{}>>;
|
|
182
|
+
|
|
183
|
+
/** Fired when the split button's menu closes. */
|
|
184
|
+
onMenuClose?: BubblingEventHandler<Readonly<{}>>;
|
|
185
|
+
|
|
116
186
|
android?: ButtonGroupAndroidProps;
|
|
117
187
|
}
|
|
118
188
|
|