react-native-platform-components 0.8.10 → 1.0.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.
Files changed (67) hide show
  1. package/README.md +68 -891
  2. package/android/src/main/java/com/platformcomponents/PCDatePickerView.kt +17 -3
  3. package/android/src/main/java/com/platformcomponents/PCImageLoader.kt +88 -0
  4. package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +292 -31
  5. package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +74 -8
  6. package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +2 -1
  7. package/android/src/main/java/com/platformcomponents/PCThemeSupport.kt +94 -0
  8. package/android/src/main/res/values/styles.xml +40 -0
  9. package/ios/PCImageLoader.swift +58 -0
  10. package/ios/PCSegmentedControl.mm +85 -25
  11. package/ios/PCSegmentedControl.swift +231 -308
  12. package/lib/commonjs/DatePickerNativeComponent.ts +4 -2
  13. package/lib/commonjs/SegmentedControl.js +138 -6
  14. package/lib/commonjs/SegmentedControl.js.map +1 -1
  15. package/lib/commonjs/SegmentedControlNativeComponent.ts +62 -8
  16. package/lib/commonjs/SelectionMenuNativeComponent.ts +4 -2
  17. package/lib/commonjs/index.web.js.map +1 -1
  18. package/lib/module/DatePickerNativeComponent.ts +4 -2
  19. package/lib/module/SegmentedControl.js +138 -7
  20. package/lib/module/SegmentedControl.js.map +1 -1
  21. package/lib/module/SegmentedControlNativeComponent.ts +62 -8
  22. package/lib/module/SelectionMenuNativeComponent.ts +4 -2
  23. package/lib/module/index.web.js.map +1 -1
  24. package/lib/typescript/commonjs/docs/docusaurus.config.d.ts +4 -0
  25. package/lib/typescript/commonjs/docs/docusaurus.config.d.ts.map +1 -0
  26. package/lib/typescript/commonjs/docs/sidebars.d.ts +4 -0
  27. package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -0
  28. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +2 -2
  29. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/src/SegmentedControl.d.ts +111 -6
  31. package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +46 -7
  33. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +2 -2
  35. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/src/index.web.d.ts +36 -1
  37. package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
  38. package/lib/typescript/module/docs/docusaurus.config.d.ts +4 -0
  39. package/lib/typescript/module/docs/docusaurus.config.d.ts.map +1 -0
  40. package/lib/typescript/module/docs/sidebars.d.ts +4 -0
  41. package/lib/typescript/module/docs/sidebars.d.ts.map +1 -0
  42. package/lib/typescript/module/src/DatePicker.d.ts +1 -1
  43. package/lib/typescript/module/src/DatePicker.d.ts.map +1 -1
  44. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +2 -2
  45. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
  46. package/lib/typescript/module/src/SegmentedControl.d.ts +111 -6
  47. package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
  48. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +46 -7
  49. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  50. package/lib/typescript/module/src/SelectionMenu.d.ts +1 -1
  51. package/lib/typescript/module/src/SelectionMenu.d.ts.map +1 -1
  52. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +2 -2
  53. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  54. package/lib/typescript/module/src/index.d.ts +6 -6
  55. package/lib/typescript/module/src/index.d.ts.map +1 -1
  56. package/lib/typescript/module/src/index.web.d.ts +36 -1
  57. package/lib/typescript/module/src/index.web.d.ts.map +1 -1
  58. package/package.json +62 -37
  59. package/plugin/build/index.cjs +58 -17
  60. package/plugin/build/index.d.ts +32 -15
  61. package/plugin/build/index.d.ts.map +1 -1
  62. package/plugin/tsconfig.json +9 -4
  63. package/src/DatePickerNativeComponent.ts +4 -2
  64. package/src/SegmentedControl.tsx +238 -11
  65. package/src/SegmentedControlNativeComponent.ts +62 -8
  66. package/src/SelectionMenuNativeComponent.ts +4 -2
  67. package/src/index.web.tsx +34 -1
package/src/index.web.tsx CHANGED
@@ -111,18 +111,51 @@ export const ContextMenu = ({
111
111
  // SegmentedControl
112
112
  // ============================================================================
113
113
 
114
+ export type SegmentedControlIconSource =
115
+ | string
116
+ | { type: 'sfSymbol'; name: string }
117
+ | { type: 'drawable'; name: string }
118
+ | { type: 'image'; source: unknown; tinted?: boolean };
119
+
120
+ export type SegmentedControlIcon =
121
+ | SegmentedControlIconSource
122
+ | { ios?: SegmentedControlIconSource; android?: SegmentedControlIconSource };
123
+
124
+ export type SegmentedControlLabelVisibility = 'auto' | 'labeled' | 'unlabeled';
125
+
114
126
  export interface SegmentedControlSegmentProps {
115
127
  label: string;
116
128
  value: string;
117
129
  disabled?: boolean;
118
- icon?: string;
130
+ icon?: SegmentedControlIcon;
131
+ badge?: string | number;
132
+ accessibilityLabel?: string;
133
+ }
134
+
135
+ export interface SegmentedControlBadgeStyle {
136
+ backgroundColor?: string;
137
+ color?: string;
138
+ }
139
+
140
+ export interface SegmentedControlLabelStyle {
141
+ fontFamily?: string;
142
+ fontSize?: number;
143
+ fontWeight?: string | number;
144
+ fontStyle?: 'normal' | 'italic';
119
145
  }
120
146
 
121
147
  export interface SegmentedControlProps extends ViewProps {
122
148
  segments: readonly SegmentedControlSegmentProps[];
123
149
  selectedValue: string | null;
124
150
  disabled?: boolean;
151
+ labelVisibility?: SegmentedControlLabelVisibility;
152
+ selectedSegmentColor?: string;
153
+ activeTintColor?: string;
154
+ inactiveTintColor?: string;
155
+ labelStyle?: SegmentedControlLabelStyle;
156
+ badgeStyle?: SegmentedControlBadgeStyle;
125
157
  onSelect?: (value: string, index: number) => void;
158
+ onDeselect?: () => void;
126
159
  ios?: Record<string, unknown>;
127
160
  android?: Record<string, unknown>;
128
161
  }