@pareto-engineering/design-system 2.0.0-alpha.4 → 2.0.0-alpha.42

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.
Files changed (225) hide show
  1. package/dist/cjs/a/BackgroundGradient/BackgroundGradient.js +77 -0
  2. package/dist/cjs/a/BackgroundGradient/index.js +15 -0
  3. package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
  4. package/dist/cjs/a/ContentTree/ContentTree.js +83 -0
  5. package/dist/cjs/a/ContentTree/common/Tree/Tree.js +116 -0
  6. package/dist/cjs/a/ContentTree/common/Tree/index.js +15 -0
  7. package/dist/cjs/a/ContentTree/common/index.js +31 -0
  8. package/dist/cjs/a/ContentTree/common/useContentTree.js +82 -0
  9. package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +65 -0
  10. package/dist/cjs/a/ContentTree/index.js +15 -0
  11. package/dist/cjs/a/ContentTree/styles.scss +33 -0
  12. package/dist/cjs/a/Conversation/Conversation.js +14 -8
  13. package/dist/cjs/a/Conversation/common/Message/Message.js +32 -6
  14. package/dist/cjs/a/Conversation/styles.scss +132 -33
  15. package/dist/cjs/a/OvalIllustration/OvalIllustration.js +133 -0
  16. package/dist/cjs/a/OvalIllustration/index.js +15 -0
  17. package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
  18. package/dist/cjs/a/Popover/Popover.js +134 -0
  19. package/dist/cjs/a/Popover/common/Divider/Divider.js +67 -0
  20. package/dist/cjs/a/Popover/common/Divider/index.js +15 -0
  21. package/dist/cjs/a/Popover/common/Item/Item.js +67 -0
  22. package/dist/cjs/a/Popover/common/Item/index.js +15 -0
  23. package/dist/cjs/a/Popover/common/index.js +21 -0
  24. package/dist/cjs/a/Popover/index.js +15 -0
  25. package/dist/cjs/a/Popover/styles.scss +43 -0
  26. package/dist/cjs/a/Shapes/Shapes.js +39 -9
  27. package/dist/cjs/a/Shapes/styles.scss +78 -22
  28. package/dist/cjs/a/SnapScroller/SnapScroller.js +77 -0
  29. package/dist/cjs/a/SnapScroller/index.js +15 -0
  30. package/dist/cjs/a/SnapScroller/styles.scss +38 -0
  31. package/dist/cjs/a/index.js +49 -1
  32. package/dist/cjs/b/Button/Button.js +10 -4
  33. package/dist/cjs/b/Button/styles.scss +55 -10
  34. package/dist/cjs/b/Logo/Logo.js +41 -41
  35. package/dist/cjs/b/Logo/styles.scss +0 -138
  36. package/dist/cjs/b/Page/common/Section/Section.js +56 -5
  37. package/dist/cjs/b/Page/styles.scss +8 -2
  38. package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +16 -9
  39. package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
  40. package/dist/cjs/c/ContentSlides/styles.scss +10 -4
  41. package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +105 -0
  42. package/dist/cjs/c/SocialMediaShareButton/index.js +15 -0
  43. package/dist/cjs/c/SocialMediaShareButton/styles.scss +39 -0
  44. package/dist/cjs/c/index.js +9 -1
  45. package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
  46. package/dist/cjs/f/common/Label/Label.js +1 -1
  47. package/dist/cjs/f/common/Label/styles.scss +1 -1
  48. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
  49. package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
  50. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +39 -6
  51. package/dist/cjs/f/fields/RatingsInput/styles.scss +29 -20
  52. package/dist/cjs/f/fields/SelectInput/SelectInput.js +36 -10
  53. package/dist/cjs/f/fields/SelectInput/styles.scss +13 -8
  54. package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  55. package/dist/cjs/f/fields/TextInput/TextInput.js +35 -7
  56. package/dist/cjs/f/fields/TextInput/styles.scss +16 -7
  57. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -8
  58. package/dist/cjs/f/fields/TextareaInput/styles.scss +19 -6
  59. package/dist/cjs/f/fields/index.js +0 -24
  60. package/dist/cjs/form-reset.scss +1 -1
  61. package/dist/cjs/index.js +13 -0
  62. package/dist/cjs/utils/hooks/index.js +23 -0
  63. package/dist/cjs/utils/hooks/useDynamicPosition.js +107 -0
  64. package/dist/cjs/utils/hooks/useWindowSize.js +39 -0
  65. package/dist/cjs/utils/index.js +19 -0
  66. package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
  67. package/dist/es/a/BackgroundGradient/index.js +2 -0
  68. package/dist/es/a/BackgroundGradient/styles.scss +16 -0
  69. package/dist/es/a/ContentTree/ContentTree.js +67 -0
  70. package/dist/es/a/ContentTree/common/Tree/Tree.js +98 -0
  71. package/dist/es/a/ContentTree/common/Tree/index.js +2 -0
  72. package/dist/es/a/ContentTree/common/index.js +3 -0
  73. package/dist/es/a/ContentTree/common/useContentTree.js +74 -0
  74. package/dist/es/a/ContentTree/common/useFirstVisibleNode.js +54 -0
  75. package/dist/es/a/ContentTree/index.js +2 -0
  76. package/dist/es/a/ContentTree/styles.scss +33 -0
  77. package/dist/es/a/Conversation/Conversation.js +14 -8
  78. package/dist/es/a/Conversation/common/Message/Message.js +32 -6
  79. package/dist/es/a/Conversation/styles.scss +132 -33
  80. package/dist/es/a/OvalIllustration/OvalIllustration.js +111 -0
  81. package/dist/es/a/OvalIllustration/index.js +2 -0
  82. package/dist/es/a/OvalIllustration/styles.scss +102 -0
  83. package/dist/es/a/Popover/Popover.js +118 -0
  84. package/dist/es/a/Popover/common/Divider/Divider.js +47 -0
  85. package/dist/es/a/Popover/common/Divider/index.js +2 -0
  86. package/dist/es/a/Popover/common/Item/Item.js +47 -0
  87. package/dist/es/a/Popover/common/Item/index.js +2 -0
  88. package/dist/es/a/Popover/common/index.js +2 -0
  89. package/dist/es/a/Popover/index.js +2 -0
  90. package/dist/es/a/Popover/styles.scss +43 -0
  91. package/dist/es/a/Shapes/Shapes.js +39 -9
  92. package/dist/es/a/Shapes/styles.scss +78 -22
  93. package/dist/es/a/SnapScroller/SnapScroller.js +61 -0
  94. package/dist/es/a/SnapScroller/index.js +2 -0
  95. package/dist/es/a/SnapScroller/styles.scss +38 -0
  96. package/dist/es/a/index.js +7 -1
  97. package/dist/es/b/Button/Button.js +8 -2
  98. package/dist/es/b/Button/styles.scss +55 -10
  99. package/dist/es/b/Logo/Logo.js +41 -41
  100. package/dist/es/b/Logo/styles.scss +0 -138
  101. package/dist/es/b/Page/common/Section/Section.js +55 -4
  102. package/dist/es/b/Page/styles.scss +8 -2
  103. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +16 -9
  104. package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
  105. package/dist/es/c/ContentSlides/styles.scss +10 -4
  106. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +89 -0
  107. package/dist/es/c/SocialMediaShareButton/index.js +2 -0
  108. package/dist/es/c/SocialMediaShareButton/styles.scss +39 -0
  109. package/dist/es/c/index.js +2 -1
  110. package/dist/es/f/common/Debugger/Debugger.js +1 -1
  111. package/dist/es/f/common/Label/Label.js +1 -1
  112. package/dist/es/f/common/Label/styles.scss +1 -1
  113. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +1 -1
  114. package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
  115. package/dist/es/f/fields/RatingsInput/RatingsInput.js +38 -6
  116. package/dist/es/f/fields/RatingsInput/styles.scss +29 -20
  117. package/dist/es/f/fields/SelectInput/SelectInput.js +36 -10
  118. package/dist/es/f/fields/SelectInput/styles.scss +13 -8
  119. package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
  120. package/dist/es/f/fields/TextInput/TextInput.js +35 -7
  121. package/dist/es/f/fields/TextInput/styles.scss +16 -7
  122. package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -8
  123. package/dist/es/f/fields/TextareaInput/styles.scss +19 -6
  124. package/dist/es/f/fields/index.js +0 -3
  125. package/dist/es/form-reset.scss +1 -1
  126. package/dist/es/index.js +2 -1
  127. package/dist/es/utils/hooks/index.js +2 -0
  128. package/dist/es/utils/hooks/useDynamicPosition.js +93 -0
  129. package/dist/es/utils/hooks/useWindowSize.js +27 -0
  130. package/dist/es/utils/index.js +1 -0
  131. package/package.json +4 -3
  132. package/src/__snapshots__/Storyshots.test.js.snap +4755 -1734
  133. package/src/local.scss +2 -0
  134. package/src/stories/StyleGuide/Sprites.stories.mdx +25 -0
  135. package/src/stories/StyleGuide/helpers.js +16 -0
  136. package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
  137. package/src/stories/a/ContentTree.stories.jsx +662 -0
  138. package/src/stories/a/Conversation.stories.jsx +78 -1
  139. package/src/stories/a/OvalIllustration.stories.jsx +59 -0
  140. package/src/stories/a/Popover.stories.jsx +106 -0
  141. package/src/stories/a/Shapes.stories.jsx +143 -0
  142. package/src/stories/a/SnapScroller.stories.jsx +98 -0
  143. package/src/stories/b/Button.stories.jsx +27 -4
  144. package/src/stories/b/Logo.stories.jsx +17 -9
  145. package/src/stories/b/Page.stories.jsx +51 -1
  146. package/src/stories/c/ContentSlides.stories.jsx +154 -2
  147. package/src/stories/c/SocialMediaShareButton.stories.jsx +25 -0
  148. package/src/stories/f/RatingsInput.stories.jsx +3 -2
  149. package/src/stories/f/SelectInput.stories.jsx +36 -5
  150. package/src/stories/f/TextInput.stories.jsx +15 -4
  151. package/src/stories/f/TextareaInput.stories.jsx +42 -6
  152. package/src/stories/utils/lorem.js +15 -0
  153. package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
  154. package/src/ui/a/BackgroundGradient/index.js +2 -0
  155. package/src/ui/a/BackgroundGradient/styles.scss +16 -0
  156. package/src/ui/a/ContentTree/ContentTree.jsx +88 -0
  157. package/src/ui/a/ContentTree/common/Tree/Tree.jsx +138 -0
  158. package/src/ui/a/ContentTree/common/Tree/index.js +2 -0
  159. package/src/ui/a/ContentTree/common/index.js +3 -0
  160. package/src/ui/a/ContentTree/common/useContentTree.js +83 -0
  161. package/src/ui/a/ContentTree/common/useFirstVisibleNode.js +59 -0
  162. package/src/ui/a/ContentTree/index.js +2 -0
  163. package/src/ui/a/ContentTree/styles.scss +33 -0
  164. package/src/ui/a/Conversation/Conversation.jsx +15 -7
  165. package/src/ui/a/Conversation/common/Message/Message.jsx +38 -6
  166. package/src/ui/a/Conversation/styles.scss +132 -33
  167. package/src/ui/a/OvalIllustration/OvalIllustration.jsx +134 -0
  168. package/src/ui/a/OvalIllustration/index.js +2 -0
  169. package/src/ui/a/OvalIllustration/styles.scss +102 -0
  170. package/src/ui/a/Popover/Popover.jsx +157 -0
  171. package/src/ui/a/Popover/index.js +2 -0
  172. package/src/ui/a/Popover/styles.scss +43 -0
  173. package/src/ui/a/Shapes/Shapes.jsx +191 -0
  174. package/src/ui/a/Shapes/index.js +2 -0
  175. package/src/ui/a/Shapes/styles.scss +255 -0
  176. package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
  177. package/src/ui/a/SnapScroller/index.js +2 -0
  178. package/src/ui/a/SnapScroller/styles.scss +38 -0
  179. package/src/ui/a/index.js +6 -0
  180. package/src/ui/b/Button/Button.jsx +9 -1
  181. package/src/ui/b/Button/styles.scss +55 -10
  182. package/src/ui/b/Logo/Logo.jsx +41 -41
  183. package/src/ui/b/Logo/styles.scss +0 -138
  184. package/src/ui/b/Page/common/Section/Section.jsx +68 -2
  185. package/src/ui/b/Page/styles.scss +8 -2
  186. package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +12 -5
  187. package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
  188. package/src/ui/c/ContentSlides/styles.scss +10 -4
  189. package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +113 -0
  190. package/src/ui/c/SocialMediaShareButton/index.js +2 -0
  191. package/src/ui/c/SocialMediaShareButton/styles.scss +39 -0
  192. package/src/ui/c/index.js +1 -0
  193. package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
  194. package/src/ui/f/common/Label/Label.jsx +1 -1
  195. package/src/ui/f/common/Label/styles.scss +1 -1
  196. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +1 -1
  197. package/src/ui/f/fields/ChoicesInput/styles.scss +17 -2
  198. package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +54 -19
  199. package/src/ui/f/fields/RatingsInput/styles.scss +29 -20
  200. package/src/ui/f/fields/SelectInput/SelectInput.jsx +43 -5
  201. package/src/ui/f/fields/SelectInput/styles.scss +13 -8
  202. package/src/ui/f/fields/TextInput/TextInput.jsx +31 -3
  203. package/src/ui/f/fields/TextInput/styles.scss +16 -7
  204. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +24 -13
  205. package/src/ui/f/fields/TextareaInput/styles.scss +19 -6
  206. package/src/ui/f/fields/index.js +0 -3
  207. package/src/ui/form-reset.scss +1 -1
  208. package/src/ui/index.js +1 -0
  209. package/src/ui/utils/hooks/index.js +2 -0
  210. package/src/ui/utils/hooks/useDynamicPosition.js +104 -0
  211. package/src/ui/utils/hooks/useWindowSize.js +32 -0
  212. package/src/ui/utils/index.js +1 -0
  213. package/stylelint.config.js +13 -13
  214. package/src/stories/f/CheckboxInput.stories.jsx +0 -37
  215. package/src/stories/f/RadioInput.stories.jsx +0 -37
  216. package/src/stories/f/TaskRecommendationInput.stories.jsx +0 -38
  217. package/src/ui/f/fields/CheckboxInput/CheckboxInput.jsx +0 -107
  218. package/src/ui/f/fields/CheckboxInput/index.js +0 -2
  219. package/src/ui/f/fields/CheckboxInput/styles.scss +0 -28
  220. package/src/ui/f/fields/RadioInput/RadioInput.jsx +0 -112
  221. package/src/ui/f/fields/RadioInput/index.js +0 -2
  222. package/src/ui/f/fields/RadioInput/styles.scss +0 -26
  223. package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +0 -130
  224. package/src/ui/f/fields/TaskRecommendationInput/index.js +0 -2
  225. package/src/ui/f/fields/TaskRecommendationInput/styles.scss +0 -41
