@pareto-engineering/design-system 4.0.0-alpha.36 → 4.0.0-alpha.38

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 (33) hide show
  1. package/dist/cjs/f/FormInput/FormInput.js +6 -0
  2. package/dist/cjs/f/fields/ChoicesInput/styles.scss +2 -2
  3. package/dist/cjs/f/fields/LinkInput/LinkInput.js +164 -0
  4. package/dist/cjs/f/fields/LinkInput/index.js +13 -0
  5. package/dist/cjs/f/fields/LinkInput/styles.scss +89 -0
  6. package/dist/cjs/f/fields/QueryCombobox/styles.scss +2 -2
  7. package/dist/cjs/f/fields/SelectInput/styles.scss +3 -2
  8. package/dist/cjs/f/fields/TextInput/styles.scss +2 -2
  9. package/dist/cjs/f/fields/TextareaInput/styles.scss +2 -2
  10. package/dist/cjs/f/fields/index.js +8 -1
  11. package/dist/es/f/FormInput/FormInput.js +7 -1
  12. package/dist/es/f/fields/ChoicesInput/styles.scss +2 -2
  13. package/dist/es/f/fields/LinkInput/LinkInput.js +156 -0
  14. package/dist/es/f/fields/LinkInput/index.js +2 -0
  15. package/dist/es/f/fields/LinkInput/styles.scss +89 -0
  16. package/dist/es/f/fields/QueryCombobox/styles.scss +2 -2
  17. package/dist/es/f/fields/SelectInput/styles.scss +3 -2
  18. package/dist/es/f/fields/TextInput/styles.scss +2 -2
  19. package/dist/es/f/fields/TextareaInput/styles.scss +2 -2
  20. package/dist/es/f/fields/index.js +2 -1
  21. package/package.json +2 -2
  22. package/src/stories/f/LinkInput.stories.jsx +100 -0
  23. package/src/ui/f/FormInput/FormInput.jsx +12 -0
  24. package/src/ui/f/fields/ChoicesInput/styles.scss +2 -2
  25. package/src/ui/f/fields/LinkInput/LinkInput.jsx +197 -0
  26. package/src/ui/f/fields/LinkInput/index.js +2 -0
  27. package/src/ui/f/fields/LinkInput/styles.scss +89 -0
  28. package/src/ui/f/fields/QueryCombobox/styles.scss +2 -2
  29. package/src/ui/f/fields/SelectInput/styles.scss +3 -2
  30. package/src/ui/f/fields/TextInput/styles.scss +2 -2
  31. package/src/ui/f/fields/TextareaInput/styles.scss +2 -2
  32. package/src/ui/f/fields/index.js +1 -0
  33. package/tests/__snapshots__/Storyshots.test.js.snap +392 -0
@@ -77,6 +77,12 @@ const FormInput = _ref => {
77
77
  disabled: disabled
78
78
  }, otherProps));
79
79
  }
