@gympass/yoga 7.88.0 → 7.88.1
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/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/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,44 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
4
|
+
import { ThemeProvider, Divider, Box, Text } from "../..";
|
|
5
|
+
describe("<Divider />", () => {
|
|
6
|
+
it("should create a divider component", () => {
|
|
7
|
+
const { toJSON } = render(
|
|
8
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(
|
|
9
|
+
Box,
|
|
10
|
+
{
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "column",
|
|
13
|
+
minWidth: 300,
|
|
14
|
+
justifyContent: "space-between",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Text.H4, { children: "First Content" }),
|
|
17
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
18
|
+
/* @__PURE__ */ jsx(Text.H4, { children: "Second Content" })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
) })
|
|
22
|
+
);
|
|
23
|
+
expect(toJSON()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
it("should create vertical divider component", () => {
|
|
26
|
+
const { toJSON } = render(
|
|
27
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(
|
|
28
|
+
Box,
|
|
29
|
+
{
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "row",
|
|
32
|
+
minWidth: 300,
|
|
33
|
+
justifyContent: "space-between",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Text.H4, { children: "First Content" }),
|
|
36
|
+
/* @__PURE__ */ jsx(Divider, { vertical: true }),
|
|
37
|
+
/* @__PURE__ */ jsx(Text.H4, { children: "Second Content" })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
) })
|
|
41
|
+
);
|
|
42
|
+
expect(toJSON()).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Drawer = ({ spacing }) => ({
|
|
2
|
+
padding: {
|
|
3
|
+
top: spacing.small,
|
|
4
|
+
right: spacing.xxxlarge,
|
|
5
|
+
bottom: spacing.xxlarge,
|
|
6
|
+
left: spacing.xxxlarge
|
|
7
|
+
},
|
|
8
|
+
width: {
|
|
9
|
+
default: 600
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var Drawer_theme_default = Drawer;
|
|
13
|
+
export {
|
|
14
|
+
Drawer_theme_default as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { hexToRgb } from "@gympass/yoga-common";
|
|
2
|
+
const Dropdown = ({
|
|
3
|
+
colors,
|
|
4
|
+
fontSizes,
|
|
5
|
+
fontWeights,
|
|
6
|
+
lineHeights,
|
|
7
|
+
radii,
|
|
8
|
+
spacing,
|
|
9
|
+
borders
|
|
10
|
+
}) => ({
|
|
11
|
+
width: 320,
|
|
12
|
+
selector: {
|
|
13
|
+
background: colors.white,
|
|
14
|
+
padding: {
|
|
15
|
+
top: spacing.small,
|
|
16
|
+
right: spacing.small,
|
|
17
|
+
bottom: spacing.small,
|
|
18
|
+
left: spacing.small
|
|
19
|
+
},
|
|
20
|
+
border: {
|
|
21
|
+
width: borders.small,
|
|
22
|
+
radius: radii.small,
|
|
23
|
+
color: colors.elements.lineAndBorders
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
arrow: {
|
|
27
|
+
fill: colors.text.secondary
|
|
28
|
+
},
|
|
29
|
+
input: {
|
|
30
|
+
font: {
|
|
31
|
+
color: colors.text.secondary,
|
|
32
|
+
size: fontSizes.small,
|
|
33
|
+
lineHeight: lineHeights.small
|
|
34
|
+
},
|
|
35
|
+
label: {
|
|
36
|
+
color: colors.text.primary,
|
|
37
|
+
margin: {
|
|
38
|
+
left: spacing.xxxsmall
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
button: {
|
|
43
|
+
padding: {
|
|
44
|
+
right: spacing.small,
|
|
45
|
+
top: spacing.small,
|
|
46
|
+
bottom: spacing.small
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
optionsList: {
|
|
50
|
+
backgroundColor: colors.white,
|
|
51
|
+
border: {
|
|
52
|
+
radius: {
|
|
53
|
+
topLeft: radii.sharp,
|
|
54
|
+
topRight: radii.sharp,
|
|
55
|
+
bottomRight: radii.small,
|
|
56
|
+
bottomLeft: radii.small
|
|
57
|
+
},
|
|
58
|
+
width: borders.small,
|
|
59
|
+
color: colors.text.primary
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
option: {
|
|
63
|
+
height: spacing.xxlarge,
|
|
64
|
+
backgroundColor: colors.white,
|
|
65
|
+
padding: {
|
|
66
|
+
top: spacing.zero,
|
|
67
|
+
right: spacing.small,
|
|
68
|
+
bottom: spacing.zero,
|
|
69
|
+
left: spacing.small
|
|
70
|
+
},
|
|
71
|
+
border: {
|
|
72
|
+
width: borders.small,
|
|
73
|
+
color: colors.elements.backgroundAndDisabled,
|
|
74
|
+
radius: {
|
|
75
|
+
topLeft: radii.sharp,
|
|
76
|
+
topRight: radii.sharp,
|
|
77
|
+
bottomRight: radii.small,
|
|
78
|
+
bottomLeft: radii.small
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
font: {
|
|
82
|
+
color: colors.text.primary,
|
|
83
|
+
size: fontSizes.small,
|
|
84
|
+
lineHeight: lineHeights.small,
|
|
85
|
+
weight: fontWeights.regular
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
backdrop: {
|
|
89
|
+
content: {
|
|
90
|
+
height: 320,
|
|
91
|
+
backgroundColor: colors.white,
|
|
92
|
+
border: {
|
|
93
|
+
radius: {
|
|
94
|
+
topLeft: radii.small,
|
|
95
|
+
topRight: radii.small
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
title: {
|
|
99
|
+
padding: {
|
|
100
|
+
top: spacing.medium,
|
|
101
|
+
right: spacing.zero,
|
|
102
|
+
bottom: spacing.medium,
|
|
103
|
+
left: spacing.zero
|
|
104
|
+
},
|
|
105
|
+
font: {
|
|
106
|
+
weight: fontWeights.bold,
|
|
107
|
+
size: fontSizes.medium
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
option: {
|
|
111
|
+
padding: {
|
|
112
|
+
top: spacing.large,
|
|
113
|
+
right: spacing.large,
|
|
114
|
+
bottom: spacing.large,
|
|
115
|
+
left: spacing.large
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
actions: {
|
|
119
|
+
padding: {
|
|
120
|
+
top: spacing.zero,
|
|
121
|
+
right: spacing.large,
|
|
122
|
+
bottom: spacing.large,
|
|
123
|
+
left: spacing.large
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
hover: {
|
|
129
|
+
selector: {
|
|
130
|
+
border: {
|
|
131
|
+
color: colors.text.primary,
|
|
132
|
+
error: colors.verve
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
option: {
|
|
136
|
+
backgroundColor: hexToRgb(colors.elements.backgroundAndDisabled, 0.5)
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
disabled: {
|
|
140
|
+
selector: {
|
|
141
|
+
border: {
|
|
142
|
+
color: colors.elements.backgroundAndDisabled
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
input: {
|
|
146
|
+
font: {
|
|
147
|
+
color: colors.text.disabled
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
arrow: {
|
|
151
|
+
fill: colors.elements.lineAndBorders
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
selected: {
|
|
155
|
+
selector: {
|
|
156
|
+
border: {
|
|
157
|
+
color: colors.text.primary
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
arrow: {
|
|
161
|
+
fill: colors.text.primary
|
|
162
|
+
},
|
|
163
|
+
input: {
|
|
164
|
+
font: {
|
|
165
|
+
color: colors.text.primary
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
optionsList: {
|
|
169
|
+
border: {
|
|
170
|
+
color: colors.text.primary
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
option: {
|
|
174
|
+
font: {
|
|
175
|
+
color: colors.text.primary,
|
|
176
|
+
weight: fontWeights.medium,
|
|
177
|
+
size: fontSizes.medium
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
var Dropdown_theme_default = Dropdown;
|
|
183
|
+
export {
|
|
184
|
+
Dropdown_theme_default as default
|
|
185
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
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, { useEffect, useState } from "react";
|
|
34
|
+
import styled, { withTheme } from "styled-components";
|
|
35
|
+
import { node, string, func, bool } from "prop-types";
|
|
36
|
+
import {
|
|
37
|
+
Animated,
|
|
38
|
+
TouchableWithoutFeedback,
|
|
39
|
+
Easing,
|
|
40
|
+
Modal
|
|
41
|
+
} from "react-native";
|
|
42
|
+
import Text from "../../Text";
|
|
43
|
+
const ClosableArea = styled(Animated.View)`
|
|
44
|
+
${({
|
|
45
|
+
theme: {
|
|
46
|
+
yoga: { colors }
|
|
47
|
+
}
|
|
48
|
+
}) => `
|
|
49
|
+
position: relative;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
|
|
53
|
+
background-color: ${colors.text.primary};
|
|
54
|
+
`}
|
|
55
|
+
`;
|
|
56
|
+
const ContentWrapper = styled(Animated.View)`
|
|
57
|
+
position: absolute;
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
|
|
60
|
+
width: 100%;
|
|
61
|
+
`;
|
|
62
|
+
const Content = styled.View`
|
|
63
|
+
${({
|
|
64
|
+
theme: {
|
|
65
|
+
yoga: {
|
|
66
|
+
components: { dropdown }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}) => `
|
|
70
|
+
justify-content: center;
|
|
71
|
+
width: 100%;
|
|
72
|
+
|
|
73
|
+
background-color: ${dropdown.backdrop.content.backgroundColor};
|
|
74
|
+
border-top-left-radius: ${dropdown.backdrop.content.border.radius.topLeft}px;
|
|
75
|
+
border-top-right-radius: ${dropdown.backdrop.content.border.radius.topRight}px;
|
|
76
|
+
`}
|
|
77
|
+
`;
|
|
78
|
+
const Title = styled(Text.Bold)`
|
|
79
|
+
${({
|
|
80
|
+
theme: {
|
|
81
|
+
yoga: {
|
|
82
|
+
components: { dropdown }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}) => `
|
|
86
|
+
width: 100%;
|
|
87
|
+
padding:
|
|
88
|
+
${dropdown.backdrop.content.title.padding.top}px
|
|
89
|
+
${dropdown.backdrop.content.title.padding.right}px
|
|
90
|
+
${dropdown.backdrop.content.title.padding.bottom}px
|
|
91
|
+
${dropdown.backdrop.content.title.padding.left}px;
|
|
92
|
+
|
|
93
|
+
font-size: ${dropdown.backdrop.content.title.font.size}px;
|
|
94
|
+
|
|
95
|
+
text-align: center;
|
|
96
|
+
`}
|
|
97
|
+
`;
|
|
98
|
+
const Backdrop = (_a) => {
|
|
99
|
+
var _b = _a, {
|
|
100
|
+
visible,
|
|
101
|
+
title,
|
|
102
|
+
children,
|
|
103
|
+
onClose,
|
|
104
|
+
theme: {
|
|
105
|
+
yoga: {
|
|
106
|
+
transition,
|
|
107
|
+
components: { dropdown }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
} = _b, props = __objRest(_b, [
|
|
111
|
+
"visible",
|
|
112
|
+
"title",
|
|
113
|
+
"children",
|
|
114
|
+
"onClose",
|
|
115
|
+
"theme"
|
|
116
|
+
]);
|
|
117
|
+
const [isOpen, toggleIsOpen] = useState(visible);
|
|
118
|
+
const [backgroundAnimation] = useState(new Animated.Value(0));
|
|
119
|
+
const [contentAnimation] = useState(
|
|
120
|
+
new Animated.Value(-dropdown.backdrop.content.height)
|
|
121
|
+
);
|
|
122
|
+
const animate = (animation, toValue) => Animated.timing(animation, {
|
|
123
|
+
toValue,
|
|
124
|
+
duration: transition.duration[0],
|
|
125
|
+
easing: Easing.out(Easing.ease),
|
|
126
|
+
useNativeDriver: false
|
|
127
|
+
}).start(() => !visible && toggleIsOpen(false));
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
if (visible)
|
|
130
|
+
toggleIsOpen(true);
|
|
131
|
+
animate(backgroundAnimation, visible ? 0.5 : 0);
|
|
132
|
+
animate(contentAnimation, visible ? 0 : -dropdown.backdrop.content.height);
|
|
133
|
+
}, [visible]);
|
|
134
|
+
return isOpen && /* @__PURE__ */ jsxs(Modal, __spreadProps(__spreadValues({}, props), { transparent: true, animationType: "none", children: [
|
|
135
|
+
/* @__PURE__ */ jsx(TouchableWithoutFeedback, { onPress: onClose, children: /* @__PURE__ */ jsx(ClosableArea, { style: { opacity: backgroundAnimation } }) }),
|
|
136
|
+
/* @__PURE__ */ jsx(ContentWrapper, { style: { bottom: contentAnimation }, children: /* @__PURE__ */ jsxs(Content, { children: [
|
|
137
|
+
title && /* @__PURE__ */ jsx(Title, { children: title }),
|
|
138
|
+
children
|
|
139
|
+
] }) })
|
|
140
|
+
] }));
|
|
141
|
+
};
|
|
142
|
+
Backdrop.propTypes = {
|
|
143
|
+
visible: bool,
|
|
144
|
+
title: string,
|
|
145
|
+
children: node.isRequired,
|
|
146
|
+
onClose: func
|
|
147
|
+
};
|
|
148
|
+
Backdrop.defaultProps = {
|
|
149
|
+
visible: false,
|
|
150
|
+
title: null,
|
|
151
|
+
onClose: () => {
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
var Backdrop_default = withTheme(Backdrop);
|
|
155
|
+
export {
|
|
156
|
+
Backdrop_default as default
|
|
157
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
4
|
+
import { ThemeProvider } from "../..";
|
|
5
|
+
import Backdrop from "./Backdrop";
|
|
6
|
+
jest.useFakeTimers();
|
|
7
|
+
describe("<Backdrop />", () => {
|
|
8
|
+
describe("Snapshots", () => {
|
|
9
|
+
it("should match snapshot", () => {
|
|
10
|
+
const { toJSON } = render(
|
|
11
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Backdrop, { title: "Find an Activity", children: "Some Content" }) })
|
|
12
|
+
);
|
|
13
|
+
expect(toJSON()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
it("should match snapshot when visible", () => {
|
|
16
|
+
const { toJSON } = render(
|
|
17
|
+
/* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Backdrop, { visible: true, title: "Find an Activity", children: "Some Content" }) })
|
|
18
|
+
);
|
|
19
|
+
expect(toJSON()).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,220 @@
|
|
|
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 { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import React, { useState } from "react";
|
|
34
|
+
import styled, { withTheme } from "styled-components";
|
|
35
|
+
import {
|
|
36
|
+
arrayOf,
|
|
37
|
+
func,
|
|
38
|
+
shape,
|
|
39
|
+
number,
|
|
40
|
+
string,
|
|
41
|
+
bool,
|
|
42
|
+
oneOfType
|
|
43
|
+
} from "prop-types";
|
|
44
|
+
import { TouchableWithoutFeedback, View } from "react-native";
|
|
45
|
+
import { ChevronDown } from "@gympass/yoga-icons";
|
|
46
|
+
import Options from "./Options";
|
|
47
|
+
import Backdrop from "./Backdrop";
|
|
48
|
+
import Text from "../../Text";
|
|
49
|
+
import Helper from "../../Input/native/Helper";
|
|
50
|
+
const Selector = styled.View`
|
|
51
|
+
${({
|
|
52
|
+
disabled,
|
|
53
|
+
selected,
|
|
54
|
+
error,
|
|
55
|
+
full,
|
|
56
|
+
theme: {
|
|
57
|
+
yoga: {
|
|
58
|
+
colors,
|
|
59
|
+
components: { dropdown }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}) => `
|
|
63
|
+
position: relative;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
align-items: center;
|
|
67
|
+
|
|
68
|
+
width: ${full ? "100%" : `${dropdown.width}px`};
|
|
69
|
+
padding: ${dropdown.selector.padding.top}px
|
|
70
|
+
${dropdown.selector.padding.right}px
|
|
71
|
+
${dropdown.selector.padding.bottom}px
|
|
72
|
+
${dropdown.selector.padding.left}px;
|
|
73
|
+
|
|
74
|
+
background-color: ${dropdown.selector.background};
|
|
75
|
+
border-radius: ${dropdown.selector.border.radius}px;
|
|
76
|
+
border-width: ${dropdown.selector.border.width}px;
|
|
77
|
+
border-style: solid;
|
|
78
|
+
border-color: ${error ? colors.feedback.attention[1] : dropdown.selector.border.color};
|
|
79
|
+
|
|
80
|
+
${disabled ? `border-color: ${dropdown.disabled.selector.border.color};` : ""};
|
|
81
|
+
${selected ? `border-color: ${dropdown.selected.selector.border.color};` : ""};
|
|
82
|
+
`}
|
|
83
|
+
`;
|
|
84
|
+
const Label = styled(Text)`
|
|
85
|
+
${({
|
|
86
|
+
disabled,
|
|
87
|
+
selected,
|
|
88
|
+
theme: {
|
|
89
|
+
yoga: {
|
|
90
|
+
components: { dropdown }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}) => `
|
|
94
|
+
color: ${dropdown.input.font.color};
|
|
95
|
+
${disabled ? `color: ${dropdown.disabled.input.font.color};` : ""}
|
|
96
|
+
${selected ? `color: ${dropdown.selected.input.font.color};` : ""}
|
|
97
|
+
`}
|
|
98
|
+
`;
|
|
99
|
+
const getSelectedOption = (options) => options.find((item) => item.selected === true);
|
|
100
|
+
const Dropdown = React.forwardRef(
|
|
101
|
+
(_a, ref) => {
|
|
102
|
+
var _b = _a, {
|
|
103
|
+
error,
|
|
104
|
+
label,
|
|
105
|
+
disabled,
|
|
106
|
+
full,
|
|
107
|
+
options,
|
|
108
|
+
cancelActionLabel,
|
|
109
|
+
confirmActionLabel,
|
|
110
|
+
onChange,
|
|
111
|
+
theme: {
|
|
112
|
+
yoga: {
|
|
113
|
+
components: { dropdown }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} = _b, rest = __objRest(_b, [
|
|
117
|
+
"error",
|
|
118
|
+
"label",
|
|
119
|
+
"disabled",
|
|
120
|
+
"full",
|
|
121
|
+
"options",
|
|
122
|
+
"cancelActionLabel",
|
|
123
|
+
"confirmActionLabel",
|
|
124
|
+
"onChange",
|
|
125
|
+
"theme"
|
|
126
|
+
]);
|
|
127
|
+
const [selected, toggleIsSelected] = useState(getSelectedOption(options));
|
|
128
|
+
const [isOpen, toggleIsOpen] = useState(false);
|
|
129
|
+
const iconColor = () => {
|
|
130
|
+
if (disabled)
|
|
131
|
+
return dropdown.disabled.arrow.fill;
|
|
132
|
+
if (selected)
|
|
133
|
+
return dropdown.selected.arrow.fill;
|
|
134
|
+
return dropdown.arrow.fill;
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
TouchableWithoutFeedback,
|
|
139
|
+
{
|
|
140
|
+
accessibilityRole: "button",
|
|
141
|
+
onPress: () => !disabled && toggleIsOpen(true),
|
|
142
|
+
children: /* @__PURE__ */ jsxs(View, { children: [
|
|
143
|
+
/* @__PURE__ */ jsxs(
|
|
144
|
+
Selector,
|
|
145
|
+
__spreadProps(__spreadValues({
|
|
146
|
+
full,
|
|
147
|
+
disabled,
|
|
148
|
+
selected,
|
|
149
|
+
error
|
|
150
|
+
}, rest), {
|
|
151
|
+
ref,
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ jsx(Label, { disabled, selected, children: selected && selected.label || label }),
|
|
154
|
+
/* @__PURE__ */ jsx(ChevronDown, { width: 20, height: 20, fill: iconColor() })
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
),
|
|
158
|
+
error && !selected && /* @__PURE__ */ jsx(Helper, { error })
|
|
159
|
+
] })
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
Backdrop,
|
|
164
|
+
{
|
|
165
|
+
visible: isOpen,
|
|
166
|
+
title: label,
|
|
167
|
+
onClose: () => toggleIsOpen(false),
|
|
168
|
+
children: /* @__PURE__ */ jsx(
|
|
169
|
+
Options,
|
|
170
|
+
{
|
|
171
|
+
options,
|
|
172
|
+
selectedOption: selected,
|
|
173
|
+
cancelActionLabel,
|
|
174
|
+
confirmActionLabel,
|
|
175
|
+
onClose: () => toggleIsOpen(false),
|
|
176
|
+
onSelect: (item) => {
|
|
177
|
+
toggleIsSelected(item);
|
|
178
|
+
onChange(item);
|
|
179
|
+
toggleIsOpen(false);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
Dropdown.propTypes = {
|
|
189
|
+
label: string,
|
|
190
|
+
disabled: bool,
|
|
191
|
+
error: string,
|
|
192
|
+
full: bool,
|
|
193
|
+
/** { label (string), value (string or number), selected: (boolean) } */
|
|
194
|
+
options: arrayOf(
|
|
195
|
+
shape({
|
|
196
|
+
label: string,
|
|
197
|
+
value: oneOfType([string, number]),
|
|
198
|
+
selected: bool
|
|
199
|
+
})
|
|
200
|
+
).isRequired,
|
|
201
|
+
/** Cancel label that will be shown in iOS option chooser */
|
|
202
|
+
cancelActionLabel: string,
|
|
203
|
+
/** Confirm label that will be shown in iOS option chooser */
|
|
204
|
+
confirmActionLabel: string,
|
|
205
|
+
onChange: func
|
|
206
|
+
};
|
|
207
|
+
Dropdown.defaultProps = {
|
|
208
|
+
label: "",
|
|
209
|
+
error: void 0,
|
|
210
|
+
full: false,
|
|
211
|
+
cancelActionLabel: "Cancel",
|
|
212
|
+
confirmActionLabel: "Confirm",
|
|
213
|
+
disabled: false,
|
|
214
|
+
onChange: () => {
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
var Dropdown_default = withTheme(Dropdown);
|
|
218
|
+
export {
|
|
219
|
+
Dropdown_default as default
|
|
220
|
+
};
|