@@ -0,0 +1,89 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import { useLayoutEffect } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
6
+
7
+ const baseClassName = styleNames.base;
8
+ const componentClassName = 'social-media-share-button';
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const SocialMediaShareButton = ({
14
+ id,
15
+ className: userClassName,
16
+ style,
17
+ icon,
18
+ // children,
19
+ type,
20
+ color
21
+ }) => {
22
+ useLayoutEffect(() => {
23
+ import("./styles.scss");
24
+ }, []);
25
+ const isServer = typeof window === 'undefined';
26
+ const title = isServer ? '' : document.title;
27
+ const link = isServer ? '' : window.location.href;
28
+ const defaultsMap = {
29
+ facebook: {
30
+ icon: 'f',
31
+ link: `https://www.facebook.com/sharer/sharer.php?u=${link}&quote=${title}`
32
+ },
33
+ twitter: {
34
+ icon: 't',
35
+ link: `https://twitter.com/intent/tweet?text=${title}&url=${link}`
36
+ }
37
+ };
38
+ return /*#__PURE__*/React.createElement("a", {
39
+ href: defaultsMap[type].link,
40
+ target: "_blank",
41
+ rel: "noreferrer",
42
+ id: id,
43
+ className: [baseClassName, componentClassName, `x-${color || type}`, userClassName].filter(e => e).join(' '),
44
+ style: style
45
+ }, /*#__PURE__*/React.createElement("button", {
46
+ type: "button"
47
+ }, icon || defaultsMap[type].icon));
48
+ };
49
+
50
+ SocialMediaShareButton.propTypes = {
51
+ /**
52
+ * The HTML id for this element
53
+ */
54
+ id: PropTypes.string,
55
+
56
+ /**
57
+ * The HTML class names for this element
58
+ */
59
+ className: PropTypes.string,
60
+
61
+ /**
62
+ * The React-written, css properties for this element.
63
+ */
64
+ style: PropTypes.objectOf(PropTypes.string),
65
+
66
+ /**
67
+ * The children JSX
68
+ */
69
+ // children:PropTypes.node,
70
+
71
+ /**
72
+ * The Social Media to Target.
73
+ * If blank, you need to provide both an icon letter (from glyphter) and a link.
74
+ */
75
+ type: PropTypes.oneOf(['twitter', 'facebook']),
76
+
77
+ /**
78
+ * The icon of the social media
79
+ */
80
+ icon: PropTypes.string,
81
+
82
+ /**
83
+ * The button color
84
+ */
85
+ color: PropTypes.string
86
+ };
87
+ SocialMediaShareButton.defaultProps = {// someProp:false
88
+ };
89
+ export default SocialMediaShareButton;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as SocialMediaShareButton } from "./SocialMediaShareButton";
@@ -0,0 +1,39 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+ @use "@aztlan/stylebook/src/mixins";
5
+ @use "@aztlan/stylebook/src/globals" as *;
6
+
7
+ $default-dimensions: 2em;
8
+ $mobile-dimensions: 2.75em;
9
+
10
+ .#{bem.$base}.social-media-share-button{
11
+
12
+ > button {
13
+ appearance: none;
14
+ background: transparent;
15
+ border: 0;
16
+ border-radius: 3em;
17
+ color: var(--x);
18
+ cursor: pointer;
19
+ font-family: "icons", sans-serif;
20
+ height: $default-dimensions;
21
+ transition: all .3s;
22
+ width: $default-dimensions;
23
+
24
+ @include mixins.media($to:$sm-md) {
25
+ height: $mobile-dimensions;
26
+ width: $mobile-dimensions;
27
+ }
28
+
29
+ &:hover {
30
+ background: var(--x);
31
+ color: var(--on-x);
32
+ }
33
+
34
+ &:focus, &:active {
35
+ background: var(--light-x);
36
+ color: var(--on-x);
37
+ }
38
+ }
39
+ }
@@ -1,3 +1,4 @@
1
1
  export { Hero } from "./Hero";