80
+ if (type === 'link') {
81
+ return /*#__PURE__*/React.createElement(_fields.LinkInput, _extends({
82
+ className: newClassName,
83
+ disabled: disabled
84
+ }, otherProps));
85
+ }
80
86
  if (extraTypes?.[type]) {
81
87
  const Component = extraTypes[type];
82
88
  return /*#__PURE__*/React.createElement(Component, _extends({
@@ -14,8 +14,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
14
14
  $default-border: var(--theme-default-input-border);
15
15
  $hover-border: var(--theme-hover-input-border);
16
16
  $focus-border: var(--theme-focus-input-border);
17
- $default-background: var(--theme-default-input-background);
18
- $disabled-background: var(--theme-disabled-input-background);
17
+ $default-background: var(--background-inputs);
18
+ $disabled-background: var(--background-inputs-30);
19
19
 
20
20
  .#{bem.$base}.choices-input {
21
21
  &.#{bem.$base}.input-wrapper {
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
10
+ var _formik = require("formik");
11
+ var _common = require("../../common");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ 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); }
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* @pareto-engineering/generator-front 1.0.12 */
16
+ // Local Definitions
17
+
18
+ const baseClassName = _exports.default.base;
19
+ const componentClassName = 'link-input';
20
+
21
+ /**
22
+ * This is the component description.
23
+ */
24
+ const LinkInput = _ref => {
25
+ let {
26
+ id,
27
+ className: userClassName,
28
+ style,
29
+ name,
30
+ label,
31
+ color,
32
+ labelColor,
33
+ validate,
34
+ description,
35
+ disabled,
36
+ placeholder,
37
+ optional,
38
+ autoComplete,
39
+ labelSpan,
40
+ desktopLabelSpan,
41
+ inputSpan,
42
+ desktopInputSpan
43
+ // ...otherProps
44
+ } = _ref;
45
+ (0, React.useInsertionEffect)(() => {
46
+ Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
47
+ }, []);
48
+ const [field] = (0, _formik.useField)({
49
+ name,
50
+ validate
51
+ });
52
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_common.FormLabel, {
53
+ name: name,
54
+ color: labelColor,
55
+ optional: optional,
56
+ columnSpan: labelSpan,
57
+ desktopColumnSpan: desktopLabelSpan
58
+ // {...otherProps}
59
+ }, label), /*#__PURE__*/React.createElement(_common.InputWrapper, {
60
+ id: id,
61
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
62
+ style: style,
63
+ columnSpan: inputSpan,
64
+ desktopColumnSpan: desktopInputSpan
65
+ }, /*#__PURE__*/React.createElement("div", {
66
+ className: "input-link-wrapper"
67
+ }, /*#__PURE__*/React.createElement("input", _extends({
68
+ id: name,
69
+ className: "input",
70
+ type: "text",
71
+ disabled: disabled,
72
+ placeholder: placeholder,
73
+ autoComplete: autoComplete
74
+ }, field)), /*#__PURE__*/React.createElement("a", {
75
+ href: field.value,
76
+ target: "_blank",
77
+ rel: "noopener noreferrer"
78
+ }, "\u2192")), /*#__PURE__*/React.createElement(_common.FormDescription, {
79
+ className: "s-1",
80
+ description: description,
81
+ name: name
82
+ })));
83
+ };
84
+ LinkInput.propTypes = {
85
+ /**
86
+ * The HTML id for this element
87
+ */
88
+ id: _propTypes.default.string,
89
+ /**
90
+ * The HTML class names for this element
91
+ */
92
+ className: _propTypes.default.string,
93
+ /**
94
+ * The React-written, css properties for this element.
95
+ */
96
+ style: _propTypes.default.objectOf(_propTypes.default.string),
97
+ /**
98
+ * The input name (html - and Formik state)
99
+ */
100
+ name: _propTypes.default.string.isRequired,
101
+ /**
102
+ * The input label
103
+ */
104
+ label: _propTypes.default.string.isRequired,
105
+ /**
106
+ * The input label color
107
+ */
108
+ labelColor: _propTypes.default.string,
109
+ /**
110
+ * The input field validator function
111
+ */
112
+ validate: _propTypes.default.func,
113
+ /**
114
+ * If the slide will only have one input
115
+ */
116
+ oneInputLabel: _propTypes.default.bool,
117
+ /**
118
+ * Input description
119
+ */
120
+ description: _propTypes.default.string,
121
+ /**
122
+ * Whether the text input should be disabled
123
+ */
124
+ disabled: _propTypes.default.bool,
125
+ /**
126
+ * The placeholder text for the input
127
+ */
128
+ placeholder: _propTypes.default.string,
129
+ /**
130
+ * The text input color
131
+ */
132
+ color: _propTypes.default.string,
133
+ /**
134
+ * Whether the input is optional or not
135
+ */
136
+ optional: _propTypes.default.bool,
137
+ /**
138
+ * The autoComplete value that the browser should watch for the input
139
+ * `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
140
+ */
141
+ autoComplete: _propTypes.default.string,
142
+ /**
143
+ * The number of columns the label should span
144
+ */
145
+ labelSpan: _propTypes.default.number,
146
+ /**
147
+ * The number of columns the input should span
148
+ */
149
+ inputSpan: _propTypes.default.number,
150
+ /**
151
+ * The number of columns the label should span on desktop
152
+ */
153
+ desktopLabelSpan: _propTypes.default.number,
154
+ /**
155
+ * The number of columns the input should span on desktop
156
+ */
157
+ desktopInputSpan: _propTypes.default.number
158
+ };
159
+ LinkInput.defaultProps = {
160
+ color: 'paragraph',
161
+ disabled: false
162
+ };
163
+ var _default = /*#__PURE__*/(0, React.memo)(LinkInput);
164
+ exports.default = _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "LinkInput", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _LinkInput.default;
10
+ }
11
+ });
12
+ var _LinkInput = _interopRequireDefault(require("./LinkInput"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,89 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* stylelint-disable max-nesting-depth -- required here */
3
+
4
+ @use "@pareto-engineering/bem";
5
+ @use "@pareto-engineering/styles/src/mixins";
6
+ @use "@pareto-engineering/styles/src/globals" as *;
7
+
8
+ $default-padding: .55em .75em;
9
+ $default-symbol-left: 1em;
10
+ $default-padding-with-symbol:
11
+ .55em
12
+ calc($default-symbol-left - 1em)
13
+ .55em
14
+ calc($default-symbol-left + 1em);
15
+ $default-input-border-radius: var(--theme-default-input-border-radius);
16
+ $default-border: var(--theme-default-input-border);
17
+ $hover-border: var(--theme-hover-input-border);
18
+ $focus-border: var(--theme-focus-input-border);
19
+ $default-background: var(--background-inputs);
20
+ $disabled-background: var(--background-inputs-30);
21
+
22
+ .#{bem.$base}.link-input {
23
+ &.#{bem.$base}.input-wrapper {
24
+ display: flex;
25
+ flex-direction: column;
26
+ position: relative;
27
+
28
+ &.has-symbol {
29
+ &::before {
30
+ color: var(--y);
31
+ content: var(--symbol);
32
+ left: $default-symbol-left;
33
+ position: absolute;
34
+ top: 50%;
35
+ transform: translate(-50%, -50%);
36
+ }
37
+
38
+ input {
39
+ padding: $default-padding-with-symbol;
40
+ }
41
+ }
42
+
43
+ > .input-link-wrapper {
44
+ display: flex;
45
+ gap: calc(var(--gap) / 2);
46
+
47
+ > a {
48
+ align-self: center;
49
+ border: 1px solid var(--interactive);
50
+ border-radius: var(--theme-default-input-border-radius);
51
+ padding: .5em;
52
+
53
+ &:hover {
54
+ background-color: var(--interactive);
55
+ color: var(--on-interactive);
56
+ }
57
+ }
58
+
59
+ > input {
60
+ background-color: $default-background;
61
+ border: $default-border;
62
+ border-radius: $default-input-border-radius;
63
+ color: var(--y);
64
+ outline: none;
65
+ padding: $default-padding;
66
+ width: 100%;
67
+
68
+ &::placeholder {
69
+ color: var(--metadata);
70
+ }
71
+
72
+ &:disabled {
73
+ background-color: $disabled-background;
74
+ }
75
+
76
+ &:not(:disabled) {
77
+ &:hover,
78
+ &:active {
79
+ border: $hover-border;
80
+ }
81
+
82
+ &:focus {
83
+ border: $focus-border;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
@@ -13,8 +13,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
13
13
  $default-border: var(--theme-default-input-border);
14
14
  $hover-border: var(--theme-hover-input-border);
15
15
  $focus-border: var(--theme-focus-input-border);
16
- $default-background: var(--theme-default-input-background);
17
- $disabled-background: var(--theme-disabled-input-background);
16
+ $default-background: var(--background-inputs);
17
+ $disabled-background: var(--background-inputs-30);
18
18
 
19
19
  .#{bem.$base}.combobox,
20
20
  .#{bem.$base}.multiple-combobox {
@@ -12,8 +12,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
12
12
  $default-border: var(--theme-default-input-border);
13
13
  $hover-border: var(--theme-hover-input-border);
14
14
  $focus-border: var(--theme-focus-input-border);
15
- $default-background: var(--theme-default-input-background);
16
- $disabled-background: var(--theme-disabled-input-background);
15
+ $default-background: var(--background-inputs);
16
+ $disabled-background: var(--background-inputs-30);
17
17
 
18
18
  .#{bem.$base}.select-input {
19
19
  &.#{bem.$base}.label {
@@ -62,6 +62,7 @@ $disabled-background: var(--theme-disabled-input-background);
62
62
 
63
63
  select {
64
64
  appearance: none;
65
+ background-color: $default-background;
65
66
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAyMCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDEuNUwxMCAxMC41TDEgMS41IiBzdHJva2U9IiM0QzRENTMiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
66
67
  background-position: calc(100% - $default-spacing-size);
67
68
  background-repeat: no-repeat;
@@ -15,8 +15,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
15
15
  $default-border: var(--theme-default-input-border);
16
16
  $hover-border: var(--theme-hover-input-border);
17
17
  $focus-border: var(--theme-focus-input-border);
18
- $default-background: var(--theme-default-input-background);
19
- $disabled-background: var(--theme-disabled-input-background);
18
+ $default-background: var(--background-inputs);
19
+ $disabled-background: var(--background-inputs-30);
20
20
 
21
21
  .#{bem.$base}.text-input {
22
22
  &.#{bem.$base}.input-wrapper {
@@ -10,8 +10,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
10
10
  $default-border: var(--theme-default-input-border);
11
11
  $hover-border: var(--theme-hover-input-border);
12
12
  $focus-border: var(--theme-focus-input-border);
13
- $default-background: var(--theme-default-input-background);
14
- $disabled-background: var(--theme-disabled-input-background);
13
+ $default-background: var(--background-inputs);
14
+ $disabled-background: var(--background-inputs-30);
15
15
 
16
16
  .#{bem.$base}.text-area-input {
17
17
  &.#{bem.$base}.input-wrapper {
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "ChoicesInput", {
15
15
  return _ChoicesInput.ChoicesInput;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "LinkInput", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _LinkInput.LinkInput;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "QueryChoices", {
19
25
  enumerable: true,
20
26
  get: function () {
@@ -65,4 +71,5 @@ var _RatingsInput = require("./RatingsInput");
65
71
  var _QueryCombobox = require("./QueryCombobox");
66
72
  var _QuerySelect = require("./QuerySelect");
67
73
  var _Checkbox = require("./Checkbox");
68
- var _QueryChoices = require("./QueryChoices");
74
+ var _QueryChoices = require("./QueryChoices");
75
+ var _LinkInput = require("./LinkInput");
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  import * as React from 'react';
4
4
  import { memo, useInsertionEffect } from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { TextInput, TextareaInput, ChoicesInput, SelectInput, QueryCombobox, QuerySelect, RatingsInput, Checkbox, QueryChoices } from "../fields";
6
+ import { TextInput, TextareaInput, ChoicesInput, SelectInput, QueryCombobox, QuerySelect, RatingsInput, Checkbox, QueryChoices, LinkInput } from "../fields";
7
7
 
8
8
  // Local Definitions
9
9
 
@@ -72,6 +72,12 @@ const FormInput = ({
72
72
  disabled: disabled
73
73
  }, otherProps));
74
74
  }
75
+ if (type === 'link') {
76
+ return /*#__PURE__*/React.createElement(LinkInput, _extends({
77
+ className: newClassName,
78
+ disabled: disabled
79
+ }, otherProps));
80
+ }
75
81
  if (extraTypes?.[type]) {
76
82
  const Component = extraTypes[type];
77
83
  return /*#__PURE__*/React.createElement(Component, _extends({
@@ -14,8 +14,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
14
14
  $default-border: var(--theme-default-input-border);
15
15
  $hover-border: var(--theme-hover-input-border);
16
16
  $focus-border: var(--theme-focus-input-border);
17
- $default-background: var(--theme-default-input-background);
18
- $disabled-background: var(--theme-disabled-input-background);
17
+ $default-background: var(--background-inputs);
18
+ $disabled-background: var(--background-inputs-30);
19
19
 
20
20
  .#{bem.$base}.choices-input {
21
21
  &.#{bem.$base}.input-wrapper {
@@ -0,0 +1,156 @@
1
+ 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); }
2
+ /* @pareto-engineering/generator-front 1.0.12 */
3
+ import * as React from 'react';
4
+ import { useInsertionEffect, memo } from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import styleNames from '@pareto-engineering/bem/exports';
7
+ import { useField } from 'formik';
8
+ import { FormLabel, FormDescription, InputWrapper } from "../../common";
9
+
10
+ // Local Definitions
11
+
12
+ const baseClassName = styleNames.base;
13
+ const componentClassName = 'link-input';
14
+
15
+ /**
16
+ * This is the component description.
17
+ */
18
+ const LinkInput = ({
19
+ id,
20
+ className: userClassName,
21
+ style,
22
+ name,
23
+ label,
24
+ color,
25
+ labelColor,
26
+ validate,
27
+ description,
28
+ disabled,
29
+ placeholder,
30
+ optional,
31
+ autoComplete,
32
+ labelSpan,
33
+ desktopLabelSpan,
34
+ inputSpan,
35
+ desktopInputSpan
36
+ // ...otherProps
37
+ }) => {
38
+ useInsertionEffect(() => {
39
+ import("./styles.scss");
40
+ }, []);
41
+ const [field] = useField({
42
+ name,
43
+ validate
44
+ });
45
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
46
+ name: name,
47
+ color: labelColor,
48
+ optional: optional,
49
+ columnSpan: labelSpan,
50
+ desktopColumnSpan: desktopLabelSpan
51
+ // {...otherProps}
52
+ }, label), /*#__PURE__*/React.createElement(InputWrapper, {
53
+ id: id,
54
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
55
+ style: style,
56
+ columnSpan: inputSpan,
57
+ desktopColumnSpan: desktopInputSpan
58
+ }, /*#__PURE__*/React.createElement("div", {
59
+ className: "input-link-wrapper"
60
+ }, /*#__PURE__*/React.createElement("input", _extends({
61
+ id: name,
62
+ className: "input",
63
+ type: "text",
64
+ disabled: disabled,
65
+ placeholder: placeholder,
66
+ autoComplete: autoComplete
67
+ }, field)), /*#__PURE__*/React.createElement("a", {
68
+ href: field.value,
69
+ target: "_blank",
70
+ rel: "noopener noreferrer"
71
+ }, "\u2192")), /*#__PURE__*/React.createElement(FormDescription, {
72
+ className: "s-1",
73
+ description: description,
74
+ name: name
75
+ })));
76
+ };
77
+ LinkInput.propTypes = {
78
+ /**
79
+ * The HTML id for this element
80
+ */
81
+ id: PropTypes.string,
82
+ /**
83
+ * The HTML class names for this element
84
+ */
85
+ className: PropTypes.string,
86
+ /**
87
+ * The React-written, css properties for this element.
88
+ */
89
+ style: PropTypes.objectOf(PropTypes.string),
90
+ /**
91
+ * The input name (html - and Formik state)
92
+ */
93
+ name: PropTypes.string.isRequired,
94
+ /**
95
+ * The input label
96
+ */
97
+ label: PropTypes.string.isRequired,
98
+ /**
99
+ * The input label color
100
+ */
101
+ labelColor: PropTypes.string,
102
+ /**
103
+ * The input field validator function
104
+ */
105
+ validate: PropTypes.func,
106
+ /**
107
+ * If the slide will only have one input
108
+ */
109
+ oneInputLabel: PropTypes.bool,
110
+ /**
111
+ * Input description
112
+ */
113
+ description: PropTypes.string,
114
+ /**
115
+ * Whether the text input should be disabled
116
+ */
117
+ disabled: PropTypes.bool,
118
+ /**
119
+ * The placeholder text for the input
120
+ */
121
+ placeholder: PropTypes.string,
122
+ /**
123
+ * The text input color
124
+ */
125
+ color: PropTypes.string,
126
+ /**
127
+ * Whether the input is optional or not
128
+ */
129
+ optional: PropTypes.bool,
130
+ /**
131
+ * The autoComplete value that the browser should watch for the input
132
+ * `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
133
+ */
134
+ autoComplete: PropTypes.string,
135
+ /**
136
+ * The number of columns the label should span
137
+ */
138
+ labelSpan: PropTypes.number,
139
+ /**
140
+ * The number of columns the input should span
141
+ */
142
+ inputSpan: PropTypes.number,
143
+ /**
144
+ * The number of columns the label should span on desktop
145
+ */
146
+ desktopLabelSpan: PropTypes.number,
147
+ /**
148
+ * The number of columns the input should span on desktop
149
+ */
150
+ desktopInputSpan: PropTypes.number
151
+ };
152
+ LinkInput.defaultProps = {
153
+ color: 'paragraph',
154
+ disabled: false
155
+ };
156
+ export default /*#__PURE__*/memo(LinkInput);
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as LinkInput } from "./LinkInput";
@@ -0,0 +1,89 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* stylelint-disable max-nesting-depth -- required here */
3
+
4
+ @use "@pareto-engineering/bem";
5
+ @use "@pareto-engineering/styles/src/mixins";
6
+ @use "@pareto-engineering/styles/src/globals" as *;
7
+
8
+ $default-padding: .55em .75em;
9
+ $default-symbol-left: 1em;
10
+ $default-padding-with-symbol:
11
+ .55em
12
+ calc($default-symbol-left - 1em)
13
+ .55em
14
+ calc($default-symbol-left + 1em);
15
+ $default-input-border-radius: var(--theme-default-input-border-radius);
16
+ $default-border: var(--theme-default-input-border);
17
+ $hover-border: var(--theme-hover-input-border);
18
+ $focus-border: var(--theme-focus-input-border);
19
+ $default-background: var(--background-inputs);
20
+ $disabled-background: var(--background-inputs-30);
21
+
22
+ .#{bem.$base}.link-input {
23
+ &.#{bem.$base}.input-wrapper {
24
+ display: flex;
25
+ flex-direction: column;
26
+ position: relative;
27
+
28
+ &.has-symbol {
29
+ &::before {
30
+ color: var(--y);
31
+ content: var(--symbol);
32
+ left: $default-symbol-left;
33
+ position: absolute;
34
+ top: 50%;
35
+ transform: translate(-50%, -50%);
36
+ }
37
+
38
+ input {
39
+ padding: $default-padding-with-symbol;
40
+ }
41
+ }
42
+
43
+ > .input-link-wrapper {
44
+ display: flex;
45
+ gap: calc(var(--gap) / 2);
46
+
47
+ > a {
48
+ align-self: center;
49
+ border: 1px solid var(--interactive);
50
+ border-radius: var(--theme-default-input-border-radius);
51
+ padding: .5em;
52
+
53
+ &:hover {
54
+ background-color: var(--interactive);
55
+ color: var(--on-interactive);
56
+ }
57
+ }
58
+
59
+ > input {
60
+ background-color: $default-background;
61
+ border: $default-border;
62
+ border-radius: $default-input-border-radius;
63
+ color: var(--y);
64
+ outline: none;
65
+ padding: $default-padding;
66
+ width: 100%;
67
+
68
+ &::placeholder {
69
+ color: var(--metadata);
70
+ }
71
+
72
+ &:disabled {
73
+ background-color: $disabled-background;
74
+ }
75
+
76
+ &:not(:disabled) {
77
+ &:hover,
78
+ &:active {
79
+ border: $hover-border;
80
+ }
81
+
82
+ &:focus {
83
+ border: $focus-border;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
@@ -13,8 +13,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
13
13
  $default-border: var(--theme-default-input-border);
14
14
  $hover-border: var(--theme-hover-input-border);
15
15
  $focus-border: var(--theme-focus-input-border);
16
- $default-background: var(--theme-default-input-background);
17
- $disabled-background: var(--theme-disabled-input-background);
16
+ $default-background: var(--background-inputs);
17
+ $disabled-background: var(--background-inputs-30);
18
18
 
19
19
  .#{bem.$base}.combobox,
20
20
  .#{bem.$base}.multiple-combobox {
@@ -12,8 +12,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
12
12
  $default-border: var(--theme-default-input-border);
13
13
  $hover-border: var(--theme-hover-input-border);
14
14
  $focus-border: var(--theme-focus-input-border);
15
- $default-background: var(--theme-default-input-background);
16
- $disabled-background: var(--theme-disabled-input-background);
15
+ $default-background: var(--background-inputs);
16
+ $disabled-background: var(--background-inputs-30);
17
17
 
18
18
  .#{bem.$base}.select-input {
19
19
  &.#{bem.$base}.label {
@@ -62,6 +62,7 @@ $disabled-background: var(--theme-disabled-input-background);
62
62
 
63
63
  select {
64
64
  appearance: none;
65
+ background-color: $default-background;
65
66
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAyMCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDEuNUwxMCAxMC41TDEgMS41IiBzdHJva2U9IiM0QzRENTMiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
66
67
  background-position: calc(100% - $default-spacing-size);
67
68
  background-repeat: no-repeat;