react-native-ui-lib 7.39.0 → 7.39.1-snapshot.6732

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 (189) hide show
  1. package/package.json +4 -2
  2. package/scripts/docs/buildDocsCommon.js +16 -83
  3. package/src/assets/index.js +2 -5
  4. package/src/assets/internal/icons/index.js +50 -0
  5. package/src/assets/internal/icons/index.web.js +50 -0
  6. package/src/assets/internal/images/index.js +26 -0
  7. package/src/assets/internal/images/index.web.js +26 -0
  8. package/src/assets/internal/index.d.ts +4 -0
  9. package/src/assets/internal/index.js +8 -0
  10. package/src/commons/Constants.d.ts +1 -0
  11. package/src/commons/Constants.js +4 -2
  12. package/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.api.json +40 -0
  13. package/src/components/avatar/index.d.ts +8 -19
  14. package/src/components/avatar/index.js +4 -2
  15. package/src/components/button/button.api.json +25 -85
  16. package/src/components/card/index.js +1 -1
  17. package/src/components/checkbox/index.d.ts +4 -1
  18. package/src/components/checkbox/index.js +7 -5
  19. package/src/components/chip/index.js +1 -1
  20. package/src/components/chipsInput/index.js +2 -2
  21. package/src/components/colorPicker/ColorPickerDialog.js +1 -1
  22. package/src/components/colorPicker/ColorPickerDialogHeader.js +2 -2
  23. package/src/components/colorPicker/ColorPickerPreview.js +2 -2
  24. package/src/components/colorPicker/index.js +1 -1
  25. package/src/components/colorSwatch/index.js +2 -3
  26. package/src/components/dateTimePicker/index.js +2 -2
  27. package/src/components/hint/hint.api.json +39 -5
  28. package/src/components/hint/index.js +2 -3
  29. package/src/components/icon/index.d.ts +12 -3
  30. package/src/components/icon/index.js +18 -9
  31. package/src/components/image/index.d.ts +1 -1
  32. package/src/components/modal/TopBar.js +1 -1
  33. package/src/components/modal/api/modalTopBar.api.json +1 -1
  34. package/src/components/modal/modal.api.json +54 -0
  35. package/src/components/overlay/index.js +4 -6
  36. package/src/components/panningViews/panDismissibleView.js +1 -1
  37. package/src/components/panningViews/panGestureView.js +1 -1
  38. package/src/components/panningViews/panListenerView.js +1 -1
  39. package/src/components/panningViews/panResponderView.js +1 -1
  40. package/src/components/panningViews/panningContext.js +1 -0
  41. package/src/components/picker/PickerItem.js +1 -1
  42. package/src/components/picker/PickerItemsList.js +6 -2
  43. package/src/components/picker/PickerSelectionStatusBar.d.ts +3 -0
  44. package/src/components/picker/PickerSelectionStatusBar.js +60 -0
  45. package/src/components/picker/api/picker.api.json +387 -5
  46. package/src/components/picker/helpers/useFieldType.js +2 -2
  47. package/src/components/picker/helpers/usePickerSelection.d.ts +4 -1
  48. package/src/components/picker/helpers/usePickerSelection.js +19 -3
  49. package/src/components/picker/index.d.ts +2 -2
  50. package/src/components/picker/index.js +15 -7
  51. package/src/components/picker/types.d.ts +48 -1
  52. package/src/components/scrollBar/index.js +3 -3
  53. package/src/components/sortableList/SortableList.api.json +7 -7
  54. package/src/components/stepper/index.js +3 -8
  55. package/src/components/tabController/apis/pageCarousel.api.json +8 -5
  56. package/src/components/textField/ClearButton.js +1 -1
  57. package/src/components/timeline/timeline.api.json +57 -106
  58. package/src/components/toast/index.js +1 -1
  59. package/src/components/wizard/WizardStates.js +3 -4
  60. package/src/hooks/useScrollTo/index.js +9 -4
  61. package/src/incubator/dialog/useDialogContent.js +1 -1
  62. package/src/incubator/expandableOverlay/index.js +1 -0
  63. package/src/incubator/panView/index.js +1 -1
  64. package/src/incubator/slider/Thumb.js +8 -1
  65. package/src/incubator/toast/toast.api.json +57 -7
  66. package/src/index.d.ts +1 -1
  67. package/src/index.js +7 -0
  68. package/src/assets/icons/index.js +0 -26
  69. package/src/assets/images/index.js +0 -5
  70. package/src/components/stepper/assets/minusSmall.png +0 -0
  71. package/src/components/stepper/assets/minusSmall@1.5x.png +0 -0
  72. package/src/components/stepper/assets/minusSmall@2x.png +0 -0
  73. package/src/components/stepper/assets/minusSmall@3x.png +0 -0
  74. package/src/components/stepper/assets/minusSmall@4x.png +0 -0
  75. package/src/components/stepper/assets/plusSmall.png +0 -0
  76. package/src/components/stepper/assets/plusSmall@1.5x.png +0 -0
  77. package/src/components/stepper/assets/plusSmall@2x.png +0 -0
  78. package/src/components/stepper/assets/plusSmall@3x.png +0 -0
  79. package/src/components/stepper/assets/plusSmall@4x.png +0 -0
  80. /package/src/assets/{icons → internal/icons}/check.png +0 -0
  81. /package/src/assets/{icons → internal/icons}/check@1.5x.png +0 -0
  82. /package/src/assets/{icons → internal/icons}/check@2x.png +0 -0
  83. /package/src/assets/{icons → internal/icons}/check@3x.png +0 -0
  84. /package/src/assets/{icons → internal/icons}/check@4x.png +0 -0
  85. /package/src/{components/wizard/assets → assets/internal/icons}/checkMarkSmall.png +0 -0
  86. /package/src/{components/wizard/assets → assets/internal/icons}/checkMarkSmall@1.5x.png +0 -0
  87. /package/src/{components/wizard/assets → assets/internal/icons}/checkMarkSmall@2x.png +0 -0
  88. /package/src/{components/wizard/assets → assets/internal/icons}/checkMarkSmall@3x.png +0 -0
  89. /package/src/{components/wizard/assets → assets/internal/icons}/checkMarkSmall@4x.png +0 -0
  90. /package/src/assets/{icons/check-small.png → internal/icons/checkSmall.png} +0 -0
  91. /package/src/assets/{icons/check-small@1.5x.png → internal/icons/checkSmall@1.5x.png} +0 -0
  92. /package/src/assets/{icons/check-small@2x.png → internal/icons/checkSmall@2x.png} +0 -0
  93. /package/src/assets/{icons/check-small@3x.png → internal/icons/checkSmall@3x.png} +0 -0
  94. /package/src/assets/{icons/check-small@4x.png → internal/icons/checkSmall@4x.png} +0 -0
  95. /package/src/{components/picker/assets/dropdown.png → assets/internal/icons/chevronDown.png} +0 -0
  96. /package/src/{components/picker/assets/dropdown@1.5x.png → assets/internal/icons/chevronDown@1.5x.png} +0 -0
  97. /package/src/{components/picker/assets/dropdown@2x.png → assets/internal/icons/chevronDown@2x.png} +0 -0
  98. /package/src/{components/picker/assets/dropdown@3x.png → assets/internal/icons/chevronDown@3x.png} +0 -0
  99. /package/src/{components/picker/assets/dropdown@4x.png → assets/internal/icons/chevronDown@4x.png} +0 -0
  100. /package/src/{components/wizard/assets → assets/internal/icons}/exclamationSmall.png +0 -0
  101. /package/src/{components/wizard/assets → assets/internal/icons}/exclamationSmall@1.5x.png +0 -0
  102. /package/src/{components/wizard/assets → assets/internal/icons}/exclamationSmall@2x.png +0 -0
  103. /package/src/{components/wizard/assets → assets/internal/icons}/exclamationSmall@3x.png +0 -0
  104. /package/src/{components/wizard/assets → assets/internal/icons}/exclamationSmall@4x.png +0 -0
  105. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutline.png +0 -0
  106. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutline@1.5x.png +0 -0
  107. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutline@2x.png +0 -0
  108. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutline@3x.png +0 -0
  109. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutline@4x.png +0 -0
  110. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutlineSmall.png +0 -0
  111. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutlineSmall@1.5x.png +0 -0
  112. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutlineSmall@2x.png +0 -0
  113. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutlineSmall@3x.png +0 -0
  114. /package/src/{components/stepper/assets → assets/internal/icons}/minusOutlineSmall@4x.png +0 -0
  115. /package/src/assets/{icons → internal/icons}/minusSmall.png +0 -0
  116. /package/src/assets/{icons → internal/icons}/minusSmall@1.5x.png +0 -0
  117. /package/src/assets/{icons → internal/icons}/minusSmall@2x.png +0 -0
  118. /package/src/assets/{icons → internal/icons}/minusSmall@3x.png +0 -0
  119. /package/src/assets/{icons → internal/icons}/minusSmall@4x.png +0 -0
  120. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutline.png +0 -0
  121. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutline@1.5x.png +0 -0
  122. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutline@2x.png +0 -0
  123. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutline@3x.png +0 -0
  124. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutline@4x.png +0 -0
  125. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutlineSmall.png +0 -0
  126. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutlineSmall@1.5x.png +0 -0
  127. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutlineSmall@2x.png +0 -0
  128. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutlineSmall@3x.png +0 -0
  129. /package/src/{components/stepper/assets → assets/internal/icons}/plusOutlineSmall@4x.png +0 -0
  130. /package/src/assets/{icons → internal/icons}/plusSmall.png +0 -0
  131. /package/src/assets/{icons → internal/icons}/plusSmall@1.5x.png +0 -0
  132. /package/src/assets/{icons → internal/icons}/plusSmall@2x.png +0 -0
  133. /package/src/assets/{icons → internal/icons}/plusSmall@3x.png +0 -0
  134. /package/src/assets/{icons → internal/icons}/plusSmall@4x.png +0 -0
  135. /package/src/assets/{icons → internal/icons}/search.png +0 -0
  136. /package/src/assets/{icons → internal/icons}/search@1.5x.png +0 -0
  137. /package/src/assets/{icons → internal/icons}/search@2x.png +0 -0
  138. /package/src/assets/{icons → internal/icons}/search@3x.png +0 -0
  139. /package/src/assets/{icons → internal/icons}/search@4x.png +0 -0
  140. /package/src/assets/{icons → internal/icons}/x.png +0 -0
  141. /package/src/assets/{icons → internal/icons}/x@2x.png +0 -0
  142. /package/src/assets/{icons → internal/icons}/x@3x.png +0 -0
  143. /package/src/assets/{icons → internal/icons}/xFlat.png +0 -0
  144. /package/src/assets/{icons → internal/icons}/xFlat@1.5x.png +0 -0
  145. /package/src/assets/{icons → internal/icons}/xFlat@2x.png +0 -0
  146. /package/src/assets/{icons → internal/icons}/xFlat@3x.png +0 -0
  147. /package/src/assets/{icons → internal/icons}/xFlat@4x.png +0 -0
  148. /package/src/assets/{icons → internal/icons}/xMedium.png +0 -0
  149. /package/src/assets/{icons → internal/icons}/xMedium@1.5x.png +0 -0
  150. /package/src/assets/{icons → internal/icons}/xMedium@2x.png +0 -0
  151. /package/src/assets/{icons → internal/icons}/xMedium@3x.png +0 -0
  152. /package/src/assets/{icons → internal/icons}/xMedium@4x.png +0 -0
  153. /package/src/{components/chipsInput/assets → assets/internal/icons}/xSmall.png +0 -0
  154. /package/src/{components/chipsInput/assets → assets/internal/icons}/xSmall@1.5x.png +0 -0
  155. /package/src/{components/chipsInput/assets → assets/internal/icons}/xSmall@2x.png +0 -0
  156. /package/src/{components/chipsInput/assets → assets/internal/icons}/xSmall@3x.png +0 -0
  157. /package/src/{components/chipsInput/assets → assets/internal/icons}/xSmall@4x.png +0 -0
  158. /package/src/assets/{images → internal/images}/gradient.png +0 -0
  159. /package/src/{components/scrollBar/assets → assets/internal/images}/gradientOverlay.png +0 -0
  160. /package/src/{components/overlay/assets/GradientOverlayHigh.png → assets/internal/images/gradientOverlayHigh.png} +0 -0
  161. /package/src/{components/overlay/assets/GradientOverlayHigh@1.5x.png → assets/internal/images/gradientOverlayHigh@1.5x.png} +0 -0
  162. /package/src/{components/overlay/assets/GradientOverlayHigh@2x.png → assets/internal/images/gradientOverlayHigh@2x.png} +0 -0
  163. /package/src/{components/overlay/assets/GradientOverlayHigh@3x.png → assets/internal/images/gradientOverlayHigh@3x.png} +0 -0
  164. /package/src/{components/overlay/assets/GradientOverlayHigh@4x.png → assets/internal/images/gradientOverlayHigh@4x.png} +0 -0
  165. /package/src/{components/overlay/assets/GradientOverlayLow.png → assets/internal/images/gradientOverlayLow.png} +0 -0
  166. /package/src/{components/overlay/assets/GradientOverlayLow@1.5x.png → assets/internal/images/gradientOverlayLow@1.5x.png} +0 -0
  167. /package/src/{components/overlay/assets/GradientOverlayLow@2x.png → assets/internal/images/gradientOverlayLow@2x.png} +0 -0
  168. /package/src/{components/overlay/assets/GradientOverlayLow@3x.png → assets/internal/images/gradientOverlayLow@3x.png} +0 -0
  169. /package/src/{components/overlay/assets/GradientOverlayLow@4x.png → assets/internal/images/gradientOverlayLow@4x.png} +0 -0
  170. /package/src/{components/overlay/assets/GradientOverlayMedium.png → assets/internal/images/gradientOverlayMedium.png} +0 -0
  171. /package/src/{components/overlay/assets/GradientOverlayMedium@1.5x.png → assets/internal/images/gradientOverlayMedium@1.5x.png} +0 -0
  172. /package/src/{components/overlay/assets/GradientOverlayMedium@2x.png → assets/internal/images/gradientOverlayMedium@2x.png} +0 -0
  173. /package/src/{components/overlay/assets/GradientOverlayMedium@3x.png → assets/internal/images/gradientOverlayMedium@3x.png} +0 -0
  174. /package/src/{components/overlay/assets/GradientOverlayMedium@4x.png → assets/internal/images/gradientOverlayMedium@4x.png} +0 -0
  175. /package/src/{components/hint/assets → assets/internal/images}/hintTipMiddle.png +0 -0
  176. /package/src/{components/hint/assets → assets/internal/images}/hintTipMiddle@1.5x.png +0 -0
  177. /package/src/{components/hint/assets → assets/internal/images}/hintTipMiddle@2x.png +0 -0
  178. /package/src/{components/hint/assets → assets/internal/images}/hintTipMiddle@3x.png +0 -0
  179. /package/src/{components/hint/assets → assets/internal/images}/hintTipMiddle@4x.png +0 -0
  180. /package/src/{components/hint/assets → assets/internal/images}/hintTipSide.png +0 -0
  181. /package/src/{components/hint/assets → assets/internal/images}/hintTipSide@1.5x.png +0 -0
  182. /package/src/{components/hint/assets → assets/internal/images}/hintTipSide@2x.png +0 -0
  183. /package/src/{components/hint/assets → assets/internal/images}/hintTipSide@3x.png +0 -0
  184. /package/src/{components/hint/assets → assets/internal/images}/hintTipSide@4x.png +0 -0
  185. /package/src/{components/colorSwatch/assets/transparentSwatch/TransparentSwatch.png → assets/internal/images/transparentSwatch.png} +0 -0
  186. /package/src/{components/colorSwatch/assets/transparentSwatch/TransparentSwatch@1.5x.png → assets/internal/images/transparentSwatch@1.5x.png} +0 -0
  187. /package/src/{components/colorSwatch/assets/transparentSwatch/TransparentSwatch@2x.png → assets/internal/images/transparentSwatch@2x.png} +0 -0
  188. /package/src/{components/colorSwatch/assets/transparentSwatch/TransparentSwatch@3x.png → assets/internal/images/transparentSwatch@3x.png} +0 -0
  189. /package/src/{components/colorSwatch/assets/transparentSwatch/TransparentSwatch@4x.png → assets/internal/images/transparentSwatch@4x.png} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { PickerProps, PickerValue, PickerSingleValue, PickerMultiValue } from '../types';