2
2
  export { ContentSlides, useContentSlides } from "./ContentSlides";
3
- export { Shortener } from "./Shortener";
3
+ export { Shortener } from "./Shortener";
4
+ export { SocialMediaShareButton } from "./SocialMediaShareButton";
@@ -31,7 +31,7 @@ const Debugger = ({
31
31
  style: style
32
32
  }, /*#__PURE__*/React.createElement(Button, {
33
33
  onClick: toggleDebugger,
34
- color: "main1"
34
+ color: "main2"
35
35
  }, isOpen ? 'Close FormDebugger' : 'Open FormDebugger'), isOpen && /*#__PURE__*/React.createElement("pre", {
36
36
  className: "debuger-content"
37
37
  }, JSON.stringify(formikContext, null, 2)));
@@ -71,6 +71,6 @@ Label.propTypes = {
71
71
  Label.defaultProps = {
72
72
  // someProp:false
73
73
  as: 'label',
74
- color: 'main1'
74
+ color: 'main2'
75
75
  };
76
76
  export default Label;
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
  .#{bem.$base}.label {
8
- color: var(--x);
8
+ color: var(--dark-x);
9
9
  }
10
10
 
11
11
 
@@ -129,7 +129,7 @@ ChoicesInput.defaultProps = {
129
129
  gridColumnsMobile: 2,
130
130
  gridColumnsDesktop: 3,
131
131
  color: 'background2',
132
- colorChecked: 'main1',
132
+ colorChecked: 'main2',
133
133
  disabled: false
134
134
  };
