@gympass/yoga 7.88.0 → 7.88.2
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/cjs/Accordion/Accordion.theme.js +46 -0
- package/cjs/Accordion/index.js +35 -0
- package/cjs/ActionRequirement/ActionRequirement.theme.js +25 -0
- package/cjs/ActionRequirement/index.js +35 -0
- package/cjs/ActionRequirement/index.native.js +35 -0
- package/cjs/AutoComplete/AutoComplete.theme.js +77 -0
- package/cjs/AutoComplete/index.js +35 -0
- package/cjs/Avatar/Avatar.theme.js +25 -0
- package/cjs/Avatar/index.js +37 -0
- package/cjs/Avatar/index.native.js +37 -0
- package/cjs/Banner/Banner.theme.js +30 -0
- package/cjs/Banner/index.js +35 -0
- package/cjs/Banner/index.native.js +35 -0
- package/cjs/BottomSheet/BottomSheet.theme.js +44 -0
- package/cjs/BottomSheet/index.js +35 -0
- package/cjs/Box/index.js +35 -0
- package/cjs/Box/index.native.js +35 -0
- package/cjs/Button/Button.theme.js +157 -0
- package/cjs/Button/index.js +43 -0
- package/cjs/Button/index.native.js +41 -0
- package/cjs/Card/Card.native.theme.js +64 -0
- package/cjs/Card/Card.theme.js +177 -0
- package/cjs/Card/Card.web.theme.js +61 -0
- package/cjs/Card/index.js +32 -0
- package/cjs/Card/index.native.js +34 -0
- package/cjs/Checkbox/CheckIcon.js +25 -0
- package/cjs/Checkbox/Checkbox.theme.js +68 -0
- package/cjs/Checkbox/CheckboxSwitch.theme.js +90 -0
- package/cjs/Checkbox/index.js +26 -0
- package/cjs/Checkbox/index.native.js +26 -0
- package/cjs/Chips/index.js +35 -0
- package/cjs/Chips/index.native.js +35 -0
- package/cjs/Datepicker/Datepicker.theme.js +32 -0
- package/cjs/Datepicker/index.js +35 -0
- package/cjs/Dialog/Dialog.theme.js +43 -0
- package/cjs/Dialog/index.js +35 -0
- package/cjs/Divider/Divider.theme.js +25 -0
- package/cjs/Divider/index.js +35 -0
- package/cjs/Divider/index.native.js +35 -0
- package/cjs/Drawer/Drawer.theme.js +35 -0
- package/cjs/Drawer/index.js +35 -0
- package/cjs/Dropdown/Dropdown.theme.js +205 -0
- package/cjs/Dropdown/index.js +35 -0
- package/cjs/Dropdown/index.native.js +35 -0
- package/cjs/Feedback/Feedback.theme.js +29 -0
- package/cjs/Feedback/index.js +35 -0
- package/cjs/Grid/Grid.theme.js +43 -0
- package/cjs/Grid/index.js +34 -0
- package/cjs/Header/Header.theme.js +34 -0
- package/cjs/Header/index.js +35 -0
- package/cjs/Heading/Heading.theme.js +38 -0
- package/cjs/Heading/index.js +35 -0
- package/cjs/Icon/Icon.js +193 -0
- package/cjs/Icon/Icon.theme.js +25 -0
- package/cjs/Icon/index.js +35 -0
- package/cjs/Icon/index.native.js +35 -0
- package/cjs/Input/Input.theme.js +86 -0
- package/cjs/Input/index.js +30 -0
- package/cjs/Input/index.native.js +29 -0
- package/cjs/List/List.theme.js +49 -0
- package/cjs/List/index.js +27 -0
- package/cjs/List/index.native.js +26 -0
- package/cjs/Menu/Menu.theme.js +63 -0
- package/cjs/Menu/index.js +41 -0
- package/cjs/Popover/Popover.theme.js +25 -0
- package/cjs/Popover/index.js +35 -0
- package/cjs/Progress/Progress.theme.js +38 -0
- package/cjs/Progress/index.js +35 -0
- package/cjs/Progress/index.native.js +35 -0
- package/cjs/RadioGroup/RadioGroup.theme.js +76 -0
- package/cjs/RadioGroup/RadioGroupContext.js +26 -0
- package/cjs/RadioGroup/index.js +27 -0
- package/cjs/RadioGroup/index.native.js +27 -0
- package/cjs/Rating/Rating.theme.js +31 -0
- package/cjs/Rating/index.js +35 -0
- package/cjs/Rating/index.native.js +35 -0
- package/cjs/Result/Result.theme.js +25 -0
- package/cjs/Result/index.native.js +41 -0
- package/cjs/Skeleton/Skeleton.theme.js +42 -0
- package/cjs/Skeleton/index.js +35 -0
- package/cjs/Skeleton/index.native.js +35 -0
- package/cjs/Slider/Slider.theme.js +95 -0
- package/cjs/Slider/index.js +35 -0
- package/cjs/Slider/index.native.js +35 -0
- package/cjs/Snackbar/Snackbar.theme.js +81 -0
- package/cjs/Snackbar/index.js +35 -0
- package/cjs/Snackbar/index.native.js +35 -0
- package/cjs/Spinner/Spinner.theme.js +25 -0
- package/cjs/Spinner/index.js +35 -0
- package/cjs/Stepper/Stepper.theme.js +56 -0
- package/cjs/Stepper/activeDot.js +25 -0
- package/cjs/Stepper/index.js +26 -0
- package/cjs/Stepper/index.native.js +26 -0
- package/cjs/Tag/Tag.theme.js +58 -0
- package/cjs/Tag/index.js +37 -0
- package/cjs/Tag/index.native.js +37 -0
- package/cjs/Text/Text.theme.js +93 -0
- package/cjs/Text/index.js +39 -0
- package/cjs/Text/index.native.js +39 -0
- package/cjs/Text/sharedTextStyle.js +64 -0
- package/cjs/Text/textStyle.android.js +57 -0
- package/cjs/Text/textStyle.ios.js +39 -0
- package/cjs/Text/textStyle.web.js +47 -0
- package/cjs/TextArea/TextArea.theme.js +36 -0
- package/cjs/TextArea/index.js +35 -0
- package/cjs/TextArea/index.native.js +35 -0
- package/cjs/Theme/Provider/Provider.js +103 -0
- package/cjs/Theme/Provider/index.js +30 -0
- package/cjs/Theme/Provider/index.native.js +35 -0
- package/cjs/Theme/Provider/native/index.js +35 -0
- package/cjs/Theme/Provider/web/FontLoader.js +51 -0
- package/cjs/Theme/Provider/web/FontLoader.test.js +39 -0
- package/cjs/Theme/Provider/web/GlobalStyle.js +38 -0
- package/cjs/Theme/Provider/web/GlobalStyle.test.js +44 -0
- package/cjs/Theme/Provider/web/ThemeProvider.js +78 -0
- package/cjs/Theme/Provider/web/expectCssMatches.js +34 -0
- package/cjs/Theme/Provider/web/index.js +41 -0
- package/cjs/Theme/helpers/themeGenerator/index.js +35 -0
- package/cjs/Theme/helpers/themeGenerator/themeGenerator.js +33 -0
- package/cjs/Theme/helpers/themeGenerator/themeGenerator.test.js +43 -0
- package/cjs/Theme/helpers/themeReader/base.test.js +96 -0
- package/cjs/Theme/helpers/themeReader/index.js +56 -0
- package/cjs/Theme/helpers/themeReader/native/native.test.js +61 -0
- package/cjs/Theme/helpers/themeReader/web/web.test.js +55 -0
- package/cjs/Theme/index.js +48 -0
- package/cjs/Theme/index.native.js +46 -0
- package/cjs/Theme/theme/componentThemes.js +112 -0
- package/cjs/Theme/theme/index.js +35 -0
- package/cjs/Theme/theme/theme.js +109 -0
- package/cjs/hooks/index.js +26 -0
- package/cjs/hooks/useCombinedRefs.js +44 -0
- package/cjs/hooks/useKeyPress.js +50 -0
- package/cjs/hooks/usePortal.js +63 -0
- package/cjs/index.js +164 -0
- package/cjs/index.native.js +122 -0
- package/cjs/shared/HiddenInput.js +45 -0
- package/cjs/shared/index.js +49 -0
- package/cjs/shared/index.native.js +36 -0
- package/cjs/shared/propTypes/charLength.js +36 -0
- package/cjs/shared/propTypes/deprecated.js +34 -0
- package/cjs/shared/propTypes/index.js +50 -0
- package/cjs/shared/propTypes/limitChildren.js +35 -0
- package/cjs/shared/propTypes/max.js +35 -0
- package/cjs/shared/propTypes/typeof.js +47 -0
- package/esm/Accordion/Accordion.theme.js +26 -0
- package/esm/Accordion/index.js +5 -0
- package/esm/ActionRequirement/ActionRequirement.theme.js +5 -0
- package/esm/ActionRequirement/index.js +5 -0
- package/esm/ActionRequirement/index.native.js +5 -0
- package/esm/ActionRequirement/native/ActionRequirement.js +57 -0
- package/esm/ActionRequirement/native/ActionRequirement.test.js +49 -0
- package/esm/ActionRequirement/native/ActionRequirementStyles.js +69 -0
- package/esm/ActionRequirement/native/index.js +13 -0
- package/esm/AutoComplete/AutoComplete.theme.js +49 -0
- package/esm/AutoComplete/index.js +5 -0
- package/esm/Avatar/Avatar.theme.js +5 -0
- package/esm/Avatar/index.js +7 -0
- package/esm/Avatar/index.native.js +7 -0
- package/esm/Avatar/native/Avatar.js +141 -0
- package/esm/Avatar/native/Avatar.test.js +39 -0
- package/esm/Avatar/native/AvatarCircle.js +54 -0
- package/esm/Banner/Banner.theme.js +10 -0
- package/esm/Banner/index.js +5 -0
- package/esm/Banner/index.native.js +5 -0
- package/esm/Banner/native/Banner.js +160 -0
- package/esm/Banner/native/Banner.test.js +113 -0
- package/esm/Banner/native/index.js +5 -0
- package/esm/BottomSheet/BottomSheet.theme.js +24 -0
- package/esm/BottomSheet/index.js +5 -0
- package/esm/Box/index.js +5 -0
- package/esm/Box/index.native.js +5 -0
- package/esm/Box/native/Box.js +7 -0
- package/esm/Box/native/Box.test.js +21 -0
- package/esm/Box/native/index.js +5 -0
- package/esm/Button/Button.theme.js +137 -0
- package/esm/Button/index.js +13 -0
- package/esm/Button/index.native.js +11 -0
- package/esm/Button/native/Button.js +198 -0
- package/esm/Button/native/Button.test.js +342 -0
- package/esm/Button/native/Icon.js +156 -0
- package/esm/Button/native/Link.js +64 -0
- package/esm/Button/native/Text.js +130 -0
- package/esm/Button/native/withTouchable.js +89 -0
- package/esm/Card/Card.native.theme.js +44 -0
- package/esm/Card/Card.theme.js +157 -0
- package/esm/Card/Card.web.theme.js +41 -0
- package/esm/Card/index.js +6 -0
- package/esm/Card/index.native.js +7 -0
- package/esm/Card/native/Card/Actions.js +11 -0
- package/esm/Card/native/Card/Card.js +181 -0
- package/esm/Card/native/Card/Card.test.js +20 -0
- package/esm/Card/native/Card/Content.js +7 -0
- package/esm/Card/native/Card/Header.js +7 -0
- package/esm/Card/native/Card/index.js +11 -0
- package/esm/Card/native/EventCard/EventCard.js +212 -0
- package/esm/Card/native/EventCard/EventCard.test.js +73 -0
- package/esm/Card/native/EventCard/index.js +5 -0
- package/esm/Card/native/GymCard/CheckIn/Avatar.js +47 -0
- package/esm/Card/native/GymCard/CheckIn/CheckIn.js +113 -0
- package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +46 -0
- package/esm/Card/native/GymCard/CheckIn/Content.js +21 -0
- package/esm/Card/native/GymCard/CheckIn/Header.js +24 -0
- package/esm/Card/native/GymCard/CheckIn/index.js +5 -0
- package/esm/Card/native/GymCard/index.js +8 -0
- package/esm/Card/native/PlanCard/Actions.js +27 -0
- package/esm/Card/native/PlanCard/Content.js +134 -0
- package/esm/Card/native/PlanCard/List.js +113 -0
- package/esm/Card/native/PlanCard/PlanCard.js +114 -0
- package/esm/Card/native/PlanCard/PlanCard.test.js +100 -0
- package/esm/Card/native/PlanCard/Subtitle.js +25 -0
- package/esm/Card/native/PlanCard/Tag.js +62 -0
- package/esm/Card/native/PlanCard/index.js +18 -0
- package/esm/Card/native/index.js +10 -0
- package/esm/Checkbox/CheckIcon.js +5 -0
- package/esm/Checkbox/Checkbox.theme.js +48 -0
- package/esm/Checkbox/CheckboxSwitch.theme.js +70 -0
- package/esm/Checkbox/index.js +6 -0
- package/esm/Checkbox/index.native.js +6 -0
- package/esm/Checkbox/native/Checkbox.js +276 -0
- package/esm/Checkbox/native/Checkbox.test.js +108 -0
- package/esm/Checkbox/native/Switch.js +166 -0
- package/esm/Checkbox/native/Switch.test.js +50 -0
- package/esm/Checkbox/native/index.js +6 -0
- package/esm/Chips/index.js +5 -0
- package/esm/Chips/index.native.js +5 -0
- package/esm/Chips/native/Chips.js +182 -0
- package/esm/Chips/native/Chips.test.js +108 -0
- package/esm/Chips/native/Counter.js +36 -0
- package/esm/Chips/native/index.js +5 -0
- package/esm/Datepicker/Datepicker.theme.js +12 -0
- package/esm/Datepicker/index.js +5 -0
- package/esm/Dialog/Dialog.theme.js +23 -0
- package/esm/Dialog/index.js +5 -0
- package/esm/Divider/Divider.theme.js +5 -0
- package/esm/Divider/index.js +5 -0
- package/esm/Divider/index.native.js +5 -0
- package/esm/Divider/native/Divider.js +33 -0
- package/esm/Divider/native/Divider.test.js +44 -0
- package/esm/Divider/native/index.js +5 -0
- package/esm/Drawer/Drawer.theme.js +15 -0
- package/esm/Drawer/index.js +5 -0
- package/esm/Dropdown/Dropdown.theme.js +185 -0
- package/esm/Dropdown/index.js +5 -0
- package/esm/Dropdown/index.native.js +5 -0
- package/esm/Dropdown/native/Backdrop.js +157 -0
- package/esm/Dropdown/native/Backdrop.test.js +22 -0
- package/esm/Dropdown/native/Dropdown.js +220 -0
- package/esm/Dropdown/native/Dropdown.test.js +76 -0
- package/esm/Dropdown/native/Options.android.js +81 -0
- package/esm/Dropdown/native/Options.ios.js +97 -0
- package/esm/Dropdown/native/index.js +5 -0
- package/esm/Feedback/Feedback.theme.js +9 -0
- package/esm/Feedback/index.js +5 -0
- package/esm/Grid/Grid.theme.js +23 -0
- package/esm/Grid/index.js +7 -0
- package/esm/Header/Header.theme.js +14 -0
- package/esm/Header/index.js +5 -0
- package/esm/Heading/Heading.theme.js +18 -0
- package/esm/Heading/index.js +5 -0
- package/esm/Icon/Icon.js +172 -0
- package/esm/Icon/Icon.theme.js +5 -0
- package/esm/Icon/index.js +5 -0
- package/esm/Icon/index.native.js +5 -0
- package/esm/Icon/native/Icon.test.js +69 -0
- package/esm/Icon/native/index.js +5 -0
- package/esm/Input/Input.theme.js +66 -0
- package/esm/Input/index.js +10 -0
- package/esm/Input/index.native.js +9 -0
- package/esm/Input/native/Email.js +37 -0
- package/esm/Input/native/Email.test.js +14 -0
- package/esm/Input/native/Helper.js +87 -0
- package/esm/Input/native/Input.js +365 -0
- package/esm/Input/native/Input.test.js +132 -0
- package/esm/Input/native/Number.js +29 -0
- package/esm/Input/native/Number.test.js +14 -0
- package/esm/Input/native/Password.js +166 -0
- package/esm/Input/native/Password.test.js +109 -0
- package/esm/Input/native/Tel.js +36 -0
- package/esm/Input/native/Tel.test.js +14 -0
- package/esm/Input/native/index.js +12 -0
- package/esm/List/List.theme.js +29 -0
- package/esm/List/index.js +7 -0
- package/esm/List/index.native.js +6 -0
- package/esm/List/native/List.js +43 -0
- package/esm/List/native/List.test.js +88 -0
- package/esm/List/native/ListItem.js +109 -0
- package/esm/List/native/index.js +6 -0
- package/esm/Menu/Menu.theme.js +43 -0
- package/esm/Menu/index.js +11 -0
- package/esm/Popover/Popover.theme.js +5 -0
- package/esm/Popover/index.js +5 -0
- package/esm/Progress/Progress.theme.js +18 -0
- package/esm/Progress/index.js +5 -0
- package/esm/Progress/index.native.js +5 -0
- package/esm/Progress/native/Progress.js +198 -0
- package/esm/Progress/native/Progress.test.js +134 -0
- package/esm/Progress/native/index.js +5 -0
- package/esm/RadioGroup/RadioGroup.theme.js +56 -0
- package/esm/RadioGroup/RadioGroupContext.js +6 -0
- package/esm/RadioGroup/index.js +7 -0
- package/esm/RadioGroup/index.native.js +7 -0
- package/esm/RadioGroup/native/Button/RadioButton.js +113 -0
- package/esm/RadioGroup/native/Button/RadioButton.test.js +70 -0
- package/esm/RadioGroup/native/Radio/Radio.js +171 -0
- package/esm/RadioGroup/native/Radio/Radio.test.js +74 -0
- package/esm/RadioGroup/native/RadioGroup.js +107 -0
- package/esm/RadioGroup/native/RadioGroup.test.js +56 -0
- package/esm/RadioGroup/native/index.js +8 -0
- package/esm/Rating/Rating.theme.js +11 -0
- package/esm/Rating/index.js +5 -0
- package/esm/Rating/index.native.js +5 -0
- package/esm/Rating/native/Rating.js +197 -0
- package/esm/Rating/native/Rating.test.js +91 -0
- package/esm/Rating/native/index.js +5 -0
- package/esm/Result/Result.theme.js +5 -0
- package/esm/Result/index.native.js +11 -0
- package/esm/Result/native/Attendances.js +54 -0
- package/esm/Result/native/Details.js +130 -0
- package/esm/Result/native/Rate.js +39 -0
- package/esm/Result/native/Result.js +98 -0
- package/esm/Result/native/Result.test.js +128 -0
- package/esm/Result/native/ResultButton.js +20 -0
- package/esm/Result/native/Tags.js +65 -0
- package/esm/Result/native/TinyTextIcon.js +29 -0
- package/esm/Result/native/index.js +5 -0
- package/esm/Skeleton/Skeleton.theme.js +22 -0
- package/esm/Skeleton/index.js +5 -0
- package/esm/Skeleton/index.native.js +5 -0
- package/esm/Skeleton/native/Skeleton.js +142 -0
- package/esm/Skeleton/native/Skeleton.test.js +40 -0
- package/esm/Skeleton/native/index.js +5 -0
- package/esm/Slider/Slider.theme.js +75 -0
- package/esm/Slider/index.js +5 -0
- package/esm/Slider/index.native.js +5 -0
- package/esm/Slider/native/Label.js +33 -0
- package/esm/Slider/native/Marker.js +84 -0
- package/esm/Slider/native/Slider.js +169 -0
- package/esm/Slider/native/Slider.test.js +105 -0
- package/esm/Slider/native/Step.js +27 -0
- package/esm/Slider/native/Tooltip.js +177 -0
- package/esm/Snackbar/Snackbar.theme.js +61 -0
- package/esm/Snackbar/index.js +5 -0
- package/esm/Snackbar/index.native.js +5 -0
- package/esm/Snackbar/native/Snackbar.js +246 -0
- package/esm/Snackbar/native/Snackbar.test.js +108 -0
- package/esm/Snackbar/native/SnackbarAnimationWrapper.js +114 -0
- package/esm/Snackbar/native/index.js +5 -0
- package/esm/Spinner/Spinner.theme.js +5 -0
- package/esm/Spinner/index.js +5 -0
- package/esm/Stepper/Stepper.theme.js +36 -0
- package/esm/Stepper/activeDot.js +5 -0
- package/esm/Stepper/index.js +6 -0
- package/esm/Stepper/index.native.js +6 -0
- package/esm/Stepper/native/Dots.js +75 -0
- package/esm/Stepper/native/Line.js +68 -0
- package/esm/Stepper/native/Step.js +33 -0
- package/esm/Stepper/native/Stepper.js +97 -0
- package/esm/Stepper/native/Stepper.test.js +64 -0
- package/esm/Stepper/native/index.js +6 -0
- package/esm/Tag/Tag.theme.js +38 -0
- package/esm/Tag/index.js +7 -0
- package/esm/Tag/index.native.js +7 -0
- package/esm/Tag/native/Informative.js +127 -0
- package/esm/Tag/native/Tag.js +121 -0
- package/esm/Tag/native/Tag.test.js +74 -0
- package/esm/Tag/native/index.js +5 -0
- package/esm/Text/Text.theme.js +73 -0
- package/esm/Text/index.js +35 -0
- package/esm/Text/index.native.js +35 -0
- package/esm/Text/native/Text.js +123 -0
- package/esm/Text/native/Text.test.js +150 -0
- package/esm/Text/native/index.js +34 -0
- package/esm/Text/sharedTextStyle.js +44 -0
- package/esm/Text/textStyle.android.js +27 -0
- package/esm/Text/textStyle.ios.js +9 -0
- package/esm/Text/textStyle.web.js +17 -0
- package/esm/TextArea/TextArea.theme.js +6 -0
- package/esm/TextArea/index.js +5 -0
- package/esm/TextArea/index.native.js +5 -0
- package/esm/TextArea/native/TextArea.js +64 -0
- package/esm/TextArea/native/TextArea.test.js +12 -0
- package/esm/TextArea/native/index.js +5 -0
- package/esm/Theme/Provider/Provider.js +75 -0
- package/esm/Theme/Provider/index.js +5 -0
- package/esm/Theme/Provider/index.native.js +5 -0
- package/esm/Theme/Provider/native/index.js +5 -0
- package/esm/Theme/Provider/web/FontLoader.js +21 -0
- package/esm/Theme/Provider/web/FontLoader.test.js +16 -0
- package/esm/Theme/Provider/web/GlobalStyle.js +18 -0
- package/esm/Theme/Provider/web/GlobalStyle.test.js +21 -0
- package/esm/Theme/Provider/web/ThemeProvider.js +50 -0
- package/esm/Theme/Provider/web/expectCssMatches.js +14 -0
- package/esm/Theme/Provider/web/index.js +6 -0
- package/esm/Theme/helpers/themeGenerator/index.js +5 -0
- package/esm/Theme/helpers/themeGenerator/themeGenerator.js +13 -0
- package/esm/Theme/helpers/themeGenerator/themeGenerator.test.js +20 -0
- package/esm/Theme/helpers/themeReader/base.test.js +73 -0
- package/esm/Theme/helpers/themeReader/index.js +26 -0
- package/esm/Theme/helpers/themeReader/native/native.test.js +38 -0
- package/esm/Theme/helpers/themeReader/web/web.test.js +32 -0
- package/esm/Theme/index.js +11 -0
- package/esm/Theme/index.native.js +10 -0
- package/esm/Theme/theme/componentThemes.js +82 -0
- package/esm/Theme/theme/index.js +5 -0
- package/esm/Theme/theme/theme.js +81 -0
- package/esm/hooks/index.js +3 -0
- package/esm/hooks/useCombinedRefs.js +20 -0
- package/esm/hooks/useKeyPress.js +26 -0
- package/esm/hooks/usePortal.js +39 -0
- package/esm/index.js +90 -0
- package/esm/index.native.js +58 -0
- package/esm/shared/HiddenInput.js +15 -0
- package/esm/shared/index.js +16 -0
- package/esm/shared/index.native.js +14 -0
- package/esm/shared/propTypes/charLength.js +16 -0
- package/esm/shared/propTypes/deprecated.js +14 -0
- package/esm/shared/propTypes/index.js +12 -0
- package/esm/shared/propTypes/limitChildren.js +15 -0
- package/esm/shared/propTypes/max.js +15 -0
- package/esm/shared/propTypes/typeof.js +17 -0
- package/package.json +2 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { bool } from "prop-types";
|
|
4
|
+
import styled, { withTheme } from "styled-components";
|
|
5
|
+
import { hexToRgb } from "@gympass/yoga-common";
|
|
6
|
+
import { Animated } from "react-native";
|
|
7
|
+
import withTouchable from "../../Button/native/withTouchable";
|
|
8
|
+
import Box from "../../Box";
|
|
9
|
+
const SwitchTrack = styled.View`
|
|
10
|
+
${({
|
|
11
|
+
theme: {
|
|
12
|
+
yoga: {
|
|
13
|
+
components: { checkboxswitch }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
checked,
|
|
17
|
+
disabled
|
|
18
|
+
}) => `
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
width: ${checkboxswitch.track.width}px;
|
|
22
|
+
height: ${checkboxswitch.track.height}px;
|
|
23
|
+
borderRadius: ${checkboxswitch.track.radii}px;
|
|
24
|
+
background-color: ${checked ? checkboxswitch.track.checked.backgroundColor : checkboxswitch.track.backgroundColor};
|
|
25
|
+
|
|
26
|
+
${disabled ? `
|
|
27
|
+
background-color: ${checkboxswitch.track.disabled.backgroundColor};` : ""}
|
|
28
|
+
`};
|
|
29
|
+
`;
|
|
30
|
+
const ThumbShadow = styled.View(
|
|
31
|
+
({
|
|
32
|
+
theme: {
|
|
33
|
+
yoga: {
|
|
34
|
+
colors,
|
|
35
|
+
components: { checkboxswitch }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
checked
|
|
39
|
+
}) => {
|
|
40
|
+
const width = checkboxswitch.thumb.width * checkboxswitch.thumb.shadowScale;
|
|
41
|
+
const height = checkboxswitch.thumb.height * checkboxswitch.thumb.shadowScale;
|
|
42
|
+
return `
|
|
43
|
+
width: ${width}px;
|
|
44
|
+
height: ${height}px;
|
|
45
|
+
position: absolute;
|
|
46
|
+
background-color: ${checked ? hexToRgb(colors.primary, 0.75) : hexToRgb(colors.elements.backgroundAndDisabled, 0.75)};
|
|
47
|
+
border-radius: ${checkboxswitch.thumb.radii}px;
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
const SwitchThumb = styled(Box).attrs(
|
|
52
|
+
({
|
|
53
|
+
theme: {
|
|
54
|
+
yoga: {
|
|
55
|
+
components: { checkboxswitch }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
disabled
|
|
59
|
+
}) => ({
|
|
60
|
+
width: checkboxswitch.thumb.width,
|
|
61
|
+
height: checkboxswitch.thumb.height,
|
|
62
|
+
borderRadius: checkboxswitch.thumb.radii,
|
|
63
|
+
bgColor: disabled ? checkboxswitch.thumb.disabled.backgroundColor : checkboxswitch.thumb.backgroundColor,
|
|
64
|
+
elevation: checkboxswitch.thumb.shadow
|
|
65
|
+
})
|
|
66
|
+
)``;
|
|
67
|
+
const CheckboxSwitch = ({
|
|
68
|
+
checked,
|
|
69
|
+
pressed,
|
|
70
|
+
disabled,
|
|
71
|
+
theme: {
|
|
72
|
+
yoga: {
|
|
73
|
+
components: { checkboxswitch }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}) => {
|
|
77
|
+
const [thumbPosition] = useState(new Animated.Value(Number(checked)));
|
|
78
|
+
const thumbTo = checkboxswitch.track.width - checkboxswitch.thumb.width - checkboxswitch.thumb.left;
|
|
79
|
+
const thumbFrom = checkboxswitch.thumb.left;
|
|
80
|
+
const shadowDiameter = checkboxswitch.thumb.width * checkboxswitch.thumb.shadowScale;
|
|
81
|
+
const shadowAndThumbDiff = shadowDiameter - checkboxswitch.thumb.width;
|
|
82
|
+
const halfDiff = shadowAndThumbDiff / 2;
|
|
83
|
+
const thumbShadowFrom = (halfDiff - checkboxswitch.thumb.left) * -1;
|
|
84
|
+
const thumbShadowTo = thumbTo - halfDiff;
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const toggle = (isChecked, position) => {
|
|
87
|
+
const animValue = {
|
|
88
|
+
fromValue: isChecked ? 0 : 1,
|
|
89
|
+
toValue: isChecked ? 1 : 0,
|
|
90
|
+
duration: 100,
|
|
91
|
+
useNativeDriver: false
|
|
92
|
+
};
|
|
93
|
+
Animated.timing(position, animValue).start();
|
|
94
|
+
};
|
|
95
|
+
toggle(!checked, thumbPosition);
|
|
96
|
+
}, [checked]);
|
|
97
|
+
return /* @__PURE__ */ jsxs(
|
|
98
|
+
SwitchTrack,
|
|
99
|
+
{
|
|
100
|
+
checked,
|
|
101
|
+
disabled,
|
|
102
|
+
as: Animated.View,
|
|
103
|
+
style: !disabled && {
|
|
104
|
+
backgroundColor: thumbPosition.interpolate({
|
|
105
|
+
inputRange: [0, 1],
|
|
106
|
+
outputRange: [
|
|
107
|
+
checkboxswitch.track.checked.backgroundColor,
|
|
108
|
+
checkboxswitch.track.backgroundColor
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
},
|
|
112
|
+
children: [
|
|
113
|
+
pressed && !disabled && /* @__PURE__ */ jsx(
|
|
114
|
+
ThumbShadow,
|
|
115
|
+
{
|
|
116
|
+
checked,
|
|
117
|
+
as: Animated.View,
|
|
118
|
+
style: {
|
|
119
|
+
transform: [
|
|
120
|
+
{
|
|
121
|
+
translateX: thumbPosition.interpolate({
|
|
122
|
+
inputRange: [0, 1],
|
|
123
|
+
outputRange: [thumbShadowTo, thumbShadowFrom]
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
SwitchThumb,
|
|
132
|
+
{
|
|
133
|
+
checked,
|
|
134
|
+
disabled,
|
|
135
|
+
as: Animated.View,
|
|
136
|
+
style: {
|
|
137
|
+
transform: [
|
|
138
|
+
{
|
|
139
|
+
translateX: thumbPosition.interpolate({
|
|
140
|
+
inputRange: [0, 1],
|
|
141
|
+
outputRange: [thumbTo, thumbFrom]
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
CheckboxSwitch.propTypes = {
|
|
153
|
+
checked: bool,
|
|
154
|
+
disabled: bool,
|
|
155
|
+
pressed: bool
|
|
156
|
+
};
|
|
157
|
+
CheckboxSwitch.defaultProps = {
|
|
158
|
+
checked: false,
|
|
159
|
+
disabled: false,
|
|
160
|
+
pressed: false
|
|
161
|
+
};
|
|
162
|
+
CheckboxSwitch.displayName = "Checkbox.Switch";
|
|
163
|
+
var Switch_default = withTouchable(withTheme(CheckboxSwitch));
|
|
164
|
+
export {
|
|
165
|
+
Switch_default as default
|
|
166
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { render, fireEvent } from "@testing-library/react-native";
|
|
4
|
+
import Checkbox from "..";
|
|
5
|
+
import ThemeProvider from "../../Theme";
|
|
6
|
+
jest.useFakeTimers();
|
|
7
|
+
describe("<Checkbox />", () => {
|
|
8
|
+
describe("<Checkbox.Switch />", () => {
|
|
9
|
+
describe("Snapshots", () => {
|
|
10
|
+
it("should match snapshot with default switch", () => {
|
|
11
|
+
const { toJSON } = render(
|
|
12
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox.Switch, {}) })
|
|
13
|
+
);
|
|
14
|
+
expect(toJSON()).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
it("should match snapshot with disabled switch", () => {
|
|
17
|
+
const { toJSON } = render(
|
|
18
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox.Switch, { disabled: true }) })
|
|
19
|
+
);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
it("should match snapshot with checked switch", () => {
|
|
23
|
+
const { toJSON } = render(
|
|
24
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox.Switch, { checked: true }) })
|
|
25
|
+
);
|
|
26
|
+
expect(toJSON()).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
it("should match snapshot with disabled and checked switch", () => {
|
|
29
|
+
const { toJSON } = render(
|
|
30
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox.Switch, { disabled: true, checked: true }) })
|
|
31
|
+
);
|
|
32
|
+
expect(toJSON()).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
it("should call onChange function when click on Checkbox.Switch", () => {
|
|
35
|
+
const onChangeMock = jest.fn();
|
|
36
|
+
const { getByRole } = render(
|
|
37
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(
|
|
38
|
+
Checkbox.Switch,
|
|
39
|
+
{
|
|
40
|
+
onChange: onChangeMock,
|
|
41
|
+
accessibilityRole: "button"
|
|
42
|
+
}
|
|
43
|
+
) })
|
|
44
|
+
);
|
|
45
|
+
fireEvent.press(getByRole("button"));
|
|
46
|
+
expect(onChangeMock).toHaveBeenCalled();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import React from "react";
|
|
34
|
+
import { number, arrayOf, bool, func, node } from "prop-types";
|
|
35
|
+
import styled, { css, withTheme } from "styled-components";
|
|
36
|
+
import { TouchableWithoutFeedback } from "react-native";
|
|
37
|
+
import Counter from "./Counter";
|
|
38
|
+
import { theme } from "../../Theme";
|
|
39
|
+
import Text from "../../Text";
|
|
40
|
+
import Icon from "../../Icon";
|
|
41
|
+
const Wrapper = styled.View`
|
|
42
|
+
height: 32px;
|
|
43
|
+
max-width: 216px;
|
|
44
|
+
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: flex-start;
|
|
48
|
+
|
|
49
|
+
margin-right: ${theme.spacing.xxsmall}px;
|
|
50
|
+
padding: ${theme.spacing.xxsmall}px;
|
|
51
|
+
|
|
52
|
+
border-style: solid;
|
|
53
|
+
border-color: ${theme.colors.elements.lineAndBorders};
|
|
54
|
+
border-radius: ${theme.radii.small}px;
|
|
55
|
+
border-width: ${theme.borders.small}px;
|
|
56
|
+
|
|
57
|
+
background-color: ${theme.colors.white};
|
|
58
|
+
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
|
|
61
|
+
${({ disabled }) => disabled ? css`
|
|
62
|
+
background-color: ${theme.colors.elements.backgroundAndDisabled};
|
|
63
|
+
color: ${theme.colors.elements.selectionAndIcons};
|
|
64
|
+
|
|
65
|
+
border-color: ${theme.colors.elements.lineAndBorders};
|
|
66
|
+
` : ""}
|
|
67
|
+
|
|
68
|
+
${({ selected }) => selected ? css`
|
|
69
|
+
background-color: ${theme.colors.yoga};
|
|
70
|
+
border-color: transparent;
|
|
71
|
+
` : ""}
|
|
72
|
+
`;
|
|
73
|
+
const StyledChips = styled(Text)`
|
|
74
|
+
font-size: ${theme.fontSizes.xsmall}px;
|
|
75
|
+
line-height: ${theme.lineHeights.xxsmall}px;
|
|
76
|
+
|
|
77
|
+
flex-shrink: 1;
|
|
78
|
+
|
|
79
|
+
${({ selected }) => selected ? css`
|
|
80
|
+
color: ${theme.colors.primary};
|
|
81
|
+
` : ""}
|
|
82
|
+
`;
|
|
83
|
+
const Chips = React.forwardRef(
|
|
84
|
+
(_a, ref) => {
|
|
85
|
+
var _b = _a, {
|
|
86
|
+
children,
|
|
87
|
+
selected,
|
|
88
|
+
counter,
|
|
89
|
+
icons,
|
|
90
|
+
disabled,
|
|
91
|
+
onToggle,
|
|
92
|
+
onPress = onToggle,
|
|
93
|
+
theme: {
|
|
94
|
+
yoga: { spacing }
|
|
95
|
+
}
|
|
96
|
+
} = _b, props = __objRest(_b, [
|
|
97
|
+
"children",
|
|
98
|
+
"selected",
|
|
99
|
+
"counter",
|
|
100
|
+
"icons",
|
|
101
|
+
"disabled",
|
|
102
|
+
"onToggle",
|
|
103
|
+
"onPress",
|
|
104
|
+
"theme"
|
|
105
|
+
]);
|
|
106
|
+
const [FirstIcon, SecondIcon] = icons;
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
TouchableWithoutFeedback,
|
|
109
|
+
__spreadProps(__spreadValues({
|
|
110
|
+
onPress,
|
|
111
|
+
ref,
|
|
112
|
+
accessibilityRole: "button"
|
|
113
|
+
}, props), {
|
|
114
|
+
children: /* @__PURE__ */ jsxs(Wrapper, { disabled, selected, children: [
|
|
115
|
+
SecondIcon && /* @__PURE__ */ jsx(
|
|
116
|
+
Icon,
|
|
117
|
+
{
|
|
118
|
+
as: SecondIcon,
|
|
119
|
+
fill: selected ? "primary" : "secondary",
|
|
120
|
+
width: "small",
|
|
121
|
+
height: "small",
|
|
122
|
+
style: {
|
|
123
|
+
marginRight: children ? spacing.xxxsmall : void 0
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
StyledChips,
|
|
129
|
+
{
|
|
130
|
+
as: selected ? Text.Medium : Text,
|
|
131
|
+
selected,
|
|
132
|
+
numberOfLines: 1,
|
|
133
|
+
children
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
selected && counter && !disabled && /* @__PURE__ */ jsx(Counter, { value: counter }),
|
|
137
|
+
FirstIcon && /* @__PURE__ */ jsx(
|
|
138
|
+
Icon,
|
|
139
|
+
{
|
|
140
|
+
as: FirstIcon,
|
|
141
|
+
fill: selected ? "primary" : "secondary",
|
|
142
|
+
width: "small",
|
|
143
|
+
height: "small",
|
|
144
|
+
style: {
|
|
145
|
+
marginLeft: children ? spacing.xxxsmall : void 0
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] })
|
|
150
|
+
})
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
Chips.propTypes = {
|
|
155
|
+
/** text to be displayed */
|
|
156
|
+
children: node,
|
|
157
|
+
/** if the chip is selected */
|
|
158
|
+
selected: bool,
|
|
159
|
+
/** will display a three digit number, if the value is greater than 999 a plus
|
|
160
|
+
* sign will be displayed instead. ex: "+999" */
|
|
161
|
+
counter: number,
|
|
162
|
+
/** disable chip */
|
|
163
|
+
disabled: bool,
|
|
164
|
+
/** a list of max two icons from @gympass/yoga-icons package */
|
|
165
|
+
icons: arrayOf(func),
|
|
166
|
+
/** onPress event */
|
|
167
|
+
onToggle: func,
|
|
168
|
+
onPress: func
|
|
169
|
+
};
|
|
170
|
+
Chips.defaultProps = {
|
|
171
|
+
children: void 0,
|
|
172
|
+
selected: false,
|
|
173
|
+
disabled: false,
|
|
174
|
+
counter: void 0,
|
|
175
|
+
icons: [],
|
|
176
|
+
onToggle: void 0,
|
|
177
|
+
onPress: void 0
|
|
178
|
+
};
|
|
179
|
+
var Chips_default = withTheme(Chips);
|
|
180
|
+
export {
|
|
181
|
+
Chips_default as default
|
|
182
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { render, fireEvent } from "@testing-library/react-native";
|
|
4
|
+
import { MapPin, ChevronDown } from "@gympass/yoga-icons";
|
|
5
|
+
import { ThemeProvider, Chips } from "../..";
|
|
6
|
+
describe("<Chips />", () => {
|
|
7
|
+
describe("Snapshots", () => {
|
|
8
|
+
it("should match snapshot", () => {
|
|
9
|
+
const { root, toJSON } = render(
|
|
10
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { children: "Classes" }) })
|
|
11
|
+
);
|
|
12
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
it("should match snapshot with disabled prop", () => {
|
|
15
|
+
const { root, toJSON } = render(
|
|
16
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { disabled: true, children: "Classes" }) })
|
|
17
|
+
);
|
|
18
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
it("should match snapshot with more than one Chip", () => {
|
|
21
|
+
const { root, toJSON } = render(
|
|
22
|
+
/* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(Chips, { children: "Classes" }),
|
|
24
|
+
/* @__PURE__ */ jsx(Chips, { children: "Gyms and studios" }),
|
|
25
|
+
/* @__PURE__ */ jsx(Chips, { children: "Personal trainers" })
|
|
26
|
+
] })
|
|
27
|
+
);
|
|
28
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
29
|
+
});
|
|
30
|
+
it("should match snapshot with a long text", () => {
|
|
31
|
+
const { root, toJSON } = render(
|
|
32
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { children: "Classes with a very long text" }) })
|
|
33
|
+
);
|
|
34
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
describe("selected", () => {
|
|
37
|
+
it("should match snapshot", () => {
|
|
38
|
+
const { root, toJSON } = render(
|
|
39
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { selected: true, children: "Classes" }) })
|
|
40
|
+
);
|
|
41
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
42
|
+
});
|
|
43
|
+
it("should match snapshot with more than one Chip", () => {
|
|
44
|
+
const { root, toJSON } = render(
|
|
45
|
+
/* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Chips, { children: "Classes" }),
|
|
47
|
+
/* @__PURE__ */ jsx(Chips, { selected: true, children: "Gyms and studios" }),
|
|
48
|
+
/* @__PURE__ */ jsx(Chips, { selected: true, children: "Personal trainers" })
|
|
49
|
+
] })
|
|
50
|
+
);
|
|
51
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe("counter", () => {
|
|
55
|
+
it("should match snapshot", () => {
|
|
56
|
+
const { root, toJSON } = render(
|
|
57
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { counter: 8, children: "Classes" }) })
|
|
58
|
+
);
|
|
59
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
60
|
+
});
|
|
61
|
+
it("should match snapshot with more than one Chip", () => {
|
|
62
|
+
const { root, toJSON } = render(
|
|
63
|
+
/* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Chips, { counter: 8, children: "Classes" }),
|
|
65
|
+
/* @__PURE__ */ jsx(Chips, { counter: 52, selected: true, children: "Gyms and studios" }),
|
|
66
|
+
/* @__PURE__ */ jsx(Chips, { counter: 1732, selected: true, children: "Personal trainers" })
|
|
67
|
+
] })
|
|
68
|
+
);
|
|
69
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe("icon", () => {
|
|
73
|
+
it("should match selected snapshot", () => {
|
|
74
|
+
const { root, toJSON } = render(
|
|
75
|
+
/* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Chips, { counter: 8, icon: [MapPin], children: "Location" }),
|
|
77
|
+
/* @__PURE__ */ jsx(Chips, { counter: 8, icon: [MapPin, ChevronDown], children: "Classes" }),
|
|
78
|
+
/* @__PURE__ */ jsx(Chips, { icon: [MapPin, ChevronDown], children: "Gyms and studios" }),
|
|
79
|
+
/* @__PURE__ */ jsx(Chips, { icon: [MapPin], children: "Personal trainers" }),
|
|
80
|
+
/* @__PURE__ */ jsx(Chips, { counter: 8, selected: true, icon: [MapPin], children: "Activities" }),
|
|
81
|
+
/* @__PURE__ */ jsx(Chips, { counter: 8, selected: true, icon: [MapPin, ChevronDown], children: "Language" }),
|
|
82
|
+
/* @__PURE__ */ jsx(Chips, { selected: true, icon: [MapPin, ChevronDown], children: "Categories" }),
|
|
83
|
+
/* @__PURE__ */ jsx(Chips, { selected: true, icon: [MapPin], children: "Availability" })
|
|
84
|
+
] })
|
|
85
|
+
);
|
|
86
|
+
expect(toJSON(root)).toMatchSnapshot();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
describe("Events", () => {
|
|
91
|
+
it("should toggle using onPress", () => {
|
|
92
|
+
const toggleMock = jest.fn();
|
|
93
|
+
const { getByText } = render(
|
|
94
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { onPress: toggleMock, children: "Classes" }) })
|
|
95
|
+
);
|
|
96
|
+
fireEvent.press(getByText("Classes"));
|
|
97
|
+
expect(toggleMock).toHaveBeenCalled();
|
|
98
|
+
});
|
|
99
|
+
it("should toggle using onToggle", () => {
|
|
100
|
+
const toggleMock = jest.fn();
|
|
101
|
+
const { getByText } = render(
|
|
102
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Chips, { onToggle: toggleMock, children: "Classes" }) })
|
|
103
|
+
);
|
|
104
|
+
fireEvent.press(getByText("Classes"));
|
|
105
|
+
expect(toggleMock).toHaveBeenCalled();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { number, oneOfType, string } from "prop-types";
|
|
5
|
+
import { theme } from "../../Theme";
|
|
6
|
+
import Text from "../../Text";
|
|
7
|
+
const Wrapper = styled(Text.Medium)`
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
|
|
13
|
+
height: 16px;
|
|
14
|
+
min-width: 16px;
|
|
15
|
+
|
|
16
|
+
padding-right: 5px;
|
|
17
|
+
padding-left: 5px;
|
|
18
|
+
margin-left: ${theme.spacing.xxxsmall}px;
|
|
19
|
+
|
|
20
|
+
color: ${theme.colors.white};
|
|
21
|
+
font-size: ${theme.fontSizes.xsmall}px;
|
|
22
|
+
line-height: ${theme.lineHeights.xsmall}px;
|
|
23
|
+
|
|
24
|
+
border-radius: ${theme.radii.small}px;
|
|
25
|
+
background-color: ${theme.colors.primary};
|
|
26
|
+
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
`;
|
|
29
|
+
const Counter = ({ value }) => /* @__PURE__ */ jsx(Wrapper, { children: Number(value) > 999 ? "+999" : value });
|
|
30
|
+
Counter.propTypes = {
|
|
31
|
+
value: oneOfType([number, string]).isRequired
|
|
32
|
+
};
|
|
33
|
+
var Counter_default = Counter;
|
|
34
|
+
export {
|
|
35
|
+
Counter_default as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const Dialog = ({ radii, spacing }) => ({
|
|
2
|
+
border: {
|
|
3
|
+
radius: radii.regular
|
|
4
|
+
},
|
|
5
|
+
padding: {
|
|
6
|
+
default: spacing.xlarge,
|
|
7
|
+
top: spacing.xxlarge,
|
|
8
|
+
withCloseButton: spacing.large
|
|
9
|
+
},
|
|
10
|
+
width: {
|
|
11
|
+
default: 580
|
|
12
|
+
},
|
|
13
|
+
height: {
|
|
14
|
+
min: 160
|
|
15
|
+
},
|
|
16
|
+
position: {
|
|
17
|
+
default: spacing.zero
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
var Dialog_theme_default = Dialog;
|
|
21
|
+
export {
|
|
22
|
+
Dialog_theme_default as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { bool } from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import styled, { css, withTheme } from "styled-components";
|
|
5
|
+
const StyledDivider = styled.View`
|
|
6
|
+
${({
|
|
7
|
+
theme: {
|
|
8
|
+
yoga: { borders, colors }
|
|
9
|
+
},
|
|
10
|
+
vertical
|
|
11
|
+
}) => {
|
|
12
|
+
return css`
|
|
13
|
+
${vertical ? "height: auto" : "width: auto"};
|
|
14
|
+
${vertical ? `border-left-width: ${borders.small}` : `border-bottom-width: ${borders.small}`};
|
|
15
|
+
|
|
16
|
+
border-color: ${colors.text.disabled};
|
|
17
|
+
`;
|
|
18
|
+
}}
|
|
19
|
+
`;
|
|
20
|
+
const Divider = React.forwardRef(({ vertical }, ref) => {
|
|
21
|
+
return /* @__PURE__ */ jsx(StyledDivider, { vertical, ref });
|
|
22
|
+
});
|
|
23
|
+
Divider.propTypes = {
|
|
24
|
+
/** If this value is defined, the divider will be in vertical when the flexDirection is row type */
|
|
25
|
+
vertical: bool
|
|
26
|
+
};
|
|
27
|
+
Divider.defaultProps = {
|
|
28
|
+
vertical: false
|
|
29
|
+
};
|
|
30
|
+
var Divider_default = withTheme(Divider);
|
|
31
|
+
export {
|
|
32
|
+
Divider_default as default
|
|
33
|
+
};
|