@gympass/yoga 7.65.0 → 7.66.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/Dialog/web/Dialog.js +12 -7
- package/cjs/Drawer/web/Drawer.js +5 -1
- package/cjs/Input/index.js +1 -0
- package/cjs/Input/web/Input.js +8 -3
- package/cjs/Input/web/Phone.js +144 -0
- package/cjs/Input/web/Phone.style.js +41 -0
- package/cjs/Input/web/data-images.js +10 -0
- package/cjs/Input/web/index.js +4 -0
- package/cjs/hooks/index.js +8 -0
- package/cjs/hooks/useCombinedRefs.js +32 -0
- package/esm/Accordion/web/Accordion.test.js +19 -0
- package/esm/ActionRequirement/index.native.js +2 -0
- package/esm/ActionRequirement/native/ActionRequirement.js +48 -0
- package/esm/ActionRequirement/native/ActionRequirement.test.js +45 -0
- package/esm/ActionRequirement/native/ActionRequirementStyles.js +25 -0
- package/esm/ActionRequirement/native/index.js +6 -0
- package/esm/ActionRequirement/web/ActionRequirement.test.js +36 -0
- package/esm/AutoComplete/web/AutoComplete.test.js +139 -0
- package/esm/Avatar/index.native.js +4 -0
- package/esm/Avatar/native/Avatar.js +96 -0
- package/esm/Avatar/native/Avatar.test.js +46 -0
- package/esm/Avatar/native/AvatarCircle.js +24 -0
- package/esm/Avatar/web/Avatar.test.js +63 -0
- package/esm/Banner/index.native.js +2 -0
- package/esm/Banner/native/Banner.js +128 -0
- package/esm/Banner/native/Banner.test.js +103 -0
- package/esm/Banner/native/index.js +2 -0
- package/esm/Banner/web/Banner.test.js +109 -0
- package/esm/BottomSheet/web/BottomSheet.test.js +48 -0
- package/esm/Box/index.native.js +2 -0
- package/esm/Box/native/Box.js +4 -0
- package/esm/Box/native/Box.test.js +16 -0
- package/esm/Box/native/index.js +2 -0
- package/esm/Box/web/Box.test.js +16 -0
- package/esm/Button/index.native.js +8 -0
- package/esm/Button/native/Button.js +110 -0
- package/esm/Button/native/Button.test.js +475 -0
- package/esm/Button/native/Icon.js +82 -0
- package/esm/Button/native/Link.js +35 -0
- package/esm/Button/native/Text.js +74 -0
- package/esm/Button/native/withTouchable.js +63 -0
- package/esm/Button/web/Button.test.js +772 -0
- package/esm/Card/index.native.js +2 -0
- package/esm/Card/native/Card/Actions.js +12 -0
- package/esm/Card/native/Card/Card.js +92 -0
- package/esm/Card/native/Card/Card.test.js +15 -0
- package/esm/Card/native/Card/Content.js +8 -0
- package/esm/Card/native/Card/Header.js +8 -0
- package/esm/Card/native/Card/index.js +8 -0
- package/esm/Card/native/EventCard/EventCard.js +169 -0
- package/esm/Card/native/EventCard/EventCard.test.js +65 -0
- package/esm/Card/native/EventCard/index.js +2 -0
- package/esm/Card/native/GymCard/CheckIn/Avatar.js +17 -0
- package/esm/Card/native/GymCard/CheckIn/CheckIn.js +66 -0
- package/esm/Card/native/GymCard/CheckIn/CheckIn.test.js +39 -0
- package/esm/Card/native/GymCard/CheckIn/Content.js +11 -0
- package/esm/Card/native/GymCard/CheckIn/Header.js +11 -0
- package/esm/Card/native/GymCard/CheckIn/index.js +2 -0
- package/esm/Card/native/GymCard/index.js +5 -0
- package/esm/Card/native/PlanCard/Actions.js +22 -0
- package/esm/Card/native/PlanCard/Content.js +75 -0
- package/esm/Card/native/PlanCard/List.js +73 -0
- package/esm/Card/native/PlanCard/PlanCard.js +51 -0
- package/esm/Card/native/PlanCard/PlanCard.test.js +84 -0
- package/esm/Card/native/PlanCard/Subtitle.js +15 -0
- package/esm/Card/native/PlanCard/Tag.js +34 -0
- package/esm/Card/native/PlanCard/index.js +15 -0
- package/esm/Card/native/index.js +5 -0
- package/esm/Card/web/Card/Card.test.js +14 -0
- package/esm/Card/web/EventCard/EventCard.test.js +27 -0
- package/esm/Card/web/PlanCard/PlanCard.test.js +94 -0
- package/esm/Checkbox/index.native.js +3 -0
- package/esm/Checkbox/native/Checkbox.js +179 -0
- package/esm/Checkbox/native/Checkbox.test.js +115 -0
- package/esm/Checkbox/native/Switch.js +115 -0
- package/esm/Checkbox/native/Switch.test.js +54 -0
- package/esm/Checkbox/native/index.js +3 -0
- package/esm/Checkbox/web/Checkbox.test.js +153 -0
- package/esm/Checkbox/web/Switch.test.js +56 -0
- package/esm/Chips/index.native.js +2 -0
- package/esm/Chips/native/Chips.js +104 -0
- package/esm/Chips/native/Chips.test.js +143 -0
- package/esm/Chips/native/Counter.js +20 -0
- package/esm/Chips/native/index.js +2 -0
- package/esm/Chips/web/Chips.test.js +128 -0
- package/esm/Datepicker/web/Datepicker.test.js +247 -0
- package/esm/Dialog/web/Dialog.js +13 -8
- package/esm/Dialog/web/Dialog.test.js +62 -0
- package/esm/Divider/index.native.js +2 -0
- package/esm/Divider/native/Divider.js +29 -0
- package/esm/Divider/native/Divider.test.js +29 -0
- package/esm/Divider/native/index.js +2 -0
- package/esm/Divider/web/Divider.test.js +29 -0
- package/esm/Drawer/web/Drawer.js +6 -2
- package/esm/Drawer/web/Drawer.test.js +33 -0
- package/esm/Dropdown/index.native.js +2 -0
- package/esm/Dropdown/native/Backdrop.js +93 -0
- package/esm/Dropdown/native/Backdrop.test.js +26 -0
- package/esm/Dropdown/native/Dropdown.js +142 -0
- package/esm/Dropdown/native/Dropdown.test.js +78 -0
- package/esm/Dropdown/native/Options.android.js +66 -0
- package/esm/Dropdown/native/Options.ios.js +71 -0
- package/esm/Dropdown/native/index.js +2 -0
- package/esm/Dropdown/web/Dropdown.test.js +93 -0
- package/esm/Feedback/web/Feedback.test.js +83 -0
- package/esm/Grid/web/Col.test.js +48 -0
- package/esm/Grid/web/Container.test.js +14 -0
- package/esm/Grid/web/Hide.test.js +31 -0
- package/esm/Grid/web/Row.test.js +14 -0
- package/esm/Header/web/Header.test.js +38 -0
- package/esm/Heading/web/Heading.test.js +58 -0
- package/esm/Icon/index.native.js +2 -0
- package/esm/Icon/native/Icon.test.js +47 -0
- package/esm/Icon/native/index.js +2 -0
- package/esm/Icon/web/Icon.test.js +47 -0
- package/esm/Input/index.js +2 -1
- package/esm/Input/index.native.js +6 -0
- package/esm/Input/native/Email.js +15 -0
- package/esm/Input/native/Email.test.js +13 -0
- package/esm/Input/native/Helper.js +62 -0
- package/esm/Input/native/Input.js +234 -0
- package/esm/Input/native/Input.test.js +181 -0
- package/esm/Input/native/Number.js +12 -0
- package/esm/Input/native/Number.test.js +13 -0
- package/esm/Input/native/Password.js +112 -0
- package/esm/Input/native/Password.test.js +125 -0
- package/esm/Input/native/Tel.js +14 -0
- package/esm/Input/native/Tel.test.js +13 -0
- package/esm/Input/native/index.js +6 -0
- package/esm/Input/web/Email.test.js +13 -0
- package/esm/Input/web/Input.js +9 -4
- package/esm/Input/web/Input.test.js +145 -0
- package/esm/Input/web/Number.test.js +13 -0
- package/esm/Input/web/Password.test.js +90 -0
- package/esm/Input/web/Phone.js +124 -0
- package/esm/Input/web/Phone.style.js +27 -0
- package/esm/Input/web/Phone.test.js +95 -0
- package/esm/Input/web/Tel.test.js +13 -0
- package/esm/Input/web/data-images.js +3 -0
- package/esm/Input/web/index.js +2 -1
- package/esm/List/index.native.js +3 -0
- package/esm/List/native/List.js +22 -0
- package/esm/List/native/List.test.js +106 -0
- package/esm/List/native/ListItem.js +51 -0
- package/esm/List/native/index.js +3 -0
- package/esm/List/web/List.test.js +62 -0
- package/esm/Menu/web/Menu.test.js +115 -0
- package/esm/Popover/web/Popover.test.js +19 -0
- package/esm/Progress/index.native.js +2 -0
- package/esm/Progress/native/Progress.js +103 -0
- package/esm/Progress/native/Progress.test.js +222 -0
- package/esm/Progress/native/index.js +2 -0
- package/esm/Progress/web/Progress.test.js +222 -0
- package/esm/RadioGroup/index.native.js +4 -0
- package/esm/RadioGroup/native/Button/RadioButton.js +64 -0
- package/esm/RadioGroup/native/Button/RadioButton.test.js +96 -0
- package/esm/RadioGroup/native/Radio/Radio.js +88 -0
- package/esm/RadioGroup/native/Radio/Radio.test.js +112 -0
- package/esm/RadioGroup/native/RadioGroup.js +66 -0
- package/esm/RadioGroup/native/RadioGroup.test.js +50 -0
- package/esm/RadioGroup/native/index.js +4 -0
- package/esm/RadioGroup/web/Button/RadioButton.test.js +121 -0
- package/esm/RadioGroup/web/Radio/Radio.test.js +108 -0
- package/esm/RadioGroup/web/RadioGroup.test.js +83 -0
- package/esm/Rating/index.native.js +2 -0
- package/esm/Rating/native/Rating.js +186 -0
- package/esm/Rating/native/Rating.test.js +121 -0
- package/esm/Rating/native/index.js +2 -0
- package/esm/Rating/web/Rating.test.js +184 -0
- package/esm/Result/index.native.js +8 -0
- package/esm/Result/native/Attendances.js +55 -0
- package/esm/Result/native/Details.js +97 -0
- package/esm/Result/native/Rate.js +35 -0
- package/esm/Result/native/Result.js +86 -0
- package/esm/Result/native/Result.test.js +107 -0
- package/esm/Result/native/ResultButton.js +13 -0
- package/esm/Result/native/Tags.js +41 -0
- package/esm/Result/native/TinyTextIcon.js +18 -0
- package/esm/Result/native/index.js +2 -0
- package/esm/Skeleton/index.native.js +2 -0
- package/esm/Skeleton/native/Skeleton.js +94 -0
- package/esm/Skeleton/native/Skeleton.test.js +78 -0
- package/esm/Skeleton/native/index.js +2 -0
- package/esm/Skeleton/web/Skeleton.test.js +77 -0
- package/esm/Slider/index.native.js +2 -0
- package/esm/Slider/native/Label.js +19 -0
- package/esm/Slider/native/Marker.js +68 -0
- package/esm/Slider/native/Slider.js +156 -0
- package/esm/Slider/native/Slider.test.js +122 -0
- package/esm/Slider/native/Step.js +14 -0
- package/esm/Slider/native/Tooltip.js +90 -0
- package/esm/Slider/web/Slider.test.js +86 -0
- package/esm/Snackbar/index.native.js +2 -0
- package/esm/Snackbar/native/Snackbar.js +199 -0
- package/esm/Snackbar/native/Snackbar.test.js +100 -0
- package/esm/Snackbar/native/SnackbarAnimationWrapper.js +124 -0
- package/esm/Snackbar/native/index.js +2 -0
- package/esm/Snackbar/web/Snackbar.test.js +118 -0
- package/esm/Stepper/index.native.js +3 -0
- package/esm/Stepper/native/Dots.js +45 -0
- package/esm/Stepper/native/Line.js +35 -0
- package/esm/Stepper/native/Step.js +19 -0
- package/esm/Stepper/native/Stepper.js +52 -0
- package/esm/Stepper/native/Stepper.test.js +70 -0
- package/esm/Stepper/native/index.js +3 -0
- package/esm/Stepper/web/Stepper.test.js +67 -0
- package/esm/Tag/index.native.js +4 -0
- package/esm/Tag/native/Informative.js +72 -0
- package/esm/Tag/native/Tag.js +75 -0
- package/esm/Tag/native/Tag.test.js +94 -0
- package/esm/Tag/native/index.js +2 -0
- package/esm/Tag/web/Tag.test.js +79 -0
- package/esm/Text/index.native.js +16 -0
- package/esm/Text/native/Text.js +69 -0
- package/esm/Text/native/Text.test.js +149 -0
- package/esm/Text/native/index.js +2 -0
- package/esm/Text/web/Text.test.js +149 -0
- package/esm/TextArea/index.native.js +2 -0
- package/esm/TextArea/native/TextArea.js +59 -0
- package/esm/TextArea/native/TextArea.test.js +11 -0
- package/esm/TextArea/native/index.js +2 -0
- package/esm/TextArea/web/TextArea.test.js +11 -0
- package/esm/Theme/Provider/index.native.js +2 -0
- package/esm/Theme/Provider/native/index.js +2 -0
- package/esm/Theme/Provider/web/FontLoader.test.js +11 -0
- package/esm/Theme/Provider/web/GlobalStyle.test.js +17 -0
- package/esm/Theme/helpers/themeReader/native/native.test.js +53 -0
- package/esm/Theme/helpers/themeReader/web/web.test.js +41 -0
- package/esm/Theme/index.native.js +5 -0
- package/esm/hooks/index.js +2 -1
- package/esm/hooks/useCombinedRefs.js +25 -0
- package/esm/index.native.js +26 -0
- package/esm/shared/index.native.js +2 -0
- package/package.json +4 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var _excluded = ["children", "activeStep"];
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
+
|
|
7
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { limitChildren, typeOf } from '../../shared';
|
|
12
|
+
import Line from './Line';
|
|
13
|
+
import Dots from './Dots';
|
|
14
|
+
import Step from './Step';
|
|
15
|
+
var Wrapper = styled.View(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
|
|
16
|
+
var LineWrapper = styled.View(function (_ref) {
|
|
17
|
+
var stepper = _ref.theme.yoga.components.stepper;
|
|
18
|
+
return "\n width: 100%;\n padding: 0 " + stepper.padding.right + "px 0 " + stepper.padding.left + "px;\n";
|
|
19
|
+
});
|
|
20
|
+
/** Stepper is responsible for the logic that drives a stepped workflow, it
|
|
21
|
+
provides a wizard-like workflow by dividing content into logical steps. */
|
|
22
|
+
|
|
23
|
+
var Stepper = function Stepper(_ref2) {
|
|
24
|
+
var children = _ref2.children,
|
|
25
|
+
activeStep = _ref2.activeStep,
|
|
26
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/React.createElement(Wrapper, rest, /*#__PURE__*/React.createElement(LineWrapper, null, /*#__PURE__*/React.createElement(Line, {
|
|
29
|
+
activeStep: activeStep,
|
|
30
|
+
totalSteps: React.Children.count(children) - 1
|
|
31
|
+
}), /*#__PURE__*/React.createElement(Dots, {
|
|
32
|
+
activeStep: activeStep,
|
|
33
|
+
labels: React.Children.map(children, function (child) {
|
|
34
|
+
return child.props.label;
|
|
35
|
+
})
|
|
36
|
+
})), React.Children.toArray(children)[activeStep]);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
Stepper.displayName = 'Stepper';
|
|
40
|
+
Stepper.propTypes = {
|
|
41
|
+
/** Must be a Stepper.Step component. */
|
|
42
|
+
children: typeOf(Step),
|
|
43
|
+
|
|
44
|
+
/** Controls the active step, it receive the index value for showing some
|
|
45
|
+
* step. Starting from 0. */
|
|
46
|
+
activeStep: limitChildren
|
|
47
|
+
};
|
|
48
|
+
Stepper.defaultProps = {
|
|
49
|
+
children: undefined,
|
|
50
|
+
activeStep: 0
|
|
51
|
+
};
|
|
52
|
+
export default Stepper;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { render } from '@testing-library/react-native';
|
|
4
|
+
import ThemeProvider from '../../Theme';
|
|
5
|
+
import Stepper from '..';
|
|
6
|
+
describe('<Stepper />', function () {
|
|
7
|
+
describe('Snapshots', function () {
|
|
8
|
+
it('should match snapshot with first step active', function () {
|
|
9
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
10
|
+
activeStep: 0
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
12
|
+
label: "step one"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step one content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
14
|
+
label: "step two"
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step two content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
16
|
+
label: "step three"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step three content"))))),
|
|
18
|
+
container = _render.container,
|
|
19
|
+
toJSON = _render.toJSON;
|
|
20
|
+
|
|
21
|
+
expect(toJSON(container)).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
it('should match snapshot with second step active', function () {
|
|
24
|
+
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
25
|
+
activeStep: 1
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
27
|
+
label: "step one"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step one content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
29
|
+
label: "step two"
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step two content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
31
|
+
label: "step three"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step three content"))))),
|
|
33
|
+
container = _render2.container,
|
|
34
|
+
toJSON = _render2.toJSON;
|
|
35
|
+
|
|
36
|
+
expect(toJSON(container)).toMatchSnapshot();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('Steps', function () {
|
|
40
|
+
it('should change the active step', function () {
|
|
41
|
+
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
42
|
+
activeStep: 0
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
44
|
+
label: "step one"
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step one content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
46
|
+
label: "step two"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step two content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
48
|
+
label: "step three"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step three content"))))),
|
|
50
|
+
queryByText = _render3.queryByText,
|
|
51
|
+
rerender = _render3.rerender;
|
|
52
|
+
|
|
53
|
+
expect(queryByText('step one content')).toBeTruthy();
|
|
54
|
+
expect(queryByText('step two content')).toBeFalsy();
|
|
55
|
+
expect(queryByText('step three content')).toBeFalsy();
|
|
56
|
+
rerender( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
57
|
+
activeStep: 1
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
59
|
+
label: "step one"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step one content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
61
|
+
label: "step two"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step two content")), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
63
|
+
label: "step three"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Text, null, "step three content")))));
|
|
65
|
+
expect(queryByText('step one content')).toBeFalsy();
|
|
66
|
+
expect(queryByText('step two content')).toBeTruthy();
|
|
67
|
+
expect(queryByText('step three content')).toBeFalsy();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import ThemeProvider from '../../Theme';
|
|
4
|
+
import Stepper from '..';
|
|
5
|
+
describe('<Stepper />', function () {
|
|
6
|
+
describe('Snapshots', function () {
|
|
7
|
+
it('should match snapshot with first step active', function () {
|
|
8
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
9
|
+
activeStep: 0
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
11
|
+
label: "step one"
|
|
12
|
+
}, "step one content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
13
|
+
label: "step two"
|
|
14
|
+
}, "step two content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
15
|
+
label: "step three"
|
|
16
|
+
}, "step three content")))),
|
|
17
|
+
container = _render.container;
|
|
18
|
+
|
|
19
|
+
expect(container).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
it('should match snapshot with second step active', function () {
|
|
22
|
+
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
23
|
+
activeStep: 1
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
25
|
+
label: "step one"
|
|
26
|
+
}, "step one content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
27
|
+
label: "step two"
|
|
28
|
+
}, "step two content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
29
|
+
label: "step three"
|
|
30
|
+
}, "step three content")))),
|
|
31
|
+
container = _render2.container;
|
|
32
|
+
|
|
33
|
+
expect(container).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('Steps', function () {
|
|
37
|
+
it('should change the active step', function () {
|
|
38
|
+
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
39
|
+
activeStep: 0
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
41
|
+
label: "step one"
|
|
42
|
+
}, "step one content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
43
|
+
label: "step two"
|
|
44
|
+
}, "step two content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
45
|
+
label: "step three"
|
|
46
|
+
}, "step three content")))),
|
|
47
|
+
queryByText = _render3.queryByText,
|
|
48
|
+
rerender = _render3.rerender;
|
|
49
|
+
|
|
50
|
+
expect(queryByText('step one content')).toBeTruthy();
|
|
51
|
+
expect(queryByText('step two content')).toBeFalsy();
|
|
52
|
+
expect(queryByText('step three content')).toBeFalsy();
|
|
53
|
+
rerender( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Stepper, {
|
|
54
|
+
activeStep: 1
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
56
|
+
label: "step one"
|
|
57
|
+
}, "step one content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
58
|
+
label: "step two"
|
|
59
|
+
}, "step two content"), /*#__PURE__*/React.createElement(Stepper.Step, {
|
|
60
|
+
label: "step three"
|
|
61
|
+
}, "step three content"))));
|
|
62
|
+
expect(queryByText('step one content')).toBeFalsy();
|
|
63
|
+
expect(queryByText('step two content')).toBeTruthy();
|
|
64
|
+
expect(queryByText('step three content')).toBeFalsy();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var _excluded = ["children", "icon", "theme", "small"];
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
|
|
5
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
+
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
9
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
10
|
+
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import styled, { withTheme } from 'styled-components';
|
|
13
|
+
import { func, oneOf, node, bool } from 'prop-types';
|
|
14
|
+
import { margins } from '@gympass/yoga-system';
|
|
15
|
+
import { StyledTag, StyledText } from './Tag';
|
|
16
|
+
import Icon from '../../Icon';
|
|
17
|
+
var Informative = styled(StyledTag)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n\n ", "\n"])), function (_ref) {
|
|
18
|
+
var variant = _ref.variant,
|
|
19
|
+
_ref$theme$yoga = _ref.theme.yoga,
|
|
20
|
+
_ref$theme$yoga$color = _ref$theme$yoga.colors,
|
|
21
|
+
text = _ref$theme$yoga$color.text,
|
|
22
|
+
_ref$theme$yoga$color2 = _ref$theme$yoga$color.feedback[variant],
|
|
23
|
+
color = _ref$theme$yoga$color2 === void 0 ? {
|
|
24
|
+
light: text.secondary
|
|
25
|
+
} : _ref$theme$yoga$color2,
|
|
26
|
+
tag = _ref$theme$yoga.components.tag;
|
|
27
|
+
return "\n background-color: " + color.light + ";\n border-color: " + color.light + ";\n border-radius: " + tag.border.radius + "px;\n ";
|
|
28
|
+
}, margins);
|
|
29
|
+
var Wrapper = styled.View(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
|
|
30
|
+
var StyledTextInformative = styled(StyledText)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref2) {
|
|
31
|
+
var _ref2$theme$yoga = _ref2.theme.yoga,
|
|
32
|
+
text = _ref2$theme$yoga.colors.text,
|
|
33
|
+
tag = _ref2$theme$yoga.components.tag;
|
|
34
|
+
return "\n color: " + text.primary + ";\n\n font-size: " + tag.font.size + "px;\n line-height: " + tag.font.lineHeight + "px;\n font-weight: " + tag.font.weight + ";\n ";
|
|
35
|
+
});
|
|
36
|
+
/** Tags should be keywords to categorize or organize an item. */
|
|
37
|
+
|
|
38
|
+
var TagInformative = function TagInformative(_ref3) {
|
|
39
|
+
var children = _ref3.children,
|
|
40
|
+
icon = _ref3.icon,
|
|
41
|
+
_ref3$theme$yoga = _ref3.theme.yoga,
|
|
42
|
+
text = _ref3$theme$yoga.colors.text,
|
|
43
|
+
tag = _ref3$theme$yoga.components.tag,
|
|
44
|
+
small = _ref3.small,
|
|
45
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/React.createElement(Informative, _extends({
|
|
48
|
+
small: small
|
|
49
|
+
}, props), /*#__PURE__*/React.createElement(Wrapper, null, icon && /*#__PURE__*/React.createElement(Icon, {
|
|
50
|
+
as: icon,
|
|
51
|
+
size: small ? tag.icon.size.small : tag.icon.size["default"],
|
|
52
|
+
fill: text.primary,
|
|
53
|
+
marginRight: tag.icon.margin.right
|
|
54
|
+
}), /*#__PURE__*/React.createElement(StyledTextInformative, null, children)));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
TagInformative.propTypes = {
|
|
58
|
+
/** style the tag following the theme (neutral, success, informative, attention) */
|
|
59
|
+
variant: oneOf(['neutral', 'success', 'informative', 'attention']),
|
|
60
|
+
icon: func,
|
|
61
|
+
children: node.isRequired,
|
|
62
|
+
|
|
63
|
+
/** Can send small to use this variant */
|
|
64
|
+
small: bool
|
|
65
|
+
};
|
|
66
|
+
TagInformative.defaultProps = {
|
|
67
|
+
variant: 'neutral',
|
|
68
|
+
icon: undefined,
|
|
69
|
+
small: false
|
|
70
|
+
};
|
|
71
|
+
TagInformative.displayName = 'Tag.Informative';
|
|
72
|
+
export default withTheme(TagInformative);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var _excluded = ["variant"],
|
|
2
|
+
_excluded2 = ["children", "variant", "small"];
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2;
|
|
5
|
+
|
|
6
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
|
+
|
|
8
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
+
|
|
10
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
11
|
+
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import styled from 'styled-components';
|
|
14
|
+
import { oneOf, node, bool } from 'prop-types';
|
|
15
|
+
import { margins } from '@gympass/yoga-system';
|
|
16
|
+
import Text from '../../Text';
|
|
17
|
+
export var StyledTag = styled.View(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n justify-content: center;\n align-items: center;\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
18
|
+
var variant = _ref.variant,
|
|
19
|
+
small = _ref.small,
|
|
20
|
+
_ref$theme$yoga = _ref.theme.yoga,
|
|
21
|
+
_ref$theme$yoga$color = _ref$theme$yoga.colors,
|
|
22
|
+
elements = _ref$theme$yoga$color.elements,
|
|
23
|
+
_ref$theme$yoga$color2 = _ref$theme$yoga$color.feedback[variant],
|
|
24
|
+
borderColor = _ref$theme$yoga$color2 === void 0 ? {
|
|
25
|
+
dark: elements.selectionAndIcons
|
|
26
|
+
} : _ref$theme$yoga$color2,
|
|
27
|
+
tag = _ref$theme$yoga.components.tag;
|
|
28
|
+
return "\n width: auto;\n " + (small ? "\n padding:\n " + tag.padding.small.top + "\n " + tag.padding.small.right + "px\n " + tag.padding.small.bottom + "\n " + tag.padding.small.left + "px;\n " : "\n padding:\n " + tag.padding["default"].top + "px\n " + tag.padding["default"].right + "px\n " + tag.padding["default"].bottom + "px\n " + tag.padding["default"].left + "px;\n ") + "\n\n border-radius: " + tag.border.radius + "px;\n border-width: " + tag.border.width + "px;\n border-color: " + borderColor.dark + ";\n ";
|
|
29
|
+
}, margins);
|
|
30
|
+
export var StyledText = styled(function (_ref2) {
|
|
31
|
+
var variant = _ref2.variant,
|
|
32
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/React.createElement(Text.Medium, rest);
|
|
35
|
+
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n ", "\n"])), function (_ref3) {
|
|
36
|
+
var variant = _ref3.variant,
|
|
37
|
+
_ref3$theme$yoga = _ref3.theme.yoga,
|
|
38
|
+
_ref3$theme$yoga$colo = _ref3$theme$yoga.colors,
|
|
39
|
+
text = _ref3$theme$yoga$colo.text,
|
|
40
|
+
_ref3$theme$yoga$colo2 = _ref3$theme$yoga$colo.feedback[variant],
|
|
41
|
+
color = _ref3$theme$yoga$colo2 === void 0 ? {
|
|
42
|
+
dark: text.secondary
|
|
43
|
+
} : _ref3$theme$yoga$colo2,
|
|
44
|
+
tag = _ref3$theme$yoga.components.tag;
|
|
45
|
+
return "\n color: " + color.dark + ";\n\n font-size: " + tag.font.size + "px;\n line-height: " + tag.font.lineHeight + "px;\n ";
|
|
46
|
+
});
|
|
47
|
+
/** Use Tag component when you want to categorize your content */
|
|
48
|
+
|
|
49
|
+
var Tag = function Tag(_ref4) {
|
|
50
|
+
var children = _ref4.children,
|
|
51
|
+
variant = _ref4.variant,
|
|
52
|
+
small = _ref4.small,
|
|
53
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded2);
|
|
54
|
+
|
|
55
|
+
return /*#__PURE__*/React.createElement(StyledTag, _extends({
|
|
56
|
+
variant: variant,
|
|
57
|
+
small: small
|
|
58
|
+
}, props), /*#__PURE__*/React.createElement(StyledText, {
|
|
59
|
+
variant: variant
|
|
60
|
+
}, children));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
Tag.propTypes = {
|
|
64
|
+
/** style the tag following the theme (success, informative, attention) */
|
|
65
|
+
variant: oneOf(['', 'success', 'informative', 'attention']),
|
|
66
|
+
|
|
67
|
+
/** Can send small to use this variant */
|
|
68
|
+
small: bool,
|
|
69
|
+
children: node.isRequired
|
|
70
|
+
};
|
|
71
|
+
Tag.defaultProps = {
|
|
72
|
+
variant: '',
|
|
73
|
+
small: false
|
|
74
|
+
};
|
|
75
|
+
export default Tag;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react-native';
|
|
3
|
+
import { Building } from '@gympass/yoga-icons';
|
|
4
|
+
import { ThemeProvider, Tag } from '../..';
|
|
5
|
+
describe('<Tag />', function () {
|
|
6
|
+
it('should match snapshot', function () {
|
|
7
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag, null, "default"))),
|
|
8
|
+
toJSON = _render.toJSON;
|
|
9
|
+
|
|
10
|
+
expect(toJSON()).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
it('should match snapshot with custom icon and informative type', function () {
|
|
13
|
+
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
14
|
+
variant: "success",
|
|
15
|
+
icon: Building
|
|
16
|
+
}, "success with custom icon"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
17
|
+
variant: "success",
|
|
18
|
+
icon: Building,
|
|
19
|
+
small: true
|
|
20
|
+
}, "success with custom icon"))),
|
|
21
|
+
toJSON = _render2.toJSON;
|
|
22
|
+
|
|
23
|
+
expect(toJSON()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
it('should match snapshot with without icon and informative type', function () {
|
|
26
|
+
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
27
|
+
variant: "success"
|
|
28
|
+
}, "success without icon"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
29
|
+
variant: "success",
|
|
30
|
+
small: true
|
|
31
|
+
}, "success without icon"))),
|
|
32
|
+
toJSON = _render3.toJSON;
|
|
33
|
+
|
|
34
|
+
expect(toJSON()).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
it('should match snapshot with variant prop', function () {
|
|
37
|
+
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag, {
|
|
38
|
+
variant: "success"
|
|
39
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag, {
|
|
40
|
+
variant: "informative"
|
|
41
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag, {
|
|
42
|
+
variant: "attention"
|
|
43
|
+
}, "attention"), /*#__PURE__*/React.createElement(Tag, {
|
|
44
|
+
variant: "attention",
|
|
45
|
+
small: true
|
|
46
|
+
}, "attention small"))),
|
|
47
|
+
toJSON = _render4.toJSON;
|
|
48
|
+
|
|
49
|
+
expect(toJSON()).toMatchSnapshot();
|
|
50
|
+
});
|
|
51
|
+
it('should match snapshot with variant prop and informative type', function () {
|
|
52
|
+
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
53
|
+
variant: "neutral"
|
|
54
|
+
}, "neutral"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
55
|
+
variant: "success"
|
|
56
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
57
|
+
variant: "informative"
|
|
58
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
59
|
+
variant: "attention"
|
|
60
|
+
}, "attention"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
61
|
+
variant: "attention",
|
|
62
|
+
small: true
|
|
63
|
+
}, "attention small"))),
|
|
64
|
+
toJSON = _render5.toJSON;
|
|
65
|
+
|
|
66
|
+
expect(toJSON()).toMatchSnapshot();
|
|
67
|
+
});
|
|
68
|
+
it('should match snapshot with variant and margin prop ', function () {
|
|
69
|
+
var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag, {
|
|
70
|
+
variant: "success"
|
|
71
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag, {
|
|
72
|
+
mv: "medium",
|
|
73
|
+
variant: "informative"
|
|
74
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag, {
|
|
75
|
+
variant: "attention"
|
|
76
|
+
}, "attention"))),
|
|
77
|
+
toJSON = _render6.toJSON;
|
|
78
|
+
|
|
79
|
+
expect(toJSON()).toMatchSnapshot();
|
|
80
|
+
});
|
|
81
|
+
it('should match snapshot with variant prop and informative type with margin prop', function () {
|
|
82
|
+
var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
83
|
+
variant: "success"
|
|
84
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
85
|
+
mv: "medium",
|
|
86
|
+
variant: "informative"
|
|
87
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
88
|
+
variant: "attention"
|
|
89
|
+
}, "attention"))),
|
|
90
|
+
toJSON = _render7.toJSON;
|
|
91
|
+
|
|
92
|
+
expect(toJSON()).toMatchSnapshot();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Building } from '@gympass/yoga-icons';
|
|
4
|
+
import { ThemeProvider, Tag } from '../..';
|
|
5
|
+
describe('<Tag />', function () {
|
|
6
|
+
it('should match snapshot', function () {
|
|
7
|
+
var _render = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag, null, "default"))),
|
|
8
|
+
container = _render.container;
|
|
9
|
+
|
|
10
|
+
expect(container).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
it('should match snapshot with custom icon and informative type', function () {
|
|
13
|
+
var _render2 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
14
|
+
variant: "success",
|
|
15
|
+
icon: Building
|
|
16
|
+
}, "success with custom icon"))),
|
|
17
|
+
container = _render2.container;
|
|
18
|
+
|
|
19
|
+
expect(container).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
it('should match snapshot with without icon and informative type', function () {
|
|
22
|
+
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
23
|
+
variant: "success"
|
|
24
|
+
}, "success without icon"))),
|
|
25
|
+
container = _render3.container;
|
|
26
|
+
|
|
27
|
+
expect(container).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
it('should match snapshot with variant prop', function () {
|
|
30
|
+
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag, {
|
|
31
|
+
variant: "success"
|
|
32
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag, {
|
|
33
|
+
variant: "informative"
|
|
34
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag, {
|
|
35
|
+
variant: "attention"
|
|
36
|
+
}, "attention"))),
|
|
37
|
+
container = _render4.container;
|
|
38
|
+
|
|
39
|
+
expect(container).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
it('should match snapshot with variant prop and informative type', function () {
|
|
42
|
+
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
43
|
+
variant: "success"
|
|
44
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
45
|
+
variant: "informative"
|
|
46
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
47
|
+
variant: "attention"
|
|
48
|
+
}, "attention"))),
|
|
49
|
+
container = _render5.container;
|
|
50
|
+
|
|
51
|
+
expect(container).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
it('should match snapshot with variant and margin prop ', function () {
|
|
54
|
+
var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag, {
|
|
55
|
+
variant: "success"
|
|
56
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag, {
|
|
57
|
+
mv: "medium",
|
|
58
|
+
variant: "informative"
|
|
59
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag, {
|
|
60
|
+
variant: "attention"
|
|
61
|
+
}, "attention"))),
|
|
62
|
+
container = _render6.container;
|
|
63
|
+
|
|
64
|
+
expect(container).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
it('should match snapshot with variant prop and informative type with margin prop', function () {
|
|
67
|
+
var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
68
|
+
variant: "success"
|
|
69
|
+
}, "success"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
70
|
+
mv: "medium",
|
|
71
|
+
variant: "informative"
|
|
72
|
+
}, "informative"), /*#__PURE__*/React.createElement(Tag.Informative, {
|
|
73
|
+
variant: "attention"
|
|
74
|
+
}, "attention"))),
|
|
75
|
+
container = _render7.container;
|
|
76
|
+
|
|
77
|
+
expect(container).toMatchSnapshot();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text, H1, H2, H3, H4, H5, Small, Tiny, Light, Regular, Medium, Bold, Black, SectionTitle, SmallestException } from './native';
|
|
2
|
+
Text.H1 = H1;
|
|
3
|
+
Text.H2 = H2;
|
|
4
|
+
Text.H3 = H3;
|
|
5
|
+
Text.H4 = H4;
|
|
6
|
+
Text.H5 = H5;
|
|
7
|
+
Text.Small = Small;
|
|
8
|
+
Text.Tiny = Tiny;
|
|
9
|
+
Text.Light = Light;
|
|
10
|
+
Text.Regular = Regular;
|
|
11
|
+
Text.Medium = Medium;
|
|
12
|
+
Text.Bold = Bold;
|
|
13
|
+
Text.Black = Black;
|
|
14
|
+
Text.SectionTitle = SectionTitle;
|
|
15
|
+
Text.SmallestException = SmallestException;
|
|
16
|
+
export default Text;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { oneOf, bool } from 'prop-types';
|
|
8
|
+
import { system } from '@gympass/yoga-system';
|
|
9
|
+
import textStyle from '../textStyle';
|
|
10
|
+
import { deprecated } from '../../shared';
|
|
11
|
+
|
|
12
|
+
var styledText = function styledText(type) {
|
|
13
|
+
return styled.Text(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n"])), textStyle(type), system);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var H1 = styledText('h1');
|
|
17
|
+
H1.displayName = 'Text.H1';
|
|
18
|
+
var H2 = styledText('h2');
|
|
19
|
+
H2.displayName = 'Text.H2';
|
|
20
|
+
var H3 = styledText('h3');
|
|
21
|
+
H3.displayName = 'Text.H3';
|
|
22
|
+
var H4 = styledText('h4');
|
|
23
|
+
H4.displayName = 'Text.H4';
|
|
24
|
+
var H5 = styledText('h5');
|
|
25
|
+
H5.displayName = 'Text.H5';
|
|
26
|
+
var Small = styledText('small');
|
|
27
|
+
Small.displayName = 'Text.Small';
|
|
28
|
+
var Tiny = styledText('tiny');
|
|
29
|
+
Tiny.displayName = 'Text.Tiny';
|
|
30
|
+
var Light = styledText('light');
|
|
31
|
+
Light.displayName = 'Text.Light';
|
|
32
|
+
var Regular = styledText('regular');
|
|
33
|
+
Regular.displayName = 'Text.Regular';
|
|
34
|
+
var Medium = styledText('medium');
|
|
35
|
+
Medium.displayName = 'Text.Medium';
|
|
36
|
+
var Bold = styledText('bold');
|
|
37
|
+
Bold.displayName = 'Text.Bold';
|
|
38
|
+
var Black = styledText('black');
|
|
39
|
+
Black.displayName = 'Text.Black';
|
|
40
|
+
var SectionTitle = styledText('sectionTitle');
|
|
41
|
+
SectionTitle.displayName = 'Text.SectionTitle';
|
|
42
|
+
var SmallestException = styledText('smallestException');
|
|
43
|
+
SmallestException.displayName = 'Text.SmallestException';
|
|
44
|
+
var TextRenderer = styledText('p');
|
|
45
|
+
|
|
46
|
+
var Text = function Text(props) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(TextRenderer, props);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Text.displayName = 'Text';
|
|
51
|
+
Text.propTypes = {
|
|
52
|
+
inverted: bool,
|
|
53
|
+
|
|
54
|
+
/** (deprecated: use color instead) style the text following the theme */
|
|
55
|
+
variant: deprecated(oneOf(['primary', 'secondary', 'vibin', 'hope', 'energy', 'relax', 'peace', 'verve', 'uplift', 'deepPurple', 'stamina', 'deep', 'medium', 'light', 'clear', 'white']), 'Use `color` system prop instead'),
|
|
56
|
+
|
|
57
|
+
/** (deprecated: use fontSize instead) style the text following the theme */
|
|
58
|
+
size: deprecated(oneOf(['xxsmall', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge', 'xxxlarge', 'huge']), 'Use `fontSize` system prop instead'),
|
|
59
|
+
|
|
60
|
+
/** set the font-weight to regular */
|
|
61
|
+
light: bool
|
|
62
|
+
};
|
|
63
|
+
Text.defaultProps = {
|
|
64
|
+
inverted: false,
|
|
65
|
+
variant: undefined,
|
|
66
|
+
size: 'medium',
|
|
67
|
+
light: false
|
|
68
|
+
};
|
|
69
|
+
export { Text, H1, H2, H3, H4, H5, Small, Tiny, Light, Regular, Medium, Bold, Black, SectionTitle, SmallestException };
|