react-native-ui-lib 8.0.1 → 8.1.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/jestSetup/jest-setup.js +154 -0
- package/lib/components/DynamicFonts/FontDownloader.d.js +1 -0
- package/lib/components/DynamicFonts/FontLoader.d.js +1 -0
- package/lib/components/DynamicFonts/NoPermissionsAcquirer.d.js +1 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.android.d.js +1 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.ios.d.js +2 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.web.d.js +2 -0
- package/lib/components/DynamicFonts/RNFSPackage.d.js +1 -0
- package/lib/components/DynamicFonts/index.d.js +3 -0
- package/lib/components/HighlighterOverlayView/index.d.js +1 -0
- package/lib/components/HighlighterOverlayView/index.web.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.ios.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.web.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.d.js +5 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.android.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.js +7 -0
- package/lib/components/Keyboard/KeyboardAwareInsetsView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.android.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.d.js +10 -0
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/index.web.d.js +1 -0
- package/lib/components/Keyboard/index.d.js +4 -0
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.js +1 -0
- package/lib/components/SafeArea/SafeAreaSpacerView.d.js +1 -0
- package/lib/components/SafeArea/SafeAreaSpacerView.web.d.js +1 -0
- package/lib/components/SafeArea/index.d.js +1 -0
- package/lib/components/index.d.js +6 -0
- package/lib/scripts/releaseNative.js +72 -0
- package/lib/specs/HighlighterViewNativeComponent.d.js +1 -0
- package/lib/specs/HighlighterViewNativeComponent.d.ts +61 -0
- package/lib/specs/HighlighterViewNativeComponent.js +8 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.js +1 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.ts +58 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.js +8 -0
- package/package.json +7 -31
- package/scripts/build/build.js +35 -0
- package/scripts/build/buildPackages/buildComponentsPackages.js +18 -0
- package/scripts/build/buildPackages/buildCustomPackages.js +106 -0
- package/scripts/build/buildPackages/index.js +6 -0
- package/scripts/createCalendarMockData.js +37 -0
- package/scripts/docs/buildDocs.js +1 -0
- package/scripts/prepush.js +71 -0
- package/scripts/release/prReleaseNotes.js +6 -0
- package/scripts/release/release.js +99 -0
- package/scripts/updateWebAssets.js +88 -0
- package/scripts/utils.js +21 -0
- package/src/assets/__tests__/Assets.spec.js +110 -0
- package/src/commons/__tests__/baseComponent.spec.js +36 -0
- package/src/commons/__tests__/constants.spec.js +202 -0
- package/src/commons/__tests__/modifiers.spec.js +453 -0
- package/src/components/WheelPicker/__tests__/index.spec.js +121 -0
- package/src/components/WheelPicker/__tests__/useListMiddleIndex.spec.js +40 -0
- package/src/components/WheelPicker/__tests__/usePresenter.spec.js +87 -0
- package/src/components/avatar/__tests__/index.spec.js +25 -0
- package/src/components/badge/__tests__/index.spec.js +84 -0
- package/src/components/button/__tests__/index.driver.spec.js +209 -0
- package/src/components/button/__tests__/index.spec.js +287 -0
- package/src/components/button/index.js +30 -8
- package/src/components/card/__tests__/CardPresenter.spec.js +35 -0
- package/src/components/carousel/__tests__/CarouselPresenter.spec.js +52 -0
- package/src/components/carousel/__tests__/index.spec.js +89 -0
- package/src/components/carousel/index.js +2 -1
- package/src/components/checkbox/__tests__/index.spec.js +357 -0
- package/src/components/chip/__tests__/index.spec.js +63 -0
- package/src/components/colorSwatch/index.js +1 -1
- package/src/components/connectionStatusBar/__tests__/index.spec.js +41 -0
- package/src/components/dateTimePicker/__tests__/index.spec.js +44 -0
- package/src/components/dialog/__tests__/index.new.spec.js +118 -0
- package/src/components/featureHighlight/__tests__/index.spec.js +76 -0
- package/src/components/floatingButton/__tests__/index.spec.js +229 -0
- package/src/components/floatingButton/index.js +66 -35
- package/src/components/hint/__tests__/index.spec.js +108 -0
- package/src/components/image/__tests__/index.spec.js +56 -0
- package/src/components/image/image.api.json +193 -1
- package/src/components/maskedInput/__tests__/maskedInput.new.spec.js +19 -0
- package/src/components/maskedInput/__tests__/maskedInput.old.spec.js +20 -0
- package/src/components/modal/__tests__/index.spec.js +58 -0
- package/src/components/numberInput/__tests__/Presenter.spec.js +374 -0
- package/src/components/numberInput/__tests__/index.spec.js +38 -0
- package/src/components/numberInput/numberInput.api.json +131 -6
- package/src/components/overlay/index.js +2 -1
- package/src/components/pageControl/pageControl.api.json +175 -1
- package/src/components/panView/__tests__/panningUtil.spec.js +693 -0
- package/src/components/picker/__tests__/PickerPresenter.spec.js +15 -0
- package/src/components/picker/__tests__/index.spec.js +364 -0
- package/src/components/picker/helpers/__tests__/usePickerLabel.spec.js +96 -0
- package/src/components/radioButton/__tests__/index.spec.js +43 -0
- package/src/components/radioGroup/__tests__/index.spec.js +96 -0
- package/src/components/sectionsWheelPicker/__tests__/index.spec.js +35 -0
- package/src/components/sectionsWheelPicker/__tests__/mockSections.js +28 -0
- package/src/components/segmentedControl/__tests__/index.spec.js +25 -0
- package/src/components/slider/__tests__/index.spec.js +35 -0
- package/src/components/slider/index.js +12 -1
- package/src/components/slider/slider.api.json +11 -0
- package/src/components/sortableGridList/__tests__/index.spec.js +51 -0
- package/src/components/sortableGridList/__tests__/usePresenter.spec.js +231 -0
- package/src/components/sortableGridList/sortableGridList.api.json +44 -1
- package/src/components/sortableList/SortableList.api.json +51 -3
- package/src/components/sortableList/__tests__/index.spec.js +105 -0
- package/src/components/stackAggregator/assets/arrow-down.png +0 -0
- package/src/components/stackAggregator/assets/arrow-down@2x.png +0 -0
- package/src/components/stackAggregator/assets/arrow-down@3x.png +0 -0
- package/src/components/switch/__tests__/index.spec.js +96 -0
- package/src/components/text/__tests__/index.driver.spec.js +124 -0
- package/src/components/text/__tests__/index.spec.js +245 -0
- package/src/components/textField/__tests__/Presenter.spec.js +240 -0
- package/src/components/textField/__tests__/index.driver.spec.js +639 -0
- package/src/components/timeline/__tests__/driver.index.spec.js +133 -0
- package/src/helpers/__tests__/AvatarHelper.spec.js +170 -0
- package/src/hooks/useDidUpdate/__tests__/useDidUpdate.spec.js +80 -0
- package/src/hooks/useOrientation/__tests__/useOrientation.spec.js +70 -0
- package/src/hooks/useToggleValue/__tests__/useToggleValue.spec.js +89 -0
- package/src/incubator/calendar/__tests__/DateUtils.spec.js +367 -0
- package/src/incubator/expandableOverlay/__tests__/index.spec.js +114 -0
- package/src/incubator/gradient/__tests__/useAngleTransform.spec.js +126 -0
- package/src/incubator/slider/__tests__/SliderPresenter.spec.js +43 -0
- package/src/incubator/slider/__tests__/index.spec.js +34 -0
- package/src/incubator/slider/slider.api.json +11 -0
- package/src/incubator/toast/__tests__/index.spec.js +64 -0
- package/src/style/__tests__/colors.spec.js +313 -0
- package/src/style/__tests__/scheme.spec.js +119 -0
- package/src/style/typographyPresets.js +26 -23
- package/src/utils/__tests__/Playground.perf.js +14 -0
- package/src/utils/__tests__/imageUtils.spec.js +54 -0
- package/src/utils/__tests__/textUtils.spec.js +446 -0
- package/.eslintrc.js +0 -56
- package/babel.config.js +0 -35
- package/index.js +0 -10
- package/lib/android/build.gradle +0 -32
- package/lib/android/src/main/AndroidManifest.xml +0 -4
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.java +0 -139
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightFrame.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightViewTagParams.java +0 -50
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterView.java +0 -167
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +0 -131
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/UiUtils.java +0 -50
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.java +0 -52
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.java +0 -213
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.java +0 -39
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewManager.java +0 -29
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewShadow.java +0 -29
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.java +0 -34
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.java +0 -49
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.java +0 -16
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java +0 -83
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor.java +0 -163
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/PredicateFunc.java +0 -5
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils.java +0 -65
- package/lib/android/src/main/java/com/wix/reactnativeuilib/utils/LogForwarder.java +0 -45
- package/lib/android/src/main/res/layout/wheel_picker.xml +0 -9
- package/lib/android/src/main/res/values/colors.xml +0 -9
- package/lib/android/src/main/res/values/styles.xml +0 -9
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/keyboardRegistry.api.json +0 -50
- package/lib/components/Keyboard/KeyboardAccessoryView/keyboardAccessoryView.api.json +0 -58
- package/lib/components/Keyboard/KeyboardAwareInsetsView/keyboardAwareInsetsView.api.json +0 -14
- package/lib/components/Keyboard/KeyboardTrackingView/keyboardTrackingView.api.json +0 -86
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.h +0 -9
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.m +0 -115
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.h +0 -19
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.m +0 -216
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.h +0 -6
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.m +0 -28
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.h +0 -39
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.m +0 -160
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.h +0 -36
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.m +0 -121
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.h +0 -48
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.m +0 -27
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolation.h +0 -16
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.h +0 -19
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.mm +0 -155
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h +0 -16
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +0 -450
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +0 -18
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +0 -99
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.h +0 -14
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +0 -827
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.h +0 -44
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +0 -171
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.h +0 -6
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.m +0 -17
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.h +0 -6
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.m +0 -105
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.h +0 -5
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.m +0 -20
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.h +0 -7
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.m +0 -76
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.h +0 -9
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.m +0 -14
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.h +0 -5
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.m +0 -26
- package/lib/ios/reactnativeuilib.xcodeproj/project.pbxproj +0 -435
- package/metro.config.js +0 -23
- package/src/.babelrc.json +0 -23
- package/src/assets/Assets.d.ts +0 -5
- package/src/assets/emojis/index.d.ts +0 -1343
- package/src/assets/index.d.ts +0 -3
- package/src/assets/internal/index.d.ts +0 -4
- package/src/commons/Config.d.ts +0 -24
- package/src/commons/Constants.d.ts +0 -54
- package/src/commons/UIComponent.d.ts +0 -4
- package/src/commons/asBaseComponent.d.ts +0 -15
- package/src/commons/baseComponent.d.ts +0 -2
- package/src/commons/forwardRef.d.ts +0 -8
- package/src/commons/modifiers.d.ts +0 -118
- package/src/commons/new.d.ts +0 -8
- package/src/commons/withScrollEnabler.d.ts +0 -13
- package/src/commons/withScrollReached.d.ts +0 -35
- package/src/components/WheelPicker/Item.d.ts +0 -28
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +0 -18
- package/src/components/WheelPicker/WheelPickerItem.driver.d.ts +0 -8
- package/src/components/WheelPicker/helpers/useListMiddleIndex.d.ts +0 -6
- package/src/components/WheelPicker/index.d.ts +0 -88
- package/src/components/WheelPicker/types.d.ts +0 -6
- package/src/components/WheelPicker/usePresenter.d.ts +0 -21
- package/src/components/actionBar/index.d.ts +0 -35
- package/src/components/actionSheet/index.d.ts +0 -80
- package/src/components/animatedImage/index.d.ts +0 -28
- package/src/components/avatar/index.d.ts +0 -382
- package/src/components/badge/index.d.ts +0 -879
- package/src/components/baseInput/Validators.d.ts +0 -8
- package/src/components/baseInput/index.d.ts +0 -29
- package/src/components/button/Button.driver.new.d.ts +0 -34
- package/src/components/button/ButtonConstants.d.ts +0 -26
- package/src/components/button/index.d.ts +0 -572
- package/src/components/button/types.d.ts +0 -153
- package/src/components/card/CardContext.d.ts +0 -3
- package/src/components/card/CardImage.d.ts +0 -20
- package/src/components/card/CardPresenter.d.ts +0 -12
- package/src/components/card/CardSection.d.ts +0 -79
- package/src/components/card/asCardChild.d.ts +0 -6
- package/src/components/card/index.d.ts +0 -120
- package/src/components/carousel/Carousel.driver.new.d.ts +0 -9
- package/src/components/carousel/CarouselPresenter.d.ts +0 -9
- package/src/components/carousel/index.d.ts +0 -73
- package/src/components/carousel/types.d.ts +0 -107
- package/src/components/checkbox/Checkbox.driver.d.ts +0 -15
- package/src/components/checkbox/index.d.ts +0 -129
- package/src/components/chip/chip.driver.d.ts +0 -33
- package/src/components/chip/index.d.ts +0 -209
- package/src/components/chipsInput/index.d.ts +0 -55
- package/src/components/colorPalette/index.d.ts +0 -116
- package/src/components/colorPicker/ColorPickerDialog.d.ts +0 -39
- package/src/components/colorPicker/ColorPickerDialogHeader.d.ts +0 -9
- package/src/components/colorPicker/ColorPickerDialogSliders.d.ts +0 -10
- package/src/components/colorPicker/ColorPickerPresenter.d.ts +0 -16
- package/src/components/colorPicker/ColorPickerPreview.d.ts +0 -12
- package/src/components/colorPicker/index.d.ts +0 -45
- package/src/components/colorSwatch/index.d.ts +0 -50
- package/src/components/connectionStatusBar/index.d.ts +0 -33
- package/src/components/connectionStatusBar/types.d.ts +0 -28
- package/src/components/dash/index.d.ts +0 -19
- package/src/components/dateTimePicker/DateTimePicker.driver.d.ts +0 -7
- package/src/components/dateTimePicker/index.d.ts +0 -288
- package/src/components/dateTimePicker/useOldApi.d.ts +0 -27
- package/src/components/dialog/Dialog.driver.new.d.ts +0 -6
- package/src/components/dialog/DialogHeader.d.ts +0 -4
- package/src/components/dialog/index.d.ts +0 -15
- package/src/components/dialog/types.d.ts +0 -138
- package/src/components/dialog/useDialogContent.d.ts +0 -13
- package/src/components/drawer/Swipeable.d.ts +0 -94
- package/src/components/drawer/index.d.ts +0 -161
- package/src/components/expandableSection/index.d.ts +0 -40
- package/src/components/fadedScrollView/index.d.ts +0 -59
- package/src/components/fader/index.d.ts +0 -37
- package/src/components/featureHighlight/index.d.ts +0 -147
- package/src/components/floatingButton/index.d.ts +0 -85
- package/src/components/gradient/index.d.ts +0 -19
- package/src/components/gridList/index.d.ts +0 -5
- package/src/components/gridList/types.d.ts +0 -29
- package/src/components/gridList/useGridLayout.d.ts +0 -15
- package/src/components/gridListItem/index.d.ts +0 -132
- package/src/components/gridView/index.d.ts +0 -80
- package/src/components/hint/Hint.driver.d.ts +0 -6
- package/src/components/hint/Hint.driver.new.d.ts +0 -19
- package/src/components/hint/HintAnchor.d.ts +0 -13
- package/src/components/hint/HintBubble.d.ts +0 -12
- package/src/components/hint/HintMockChildren.d.ts +0 -8
- package/src/components/hint/HintOld.d.ts +0 -196
- package/src/components/hint/hooks/useHintAccessibility.d.ts +0 -10
- package/src/components/hint/hooks/useHintLayout.d.ts +0 -13
- package/src/components/hint/hooks/useHintPosition.d.ts +0 -29
- package/src/components/hint/hooks/useHintVisibility.d.ts +0 -6
- package/src/components/hint/index.d.ts +0 -14
- package/src/components/hint/types.d.ts +0 -106
- package/src/components/icon/index.d.ts +0 -97
- package/src/components/image/Image.driver.d.ts +0 -4
- package/src/components/image/Image.driver.new.d.ts +0 -2
- package/src/components/image/index.d.ts +0 -192
- package/src/components/listItem/ListItemPart.d.ts +0 -15
- package/src/components/listItem/index.d.ts +0 -52
- package/src/components/listItem/types.d.ts +0 -60
- package/src/components/loaderScreen/index.d.ts +0 -13
- package/src/components/loaderScreen/types.d.ts +0 -32
- package/src/components/marquee/index.d.ts +0 -5
- package/src/components/marquee/types.d.ts +0 -35
- package/src/components/maskedInput/index.d.ts +0 -5
- package/src/components/maskedInput/new.d.ts +0 -22
- package/src/components/modal/Modal.driver.new.d.ts +0 -8
- package/src/components/modal/TopBar.d.ts +0 -89
- package/src/components/modal/index.d.ts +0 -64
- package/src/components/numberInput/NumberInput.driver.d.ts +0 -6
- package/src/components/numberInput/Presenter.d.ts +0 -21
- package/src/components/numberInput/index.d.ts +0 -57
- package/src/components/overlay/index.d.ts +0 -68
- package/src/components/pageControl/index.d.ts +0 -56
- package/src/components/panView/index.d.ts +0 -21
- package/src/components/panView/panningUtil.d.ts +0 -38
- package/src/components/panView/usePanGesture.d.ts +0 -49
- package/src/components/picker/Picker.driver.new.d.ts +0 -44
- package/src/components/picker/PickerContext.d.ts +0 -4
- package/src/components/picker/PickerItem.d.ts +0 -11
- package/src/components/picker/PickerItemsList.d.ts +0 -4
- package/src/components/picker/PickerPresenter.d.ts +0 -7
- package/src/components/picker/PickerSelectionStatusBar.d.ts +0 -3
- package/src/components/picker/helpers/useFieldType.d.ts +0 -373
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +0 -5
- package/src/components/picker/helpers/useNewPickerProps.d.ts +0 -3
- package/src/components/picker/helpers/usePickerLabel.d.ts +0 -17
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +0 -4
- package/src/components/picker/helpers/usePickerSearch.d.ts +0 -9
- package/src/components/picker/helpers/usePickerSelection.d.ts +0 -16
- package/src/components/picker/index.d.ts +0 -15
- package/src/components/picker/types.d.ts +0 -321
- package/src/components/pieChart/PieSegment.d.ts +0 -34
- package/src/components/pieChart/index.d.ts +0 -15
- package/src/components/progressBar/index.d.ts +0 -65
- package/src/components/progressiveImage/index.d.ts +0 -23
- package/src/components/radioButton/RadioButton.driver.d.ts +0 -9
- package/src/components/radioButton/index.d.ts +0 -121
- package/src/components/radioGroup/RadioGroup.driver.d.ts +0 -13
- package/src/components/radioGroup/RadioGroupContext.d.ts +0 -14
- package/src/components/radioGroup/asRadioGroupChild.d.ts +0 -2
- package/src/components/radioGroup/index.d.ts +0 -47
- package/src/components/scrollBar/index.d.ts +0 -88
- package/src/components/searchInput/index.d.ts +0 -37
- package/src/components/searchInput/types.d.ts +0 -66
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +0 -25
- package/src/components/sectionsWheelPicker/index.d.ts +0 -43
- package/src/components/segmentedControl/index.d.ts +0 -90
- package/src/components/segmentedControl/segment.d.ts +0 -111
- package/src/components/segmentedControl/useSegmentedControlPreset.d.ts +0 -10
- package/src/components/skeletonView/index.d.ts +0 -163
- package/src/components/slider/ColorSliderGroup.d.ts +0 -13
- package/src/components/slider/GradientSlider.d.ts +0 -20
- package/src/components/slider/SliderContext.d.ts +0 -8
- package/src/components/slider/Thumb.d.ts +0 -32
- package/src/components/slider/index.d.ts +0 -31
- package/src/components/slider/slider.driver.d.ts +0 -5
- package/src/components/slider/types.d.ts +0 -197
- package/src/components/sortableGridList/SortableItem.d.ts +0 -6
- package/src/components/sortableGridList/index.d.ts +0 -5
- package/src/components/sortableGridList/types.d.ts +0 -34
- package/src/components/sortableGridList/usePresenter.d.ts +0 -21
- package/src/components/sortableList/SortableList.driver.new.d.ts +0 -2
- package/src/components/sortableList/SortableListContext.d.ts +0 -19
- package/src/components/sortableList/SortableListItem.d.ts +0 -8
- package/src/components/sortableList/SortableListItem.driver.new.d.ts +0 -11
- package/src/components/sortableList/index.d.ts +0 -5
- package/src/components/sortableList/types.d.ts +0 -48
- package/src/components/sortableList/usePresenter.d.ts +0 -12
- package/src/components/stackAggregator/index.d.ts +0 -89
- package/src/components/stateScreen/index.d.ts +0 -5
- package/src/components/stateScreen/types.d.ts +0 -30
- package/src/components/stepper/index.d.ts +0 -47
- package/src/components/svgImage/index.d.ts +0 -14
- package/src/components/svgImage/index.web.d.ts +0 -18
- package/src/components/switch/index.d.ts +0 -102
- package/src/components/switch/switch.driver.d.ts +0 -18
- package/src/components/tabController/PageCarousel.d.ts +0 -9
- package/src/components/tabController/TabBar.d.ts +0 -97
- package/src/components/tabController/TabBarContext.d.ts +0 -18
- package/src/components/tabController/TabBarItem.d.ts +0 -105
- package/src/components/tabController/TabPage.d.ts +0 -33
- package/src/components/tabController/index.d.ts +0 -48
- package/src/components/tabController/useImperativeTabControllerHandle.d.ts +0 -6
- package/src/components/tabController/useScrollToItem.d.ts +0 -79
- package/src/components/text/Text.driver.d.ts +0 -7
- package/src/components/text/Text.driver.new.d.ts +0 -17
- package/src/components/text/index.d.ts +0 -195
- package/src/components/textField/CharCounter.d.ts +0 -7
- package/src/components/textField/ClearButton.d.ts +0 -4
- package/src/components/textField/FieldContext.d.ts +0 -4
- package/src/components/textField/FloatingPlaceholder.d.ts +0 -7
- package/src/components/textField/Input.d.ts +0 -8
- package/src/components/textField/Label.d.ts +0 -7
- package/src/components/textField/Presenter.d.ts +0 -7
- package/src/components/textField/TextField.driver.new.d.ts +0 -129
- package/src/components/textField/ValidationMessage.d.ts +0 -7
- package/src/components/textField/index.d.ts +0 -114
- package/src/components/textField/presets/outline.d.ts +0 -737
- package/src/components/textField/presets/underline.d.ts +0 -735
- package/src/components/textField/textInput/index.d.ts +0 -1
- package/src/components/textField/textInput/index.web.d.ts +0 -3
- package/src/components/textField/types.d.ts +0 -287
- package/src/components/textField/useFieldState.d.ts +0 -16
- package/src/components/textField/useImperativeInputHandle.d.ts +0 -4
- package/src/components/textField/usePreset.d.ts +0 -1696
- package/src/components/textField/validators.d.ts +0 -9
- package/src/components/textFieldOld/index.d.ts +0 -71
- package/src/components/timeline/Line.d.ts +0 -10
- package/src/components/timeline/Point.d.ts +0 -9
- package/src/components/timeline/index.d.ts +0 -11
- package/src/components/timeline/line.driver.d.ts +0 -10
- package/src/components/timeline/point.driver.d.ts +0 -8
- package/src/components/timeline/timeline.driver.d.ts +0 -25
- package/src/components/timeline/types.d.ts +0 -50
- package/src/components/touchableOpacity/index.d.ts +0 -50
- package/src/components/view/View.driver.new.d.ts +0 -7
- package/src/components/view/index.d.ts +0 -46
- package/src/components/wizard/WizardStates.d.ts +0 -2
- package/src/components/wizard/WizardStep.d.ts +0 -4
- package/src/components/wizard/index.d.ts +0 -31
- package/src/components/wizard/types.d.ts +0 -90
- package/src/helpers/AvatarHelper.d.ts +0 -9
- package/src/helpers/FormattingPresenter.d.ts +0 -6
- package/src/helpers/Profiler.d.ts +0 -22
- package/src/helpers/index.d.ts +0 -3
- package/src/hooks/index.d.ts +0 -14
- package/src/hooks/useCombinedRefs/index.d.ts +0 -3
- package/src/hooks/useDebounce/index.d.ts +0 -5
- package/src/hooks/useDidUpdate/index.d.ts +0 -6
- package/src/hooks/useHiddenLocation/index.d.ts +0 -13
- package/src/hooks/useHiddenLocation/index.web.d.ts +0 -13
- package/src/hooks/useKeyboardHeight/index.d.ts +0 -5
- package/src/hooks/useMeasure/index.d.ts +0 -15
- package/src/hooks/useModifiers/index.d.ts +0 -3
- package/src/hooks/useOrientation/index.d.ts +0 -7
- package/src/hooks/useScrollEnabler/index.d.ts +0 -23
- package/src/hooks/useScrollReached/index.d.ts +0 -28
- package/src/hooks/useScrollTo/index.d.ts +0 -37
- package/src/hooks/useScrollToItem/index.d.ts +0 -65
- package/src/hooks/useThemeProps/index.d.ts +0 -2
- package/src/hooks/useToggleValue/index.d.ts +0 -2
- package/src/incubator/TouchableOpacity.d.ts +0 -52
- package/src/incubator/calendar/Agenda.d.ts +0 -4
- package/src/incubator/calendar/CalendarContext.d.ts +0 -4
- package/src/incubator/calendar/CalendarItem.d.ts +0 -5
- package/src/incubator/calendar/Day.d.ts +0 -4
- package/src/incubator/calendar/Day_OLD.d.ts +0 -4
- package/src/incubator/calendar/Header.d.ts +0 -4
- package/src/incubator/calendar/Month.d.ts +0 -4
- package/src/incubator/calendar/TodayButton.d.ts +0 -4
- package/src/incubator/calendar/Week.d.ts +0 -4
- package/src/incubator/calendar/WeekDaysNames.d.ts +0 -4
- package/src/incubator/calendar/helpers/CalendarProcessor.d.ts +0 -2
- package/src/incubator/calendar/helpers/DataProcessor.d.ts +0 -2
- package/src/incubator/calendar/helpers/DateUtils.d.ts +0 -23
- package/src/incubator/calendar/index.d.ts +0 -7
- package/src/incubator/calendar/types.d.ts +0 -118
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.d.ts +0 -7
- package/src/incubator/expandableOverlay/index.d.ts +0 -83
- package/src/incubator/gradient/BorderGradient.d.ts +0 -4
- package/src/incubator/gradient/CircleGradient.d.ts +0 -4
- package/src/incubator/gradient/RectangleGradient.d.ts +0 -4
- package/src/incubator/gradient/index.d.ts +0 -5
- package/src/incubator/gradient/types.d.ts +0 -26
- package/src/incubator/gradient/useAngleTransform.d.ts +0 -27
- package/src/incubator/index.d.ts +0 -9
- package/src/incubator/slider/Slider.driver.d.ts +0 -5
- package/src/incubator/slider/SliderPresenter.d.ts +0 -6
- package/src/incubator/slider/Thumb.d.ts +0 -24
- package/src/incubator/slider/Track.d.ts +0 -13
- package/src/incubator/slider/index.d.ts +0 -139
- package/src/incubator/toast/Toast.driver.new.d.ts +0 -54
- package/src/incubator/toast/helpers/useToastAnimation.d.ts +0 -22
- package/src/incubator/toast/helpers/useToastPresets.d.ts +0 -8
- package/src/incubator/toast/helpers/useToastTimer.d.ts +0 -6
- package/src/incubator/toast/index.d.ts +0 -9
- package/src/incubator/toast/types.d.ts +0 -111
- package/src/index.d.ts +0 -92
- package/src/optionalDependencies/BlurViewPackage.d.ts +0 -2
- package/src/optionalDependencies/BlurViewPackage.web.d.ts +0 -2
- package/src/optionalDependencies/DateTimePickerPackage.d.ts +0 -2
- package/src/optionalDependencies/FlashListPackage.d.ts +0 -2
- package/src/optionalDependencies/HapticFeedbackPackage.d.ts +0 -2
- package/src/optionalDependencies/LinearGradientPackage.d.ts +0 -2
- package/src/optionalDependencies/MomentPackage.d.ts +0 -2
- package/src/optionalDependencies/NetInfoPackage.d.ts +0 -2
- package/src/optionalDependencies/PostCssPackage.d.ts +0 -5
- package/src/optionalDependencies/ShimmerPackage.d.ts +0 -2
- package/src/optionalDependencies/SvgPackage.d.ts +0 -3
- package/src/optionalDependencies/index.d.ts +0 -9
- package/src/optionalDependencies/index.web.d.ts +0 -7
- package/src/services/HapticService.d.ts +0 -15
- package/src/services/LogService.d.ts +0 -35
- package/src/services/index.d.ts +0 -2
- package/src/style/borderRadiuses.d.ts +0 -30
- package/src/style/colorName.d.ts +0 -8
- package/src/style/colorNameMap.d.ts +0 -2
- package/src/style/colors.d.ts +0 -274
- package/src/style/colorsPalette.d.ts +0 -101
- package/src/style/components.d.ts +0 -15
- package/src/style/componentsColors.d.ts +0 -5
- package/src/style/designTokens.d.ts +0 -69
- package/src/style/designTokensDM.d.ts +0 -69
- package/src/style/dividers.d.ts +0 -11
- package/src/style/index.d.ts +0 -13
- package/src/style/scheme.d.ts +0 -57
- package/src/style/shadows.d.ts +0 -223
- package/src/style/spacings.d.ts +0 -32
- package/src/style/themeManager.d.ts +0 -22
- package/src/style/typography.d.ts +0 -26
- package/src/style/typographyPresets.d.ts +0 -7
- package/src/testkit/Component.driver.d.ts +0 -30
- package/src/testkit/DriverException.d.ts +0 -12
- package/src/testkit/UniDriver.d.ts +0 -29
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +0 -26
- package/src/testkit/index.d.ts +0 -25
- package/src/testkit/new/Component.driver.d.ts +0 -16
- package/src/testkit/new/useDraggable.driver.d.ts +0 -15
- package/src/testkit/new/usePressable.driver.d.ts +0 -14
- package/src/testkit/new/useScrollable.driver.d.ts +0 -13
- package/src/typings/assets.d.ts +0 -52
- package/src/typings/common.d.ts +0 -12
- package/src/typings/module.d.ts +0 -13
- package/src/typings/recorderTypes.d.ts +0 -13
- package/src/uilib-test-renderer/helper.d.ts +0 -8
- package/src/uilib-test-renderer/index.d.ts +0 -4
- package/src/uilib-test-renderer/scrollViewHelper.d.ts +0 -9
- package/src/utils/dateUtils.d.ts +0 -2
- package/src/utils/imageUtils.d.ts +0 -5
- package/src/utils/index.d.ts +0 -4
- package/src/utils/styleUtils.d.ts +0 -7
- package/src/utils/textUtils.d.ts +0 -8
- /package/{src → scripts/build}/.babelrc.exports.js +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { default as Constants, updateConstants, _reset } from "../Constants";
|
|
2
|
+
describe('Constants', () => {
|
|
3
|
+
beforeEach(() => {
|
|
4
|
+
_reset();
|
|
5
|
+
});
|
|
6
|
+
describe('Breakpoints and Page Margins', () => {
|
|
7
|
+
it('getPageMargins without init should return 0', () => {
|
|
8
|
+
expect(Constants.getPageMargins()).toBe(0);
|
|
9
|
+
});
|
|
10
|
+
it('getPageMargins with one breakpoint', () => {
|
|
11
|
+
const original = {
|
|
12
|
+
screen: {
|
|
13
|
+
width: Constants.screenWidth,
|
|
14
|
+
height: Constants.screenHeight
|
|
15
|
+
},
|
|
16
|
+
window: {
|
|
17
|
+
width: Constants.windowWidth,
|
|
18
|
+
height: Constants.windowHeight
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
updateConstants({
|
|
22
|
+
screen: {
|
|
23
|
+
width: 50,
|
|
24
|
+
height: 50
|
|
25
|
+
},
|
|
26
|
+
window: {
|
|
27
|
+
width: 50,
|
|
28
|
+
height: 50
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Constants.setBreakpoints([{
|
|
32
|
+
breakpoint: 100,
|
|
33
|
+
pageMargin: 5
|
|
34
|
+
}]);
|
|
35
|
+
expect(Constants.getPageMargins()).toBe(0);
|
|
36
|
+
updateConstants(original);
|
|
37
|
+
expect(Constants.getPageMargins()).toBe(5);
|
|
38
|
+
});
|
|
39
|
+
it('getPageMargins with one breakpoint and a default', () => {
|
|
40
|
+
const original = {
|
|
41
|
+
screen: {
|
|
42
|
+
width: Constants.screenWidth,
|
|
43
|
+
height: Constants.screenHeight
|
|
44
|
+
},
|
|
45
|
+
window: {
|
|
46
|
+
width: Constants.windowWidth,
|
|
47
|
+
height: Constants.windowHeight
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
updateConstants({
|
|
51
|
+
screen: {
|
|
52
|
+
width: 50,
|
|
53
|
+
height: 50
|
|
54
|
+
},
|
|
55
|
+
window: {
|
|
56
|
+
width: 50,
|
|
57
|
+
height: 50
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Constants.setBreakpoints([{
|
|
61
|
+
breakpoint: 100,
|
|
62
|
+
pageMargin: 5
|
|
63
|
+
}], {
|
|
64
|
+
defaultMargin: 3
|
|
65
|
+
});
|
|
66
|
+
expect(Constants.getPageMargins()).toBe(3);
|
|
67
|
+
updateConstants(original);
|
|
68
|
+
expect(Constants.getPageMargins()).toBe(5);
|
|
69
|
+
});
|
|
70
|
+
it('getPageMargins with three breakpoints', () => {
|
|
71
|
+
const original = {
|
|
72
|
+
screen: {
|
|
73
|
+
width: Constants.screenWidth,
|
|
74
|
+
height: Constants.screenHeight
|
|
75
|
+
},
|
|
76
|
+
window: {
|
|
77
|
+
width: Constants.windowWidth,
|
|
78
|
+
height: Constants.windowHeight
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
updateConstants({
|
|
82
|
+
screen: {
|
|
83
|
+
width: 50,
|
|
84
|
+
height: 50
|
|
85
|
+
},
|
|
86
|
+
window: {
|
|
87
|
+
width: 50,
|
|
88
|
+
height: 50
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Constants.setBreakpoints([{
|
|
92
|
+
breakpoint: 100,
|
|
93
|
+
pageMargin: 5
|
|
94
|
+
}, {
|
|
95
|
+
breakpoint: 1000,
|
|
96
|
+
pageMargin: 10
|
|
97
|
+
}]);
|
|
98
|
+
expect(Constants.getPageMargins()).toBe(0);
|
|
99
|
+
updateConstants({
|
|
100
|
+
screen: {
|
|
101
|
+
width: 1200,
|
|
102
|
+
height: 1200
|
|
103
|
+
},
|
|
104
|
+
window: {
|
|
105
|
+
width: 1200,
|
|
106
|
+
height: 1200
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
expect(Constants.getPageMargins()).toBe(10);
|
|
110
|
+
updateConstants(original);
|
|
111
|
+
expect(Constants.getPageMargins()).toBe(5);
|
|
112
|
+
});
|
|
113
|
+
it('getPageMargins with three breakpoints and a default', () => {
|
|
114
|
+
const original = {
|
|
115
|
+
screen: {
|
|
116
|
+
width: Constants.screenWidth,
|
|
117
|
+
height: Constants.screenHeight
|
|
118
|
+
},
|
|
119
|
+
window: {
|
|
120
|
+
width: Constants.windowWidth,
|
|
121
|
+
height: Constants.windowHeight
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
updateConstants({
|
|
125
|
+
screen: {
|
|
126
|
+
width: 50,
|
|
127
|
+
height: 50
|
|
128
|
+
},
|
|
129
|
+
window: {
|
|
130
|
+
width: 50,
|
|
131
|
+
height: 50
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
Constants.setBreakpoints([{
|
|
135
|
+
breakpoint: 100,
|
|
136
|
+
pageMargin: 5
|
|
137
|
+
}, {
|
|
138
|
+
breakpoint: 1000,
|
|
139
|
+
pageMargin: 10
|
|
140
|
+
}], {
|
|
141
|
+
defaultMargin: 3
|
|
142
|
+
});
|
|
143
|
+
expect(Constants.getPageMargins()).toBe(3);
|
|
144
|
+
updateConstants({
|
|
145
|
+
screen: {
|
|
146
|
+
width: 1200,
|
|
147
|
+
height: 1200
|
|
148
|
+
},
|
|
149
|
+
window: {
|
|
150
|
+
width: 1200,
|
|
151
|
+
height: 1200
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
expect(Constants.getPageMargins()).toBe(10);
|
|
155
|
+
updateConstants(original);
|
|
156
|
+
expect(Constants.getPageMargins()).toBe(5);
|
|
157
|
+
});
|
|
158
|
+
it('setBreakpoints should arrange input in order', () => {
|
|
159
|
+
const original = {
|
|
160
|
+
screen: {
|
|
161
|
+
width: Constants.screenWidth,
|
|
162
|
+
height: Constants.screenHeight
|
|
163
|
+
},
|
|
164
|
+
window: {
|
|
165
|
+
width: Constants.windowWidth,
|
|
166
|
+
height: Constants.windowHeight
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
updateConstants({
|
|
170
|
+
screen: {
|
|
171
|
+
width: 50,
|
|
172
|
+
height: 50
|
|
173
|
+
},
|
|
174
|
+
window: {
|
|
175
|
+
width: 50,
|
|
176
|
+
height: 50
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
Constants.setBreakpoints([{
|
|
180
|
+
breakpoint: 1000,
|
|
181
|
+
pageMargin: 10
|
|
182
|
+
}, {
|
|
183
|
+
breakpoint: 100,
|
|
184
|
+
pageMargin: 5
|
|
185
|
+
}]);
|
|
186
|
+
expect(Constants.getPageMargins()).toBe(0);
|
|
187
|
+
updateConstants({
|
|
188
|
+
screen: {
|
|
189
|
+
width: 1200,
|
|
190
|
+
height: 1200
|
|
191
|
+
},
|
|
192
|
+
window: {
|
|
193
|
+
width: 1200,
|
|
194
|
+
height: 1200
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
expect(Constants.getPageMargins()).toBe(10);
|
|
198
|
+
updateConstants(original);
|
|
199
|
+
expect(Constants.getPageMargins()).toBe(5);
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
});
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import {ThemeManager, Colors, Typography, BorderRadiuses, Spacings} from '../../style';
|
|
3
|
+
import * as uut from '../modifiers';
|
|
4
|
+
|
|
5
|
+
describe('Modifiers', () => {
|
|
6
|
+
const SampleComponent = () => {};
|
|
7
|
+
SampleComponent.displayName = 'SampleComponent';
|
|
8
|
+
SampleComponent.propTypes = {
|
|
9
|
+
prop1: PropTypes.string,
|
|
10
|
+
prop2: PropTypes.number
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('extractColorValue', () => {
|
|
14
|
+
it('should return color value according to modifier', () => {
|
|
15
|
+
expect(uut.extractColorValue({red30: true})).toBe(Colors.red30);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should take last color passed as modifier', () => {
|
|
19
|
+
expect(uut.extractColorValue({red30: true, green10: false, purple50: true})).toBe(Colors.purple50);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('background modifiers', () => {
|
|
24
|
+
it('should return color value according to background-?? prop that was sent', () => {
|
|
25
|
+
expect(uut.extractBackgroundColorValue({'background-red30': true})).toBe(Colors.red30);
|
|
26
|
+
expect(uut.extractBackgroundColorValue({'bg-red30': true})).toBe(Colors.red30);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should return undefined value for unfamiliar color const', () => {
|
|
30
|
+
expect(uut.extractBackgroundColorValue({'background-uknown30': true})).toBe(undefined);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('extractTypographyValue', () => {
|
|
35
|
+
it('should extract typography value according to typography modifier', () => {
|
|
36
|
+
expect(uut.extractTypographyValue({text40: true})).toEqual(Typography.text40);
|
|
37
|
+
expect(uut.extractTypographyValue({text70: true})).toEqual(Typography.text70);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should return undefined if not typography modifier was sent', () => {
|
|
41
|
+
expect(uut.extractTypographyValue({})).toEqual(undefined);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should ignore modifiers with false value', () => {
|
|
45
|
+
expect(uut.extractTypographyValue({
|
|
46
|
+
text40: true,
|
|
47
|
+
text70: false
|
|
48
|
+
})).toEqual(Typography.text40);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should prioritize last typography modifier prop in case there is more than one', () => {
|
|
52
|
+
expect(uut.extractTypographyValue({
|
|
53
|
+
text40: true,
|
|
54
|
+
text70: true
|
|
55
|
+
})).toEqual(Typography.text70);
|
|
56
|
+
expect(uut.extractTypographyValue({
|
|
57
|
+
text70: true,
|
|
58
|
+
text40: true
|
|
59
|
+
})).toEqual(Typography.text40);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should return value of the custom made typography', () => {
|
|
63
|
+
const customTypography = {fontSize: Typography.text30.fontSize, fontWeight: '400'};
|
|
64
|
+
Typography.loadTypographies({customTypography});
|
|
65
|
+
expect(uut.extractTypographyValue({customTypography: true})).toEqual(customTypography);
|
|
66
|
+
expect(uut.extractTypographyValue({
|
|
67
|
+
text40: true,
|
|
68
|
+
customTypography: true
|
|
69
|
+
})).toEqual({...Typography.text40, ...customTypography});
|
|
70
|
+
expect(uut.extractTypographyValue({
|
|
71
|
+
customTypography: true,
|
|
72
|
+
text40: true
|
|
73
|
+
})).toEqual({...customTypography, ...Typography.text40});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should merge typography modifiers', () => {
|
|
77
|
+
const bold = {fontWeight: 'bold'};
|
|
78
|
+
Typography.loadTypographies({bold});
|
|
79
|
+
expect(uut.extractTypographyValue({text70: true, bold: true})).toEqual({
|
|
80
|
+
...Typography.text70,
|
|
81
|
+
fontWeight: 'bold'
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('extractPaddingValues - paddings modifiers', () => {
|
|
87
|
+
it('should return paddings values according to padding?-?? prop that was sent', () => {
|
|
88
|
+
expect(uut.extractPaddingValues({
|
|
89
|
+
'padding-25': true,
|
|
90
|
+
'paddingL-15': true,
|
|
91
|
+
'paddingT-10': true,
|
|
92
|
+
'paddingR-20': true,
|
|
93
|
+
'paddingB-15': true,
|
|
94
|
+
'paddingH-20': true,
|
|
95
|
+
'paddingV-15': true
|
|
96
|
+
})).toEqual({
|
|
97
|
+
padding: 25,
|
|
98
|
+
paddingLeft: 15,
|
|
99
|
+
paddingTop: 10,
|
|
100
|
+
paddingRight: 20,
|
|
101
|
+
paddingBottom: 15,
|
|
102
|
+
paddingHorizontal: 20,
|
|
103
|
+
paddingVertical: 15
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should ignore unfamiliar paddings keys', () => {
|
|
108
|
+
expect(uut.extractPaddingValues({'paddings-25': true})).toEqual({});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('should ignore non numeric padding values', () => {
|
|
112
|
+
expect(uut.extractPaddingValues({'padding-2a5': true})).toEqual({});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('should support Spacing preset for padding', () => {
|
|
116
|
+
expect(uut.extractPaddingValues({'padding-s3': true})).toEqual({padding: 12});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe('extractMarginValues - margins modifiers', () => {
|
|
121
|
+
it('should return margins values according to margin?-?? prop that was sent', () => {
|
|
122
|
+
expect(uut.extractMarginValues({
|
|
123
|
+
'margin-25': true,
|
|
124
|
+
'marginL-15': true,
|
|
125
|
+
'marginT-10': true,
|
|
126
|
+
'marginR-20': true,
|
|
127
|
+
'marginB-15': true,
|
|
128
|
+
'marginH-20': true,
|
|
129
|
+
'marginV-15': true
|
|
130
|
+
})).toEqual({
|
|
131
|
+
margin: 25,
|
|
132
|
+
marginLeft: 15,
|
|
133
|
+
marginTop: 10,
|
|
134
|
+
marginRight: 20,
|
|
135
|
+
marginBottom: 15,
|
|
136
|
+
marginHorizontal: 20,
|
|
137
|
+
marginVertical: 15
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('should ignore unfamiliar margin keys', () => {
|
|
142
|
+
expect(uut.extractMarginValues({'margins-25': true})).toEqual({});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('should ignore non numeric margin values', () => {
|
|
146
|
+
expect(uut.extractMarginValues({'margin-2a5': true})).toEqual({});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('should support Spacing preset for margin', () => {
|
|
150
|
+
expect(uut.extractMarginValues({'marginL-s4': true})).toEqual({marginLeft: 16});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
describe('extractAlignmentsValues - alignments modifiers', () => {
|
|
155
|
+
it('should return prop alignment for a row view', () => {
|
|
156
|
+
expect(uut.extractAlignmentsValues({row: true, left: true})).toEqual({
|
|
157
|
+
flexDirection: 'row',
|
|
158
|
+
justifyContent: 'flex-start'
|
|
159
|
+
});
|
|
160
|
+
expect(uut.extractAlignmentsValues({row: true, right: true})).toEqual({
|
|
161
|
+
flexDirection: 'row',
|
|
162
|
+
justifyContent: 'flex-end'
|
|
163
|
+
});
|
|
164
|
+
expect(uut.extractAlignmentsValues({row: true, top: true})).toEqual({
|
|
165
|
+
flexDirection: 'row',
|
|
166
|
+
alignItems: 'flex-start'
|
|
167
|
+
});
|
|
168
|
+
expect(uut.extractAlignmentsValues({row: true, bottom: true})).toEqual({
|
|
169
|
+
flexDirection: 'row',
|
|
170
|
+
alignItems: 'flex-end'
|
|
171
|
+
});
|
|
172
|
+
expect(uut.extractAlignmentsValues({row: true, centerH: true})).toEqual({
|
|
173
|
+
flexDirection: 'row',
|
|
174
|
+
justifyContent: 'center'
|
|
175
|
+
});
|
|
176
|
+
expect(uut.extractAlignmentsValues({row: true, centerV: true})).toEqual({
|
|
177
|
+
flexDirection: 'row',
|
|
178
|
+
alignItems: 'center'
|
|
179
|
+
});
|
|
180
|
+
expect(uut.extractAlignmentsValues({row: true, spread: true})).toEqual({
|
|
181
|
+
flexDirection: 'row',
|
|
182
|
+
justifyContent: 'space-between'
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('should return prop alignment for a column view (default)', () => {
|
|
187
|
+
expect(uut.extractAlignmentsValues({left: true})).toEqual({alignItems: 'flex-start'});
|
|
188
|
+
expect(uut.extractAlignmentsValues({right: true})).toEqual({alignItems: 'flex-end'});
|
|
189
|
+
expect(uut.extractAlignmentsValues({top: true})).toEqual({
|
|
190
|
+
justifyContent: 'flex-start'
|
|
191
|
+
});
|
|
192
|
+
expect(uut.extractAlignmentsValues({bottom: true})).toEqual({
|
|
193
|
+
justifyContent: 'flex-end'
|
|
194
|
+
});
|
|
195
|
+
expect(uut.extractAlignmentsValues({centerH: true})).toEqual({alignItems: 'center'});
|
|
196
|
+
expect(uut.extractAlignmentsValues({centerV: true})).toEqual({justifyContent: 'center'});
|
|
197
|
+
expect(uut.extractAlignmentsValues({spread: true})).toEqual({
|
|
198
|
+
justifyContent: 'space-between'
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it('should return center alignment for both axis', () => {
|
|
203
|
+
expect(uut.extractAlignmentsValues({center: true})).toEqual({
|
|
204
|
+
justifyContent: 'center',
|
|
205
|
+
alignItems: 'center'
|
|
206
|
+
});
|
|
207
|
+
expect(uut.extractAlignmentsValues({row: true, center: true})).toEqual({
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
justifyContent: 'center',
|
|
210
|
+
alignItems: 'center'
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
describe('extractPositionStyle', () => {
|
|
216
|
+
it('should return undefined when modifier prop is invalid/irrelevant', () => {
|
|
217
|
+
expect(uut.extractPositionStyle({abs: false})).toEqual(undefined);
|
|
218
|
+
expect(uut.extractPositionStyle({absK: true})).toEqual(undefined);
|
|
219
|
+
expect(uut.extractPositionStyle({absolute: true})).toEqual(undefined);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('should return absolute style', () => {
|
|
223
|
+
expect(uut.extractPositionStyle({abs: true})).toEqual({position: 'absolute'});
|
|
224
|
+
});
|
|
225
|
+
it('should return absolute fill object style', () => {
|
|
226
|
+
expect(uut.extractPositionStyle({absF: true})).toEqual({
|
|
227
|
+
position: 'absolute',
|
|
228
|
+
top: 0,
|
|
229
|
+
left: 0,
|
|
230
|
+
right: 0,
|
|
231
|
+
bottom: 0
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
it('should return absolute with top value', () => {
|
|
235
|
+
expect(uut.extractPositionStyle({absT: true})).toEqual({position: 'absolute', top: 0});
|
|
236
|
+
});
|
|
237
|
+
it('should return absolute with bottom value', () => {
|
|
238
|
+
expect(uut.extractPositionStyle({absB: true})).toEqual({position: 'absolute', bottom: 0});
|
|
239
|
+
});
|
|
240
|
+
it('should return absolute with left value', () => {
|
|
241
|
+
expect(uut.extractPositionStyle({absL: true})).toEqual({position: 'absolute', left: 0});
|
|
242
|
+
});
|
|
243
|
+
it('should return absolute with right value', () => {
|
|
244
|
+
expect(uut.extractPositionStyle({absR: true})).toEqual({position: 'absolute', right: 0});
|
|
245
|
+
});
|
|
246
|
+
it('should return absolute with vertical values', () => {
|
|
247
|
+
expect(uut.extractPositionStyle({absV: true})).toEqual({position: 'absolute', top: 0, bottom: 0});
|
|
248
|
+
});
|
|
249
|
+
it('should return absolute with horizontal values', () => {
|
|
250
|
+
expect(uut.extractPositionStyle({absH: true})).toEqual({position: 'absolute', left: 0, right: 0});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it('should combine multiple abs modifiers', () => {
|
|
254
|
+
expect(uut.extractPositionStyle({absB: true, absR: true})).toEqual({position: 'absolute', bottom: 0, right: 0});
|
|
255
|
+
expect(uut.extractPositionStyle({absH: true, absV: true})).toEqual({position: 'absolute', top: 0, left: 0, bottom: 0, right: 0});
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
describe('extractFlexStyle - flex modifier', () => {
|
|
260
|
+
it('should return flex style according to flex-? prop', () => {
|
|
261
|
+
expect(uut.extractFlexStyle({'flex-2': true})).toEqual({flex: 2});
|
|
262
|
+
expect(uut.extractFlexStyle({flex: true})).toEqual({flex: 1});
|
|
263
|
+
expect(uut.extractFlexStyle({'flex-0': true})).toEqual({flex: 0});
|
|
264
|
+
expect(uut.extractFlexStyle({})).toEqual(undefined);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('should handle flexG and flexS props', () => {
|
|
268
|
+
expect(uut.extractFlexStyle({'flexG-2': true})).toEqual({flexGrow: 2});
|
|
269
|
+
expect(uut.extractFlexStyle({flexG: true})).toEqual({flexGrow: 1});
|
|
270
|
+
expect(uut.extractFlexStyle({'flexS-3': true})).toEqual({flexShrink: 3});
|
|
271
|
+
expect(uut.extractFlexStyle({flexS: true})).toEqual({flexShrink: 1});
|
|
272
|
+
expect(uut.extractFlexStyle({flexG: false, flexS: false})).toEqual(undefined);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it('should handle bad usage', () => {
|
|
276
|
+
expect(uut.extractFlexStyle({'flexG-2s': true})).toEqual(undefined);
|
|
277
|
+
expect(uut.extractFlexStyle({'flex-aaa': true})).toEqual(undefined);
|
|
278
|
+
expect(uut.extractFlexStyle({'flexB-12': true})).toEqual(undefined);
|
|
279
|
+
expect(uut.extractFlexStyle({'flex-': true})).toEqual({flex: 1});
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
describe('extractBorderRadiusValue - BorderRadius modifier', () => {
|
|
284
|
+
it('should return border radius value according br? modifier prop', () => {
|
|
285
|
+
expect(uut.extractBorderRadiusValue({br10: true})).toEqual(BorderRadiuses.br10);
|
|
286
|
+
expect(uut.extractBorderRadiusValue({br20: true})).toEqual(BorderRadiuses.br20);
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
// describe('extractOwnProps', () => {
|
|
291
|
+
// it('should extract the component props from a props object', () => {
|
|
292
|
+
// const props = {color: 'red', topShadow: 1, bottomShadow: 2};
|
|
293
|
+
// expect(MultipleShadow.extractOwnProps(props)).toEqual({
|
|
294
|
+
// topShadow: 1,
|
|
295
|
+
// bottomShadow: 2,
|
|
296
|
+
// });
|
|
297
|
+
// });
|
|
298
|
+
|
|
299
|
+
// it('should omit props that were required to ignore', () => {
|
|
300
|
+
// const props = {color: 'red', topShadow: 1, bottomShadow: 2};
|
|
301
|
+
// expect(MultipleShadow.extractOwnProps(props, 'topShadow')).toEqual({
|
|
302
|
+
// bottomShadow: 2,
|
|
303
|
+
// });
|
|
304
|
+
// expect(MultipleShadow.extractOwnProps(props, ['topShadow', 'bottomShadow'])).toEqual({});
|
|
305
|
+
// });
|
|
306
|
+
// });
|
|
307
|
+
|
|
308
|
+
describe('extractModifiersProps', () => {
|
|
309
|
+
it('should return all modifiers props', () => {
|
|
310
|
+
expect(uut.extractModifierProps({
|
|
311
|
+
'paddingL-20': true,
|
|
312
|
+
'bg-red30': true,
|
|
313
|
+
other: 'some-value'
|
|
314
|
+
})).toEqual({
|
|
315
|
+
'paddingL-20': true,
|
|
316
|
+
'bg-red30': true
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
expect(uut.extractModifierProps({
|
|
320
|
+
'margin-50': true,
|
|
321
|
+
'background-blue20': true,
|
|
322
|
+
other: 'some-value'
|
|
323
|
+
})).toEqual({
|
|
324
|
+
'margin-50': true,
|
|
325
|
+
'background-blue20': true
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
expect(uut.extractModifierProps({left: true, 'bg-red10': false, other: 'some-value'})).toEqual({
|
|
329
|
+
left: true,
|
|
330
|
+
'bg-red10': false
|
|
331
|
+
});
|
|
332
|
+
expect(uut.extractModifierProps({
|
|
333
|
+
'paddingL-20': true,
|
|
334
|
+
'gap-10': true,
|
|
335
|
+
other: 'some-value'
|
|
336
|
+
})).toEqual({
|
|
337
|
+
'paddingL-20': true,
|
|
338
|
+
'gap-10': true
|
|
339
|
+
});
|
|
340
|
+
expect(uut.extractModifierProps({
|
|
341
|
+
'paddingL-20': true,
|
|
342
|
+
'gap-s3': true,
|
|
343
|
+
other: 'some-value'
|
|
344
|
+
})).toEqual({
|
|
345
|
+
'paddingL-20': true,
|
|
346
|
+
'gap-s3': true
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
describe('extractOwnProps', () => {
|
|
352
|
+
it('should extract the component props from a props object', () => {
|
|
353
|
+
const props = {color: 'red', prop1: 'text', prop2: 2};
|
|
354
|
+
expect(uut.extractOwnProps.bind(SampleComponent)(props)).toEqual({
|
|
355
|
+
prop1: 'text',
|
|
356
|
+
prop2: 2
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('should omit props that were required to ignore', () => {
|
|
361
|
+
const props = {color: 'red', prop1: 'text', prop2: 2};
|
|
362
|
+
expect(uut.extractOwnProps.bind(SampleComponent)(props, 'prop1')).toEqual({
|
|
363
|
+
prop2: 2
|
|
364
|
+
});
|
|
365
|
+
expect(uut.extractOwnProps.bind(SampleComponent)(props, ['prop1', 'prop2'])).toEqual({});
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
describe('getThemeProps', () => {
|
|
370
|
+
beforeEach(() => {
|
|
371
|
+
ThemeManager.setComponentTheme('SampleComponent', undefined);
|
|
372
|
+
ThemeManager.setComponentForcedTheme('SampleComponent', undefined);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it('should return props values from the Theme Manager if were defined', () => {
|
|
376
|
+
ThemeManager.setComponentTheme('SampleComponent', {prop1: 'themeValue'});
|
|
377
|
+
expect(uut.getThemeProps.call(SampleComponent, {})).toEqual({prop1: 'themeValue'});
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
it('should return override theme values with passed props values', () => {
|
|
381
|
+
ThemeManager.setComponentTheme('SampleComponent', {prop1: 'themeValue'});
|
|
382
|
+
expect(uut.getThemeProps.call(SampleComponent, {prop1: 'someValue'})).toEqual({prop1: 'someValue'});
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
it('should return props values from the Theme Manager merged with values from passed props', () => {
|
|
386
|
+
ThemeManager.setComponentTheme('SampleComponent', {prop1: 'themeValue'});
|
|
387
|
+
expect(uut.getThemeProps.call(SampleComponent, {prop2: 2})).toEqual({prop1: 'themeValue', prop2: 2});
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('should support getThemeProps callback that accepts current props and can condition returned props', () => {
|
|
391
|
+
ThemeManager.setComponentTheme('SampleComponent', props => ({prop1: props.test ? 'yes' : 'no'}));
|
|
392
|
+
expect(uut.getThemeProps.call(SampleComponent, {test: true})).toEqual({prop1: 'yes', test: true});
|
|
393
|
+
expect(uut.getThemeProps.call(SampleComponent, {test: false})).toEqual({prop1: 'no', test: false});
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it('should prioritize forced theme props over user props', () => {
|
|
397
|
+
ThemeManager.setComponentForcedTheme('SampleComponent', () => ({foo: 'forced'}));
|
|
398
|
+
expect(uut.getThemeProps.call(SampleComponent, {foo: 'user-value', other: 'other'})).toEqual({
|
|
399
|
+
foo: 'forced',
|
|
400
|
+
other: 'other'
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
describe('generateModifiersStyle', () => {
|
|
406
|
+
it('should generate modifiers object out of props', () => {
|
|
407
|
+
const modifiers = uut.generateModifiersStyle(undefined, {
|
|
408
|
+
'bg-red40': true,
|
|
409
|
+
'padding-20': true,
|
|
410
|
+
'margin-20': true,
|
|
411
|
+
flex: true,
|
|
412
|
+
bottom: true,
|
|
413
|
+
br100: true
|
|
414
|
+
});
|
|
415
|
+
expect(modifiers.backgroundColor).toBe(Colors.red40);
|
|
416
|
+
expect(modifiers.paddings).toEqual({padding: 20});
|
|
417
|
+
expect(modifiers.margins).toEqual({margin: 20});
|
|
418
|
+
expect(modifiers.flexStyle).toEqual({flex: 1});
|
|
419
|
+
expect(modifiers.alignments).toEqual({justifyContent: 'flex-end'});
|
|
420
|
+
expect(modifiers.borderRadius).toEqual(BorderRadiuses.br100);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
// TODO: enable this test once we fixed the issue with omitting empty values out of modifiers
|
|
424
|
+
it.skip('should not include empty modifiers values', () => {
|
|
425
|
+
const modifiers = uut.generateModifiersStyle(undefined, {'bg-red40': true});
|
|
426
|
+
expect(modifiers.backgroundColor).toBe(Colors.red40);
|
|
427
|
+
expect(modifiers.paddings).toBeUndefined();
|
|
428
|
+
expect(modifiers.margins).toBeUndefined();
|
|
429
|
+
expect(modifiers.flexStyle).toBeUndefined();
|
|
430
|
+
expect(modifiers.alignments).toBeUndefined();
|
|
431
|
+
expect(modifiers.borderRadius).toBeUndefined();
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
describe('extractGapValues', () => {
|
|
436
|
+
it('Should return gap 10', () => {
|
|
437
|
+
const gap = uut.extractGapValues({'gap-10': true});
|
|
438
|
+
expect(gap).toEqual(10);
|
|
439
|
+
});
|
|
440
|
+
it('Should return gap 20', () => {
|
|
441
|
+
const gap = uut.extractGapValues({'gap-20': true});
|
|
442
|
+
expect(gap).toEqual(20);
|
|
443
|
+
});
|
|
444
|
+
it('Should return gap spacing s3', () => {
|
|
445
|
+
const gap = uut.extractGapValues({'gap-s3': true});
|
|
446
|
+
expect(gap).toEqual(Spacings.s3);
|
|
447
|
+
});
|
|
448
|
+
it('Should return gap spacing s10', () => {
|
|
449
|
+
const gap = uut.extractGapValues({'gap-s10': true});
|
|
450
|
+
expect(gap).toEqual(Spacings.s10);
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
});
|