135
135
  export default /*#__PURE__*/memo(ChoicesInput);
@@ -29,10 +29,21 @@ $default-transition:all .3s;
29
29
  z-index: -1;
30
30
  }
31
31
 
32
+ input:disabled + label {
33
+ background-color: var(--dark-x);
34
+ }
35
+
36
+ input:not(:disabled) + label {
37
+ &:hover {
38
+ border-color: var(--light-y);
39
+ }
40
+ }
41
+
32
42
  label {
33
- background: var(--x);
34
- border-radius: var(--theme-border-radius);
43
+ border: var(--theme-border-style) var(--dark-x);
44
+ background: var(--light-x);
35
45
  color: var(--on-x);
46
+ border-radius: var(--theme-border-radius);
36
47
  display: block;
37
48
  height: 100%;
38
49
  padding: $default-padding;
@@ -44,6 +55,10 @@ $default-transition:all .3s;
44
55
  input:checked + label {
45
56
  background: var(--y);
46
57
  color: var(--on-y);
58
+
59
+ &:hover {
60
+ border-color: var(--y);
61
+ }
47
62
  }
48
63
  }
49
64
  }
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import styleNames from '@pareto-engineering/bem'; // Local Definitions
6
6
 
7
7
  import { Rating } from "./common";
8
+ import { FormLabel } from "../../common";
8
9
  const baseClassName = styleNames.base;