3
- interface UsePickerSelectionProps extends Pick<PickerProps, 'migrate' | 'value' | 'onChange' | 'getItemValue' | 'topBarProps' | 'mode'> {
3
+ interface UsePickerSelectionProps extends Pick<PickerProps, 'migrate' | 'value' | 'onChange' | 'getItemValue' | 'topBarProps' | 'mode' | 'items'> {
4
4
  pickerExpandableRef: RefObject<any>;
5
5
  setSearchValue: (searchValue: string) => void;
6
6
  }
@@ -9,5 +9,8 @@ declare const usePickerSelection: (props: UsePickerSelectionProps) => {
9
9
  onDoneSelecting: (item: PickerValue) => void;
10
10
  toggleItemSelection: (item: PickerSingleValue) => void;
11
11
  cancelSelect: () => void;
12
+ areAllItemsSelected: boolean;
13
+ selectedCount: number;
14
+ toggleAllItemsSelection: (selectAll: boolean) => void;
12
15
  };
13
16
  export default usePickerSelection;
@@ -1,6 +1,6 @@
1
1
  import _xor from "lodash/xor";
2
2
  import _xorBy from "lodash/xorBy";
3
- import { useCallback, useState, useEffect } from 'react';
3
+ import { useCallback, useState, useEffect, useMemo } from 'react';
4
4
  import { PickerModes } from "../types";
5
5
  const usePickerSelection = props => {
6
6
  const {
@@ -11,7 +11,8 @@ const usePickerSelection = props => {
11
11
  pickerExpandableRef,
12
12
  getItemValue,
13
13
  setSearchValue,
14
- mode
14
+ mode,
15
+ items
15
16
  } = props;
16
17
  const [multiDraftValue, setMultiDraftValue] = useState(value);
17
18
  const [multiFinalValue, setMultiFinalValue] = useState(value);
@@ -43,11 +44,26 @@ const usePickerSelection = props => {
43
44
  pickerExpandableRef.current?.closeExpandable?.();
44
45
  topBarProps?.onCancel?.();
45
46
  }, [multiFinalValue, topBarProps]);
47
+ const availableItems = useMemo(() => {
48
+ return items?.filter(item => !item.disabled).map(item => item.value) || [];
49
+ }, [items]);
50
+ const areAllItemsSelected = useMemo(() => {
51
+ return multiDraftValue?.length === availableItems.length;
52
+ }, [multiDraftValue, availableItems]);
53
+ const selectedCount = useMemo(() => {
54
+ return multiDraftValue?.length;
55
+ }, [multiDraftValue]);
56
+ const toggleAllItemsSelection = useCallback(selectAll => {
57
+ setMultiDraftValue(selectAll ? availableItems : []);
58
+ }, [availableItems]);
46
59
  return {
47
60
  multiDraftValue,
48
61
  onDoneSelecting,
49
62
  toggleItemSelection,
50
- cancelSelect
63
+ cancelSelect,
64
+ areAllItemsSelected,
65
+ selectedCount,
66
+ toggleAllItemsSelection
51
67
  };
52
68
  };
53
69
  export default usePickerSelection;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PickerItem from './PickerItem';
3
3
  import { extractPickerItems } from './PickerPresenter';
4
- import { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods } from './types';
4
+ import { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods, PickerSelectionStatusProps } from './types';
5
5
  type PickerStatics = {
6
6
  Item: typeof PickerItem;
7
7
  modes: typeof PickerModes;
@@ -9,7 +9,7 @@ type PickerStatics = {
9
9
  extractPickerItems: typeof extractPickerItems;
10
10
  };
11
11
  declare const Picker: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<unknown>>;
12
- export { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods };
12
+ export { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods, PickerSelectionStatusProps };
13
13
  export { Picker };
14
14
  declare const _default: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<unknown>> & PickerStatics;
15
15
  export default _default;
@@ -18,7 +18,7 @@ import useFieldType from "./helpers/useFieldType";
18
18
  import useNewPickerProps from "./helpers/useNewPickerProps";
19
19
  // import usePickerMigrationWarnings from './helpers/usePickerMigrationWarnings';
20
20
  import { extractPickerItems } from "./PickerPresenter";
21
- import { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods } from "./types";
21
+ import { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods, PickerSelectionStatusProps } from "./types";
22
22
  const DEFAULT_DIALOG_PROPS = {
23
23
  bottom: true,
24
24
  width: '100%'
@@ -58,6 +58,7 @@ const Picker = React.forwardRef((props, ref) => {
58
58
  showLoader,
59
59
  customLoaderElement,
60
60
  renderCustomTopElement,
61
+ selectionStatus,
61
62
  ...others
62
63
  } = themeProps;
63
64
  const {
@@ -101,7 +102,10 @@ const Picker = React.forwardRef((props, ref) => {
101
102
  multiDraftValue,
102
103
  onDoneSelecting,
103
104
  toggleItemSelection,
104
- cancelSelect
105
+ cancelSelect,
106
+ areAllItemsSelected,
107
+ selectedCount,
108
+ toggleAllItemsSelection
105
109
  } = usePickerSelection({
106
110
  migrate,
107
111
  value,
@@ -110,7 +114,8 @@ const Picker = React.forwardRef((props, ref) => {
110
114
  getItemValue,
111
115
  topBarProps,
112
116
  setSearchValue,
113
- mode
117
+ mode,
118
+ items
114
119
  });
115
120
  const {
116
121
  label,
@@ -154,9 +159,12 @@ const Picker = React.forwardRef((props, ref) => {
154
159
  getItemLabel,
155
160
  onSelectedLayout: onSelectedItemLayout,
156
161
  renderItem,
157
- selectionLimit
162
+ selectionLimit,
163
+ areAllItemsSelected,
164
+ selectedCount,
165
+ toggleAllItemsSelection
158
166
  };
159
- }, [migrate, mode, value, multiDraftValue, renderItem, getItemValue, getItemLabel, selectionLimit, onSelectedItemLayout, toggleItemSelection, onDoneSelecting]);
167
+ }, [migrate, mode, value, multiDraftValue, renderItem, getItemValue, getItemLabel, selectionLimit, onSelectedItemLayout, toggleItemSelection, onDoneSelecting, areAllItemsSelected, selectedCount, toggleAllItemsSelection]);
160
168
  const renderPickerItem = useCallback((item, index) => {
161
169
  return <PickerItem key={`${index}-${item.value}`} {...item} />;
162
170
  }, []);
@@ -201,7 +209,7 @@ const Picker = React.forwardRef((props, ref) => {
201
209
  ...topBarProps,
202
210
  onCancel: cancelSelect,
203
211
  onDone: mode === PickerModes.MULTI ? () => onDoneSelecting(multiDraftValue) : undefined
204
- }} showSearch={showSearch} searchStyle={searchStyle} searchPlaceholder={searchPlaceholder} onSearchChange={_onSearchChange} renderCustomSearch={renderCustomSearch} renderHeader={renderHeader} listProps={listProps} useSafeArea={useSafeArea} showLoader={showLoader} customLoaderElement={customLoaderElement} renderCustomTopElement={renderCustomTopElement}>
212
+ }} showSearch={showSearch} searchStyle={searchStyle} searchPlaceholder={searchPlaceholder} onSearchChange={_onSearchChange} renderCustomSearch={renderCustomSearch} renderHeader={renderHeader} listProps={listProps} useSafeArea={useSafeArea} showLoader={showLoader} customLoaderElement={customLoaderElement} renderCustomTopElement={renderCustomTopElement} selectionStatus={selectionStatus}>
205
213
  {filteredItems}
206
214
  </PickerItemsList>;
207
215
  }, [testID, mode, useDialog, selectedItemPosition, topBarProps, cancelSelect, onDoneSelecting, multiDraftValue, showSearch, searchStyle, searchPlaceholder, _onSearchChange, renderCustomSearch, renderHeader, listProps, filteredItems, useSafeArea, useWheelPicker, items, showLoader]);
@@ -221,6 +229,6 @@ Picker.modes = PickerModes;
221
229
  Picker.fieldTypes = PickerFieldTypes;
222
230
  // @ts-expect-error
223
231
  Picker.extractPickerItems = extractPickerItems;
224
- export { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods };
232
+ export { PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods, PickerSelectionStatusProps };
225
233
  export { Picker }; // For tests
226
234
  export default Picker;
@@ -4,6 +4,8 @@ import { ExpandableOverlayProps, ExpandableOverlayMethods } from '../../incubato
4
4
  import { ModalTopBarProps } from '../modal/TopBar';
5
5
  import { TextFieldMethods, TextFieldProps } from '../textField';
6
6
  import { TouchableOpacityProps } from '../touchableOpacity';
7
+ import { ButtonProps } from '../button';
8
+ import { CheckboxProps } from '../checkbox';
7
9
  export declare enum PickerModes {
8
10
  SINGLE = "SINGLE",
9
11
  MULTI = "MULTI"
@@ -147,6 +149,44 @@ type PickerExpandableOverlayProps = {
147
149
  */
148
150
  enableModalBlur?: boolean;
149
151
  };
152
+ interface PickerSelectionStatusLabelData {
153
+ selectedCount: number;
154
+ areAllItemsSelected: boolean;
155
+ }
156
+ export type ButtonSelectionStatus = {
157
+ /**
158
+ * Select all element type
159
+ */
160
+ selectAllType?: 'button';
161
+ /**
162
+ * Button props
163
+ */
164
+ buttonProps?: ButtonProps;
165
+ };
166
+ export type CheckboxSelectionStatus = {
167
+ /**
168
+ * Select all element type
169
+ */
170
+ selectAllType?: 'checkbox';
171
+ /**
172
+ * Checkbox props
173
+ */
174
+ checkboxProps?: CheckboxProps;
175
+ };
176
+ export type PickerSelectionStatusProps = {
177
+ /**
178
+ * A function that generates a label based on the selected items' count and status
179
+ */
180
+ getLabel?: (data: PickerSelectionStatusLabelData) => string;
181
+ /**
182
+ * Custom container style
183
+ */
184
+ containerStyle?: StyleProp<ViewStyle>;
185
+ /**
186
+ * Control weather to show the label or not
187
+ */
188
+ showLabel?: boolean;
189
+ } & (ButtonSelectionStatus | CheckboxSelectionStatus);
150
190
  export type PickerBaseProps = Omit<TextFieldProps, 'value' | 'onChange'> & PickerPropsDeprecation & PickerExpandableOverlayProps & PickerListProps & {
151
191
  /**
152
192
  * Use dialog instead of modal picker
@@ -193,6 +233,10 @@ export type PickerBaseProps = Omit<TextFieldProps, 'value' | 'onChange'> & Picke
193
233
  * Render custom top element
194
234
  */
195
235
  renderCustomTopElement?: (value?: PickerValue) => React.ReactElement;
236
+ /**
237
+ * Selection status bar props
238
+ */
239
+ selectionStatus?: PickerSelectionStatusProps;
196
240
  /**
197
241
  * Add onPress callback for when pressing the picker
198
242
  */
@@ -286,8 +330,11 @@ export interface PickerContextProps extends Pick<PickerProps, 'migrate' | 'value
286
330
  isMultiMode: boolean;
287
331
  onSelectedLayout: (event: any) => any;
288
332
  selectionLimit: PickerProps['selectionLimit'];
333
+ areAllItemsSelected: boolean;
334
+ selectedCount: number;
335
+ toggleAllItemsSelection?: (selectAll: boolean) => void;
289
336
  }
290
- export type PickerItemsListProps = Pick<PropsWithChildren<PickerProps>, 'topBarProps' | 'listProps' | 'renderHeader' | 'useSafeArea' | 'showLoader' | 'customLoaderElement' | 'renderCustomTopElement' | 'showSearch' | 'searchStyle' | 'searchPlaceholder' | 'onSearchChange' | 'renderCustomSearch' | 'children' | 'useWheelPicker' | 'useDialog' | 'mode' | 'testID'> & {
337
+ export type PickerItemsListProps = Pick<PropsWithChildren<PickerProps>, 'topBarProps' | 'listProps' | 'renderHeader' | 'useSafeArea' | 'showLoader' | 'customLoaderElement' | 'renderCustomTopElement' | 'selectionStatus' | 'showSearch' | 'searchStyle' | 'searchPlaceholder' | 'onSearchChange' | 'renderCustomSearch' | 'children' | 'useWheelPicker' | 'useDialog' | 'mode' | 'testID'> & {
291
338
  items?: {
292
339
  value: any;
293
340
  label: any;
@@ -8,8 +8,8 @@ import { Colors } from "../../style";
8
8
  import { Constants, asBaseComponent, forwardRef } from "../../commons/new";
9
9
  import View from "../view";
10
10
  import Image from "../image";
11
+ import Assets from "../../assets";
11
12
  const GRADIENT_WIDTH = 76;
12
- const defaultImage = () => require("./assets/gradientOverlay.png");
13
13
 
14
14
  /**
15
15
  * @description: Scrollable container with animated gradient overlay for horizontal scroll
@@ -17,7 +17,7 @@ const defaultImage = () => require("./assets/gradientOverlay.png");
17
17
  */
18
18
 
19
19
  class ScrollBar extends Component {
20
- static displayName = 'ScrollBar';
20
+ static displayName = 'IGNORE';
21
21
  static defaultProps = {
22
22
  gradientWidth: GRADIENT_WIDTH,
23
23
  gradientMargins: 0,
@@ -175,7 +175,7 @@ class ScrollBar extends Component {
175
175
  right: !left ? gradientMargins : undefined,
176
176
  left: left ? gradientMargins : undefined
177
177
  }}>
178
- <Image source={gradientImage || defaultImage()} style={{
178
+ <Image source={gradientImage || Assets.internal.images.gradientOverlay} style={{
179
179
  width: gradientWidth,
180
180
  height: heightToUse,
181
181
  tintColor: gradientColor,
@@ -45,14 +45,14 @@
45
45
  "snippet": [
46
46
  "function Example(props) {",
47
47
  " const data = Array.from({length: 10}, (_, index) => {",
48
- " let text = \\`\\${index}\\`;",
48
+ " let text = `${index}`;",
49
49
  " if (index === 3) {",
50
50
  " text = 'Locked item';",
51
51
  " }",
52
52
  " ",
53
53
  " return {",
54
54
  " text,",
55
- " id: \\`\\${index}\\`,",
55
+ " id: `${index}`,",
56
56
  " locked: index === 3",
57
57
  " };",
58
58
  " });",
@@ -78,11 +78,11 @@
78
78
  " }, []);",
79
79
  "",
80
80
  " const keyExtractor = useCallback((item: Item) => {",
81
- " return \\`\\${item.id}\\`;",
81
+ " return `${item.id}`;",
82
82
  " }, []);",
83
83
  "",
84
84
  " return (",
85
- " <div>",
85
+ " <View>",
86
86
  " <SortableList",
87
87
  " data={data$1}",
88
88
  " flexMigration",
@@ -90,8 +90,8 @@
90
90
  " renderItem={renderItem$3}",
91
91
  " keyExtractor={keyExtractor$4}",
92
92
  " />",
93
- " </div>",
94
- " );",
95
- "}"
93
+ " </View>",
94
+ " )",
95
+ "};"
96
96
  ]
97
97
  }
@@ -6,17 +6,12 @@ import { asBaseComponent } from "../../commons/new";
6
6
  import View from "../view";
7
7
  import Text from "../text";
8
8
  import Button from "../button";
9
+ import Assets from "../../assets";
9
10
  var ActionType = /*#__PURE__*/function (ActionType) {
10
11
  ActionType["MINUS"] = "minus";
11
12
  ActionType["PLUS"] = "plus";
12
13
  return ActionType;
13
14
  }(ActionType || {});
14
- const minusOutline = require("./assets/minusOutline.png");
15
- const minusOutlineSmall = require("./assets/minusOutlineSmall.png");
16
- const plusOutline = require("./assets/plusOutline.png");
17
- const plusOutlineSmall = require("./assets/plusOutlineSmall.png");
18
- const plusSmall = require("./assets/plusSmall.png");
19
- const minusSmall = require("./assets/minusSmall.png");
20
15
  const DEFAULT_STEP = 1;
21
16
  /**
22
17
  * @description: A stepper component
@@ -150,8 +145,8 @@ class Stepper extends PureComponent {
150
145
  } = this.props;
151
146
  const allowStepChange = this.allowStepChange(actionType);
152
147
  const isFloatingStepper = type === 'floating';
153
- const minusButton = isFloatingStepper ? minusSmall : small ? minusOutlineSmall : minusOutline;
154
- const plusButton = isFloatingStepper ? plusSmall : small ? plusOutlineSmall : plusOutline;
148
+ const minusButton = isFloatingStepper ? Assets.internal.icons.minusSmall : small ? Assets.internal.icons.minusOutlineSmall : Assets.internal.icons.minusOutline;
149
+ const plusButton = isFloatingStepper ? Assets.internal.icons.plusSmall : small ? Assets.internal.icons.plusOutlineSmall : Assets.internal.icons.plusOutline;
155
150
  return <Button link color={isFloatingStepper ? Colors.$iconDefault : undefined} iconSource={actionType === ActionType.MINUS ? minusButton : plusButton} disabled={disabled || !allowStepChange} onPress={() => this.handleStepChange(actionType)} testID={actionType === ActionType.MINUS ? `${testID}.minusStep` : `${testID}.plusStep`} />;
156
151
  }
157
152
  render() {
@@ -7,11 +7,14 @@
7
7
  "extendsLink": ["https://reactnative.dev/docs/scrollview"],
8
8
  "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx",
9
9
  "images": [],
10
+ "props": [],
10
11
  "snippet": [
11
- "<TabController.PageCarousel>",
12
- " {_.map(items, (item, key) => {",
13
- " return ($1);",
14
- " })}",
15
- "</TabController.PageCarousel>"
12
+ "<TabController>",
13
+ " <TabController.PageCarousel>",
14
+ " {_.map(items, (item, key) => {",
15
+ " return <TabController.TabPage index={key}/>;",
16
+ " })}",
17
+ " </TabController.PageCarousel>",
18
+ "</TabController>"
16
19
  ]
17
20
  }
@@ -54,7 +54,7 @@ const ClearButton = ({
54
54
  onClear?.();
55
55
  };
56
56
  return <View reanimated style={style} testID={`${testID}.container`}>
57
- <Button link iconSource={Assets.icons.xFlat} iconStyle={styles.clearIcon} onPress={clear} hitSlop={hitSlop} accessible={hasValue} accessibilityLabel={'clear'} testID={testID} />
57
+ <Button link iconSource={Assets.internal.icons.xFlat} iconStyle={styles.clearIcon} onPress={clear} hitSlop={hitSlop} accessible={hasValue} accessibilityLabel={'clear'} testID={testID} />
58
58
  </View>;
59
59
  };
60
60
  const styles = StyleSheet.create({
@@ -29,30 +29,18 @@
29
29
  }
30
30
  ],
31
31
  "snippet": [
32
- "<Timeline ",
33
- " topLine={{",
34
- " state: Timeline.states.ERROR",
35
- " }$1}",
36
- " bottomLine={{",
37
- " type: Timeline.lineTypes.DASHED,",
38
- " color: Colors.orange40",
39
- " }$2}",
40
- " point={{",
41
- " type: Timeline.pointTypes.OUTLINE,",
42
- " color: Colors.orange40,",
43
- " icon: Assets.icons.demo.camera,",
44
- " anchorRef: alignToTitle ? titleRef : undefined",
45
- " }$3}",
32
+ "<Timeline",
33
+ " topLine={{type: Timeline.lineTypes.DASHED}}",
34
+ " bottomLine={{state: Timeline.states.SUCCESS}}",
35
+ " point={{state: Timeline.states.SUCCESS}}",
46
36
  ">",
47
- " <View flex centerH paddingH-20>",
48
- " <Text text70 dark10 ref={titleRef}>",
49
- " {title}",
50
- " </Text>",
51
- " <Text dark40>",
52
- " {description}",
53
- " </Text>",
54
- " </View>",
55
- "</Timeline>"
37
+ " <View padding-20 bg-grey60 br30>",
38
+ " <Text text70BO>Title</Text>",
39
+ " <View marginT-5 padding-8 bg-white br30>",
40
+ " <Text>Description</Text>",
41
+ " </View>",
42
+ " </View>",
43
+ " </Timeline>"
56
44
  ],
57
45
  "docs": {
58
46
  "hero": {
@@ -138,29 +126,7 @@
138
126
  "title": "Current",
139
127
  "content": [
140
128
  {
141
- "props": {
142
- "state": "current",
143
- "point": {
144
- "type": {
145
- "type": "bullet"
146
- }
147
- },
148
- "bottomLine": {
149
- "type": {
150
- "type": "solid"
151
- }
152
- }
153
- }
154
- },
155
- {
156
- "props": {
157
- "point": {
158
- "type": {
159
- "type": "bullet",
160
- "color": "#116DFF"
161
- }
162
- }
163
- }
129
+ "snippet": "<Timeline topLine={{state: Timeline.states.CURRENT}} bottomLine={{state: Timeline.states.CURRENT}} point={{state: Timeline.states.CURRENT}}><View style={{height: 88}}/></Timeline>"
164
130
  }
165
131
  ],
166
132
  "description": "state: current"
@@ -169,19 +135,7 @@
169
135
  "title": "Next",
170
136
  "content": [
171
137
  {
172
- "props": {
173
- "state": "next",
174
- "point": {
175
- "type": {
176
- "type": "bullet"
177
- }
178
- },
179
- "bottomLine": {
180
- "type": {
181
- "type": "solid"
182
- }
183
- }
184
- }
138
+ "snippet": "<Timeline topLine={{state: Timeline.states.NEXT}} bottomLine={{state: Timeline.states.NEXT}} point={{state: Timeline.states.NEXT, type: Timeline.pointTypes.CIRCLE}}><View style={{height: 88}}/></Timeline>"
185
139
  }
186
140
  ],
187
141
  "description": "state: next"
@@ -190,19 +144,7 @@
190
144
  "title": "Error",
191
145
  "content": [
192
146
  {
193
- "props": {
194
- "state": "error",
195
- "point": {
196
- "type": {
197
- "type": "bullet"
198
- }
199
- },
200
- "bottomLine": {
201
- "type": {
202
- "type": "solid"
203
- }
204
- }
205
- }
147
+ "snippet": "<Timeline topLine={{state: Timeline.states.ERROR}} bottomLine={{state: Timeline.states.ERROR}} point={{state: Timeline.states.ERROR}}><View style={{height: 88}}/></Timeline>"
206
148
  }
207
149
  ],
208
150
  "description": "state: error"
@@ -211,19 +153,7 @@
211
153
  "title": "Success",
212
154
  "content": [
213
155
  {
214
- "props": {
215
- "state": "success",
216
- "point": {
217
- "type": {
218
- "type": "bullet"
219
- }
220
- },
221
- "bottomLine": {
222
- "type": {
223
- "type": "solid"
224
- }
225
- }
226
- }
156
+ "snippet": "<Timeline topLine={{state: Timeline.states.SUCCESS}} bottomLine={{state: Timeline.states.SUCCESS}} point={{state: Timeline.states.SUCCESS}}><View style={{height: 88}}/></Timeline>"
227
157
  }
228
158
  ],
229
159
  "description": "state: success"
@@ -238,15 +168,30 @@
238
168
  "items": [
239
169
  {
240
170
  "title": "Bullet",
241
- "description": "type: bullet"
171
+ "description": "type: bullet",
172
+ "content": [
173
+ {
174
+ "snippet": "<Timeline point={{type: Timeline.pointTypes.BULLET}}><View style={{height: 88}}/></Timeline>"
175
+ }
176
+ ]
242
177
  },
243
178
  {
244
179
  "title": "Circle",
245
- "description": "type: circle"
180
+ "description": "type: circle",
181
+ "content": [
182
+ {
183
+ "snippet": "<Timeline point={{state: Timeline.states.NEXT, type: Timeline.pointTypes.CIRCLE}}><View style={{height: 88}}/></Timeline>"
184
+ }
185
+ ]
246
186
  },
247
187
  {
248
188
  "title": "Outline",
249
- "description": "type: outline"
189
+ "description": "type: outline",
190
+ "content": [
191
+ {
192
+ "snippet": "<Timeline point={{type: Timeline.pointTypes.OUTLINE}}><View style={{height: 88}}/></Timeline>"
193
+ }
194
+ ]
250
195
  }
251
196
  ],
252
197
  "title": "Point",
@@ -260,14 +205,7 @@
260
205
  "title": "Text",
261
206
  "content": [
262
207
  {
263
- "props": {
264
- "state": "current",
265
- "bottomLine": {
266
- "type": {
267
- "type": "solid"
268
- }
269
- }
270
- }
208
+ "snippet": "<Timeline point={{label: '1'}}><View style={{height: 88}}/></Timeline>"
271
209
  }
272
210
  ],
273
211
  "description": "text: “1”"
@@ -276,21 +214,19 @@
276
214
  "title": "Icon",
277
215
  "content": [
278
216
  {
279
- "props": {
280
- "state": "current",
281
- "bottomLine": {
282
- "type": {
283
- "type": "dashed"
284
- }
285
- }
286
- }
217
+ "snippet": "<Timeline point={{state: Timeline.states.SUCCESS, icon: Assets.internal.icons.checkSmall}}><View style={{height: 88}}/></Timeline>"
287
218
  }
288
219
  ],
289
- "description": "icon: Assets.icons.general.checkmarkSmall"
220
+ "description": "icon: Assets.internal.icons.general.checkmarkSmall"
290
221
  },
291
222
  {
292
223
  "title": "Icon without background",
293
- "description": "icon: Assets.icons.general.favorite, removeIconBackground: true"
224
+ "content": [
225
+ {
226
+ "snippet": "<Timeline point={{state: Timeline.states.SUCCESS, icon: Assets.internal.icons.search, removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
227
+ }
228
+ ],
229
+ "description": "icon: Assets.internal.icons.general.favorite, removeIconBackground: true"
294
230
  }
295
231
  ],
296
232
  "name": "Point Accessories"
@@ -301,10 +237,20 @@
301
237
  "items": [
302
238
  {
303
239
  "title": "Solid",
240
+ "content": [
241
+ {
242
+ "snippet": "<Timeline topLine={{state: Timeline.states.CURRENT}} point={{removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
243
+ }
244
+ ],
304
245
  "description": "type: solid"
305
246
  },
306
247
  {
307
248
  "title": "Dashed",
249
+ "content": [
250
+ {
251
+ "snippet": "<Timeline topLine={{state: Timeline.states.CURRENT, type: Timeline.lineTypes.DASHED}} point={{removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
252
+ }
253
+ ],
308
254
  "description": "type: dashed"
309
255
  }
310
256
  ],
@@ -317,6 +263,11 @@
317
263
  "items": [
318
264
  {
319
265
  "title": "Entry",
266
+ "content": [
267
+ {
268
+ "snippet": "<Timeline topLine={{state: Timeline.states.NEXT, entry: true}} bottomLine={{state: Timeline.states.NEXT, entry: true}} point={{removeIconBackground: true}}><View style={{height: 88}}/></Timeline>"
269
+ }
270
+ ],
320
271
  "description": "entry: true"
321
272
  }
322
273
  ],
@@ -239,7 +239,7 @@ export default class Toast extends PureBaseComponent {
239
239
  <Button
240
240
  link
241
241
  iconStyle={{tintColor: textColor}}
242
- iconSource={Assets.icons.x}
242
+ iconSource={Assets.internal.icons.x}
243
243
  onPress={this.onDismiss}
244
244
  paddingR-20
245
245
  accessibilityLabel={'dismiss'}
@@ -1,6 +1,5 @@
1
1
  import Colors from "../../style/colors";
2
- const checkMarkSmall = require("./assets/checkMarkSmall.png");
3
- const exclamationSmall = require("./assets/exclamationSmall.png");
2
+ import Assets from "../../assets";
4
3
  export const StatesConfig = {
5
4
  enabled: {
6
5
  color: Colors.$textNeutralHeavy,
@@ -14,7 +13,7 @@ export const StatesConfig = {
14
13
  error: {
15
14
  color: Colors.$iconDangerLight,
16
15
  circleColor: Colors.$outlineDanger,
17
- icon: exclamationSmall,
16
+ icon: Assets.internal.icons.exclamationSmall,
18
17
  enabled: true,
19
18
  accessibilityInfo: 'Validation Error'
20
19
  },
@@ -27,7 +26,7 @@ export const StatesConfig = {
27
26
  completed: {
28
27
  color: Colors.$iconNeutral,
29
28
  circleColor: Colors.$outlineDisabled,
30
- icon: checkMarkSmall,
29
+ icon: Assets.internal.icons.checkMarkSmall,
31
30
  enabled: true,
32
31
  accessibilityInfo: 'Completed'
33
32
  },