@pareto-engineering/design-system 2.0.0-alpha.41 → 2.0.0-alpha.44
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/.env.scripts.example +4 -0
- package/.eslintrc.js +25 -1
- package/babel.config.js +1 -0
- package/dist/cjs/a/GradientBackground/GradientBackground.js +140 -0
- package/dist/cjs/a/GradientBackground/index.js +15 -0
- package/dist/cjs/a/GradientBackground/styles.scss +191 -0
- package/dist/cjs/a/Popover/Popover.js +134 -0
- package/dist/cjs/a/Popover/common/Divider/Divider.js +67 -0
- package/dist/cjs/a/Popover/common/Divider/index.js +15 -0
- package/dist/cjs/a/Popover/common/Item/Item.js +67 -0
- package/dist/cjs/a/Popover/common/Item/index.js +15 -0
- package/dist/cjs/a/Popover/common/index.js +21 -0
- package/dist/cjs/a/Popover/index.js +15 -0
- package/dist/cjs/a/Popover/styles.scss +33 -0
- package/dist/cjs/a/index.js +9 -1
- package/dist/cjs/c/AcceptCookies/AcceptCookies.js +134 -0
- package/dist/cjs/c/AcceptCookies/index.js +15 -0
- package/dist/cjs/c/AcceptCookies/styles.scss +49 -0
- package/dist/cjs/c/BlogCategoryButton/BlogCategoryButton.js +95 -0
- package/dist/cjs/c/BlogCategoryButton/index.js +15 -0
- package/dist/cjs/c/BlogContext/BlogContextProvider.js +63 -0
- package/dist/cjs/c/BlogContext/Context.js +16 -0
- package/dist/cjs/c/BlogContext/ContextProvider.js +63 -0
- package/dist/cjs/c/BlogContext/index.js +31 -0
- package/dist/cjs/c/BlogContext/useBlog.js +16 -0
- package/dist/cjs/c/BlogPost/BlogPost.js +147 -0
- package/dist/cjs/c/BlogPost/index.js +15 -0
- package/dist/cjs/c/BlogPost/styles.scss +33 -0
- package/dist/cjs/c/BlogPostsList/BlogPostsList.js +73 -0
- package/dist/cjs/c/BlogPostsList/common/Card/Card.js +170 -0
- package/dist/cjs/c/BlogPostsList/common/Card/index.js +15 -0
- package/dist/cjs/c/BlogPostsList/common/index.js +13 -0
- package/dist/cjs/c/BlogPostsList/index.js +15 -0
- package/dist/cjs/c/BlogPostsList/styles.scss +72 -0
- package/dist/cjs/c/SiteFooter/SiteFooter.js +73 -0
- package/dist/cjs/c/SiteFooter/common/Section/Section.js +95 -0
- package/dist/cjs/c/SiteFooter/common/Section/index.js +15 -0
- package/dist/cjs/c/SiteFooter/common/index.js +13 -0
- package/dist/cjs/c/SiteFooter/index.js +15 -0
- package/dist/cjs/c/SiteFooter/styles.scss +34 -0
- package/dist/cjs/c/SiteHeaderCTA/SiteHeaderCTA.js +108 -0
- package/dist/cjs/c/SiteHeaderCTA/index.js +15 -0
- package/dist/cjs/c/SiteHeaderCTA/styles.scss +44 -0
- package/dist/cjs/c/SiteMission/SiteMission.js +113 -0
- package/dist/cjs/c/SiteMission/index.js +15 -0
- package/dist/cjs/c/SiteMission/styles.scss +30 -0
- package/dist/cjs/c/SiteNavigation/SiteNavigation.js +130 -0
- package/dist/cjs/c/SiteNavigation/index.js +15 -0
- package/dist/cjs/c/SiteNavigation/styles.scss +118 -0
- package/dist/cjs/c/SiteOnboardingStep/SiteOnboardingStep.js +98 -0
- package/dist/cjs/c/SiteOnboardingStep/index.js +15 -0
- package/dist/cjs/c/SiteOnboardingStep/styles.scss +51 -0
- package/dist/cjs/c/SitePricing/SitePricing.js +108 -0
- package/dist/cjs/c/SitePricing/index.js +15 -0
- package/dist/cjs/c/SitePricing/styles.scss +73 -0
- package/dist/cjs/c/SiteServices/SiteServices.js +211 -0
- package/dist/cjs/c/SiteServices/index.js +15 -0
- package/dist/cjs/c/SiteServices/styles.scss +138 -0
- package/dist/cjs/c/TeamGallery/TeamGallery.js +80 -0
- package/dist/cjs/c/TeamGallery/common/PersonCard/PersonCard.js +84 -0
- package/dist/cjs/c/TeamGallery/common/PersonCard/index.js +15 -0
- package/dist/cjs/c/TeamGallery/common/index.js +13 -0
- package/dist/cjs/c/TeamGallery/index.js +15 -0
- package/dist/cjs/c/TeamGallery/styles.scss +100 -0
- package/dist/cjs/c/Testimonials/Testimonials.js +119 -0
- package/dist/cjs/c/Testimonials/index.js +15 -0
- package/dist/cjs/c/Testimonials/styles.scss +112 -0
- package/dist/cjs/experimental/GradientBackground/GradientBackground.js +98 -0
- package/dist/cjs/experimental/GradientBackground/index.js +15 -0
- package/dist/cjs/experimental/GradientBackground/styles.scss +64 -0
- package/dist/cjs/experimental/index.js +13 -0
- package/dist/cjs/f/FormInput/FormInput.js +5 -2
- package/dist/cjs/f/FormInput/styles.scss +11 -0
- package/dist/cjs/f/fields/CheckboxInput/CheckboxInput.js +105 -0
- package/dist/cjs/f/fields/CheckboxInput/index.js +15 -0
- package/dist/cjs/f/fields/CheckboxInput/styles.scss +28 -0
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +222 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +148 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +103 -0
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +229 -0
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/common/index.js +29 -0
- package/dist/cjs/f/fields/QueryCombobox/index.js +15 -0
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +65 -0
- package/dist/cjs/f/fields/RadioInput/RadioInput.js +110 -0
- package/dist/cjs/f/fields/RadioInput/index.js +15 -0
- package/dist/cjs/f/fields/RadioInput/styles.scss +26 -0
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +0 -1
- package/dist/cjs/f/fields/SelectInput/styles.scss +8 -6
- package/dist/cjs/f/fields/TaskRecommendation/TaskRecommendation.js +129 -0
- package/dist/cjs/f/fields/TaskRecommendation/index.js +15 -0
- package/dist/cjs/f/fields/TaskRecommendation/styles.scss +37 -0
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +131 -0
- package/dist/cjs/f/fields/TaskRecommendationInput/index.js +15 -0
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +41 -0
- package/dist/cjs/f/fields/TextArea/TextArea.js +141 -0
- package/dist/cjs/f/fields/TextArea/index.js +15 -0
- package/dist/cjs/f/fields/TextArea/styles.scss +19 -0
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/test/QueryLoader/QueryLoader.js +41 -0
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +49 -0
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/index.js +15 -0
- package/dist/cjs/test/QueryLoader/common/index.js +13 -0
- package/dist/cjs/test/QueryLoader/index.js +15 -0
- package/dist/cjs/test/QueryLoader/styles.scss +9 -0
- package/dist/cjs/test/index.js +13 -0
- package/dist/cjs/utils/hooks/index.js +23 -0
- package/dist/cjs/utils/hooks/useDynamicPosition.js +107 -0
- package/dist/cjs/utils/hooks/useWindowSize.js +39 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/es/a/GradientBackground/GradientBackground.js +118 -0
- package/dist/es/a/GradientBackground/index.js +2 -0
- package/dist/es/a/GradientBackground/styles.scss +191 -0
- package/dist/es/a/Popover/Popover.js +118 -0
- package/dist/es/a/Popover/common/Divider/Divider.js +47 -0
- package/dist/es/a/Popover/common/Divider/index.js +2 -0
- package/dist/es/a/Popover/common/Item/Item.js +47 -0
- package/dist/es/a/Popover/common/Item/index.js +2 -0
- package/dist/es/a/Popover/common/index.js +2 -0
- package/dist/es/a/Popover/index.js +2 -0
- package/dist/es/a/Popover/styles.scss +33 -0
- package/dist/es/a/index.js +2 -1
- package/dist/es/c/AcceptCookies/AcceptCookies.js +117 -0
- package/dist/es/c/AcceptCookies/index.js +2 -0
- package/dist/es/c/AcceptCookies/styles.scss +49 -0
- package/dist/es/c/BlogCategoryButton/BlogCategoryButton.js +68 -0
- package/dist/es/c/BlogCategoryButton/index.js +2 -0
- package/dist/es/c/BlogContext/BlogContextProvider.js +45 -0
- package/dist/es/c/BlogContext/Context.js +2 -0
- package/dist/es/c/BlogContext/ContextProvider.js +45 -0
- package/dist/es/c/BlogContext/index.js +4 -0
- package/dist/es/c/BlogContext/useBlog.js +3 -0
- package/dist/es/c/BlogPost/BlogPost.js +128 -0
- package/dist/es/c/BlogPost/index.js +2 -0
- package/dist/es/c/BlogPost/styles.scss +33 -0
- package/dist/es/c/BlogPostsList/BlogPostsList.js +56 -0
- package/dist/es/c/BlogPostsList/common/Card/Card.js +143 -0
- package/dist/es/c/BlogPostsList/common/Card/index.js +2 -0
- package/dist/es/c/BlogPostsList/common/index.js +1 -0
- package/dist/es/c/BlogPostsList/index.js +2 -0
- package/dist/es/c/BlogPostsList/styles.scss +72 -0
- package/dist/es/c/SiteFooter/SiteFooter.js +56 -0
- package/dist/es/c/SiteFooter/common/Section/Section.js +73 -0
- package/dist/es/c/SiteFooter/common/Section/index.js +2 -0
- package/dist/es/c/SiteFooter/common/index.js +1 -0
- package/dist/es/c/SiteFooter/index.js +2 -0
- package/dist/es/c/SiteFooter/styles.scss +34 -0
- package/dist/es/c/SiteHeaderCTA/SiteHeaderCTA.js +92 -0
- package/dist/es/c/SiteHeaderCTA/index.js +2 -0
- package/dist/es/c/SiteHeaderCTA/styles.scss +44 -0
- package/dist/es/c/SiteMission/SiteMission.js +96 -0
- package/dist/es/c/SiteMission/index.js +2 -0
- package/dist/es/c/SiteMission/styles.scss +30 -0
- package/dist/es/c/SiteNavigation/SiteNavigation.js +111 -0
- package/dist/es/c/SiteNavigation/index.js +2 -0
- package/dist/es/c/SiteNavigation/styles.scss +118 -0
- package/dist/es/c/SiteOnboardingStep/SiteOnboardingStep.js +81 -0
- package/dist/es/c/SiteOnboardingStep/index.js +2 -0
- package/dist/es/c/SiteOnboardingStep/styles.scss +51 -0
- package/dist/es/c/SitePricing/SitePricing.js +91 -0
- package/dist/es/c/SitePricing/index.js +2 -0
- package/dist/es/c/SitePricing/styles.scss +73 -0
- package/dist/es/c/SiteServices/SiteServices.js +195 -0
- package/dist/es/c/SiteServices/index.js +2 -0
- package/dist/es/c/SiteServices/styles.scss +138 -0
- package/dist/es/c/TeamGallery/TeamGallery.js +64 -0
- package/dist/es/c/TeamGallery/common/PersonCard/PersonCard.js +64 -0
- package/dist/es/c/TeamGallery/common/PersonCard/index.js +2 -0
- package/dist/es/c/TeamGallery/common/index.js +1 -0
- package/dist/es/c/TeamGallery/index.js +2 -0
- package/dist/es/c/TeamGallery/styles.scss +100 -0
- package/dist/es/c/Testimonials/Testimonials.js +99 -0
- package/dist/es/c/Testimonials/index.js +2 -0
- package/dist/es/c/Testimonials/styles.scss +112 -0
- package/dist/es/experimental/GradientBackground/GradientBackground.js +76 -0
- package/dist/es/experimental/GradientBackground/index.js +2 -0
- package/dist/es/experimental/GradientBackground/styles.scss +64 -0
- package/dist/es/experimental/index.js +1 -0
- package/dist/es/f/FormInput/FormInput.js +4 -1
- package/dist/es/f/FormInput/styles.scss +11 -0
- package/dist/es/f/fields/CheckboxInput/CheckboxInput.js +85 -0
- package/dist/es/f/fields/CheckboxInput/index.js +2 -0
- package/dist/es/f/fields/CheckboxInput/styles.scss +28 -0
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +197 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +129 -0
- package/dist/es/f/fields/QueryCombobox/common/Combobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/Menu/Menu.js +77 -0
- package/dist/es/f/fields/QueryCombobox/common/Menu/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +202 -0
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/common/index.js +3 -0
- package/dist/es/f/fields/QueryCombobox/index.js +2 -0
- package/dist/es/f/fields/QueryCombobox/styles.scss +65 -0
- package/dist/es/f/fields/RadioInput/RadioInput.js +90 -0
- package/dist/es/f/fields/RadioInput/index.js +2 -0
- package/dist/es/f/fields/RadioInput/styles.scss +26 -0
- package/dist/es/f/fields/SelectInput/SelectInput.js +0 -1
- package/dist/es/f/fields/SelectInput/styles.scss +8 -6
- package/dist/es/f/fields/TaskRecommendation/TaskRecommendation.js +111 -0
- package/dist/es/f/fields/TaskRecommendation/index.js +2 -0
- package/dist/es/f/fields/TaskRecommendation/styles.scss +37 -0
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +111 -0
- package/dist/es/f/fields/TaskRecommendationInput/index.js +2 -0
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +41 -0
- package/dist/es/f/fields/TextArea/TextArea.js +124 -0
- package/dist/es/f/fields/TextArea/index.js +2 -0
- package/dist/es/f/fields/TextArea/styles.scss +19 -0
- package/dist/es/index.js +3 -1
- package/dist/es/test/QueryLoader/QueryLoader.js +29 -0
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
- package/dist/es/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +31 -0
- package/dist/es/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
- package/dist/es/test/QueryLoader/common/index.js +1 -0
- package/dist/es/test/QueryLoader/index.js +2 -0
- package/dist/es/test/QueryLoader/styles.scss +9 -0
- package/dist/es/test/index.js +1 -0
- package/dist/es/utils/hooks/index.js +2 -0
- package/dist/es/utils/hooks/useDynamicPosition.js +93 -0
- package/dist/es/utils/hooks/useWindowSize.js +27 -0
- package/dist/es/utils/index.js +1 -0
- package/package.json +14 -2
- package/relay.config.js +12 -0
- package/schema.graphql +4075 -0
- package/scripts/fetchSchema.js +74 -0
- package/src/__snapshots__/Storyshots.test.js.snap +422 -8
- package/src/stories/a/Popover.stories.jsx +106 -0
- package/src/stories/test/QueryLoader.stories.jsx +36 -0
- package/src/stories/utils/lorem.js +15 -0
- package/src/stories/utils/relay/EnvironmentProvider.jsx +14 -0
- package/src/stories/utils/relay/environment.js +5 -0
- package/src/stories/utils/relay/index.js +4 -0
- package/src/stories/utils/relay/mockRelayOperation.js +14 -0
- package/src/stories/utils/relay/mockResolvers.js +299 -0
- package/src/ui/a/Popover/Popover.jsx +157 -0
- package/src/ui/a/Popover/index.js +2 -0
- package/src/ui/a/Popover/styles.scss +33 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/f/FormInput/FormInput.jsx +5 -1
- package/src/ui/f/FormInput/styles.scss +11 -0
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +1 -1
- package/src/ui/f/fields/SelectInput/styles.scss +8 -6
- package/src/ui/index.js +2 -0
- package/src/ui/test/QueryLoader/QueryLoader.jsx +41 -0
- package/src/ui/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +68 -0
- package/src/ui/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.jsx +51 -0
- package/src/ui/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
- package/src/ui/test/QueryLoader/common/index.js +1 -0
- package/src/ui/test/QueryLoader/index.js +2 -0
- package/src/ui/test/index.js +1 -0
- package/src/ui/utils/hooks/index.js +2 -0
- package/src/ui/utils/hooks/useDynamicPosition.js +104 -0
- package/src/ui/utils/hooks/useWindowSize.js +32 -0
- package/src/ui/utils/index.js +1 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
2
|
+
|
|
3
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useLayoutEffect } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { useField } from 'formik';
|
|
8
|
+
import styleNames from '@pareto-engineering/bem';
|
|
9
|
+
import { FormLabel } from "../../common"; // Local Definitions
|
|
10
|
+
|
|
11
|
+
const baseClassName = styleNames.base;
|
|
12
|
+
const componentClassName = 'task-recommendation';
|
|
13
|
+
/**
|
|
14
|
+
* This is the component description.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const TaskRecommendation = ({
|
|
18
|
+
id,
|
|
19
|
+
className: userClassName,
|
|
20
|
+
style,
|
|
21
|
+
name,
|
|
22
|
+
value,
|
|
23
|
+
oneLiner,
|
|
24
|
+
label,
|
|
25
|
+
color,
|
|
26
|
+
image // ...otherProps
|
|
27
|
+
|
|
28
|
+
}) => {
|
|
29
|
+
var _field$value;
|
|
30
|
+
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
import("./styles.scss");
|
|
33
|
+
}, []);
|
|
34
|
+
const [field] = useField(name);
|
|
35
|
+
const isOptionSelected = !!(((_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.length) > 0 && field.value.includes(value));
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
id: id,
|
|
38
|
+
className: [baseClassName, componentClassName, userClassName, `x-${color}`].filter(e => e).join(' '),
|
|
39
|
+
style: style // {...otherProps}
|
|
40
|
+
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: `task-content ${isOptionSelected ? 'b-x' : 'b-on-x'}`
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "v1 p-v task"
|
|
45
|
+
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
46
|
+
className: `uc mb-v ${isOptionSelected ? 'c-on-x' : 'c-x'}`,
|
|
47
|
+
name: name
|
|
48
|
+
}, label), /*#__PURE__*/React.createElement("input", _extends({}, field, {
|
|
49
|
+
value: value,
|
|
50
|
+
id: name,
|
|
51
|
+
className: "input",
|
|
52
|
+
type: "checkbox"
|
|
53
|
+
})), /*#__PURE__*/React.createElement("img", {
|
|
54
|
+
className: "image",
|
|
55
|
+
src: image,
|
|
56
|
+
alt: "img"
|
|
57
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
58
|
+
className: ['uc u2 mt-u', isOptionSelected && 'c-on-x'].filter(e => e).join(' ')
|
|
59
|
+
}, oneLiner))));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
TaskRecommendation.propTypes = {
|
|
63
|
+
/**
|
|
64
|
+
* The HTML id for this element
|
|
65
|
+
*/
|
|
66
|
+
id: PropTypes.string,
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The HTML class names for this element
|
|
70
|
+
*/
|
|
71
|
+
className: PropTypes.string,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The React-written, css properties for this element.
|
|
75
|
+
*/
|
|
76
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The name of the input
|
|
80
|
+
*/
|
|
81
|
+
name: PropTypes.string.isRequired,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The value of the input
|
|
85
|
+
*/
|
|
86
|
+
value: PropTypes.string.isRequired,
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The task one liner description
|
|
90
|
+
*/
|
|
91
|
+
oneLiner: PropTypes.string.isRequired,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The task label
|
|
95
|
+
*/
|
|
96
|
+
label: PropTypes.string.isRequired,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The color
|
|
100
|
+
*/
|
|
101
|
+
color: PropTypes.string,
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Task image
|
|
105
|
+
*/
|
|
106
|
+
image: PropTypes.string.isRequired
|
|
107
|
+
};
|
|
108
|
+
TaskRecommendation.defaultProps = {
|
|
109
|
+
color: 'main2'
|
|
110
|
+
};
|
|
111
|
+
export default TaskRecommendation;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.task-recommendation {
|
|
5
|
+
|
|
6
|
+
.task-content {
|
|
7
|
+
border-radius: var(--theme-border-radius);
|
|
8
|
+
border: 1px solid var(--x);
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
.task {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: space-around;
|
|
16
|
+
align-items: center;
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
.input {
|
|
20
|
+
appearance: none;
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: 0;
|
|
23
|
+
top: 0;
|
|
24
|
+
bottom:0;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.image {
|
|
30
|
+
width: 7rem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
2
|
+
|
|
3
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useLayoutEffect, memo } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { useField } from 'formik';
|
|
8
|
+
import styleNames from '@pareto-engineering/bem';
|
|
9
|
+
import { FormLabel } from "../../common"; // Local Definitions
|
|
10
|
+
|
|
11
|
+
const baseClassName = styleNames.base;
|
|
12
|
+
const componentClassName = 'task-recommendation-input';
|
|
13
|
+
/**
|
|
14
|
+
* This is the component description.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const TaskRecommendationInput = ({
|
|
18
|
+
id,
|
|
19
|
+
className: userClassName,
|
|
20
|
+
style,
|
|
21
|
+
name,
|
|
22
|
+
value,
|
|
23
|
+
oneLiner,
|
|
24
|
+
label,
|
|
25
|
+
color,
|
|
26
|
+
image // ...otherProps
|
|
27
|
+
|
|
28
|
+
}) => {
|
|
29
|
+
var _field$value;
|
|
30
|
+
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
import("./styles.scss");
|
|
33
|
+
}, []);
|
|
34
|
+
const [field] = useField(name);
|
|
35
|
+
const isOptionSelected = !!(((_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.length) > 0 && field.value.includes(value));
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
id: id,
|
|
38
|
+
className: [baseClassName, componentClassName, userClassName, `x-${color}`].filter(e => e).join(' '),
|
|
39
|
+
style: style // {...otherProps}
|
|
40
|
+
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: `task-content ${isOptionSelected ? 'b-x' : 'b-on-x'}`
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "v1 p-v task"
|
|
45
|
+
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
46
|
+
className: `uc mb-v ${isOptionSelected ? styleNames.modifierActive : ''}`,
|
|
47
|
+
name: name
|
|
48
|
+
}, label), /*#__PURE__*/React.createElement("input", _extends({}, field, {
|
|
49
|
+
value: value,
|
|
50
|
+
id: name,
|
|
51
|
+
className: "input",
|
|
52
|
+
type: "checkbox"
|
|
53
|
+
})), /*#__PURE__*/React.createElement("img", {
|
|
54
|
+
className: "image",
|
|
55
|
+
src: image,
|
|
56
|
+
alt: "img"
|
|
57
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
58
|
+
className: ['uc u2 mt-u', isOptionSelected && 'c-on-x'].filter(e => e).join(' ')
|
|
59
|
+
}, oneLiner))));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
TaskRecommendationInput.propTypes = {
|
|
63
|
+
/**
|
|
64
|
+
* The HTML id for this element
|
|
65
|
+
*/
|
|
66
|
+
id: PropTypes.string,
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The HTML class names for this element
|
|
70
|
+
*/
|
|
71
|
+
className: PropTypes.string,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The React-written, css properties for this element.
|
|
75
|
+
*/
|
|
76
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The name of the input
|
|
80
|
+
*/
|
|
81
|
+
name: PropTypes.string.isRequired,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The value of the input
|
|
85
|
+
*/
|
|
86
|
+
value: PropTypes.string.isRequired,
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The task one liner description
|
|
90
|
+
*/
|
|
91
|
+
oneLiner: PropTypes.string.isRequired,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The task label
|
|
95
|
+
*/
|
|
96
|
+
label: PropTypes.string.isRequired,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The color
|
|
100
|
+
*/
|
|
101
|
+
color: PropTypes.string,
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Task image
|
|
105
|
+
*/
|
|
106
|
+
image: PropTypes.string.isRequired
|
|
107
|
+
};
|
|
108
|
+
TaskRecommendationInput.defaultProps = {
|
|
109
|
+
color: 'main2'
|
|
110
|
+
};
|
|
111
|
+
export default /*#__PURE__*/memo(TaskRecommendationInput);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.task-recommendation-input {
|
|
5
|
+
|
|
6
|
+
.task-content {
|
|
7
|
+
border-radius: var(--theme-border-radius);
|
|
8
|
+
border: 1px solid var(--x);
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
.task {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: space-around;
|
|
16
|
+
align-items: center;
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
.#{bem.$modifier-active} {
|
|
20
|
+
color: var(--on-x);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.input {
|
|
24
|
+
appearance: none;
|
|
25
|
+
position: absolute;
|
|
26
|
+
left: 0;
|
|
27
|
+
top: 0;
|
|
28
|
+
bottom:0;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.image {
|
|
34
|
+
width: 7rem;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
2
|
+
|
|
3
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useLayoutEffect } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import styleNames from '@pareto-engineering/bem';
|
|
8
|
+
import { useField } from 'formik'; // Local Definitions
|
|
9
|
+
|
|
10
|
+
import { FormLabel, FormDescription } from "../../common";
|
|
11
|
+
const baseClassName = styleNames.base;
|
|
12
|
+
const componentClassName = 'text-area';
|
|
13
|
+
/**
|
|
14
|
+
* This is the component description.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const TextArea = ({
|
|
18
|
+
id,
|
|
19
|
+
className: userClassName,
|
|
20
|
+
style,
|
|
21
|
+
name,
|
|
22
|
+
label,
|
|
23
|
+
validate,
|
|
24
|
+
labelAsDescription,
|
|
25
|
+
textAreaId,
|
|
26
|
+
rows,
|
|
27
|
+
textAreaColor,
|
|
28
|
+
labelColor,
|
|
29
|
+
description // ...otherProps
|
|
30
|
+
|
|
31
|
+
}) => {
|
|
32
|
+
useLayoutEffect(() => {
|
|
33
|
+
import("./styles.scss");
|
|
34
|
+
}, []);
|
|
35
|
+
const [field, meta] = useField({
|
|
36
|
+
name,
|
|
37
|
+
validate
|
|
38
|
+
});
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
id: id,
|
|
41
|
+
className: [baseClassName, componentClassName, userClassName, `x-${textAreaColor}`, `y-${labelColor}`].filter(e => e).join(' '),
|
|
42
|
+
style: style // {...otherProps}
|
|
43
|
+
|
|
44
|
+
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
45
|
+
className: ['c-y', labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
46
|
+
name: name
|
|
47
|
+
}, label), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
48
|
+
id: textAreaId,
|
|
49
|
+
className: `textarea v50 pv-v ${meta.touched && meta.error ? 'input-border-error' : 'input-border'}`
|
|
50
|
+
}, field, {
|
|
51
|
+
rows: rows
|
|
52
|
+
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
|
|
53
|
+
isError: !!meta.error,
|
|
54
|
+
className: "v50 mt-v s-1"
|
|
55
|
+
}, meta.error || description), ' ');
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
TextArea.propTypes = {
|
|
59
|
+
/**
|
|
60
|
+
* The HTML id for this element
|
|
61
|
+
*/
|
|
62
|
+
id: PropTypes.string,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The HTML class names for this element
|
|
66
|
+
*/
|
|
67
|
+
className: PropTypes.string,
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The React-written, css properties for this element.
|
|
71
|
+
*/
|
|
72
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The input name (html - and Formik state)
|
|
76
|
+
*/
|
|
77
|
+
name: PropTypes.string.isRequired,
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The input label
|
|
81
|
+
*/
|
|
82
|
+
label: PropTypes.string.isRequired,
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The input value validator function
|
|
86
|
+
*/
|
|
87
|
+
validate: PropTypes.func,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* If the text area depends on it's label's text as the default description
|
|
91
|
+
*/
|
|
92
|
+
labelAsDescription: PropTypes.bool,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The textarea id
|
|
96
|
+
*/
|
|
97
|
+
textAreaId: PropTypes.string,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The number of rows int the text area
|
|
101
|
+
*/
|
|
102
|
+
rows: PropTypes.number,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Text area base color
|
|
106
|
+
*/
|
|
107
|
+
textAreaColor: PropTypes.string,
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Label base color
|
|
111
|
+
*/
|
|
112
|
+
labelColor: PropTypes.string,
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Text area description
|
|
116
|
+
*/
|
|
117
|
+
description: PropTypes.string
|
|
118
|
+
};
|
|
119
|
+
TextArea.defaultProps = {
|
|
120
|
+
rows: 3,
|
|
121
|
+
textAreaColor: 'background',
|
|
122
|
+
labelColor: 'main1'
|
|
123
|
+
};
|
|
124
|
+
export default TextArea;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
|
|
4
|
+
.#{bem.$base}.text-area{
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
.textarea {
|
|
9
|
+
background: var(--light-x);
|
|
10
|
+
color: var(--on-x);
|
|
11
|
+
|
|
12
|
+
&:focus {
|
|
13
|
+
background: var(--dark-x);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
package/dist/es/index.js
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var _QueryLoaderHelloQuery;
|
|
2
|
+
|
|
3
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useEffect, Suspense } from 'react';
|
|
6
|
+
import { useQueryLoader } from 'react-relay'; // Local Definitions
|
|
7
|
+
|
|
8
|
+
import { PreloadedTestData } from "./common";
|
|
9
|
+
const testQuery = _QueryLoaderHelloQuery !== void 0 ? _QueryLoaderHelloQuery : (_QueryLoaderHelloQuery = require("./__generated__/QueryLoaderHelloQuery.graphql"), _QueryLoaderHelloQuery.hash && _QueryLoaderHelloQuery.hash !== "b92d001ab0208bd484a99f77c274d5ef" && console.error("The definition of 'QueryLoaderHelloQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _QueryLoaderHelloQuery);
|
|
10
|
+
/**
|
|
11
|
+
* This is the component description.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const QueryLoader = () => {
|
|
15
|
+
const [queryReference, loadQuery] = useQueryLoader(testQuery);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
loadQuery({});
|
|
18
|
+
}, []);
|
|
19
|
+
return /*#__PURE__*/React.createElement(Suspense, {
|
|
20
|
+
fallback: "loading"
|
|
21
|
+
}, queryReference ? /*#__PURE__*/React.createElement(PreloadedTestData, {
|
|
22
|
+
queryReference: queryReference,
|
|
23
|
+
query: testQuery
|
|
24
|
+
}) : null);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
QueryLoader.defaultProps = {// someProp:false
|
|
28
|
+
};
|
|
29
|
+
export default QueryLoader;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flow
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
'use strict';
|
|
7
|
+
/*::
|
|
8
|
+
import type { ConcreteRequest } from 'relay-runtime';
|
|
9
|
+
export type QueryLoaderHelloQueryVariables = {||};
|
|
10
|
+
export type QueryLoaderHelloQueryResponse = {|
|
|
11
|
+
+hello: ?string
|
|
12
|
+
|};
|
|
13
|
+
export type QueryLoaderHelloQuery = {|
|
|
14
|
+
variables: QueryLoaderHelloQueryVariables,
|
|
15
|
+
response: QueryLoaderHelloQueryResponse,
|
|
16
|
+
|};
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
query QueryLoaderHelloQuery {
|
|
21
|
+
hello
|
|
22
|
+
}
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const node
|
|
26
|
+
/*: ConcreteRequest*/
|
|
27
|
+
= function () {
|
|
28
|
+
var v0 = [{
|
|
29
|
+
"alias": null,
|
|
30
|
+
"args": null,
|
|
31
|
+
"kind": "ScalarField",
|
|
32
|
+
"name": "hello",
|
|
33
|
+
"storageKey": null
|
|
34
|
+
}];
|
|
35
|
+
return {
|
|
36
|
+
"fragment": {
|
|
37
|
+
"argumentDefinitions": [],
|
|
38
|
+
"kind": "Fragment",
|
|
39
|
+
"metadata": null,
|
|
40
|
+
"name": "QueryLoaderHelloQuery",
|
|
41
|
+
"selections": v0
|
|
42
|
+
/*: any*/
|
|
43
|
+
,
|
|
44
|
+
"type": "Query",
|
|
45
|
+
"abstractKey": null
|
|
46
|
+
},
|
|
47
|
+
"kind": "Request",
|
|
48
|
+
"operation": {
|
|
49
|
+
"argumentDefinitions": [],
|
|
50
|
+
"kind": "Operation",
|
|
51
|
+
"name": "QueryLoaderHelloQuery",
|
|
52
|
+
"selections": v0
|
|
53
|
+
/*: any*/
|
|
54
|
+
|
|
55
|
+
},
|
|
56
|
+
"params": {
|
|
57
|
+
"cacheID": "463f9ee8a82dd6ec8dedeb28649cce74",
|
|
58
|
+
"id": null,
|
|
59
|
+
"metadata": {},
|
|
60
|
+
"name": "QueryLoaderHelloQuery",
|
|
61
|
+
"operationKind": "query",
|
|
62
|
+
"text": "query QueryLoaderHelloQuery {\n hello\n}\n"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}(); // prettier-ignore
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
node
|
|
69
|
+
/*: any*/
|
|
70
|
+
.hash = 'b92d001ab0208bd484a99f77c274d5ef';
|
|
71
|
+
module.exports = node;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { usePreloadedQuery } from 'react-relay';
|
|
5
|
+
/**
|
|
6
|
+
* This is the component description.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const PreloadedTestData = ({
|
|
10
|
+
query,
|
|
11
|
+
queryReference // ...otherProps
|
|
12
|
+
|
|
13
|
+
}) => {
|
|
14
|
+
const data = usePreloadedQuery(query, queryReference);
|
|
15
|
+
return /*#__PURE__*/React.createElement("pre", null, JSON.stringify(data, null, 2));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
PreloadedTestData.propTypes = {
|
|
19
|
+
/**
|
|
20
|
+
* The query to be used to query the test data
|
|
21
|
+
*/
|
|
22
|
+
query: PropTypes.objectOf(PropTypes.PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The query reference to be used to access the preloaded data
|
|
26
|
+
*/
|
|
27
|
+
queryReference: PropTypes.objectOf(PropTypes.PropTypes.oneOfType([PropTypes.string, PropTypes.object]))
|
|
28
|
+
};
|
|
29
|
+
PreloadedTestData.defaultProps = {// someProp:false
|
|
30
|
+
};
|
|
31
|
+
export default PreloadedTestData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PreloadedTestData } from "./PreloadedTestData";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { QueryLoader } from "./QueryLoader";
|