9
10
  const componentClassName = 'ratings-input';
10
11
  /**
@@ -18,9 +19,13 @@ const RatingsInput = ({
18
19
  name,
19
20
  ratingCount,
20
21
  showRatingValue,
22
+ oneInputLabel,
23
+ label,
24
+ labelColor,
21
25
  labelMax,
22
26
  labelMin,
23
- displayRatingsLabel // ...otherProps
27
+ displayRatingsLabel,
28
+ optional // ...otherProps
24
29
 
25
30
  }) => {
26
31
  useLayoutEffect(() => {
@@ -30,8 +35,14 @@ const RatingsInput = ({
30
35
  return /*#__PURE__*/React.createElement("div", {
31
36
  id: id,
32
37
  className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
33
- style: style // {...otherProps}
34
-
38
+ style: style
39
+ }, /*#__PURE__*/React.createElement(FormLabel, {
40
+ className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
41
+ name: name,
42
+ color: labelColor,
43
+ optional: optional
44
+ }, label), /*#__PURE__*/React.createElement("div", {
45
+ className: "stars"
35
46
  }, displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
36
47
  className: "label-text md-s-1 s-2 x-metadata c-x"
37
48
  }, labelMin), [...Array(ratingCount)].map((_, index) => {
@@ -47,7 +58,7 @@ const RatingsInput = ({
47
58
  });
48
59
  }), displayRatingsLabel && /*#__PURE__*/React.createElement("p", {
49
60
  className: "label-text md-s-1 s-2 x-metadata c-x"
50
- }, labelMax));
61
+ }, labelMax)));
51
62
  };
