@pareto-engineering/design-system 4.0.0-alpha.37 → 4.0.0-alpha.39
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/dist/cjs/f/FormInput/FormInput.js +6 -0
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +164 -0
- package/dist/cjs/f/fields/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/LinkInput/styles.scss +89 -0
- package/dist/cjs/f/fields/index.js +8 -1
- package/dist/es/f/FormInput/FormInput.js +7 -1
- package/dist/es/f/fields/LinkInput/LinkInput.js +156 -0
- package/dist/es/f/fields/LinkInput/index.js +2 -0
- package/dist/es/f/fields/LinkInput/styles.scss +89 -0
- package/dist/es/f/fields/index.js +2 -1
- package/package.json +3 -3
- package/src/stories/f/LinkInput.stories.jsx +100 -0
- package/src/ui/f/FormInput/FormInput.jsx +12 -0
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +197 -0
- package/src/ui/f/fields/LinkInput/index.js +2 -0
- package/src/ui/f/fields/LinkInput/styles.scss +89 -0
- package/src/ui/f/fields/index.js +1 -0
- package/tests/__snapshots__/Storyshots.test.js.snap +393 -1
|
@@ -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({
|
|
@@ -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
|
+
}
|
|
@@ -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({
|
|
@@ -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,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
|
+
}
|
|
@@ -6,4 +6,5 @@ export { RatingsInput } from "./RatingsInput";
|
|
|
6
6
|
export { QueryCombobox } from "./QueryCombobox";
|
|
7
7
|
export { QuerySelect } from "./QuerySelect";
|
|
8
8
|
export { Checkbox } from "./Checkbox";
|
|
9
|
-
export { QueryChoices } from "./QueryChoices";
|
|
9
|
+
export { QueryChoices } from "./QueryChoices";
|
|
10
|
+
export { LinkInput } from "./LinkInput";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.39",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@pareto-engineering/assets": "^4.0.0-alpha.34",
|
|
54
54
|
"@pareto-engineering/bem": "^4.0.0-alpha.20",
|
|
55
|
-
"@pareto-engineering/styles": "^4.0.0-alpha.
|
|
55
|
+
"@pareto-engineering/styles": "^4.0.0-alpha.39",
|
|
56
56
|
"@pareto-engineering/utils": "^4.0.0-alpha.33",
|
|
57
57
|
"date-fns": "^2.29.3",
|
|
58
58
|
"downshift": "^6.1.12",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"relay-test-utils": "^15.0.0"
|
|
69
69
|
},
|
|
70
70
|
"browserslist": "> 2%",
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "6697f56d2d6003af7adcc7ee4bf7e22e1ad2db61"
|
|
72
72
|
}
|