52
63
 
53
64
  RatingsInput.propTypes = {
@@ -81,6 +92,11 @@ RatingsInput.propTypes = {
81
92
  */
82
93
  showRatingValue: PropTypes.bool,
83
94
 
95
+ /**
96
+ * The label of the ratings input
97
+ */
98
+ label: PropTypes.string.isRequired,
99
+
84
100
  /**
85
101
  * description for the highest rating value
86
102
  */
@@ -94,10 +110,26 @@ RatingsInput.propTypes = {
94
110
  /**
95
111
  * If the rating lables should be shown
96
112
  */
97
- displayRatingsLabel: PropTypes.bool
113
+ displayRatingsLabel: PropTypes.bool,
114
+
115
+ /**
116
+ * Whether the input is optional or not
117
+ */
118
+ optional: PropTypes.bool,
119
+
120
+ /**
121
+ * If the slide will only have one input
122
+ */
123
+ oneInputLabel: PropTypes.bool,
124
+
125
+ /**
126
+ * String that will represent color for the label
127
+ */
128
+ labelColor: PropTypes.string
98
129
  };
99
130
  RatingsInput.defaultProps = {
100
131
  labelMin: 'not satisfied.',
101
- labelMax: 'very satisfied.'
132
+ labelMax: 'very satisfied.',
133
+ labelColor: 'main2'
102
134
  };
103
135
  export default /*#__PURE__*/memo(RatingsInput);
@@ -7,34 +7,43 @@ $default-transition: all .2s;
7
7
 
8
8
  .#{bem.$base}.ratings-input {
9
9
  display: flex;
10
+ flex-direction: column;
10
11
 
11
- >:not(:last-child) {
12
- margin-right: $default-rating-icon-margin;
12
+ p {
13
+ padding: $default-padding;
13
14
  }
14
15
 
15
- .#{bem.$base}.rating {
16
+ .stars {
16
17
  display: flex;
17
18
 
18
- input {
19
- opacity: 0;
20
- position: absolute;
21
- visibility: none;
22
- z-index: -1;
19
+ >:not(:last-child) {
20
+ margin-right: $default-rating-icon-margin;
23
21
  }
24
-
25
- label {
22
+
23
+ .#{bem.$base}.rating {
26
24
  display: flex;
27
- flex-direction: column;
28
- align-items: center;
29
- padding: $default-padding;
30
- transition: $default-transition;
31
- cursor: pointer;
25
+
26
+ input {
27
+ opacity: 0;
28
+ position: absolute;
29
+ visibility: none;
30
+ z-index: -1;
31
+ }
32
+
33
+ label {
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ padding: $default-padding;
38
+ transition: $default-transition;
39
+ cursor: pointer;
40
+ }
41
+ }
42
+
43
+ .label-text {
44
+ margin-bottom: 0;
45
+ align-self: flex-end;
32
46
  }
33
- }
34
-
35
- .label-text {
36
- margin-bottom: 0;
37
- align-self: flex-end;
38
47
  }
39
48
  }
40
49
 
@@ -20,25 +20,32 @@ const SelectInput = ({
20
20
  style,
21
21
  name,
22
22
  label,
23
+ color,
23
24
  options,
25
+ validate,
26
+ description,
24
27
  disabled // ...otherProps
25
28
 
26
29
  }) => {
27
30
  useLayoutEffect(() => {
28
31
  import("./styles.scss");
29
32
  }, []);
30
- const [field, meta] = useField(name);
33
+ const [field, meta] = useField({
34
+ name,
35
+ validate
36
+ });
31
37
  return /*#__PURE__*/React.createElement("div", {
32
38
  id: id,
33
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
39
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
34
40
  style: style // {...otherProps}
35
41
 
36
42
  }, /*#__PURE__*/React.createElement(FormLabel, {
37
43
  className: "input-label",
38
44
  name: name
39
45
  }, label), /*#__PURE__*/React.createElement("select", _extends({
40
- className: "input v25 pv-v"
46
+ className: "input"
41
47
  }, field, {
48
+ value: field.value || '',
42
49
  id: name,
43
50
  disabled: disabled
44
51
  }), options.map(option => {
@@ -49,11 +56,13 @@ const SelectInput = ({
49
56
  } : option;
50
57
  return /*#__PURE__*/React.createElement("option", {
51
58
  key: newOption.value,
52
- value: newOption.value
59
+ value: newOption.value,
60
+ disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false
53
61
  }, newOption.label);
54
- })), meta.error && meta.touched && /*#__PURE__*/React.createElement(FormDescription, {
55
- error: true
56
- }, meta.error));
62
+ })), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
63
+ isError: !!meta.error,
64
+ className: "v50 mt-v s-1"
65
+ }, meta.error || description));
57
66
  };
58
67
 
59
68
  SelectInput.propTypes = {
@@ -82,20 +91,37 @@ SelectInput.propTypes = {
82
91
  */
83
92
  label: PropTypes.string,
84
93
 
94
+ /**
95
+ * The input field validator function
96
+ */
97
+ validate: PropTypes.func,
98
+
99
+ /**
100
+ * The select input description
101
+ */
102
+ description: PropTypes.string,
103
+
85
104
  /**
86
105
  * The options of the select input
87
106
  */
88
107
  options: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
89
108
  value: PropTypes.string,
90
- label: PropTypes.string
109
+ label: PropTypes.string,
110
+ disabled: PropTypes.bool
91
111
  })])),
92
112
 
93
113
  /**
94
114
  * Whether the select input should be disabled
95
115
  */
96
- disabled: PropTypes.bool
116
+ disabled: PropTypes.bool,
117
+
118
+ /**
119
+ * The color of the select input
120
+ */
121
+ color: PropTypes.string
97
122
  };
98
123
  SelectInput.defaultProps = {
99
- disabled: false
124
+ disabled: false,
125
+ color: 'background2'
100
126
  };
101
127
  export default /*#__PURE__*/memo(SelectInput);
@@ -5,7 +5,7 @@
5
5
  @use "../../../form.scss";
6
6
 
7
7
 
8
- $default-padding: 0.75em 0.75em 0.55em;
8
+ $default-padding: 0.75em;
9
9
 
10
10
 
11
11
  .#{bem.$base}.select-input {
@@ -13,17 +13,22 @@ $default-padding: 0.75em 0.75em 0.55em;
13
13
  flex-direction: column;
14
14
 
15
15
 
16
- .input-label {
17
- color: var(--main1);
18
- }
19
-
20
16
  .input {
21
- background: var(--light-background1);
22
- color: var(--on-background1);
17
+ border: var(--theme-border-style) var(--dark-y);
18
+ background: var(--light-y);
19
+ color:var(--on-y);
23
20
  padding: $default-padding;
24
21
 
22
+ &:not(:disabled):hover{
23
+ border: var(--theme-border-style) var(--light-background4);
24
+ }
25
+
26
+ &:disabled {
27
+ background-color: var(--dark-y);
28
+ }
29
+
25
30
  &:focus {
26
- background: var(--dark-background1);
31
+ background: var(--y);
27
32
  }
28
33
  }
29
34
  }
@@ -106,6 +106,6 @@ TaskRecommendationInput.propTypes = {
106
106
  image: PropTypes.string.isRequired
107
107
  };
108
108
  TaskRecommendationInput.defaultProps = {
109
- color: 'main1'
109
+ color: 'main2'
110
110
  };
111
111
  export default /*#__PURE__*/memo(TaskRecommendationInput);
@@ -21,10 +21,14 @@ const TextInput = ({
21
21
  type,
22
22
  name,
23
23
  label,
24
+ color,
25
+ labelColor,
24
26
  validate,
25
27
  oneInputLabel,
26
28
  description,
27
- disabled // ...otherProps
29
+ disabled,
30
+ placeholder,
31
+ optional // ...otherProps
28
32
 
29
33
  }) => {
30
34
  useLayoutEffect(() => {
@@ -36,17 +40,20 @@ const TextInput = ({
36
40
  });
37
41
  return /*#__PURE__*/React.createElement("div", {
38
42
  id: id,
39
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
43
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
40
44
  style: style // {...otherProps}
41
45
 
42
46
  }, /*#__PURE__*/React.createElement(FormLabel, {
43
- className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
44
- name: name
47
+ className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
48
+ name: name,
49
+ color: labelColor,
50
+ optional: optional
45
51
  }, label), /*#__PURE__*/React.createElement("input", _extends({
46
52
  id: name,
47
- className: `input ${meta.touched && meta.error ? 'input-border-error' : 'input-border'}`,
53
+ className: "input",
48
54
  type: type,
49
- disabled: disabled
55
+ disabled: disabled,
56
+ placeholder: placeholder
50
57
  }, field)), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
51
58
  isError: !!meta.error,
52
59
  className: "v50 mt-v s-1"
@@ -79,6 +86,11 @@ TextInput.propTypes = {
79
86
  */
80
87
  label: PropTypes.string.isRequired,
81
88
 
89
+ /**
90
+ * The input label color
91
+ */
92
+ labelColor: PropTypes.string,
93
+
82
94
  /**
83
95
  * The type of the input (html)
84
96
  */
@@ -102,10 +114,26 @@ TextInput.propTypes = {
102
114
  /**
103
115
  * Whether the text input should be disabled
104
116
  */
105
- disabled: PropTypes.bool
117
+ disabled: PropTypes.bool,
118
+
119
+ /**
120
+ * The placeholder text for the input
121
+ */
122
+ placeholder: PropTypes.string,
123
+
124
+ /**
125
+ * The text input color
126
+ */
127
+ color: PropTypes.string,
128
+
129
+ /**
130
+ * Whether the input is optional or not
131
+ */
132
+ optional: PropTypes.bool
106
133
  };
107
134
  TextInput.defaultProps = {
108
135
  type: 'text',
136
+ color: 'background2',
109
137
  disabled: false
110
138
  };
111
139
  export default /*#__PURE__*/memo(TextInput);
@@ -9,17 +9,26 @@ $default-padding: 0.75em 0.75em 0.55em;
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
 
12
- .input-label {
13
- color: var(--main1);
14
- }
15
-
16
12
  .input {
17
- background: var(--light-background1);
18
- color: var(--on-background1);
13
+ border: var(--theme-border-style) var(--dark-y);
14
+ background: var(--light-y);
15
+ color: var(--on-y);
19
16
  padding: $default-padding;
20
17
 
18
+ &::placeholder{
19
+ color: var(--metadata);
20
+ }
21
+
22
+ &:not(:disabled):hover{
23
+ border: var(--theme-border-style) var(--light-background4);
24
+ }
25
+
26
+ &:disabled {
27
+ background-color: var(--dark-y);
28
+ }
29
+
21
30
  &:focus {
22
- background: var(--dark-background1);
31
+ background: var(--light-background4);
23
32
  }
24
33
  }
25
34
  }
@@ -27,7 +27,8 @@ const TextareaInput = ({
27
27
  textAreaColor,
28
28
  labelColor,
29
29
  description,
30
- disabled // ...otherProps
30
+ disabled,
31
+ placeholder // ...otherProps
31
32
 
32
33
  }) => {
33
34
  useLayoutEffect(() => {
@@ -39,16 +40,18 @@ const TextareaInput = ({
39
40
  });
40
41
  return /*#__PURE__*/React.createElement("div", {
41
42
  id: id,
42
- className: [baseClassName, componentClassName, userClassName, `x-${textAreaColor}`, `y-${labelColor}`].filter(e => e).join(' '),
43
+ className: [baseClassName, componentClassName, userClassName, `y-${textAreaColor}`].filter(e => e).join(' '),
43
44
  style: style // {...otherProps}
44
45
 
45
46
  }, /*#__PURE__*/React.createElement(FormLabel, {
46
- className: ['c-y', labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
47
- name: name
47
+ className: [labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
48
+ name: name,
49
+ color: labelColor
48
50
  }, label), /*#__PURE__*/React.createElement("textarea", _extends({
49
51
  id: textAreaId,
50
- className: `textarea v50 pv-v ${meta.touched && meta.error ? 'input-border-error' : 'input-border'}`
52
+ className: "textarea"
51
53
  }, field, {
54
+ placeholder: placeholder,
52
55
  rows: rows,
53
56
  disabled: disabled
54
57
  })), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
@@ -121,12 +124,16 @@ TextareaInput.propTypes = {
121
124
  /**
122
125
  * Whether the text area should be disabled
123
126
  */
124
- disabled: PropTypes.bool
127
+ disabled: PropTypes.bool,
128
+
129
+ /**
130
+ * The textarea placeholder text
131
+ */
132
+ placeholder: PropTypes.string
125
133
  };
126
134
  TextareaInput.defaultProps = {
127
135
  rows: 3,
128
- textAreaColor: 'background1',
129
- labelColor: 'main1',
136
+ textAreaColor: 'background2',
130
137
  disabled: false
131
138
  };
132
139
  export default /*#__PURE__*/memo(TextareaInput);