Skip to content

Commit d1b5ff8

Browse files
authored
Create a new dist version 0.0.10 (#26)
Collecting: - Impl [Form] new Textarea component (#24) - Fix [Models] Issue with input validation (#25)
1 parent 65ec7c2 commit d1b5ff8

File tree

16 files changed

+457
-164
lines changed

16 files changed

+457
-164
lines changed

commit_message

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11

22

3-
Create a new dist version 0.0.9
3+
Create a new dist version 0.0.10
44

55
Collecting:
6-
- Fix [Wizard] remove hasSteps logic (#18)
7-
- add isOpen prop in FormSelect (#19)
8-
- Impl [Models] Add `FormKeyValueTable` component (#20)
9-
- Update form.util.js (#21)
10-
- Fix [FormKeyValue] fix last row (#22)
6+
- Impl [Form] new Textarea component (#24)
7+
- Fix [Models] Issue with input validation (#25)

dist/components/Button/Button.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require("./Button.scss");
2525

2626
var _jsxRuntime = require("react/jsx-runtime");
2727

28-
var _excluded = ["className", "icon", "label", "tooltip", "variant"];
28+
var _excluded = ["className", "density", "icon", "label", "tooltip", "variant"];
2929

3030
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3131

@@ -45,13 +45,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
4545

4646
var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
4747
var className = _ref.className,
48+
density = _ref.density,
4849
icon = _ref.icon,
4950
label = _ref.label,
5051
tooltip = _ref.tooltip,
5152
variant = _ref.variant,
5253
restProps = _objectWithoutProperties(_ref, _excluded);
5354

54-
var buttonClassName = (0, _classnames.default)('btn', "btn-".concat(variant), className);
55+
var buttonClassName = (0, _classnames.default)('btn', "btn-".concat(variant), "btn-".concat(density), className);
5556
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
5657
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
5758
text: tooltip
@@ -68,12 +69,14 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
6869
});
6970
Button.defaultProps = {
7071
className: '',
72+
density: 'normal',
7173
label: 'Button',
7274
tooltip: '',
7375
variant: _constants.TERTIARY_BUTTON
7476
};
7577
Button.propTypes = {
7678
className: _propTypes.default.string,
79+
density: _propTypes.default.oneOf(['dense', 'normal', 'medium', 'chunky']),
7780
icon: _propTypes.default.element,
7881
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
7982
tooltip: _propTypes.default.string,

dist/components/Button/Button.scss

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,31 @@
77
align-items: center;
88
justify-content: center;
99
min-width: 90px;
10-
height: 36px;
10+
height: $fieldNormal;
1111
padding: 0 16px;
1212
color: $white;
1313
font-weight: 500;
1414
font-size: 0.875rem;
1515
font-style: normal;
16-
line-height: 16px;
1716
border: $transparentBorder;
1817
border-radius: $mainBorderRadius;
1918

19+
&-dense {
20+
height: $fieldDense;
21+
}
22+
23+
&-normal {
24+
height: $fieldNormal;
25+
}
26+
27+
&-medium {
28+
height: $fieldMedium;
29+
}
30+
31+
&-chunky {
32+
height: $fieldChunky;
33+
}
34+
2035
svg {
2136
& > * {
2237
fill: currentColor;

dist/components/FormInput/FormInput.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
136136
(0, _useDetectOutsideClick.useDetectOutsideClick)(ref, function () {
137137
return setShowValidationRules(false);
138138
});
139-
var formFieldClassNames = (0, _classnames.default)('form-field', className);
139+
var formFieldClassNames = (0, _classnames.default)('form-field form-field-input', className);
140140
var inputWrapperClassNames = (0, _classnames.default)('form-field__wrapper', "form-field__wrapper-".concat(density), disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
141141
var labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
142142
(0, _react.useEffect)(function () {
@@ -200,6 +200,8 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
200200
};
201201

202202
var handleScroll = function handleScroll(event) {
203+
if (inputRef.current.contains(event.target)) return;
204+
203205
if (!event.target.closest('.options-menu') && !event.target.classList.contains('form-field')) {
204206
setShowValidationRules(false);
205207
}

dist/components/FormInput/formInput.scss

Lines changed: 41 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,90 +3,57 @@
33
@import '../../scss/shadows';
44
@import '../../scss/mixins';
55

6-
.form-field {
7-
@include formField;
6+
.form-field.form-field-input {
7+
width: 100%;
88

9-
&__label {
10-
&-icon {
11-
display: inline-flex;
12-
margin-left: 3px;
9+
.form-field {
10+
@include formField;
1311

14-
& > *,
15-
a {
12+
&__label {
13+
&-icon {
1614
display: inline-flex;
17-
}
18-
19-
a {
20-
transform: translateY(-1px);
21-
}
15+
margin-left: 3px;
2216

23-
svg {
24-
width: 12px;
25-
height: 12px;
26-
27-
path {
28-
fill: $cornflowerBlue;
17+
& > *,
18+
a {
19+
display: inline-flex;
2920
}
30-
}
31-
}
32-
}
33-
34-
input {
35-
border: 0;
36-
color: inherit;
37-
background-color: transparent;
38-
padding: 0;
39-
width: 100%;
40-
41-
&::placeholder {
42-
color: $spunPearl;
43-
}
44-
45-
&::-webkit-input-placeholder {
46-
/* Chrome/Opera/Safari */
47-
color: $spunPearl;
48-
}
4921

50-
&::-moz-placeholder {
51-
/* Firefox 19+ */
52-
color: $spunPearl;
53-
}
54-
55-
&:-ms-input-placeholder {
56-
/* IE 10+ */
57-
color: $spunPearl;
58-
}
22+
a {
23+
transform: translateY(-1px);
24+
}
5925

60-
&:-moz-placeholder {
61-
/* Firefox 18- */
62-
color: $spunPearl;
63-
}
26+
svg {
27+
width: 12px;
28+
height: 12px;
6429

65-
&:disabled {
66-
background: transparent;
67-
cursor: not-allowed;
30+
path {
31+
fill: $cornflowerBlue;
32+
}
33+
}
34+
}
6835
}
69-
}
70-
71-
&__suggestion-list {
72-
position: absolute;
73-
top: 100%;
74-
left: 0;
75-
z-index: 5;
76-
margin: 0;
77-
padding: 7px 0;
78-
background-color: $white;
79-
border-radius: 4px;
80-
box-shadow: $previewBoxShadow;
8136

82-
.suggestion-item {
83-
padding: 7px 15px;
84-
color: $mulledWine;
85-
list-style-type: none;
86-
87-
&:hover {
88-
background-color: $alabaster;
89-
cursor: pointer;
37+
&__suggestion-list {
38+
position: absolute;
39+
top: 100%;
40+
left: 0;
41+
z-index: 5;
42+
margin: 0;
43+
padding: 7px 0;
44+
background-color: $white;
45+
border-radius: 4px;
46+
box-shadow: $previewBoxShadow;
47+
48+
.suggestion-item {
49+
padding: 7px 15px;
50+
color: $mulledWine;
51+
list-style-type: none;
52+
53+
&:hover {
54+
background-color: $alabaster;
55+
cursor: pointer;
56+
}
9057
}
9158
}
9259
}

dist/components/FormSelect/FormSelect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ var FormSelect = function FormSelect(_ref) {
185185
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
186186
"data-testid": "select",
187187
ref: selectRef,
188-
className: "form-field ".concat(className),
188+
className: "form-field form-field-select ".concat(className),
189189
onClick: toggleOpen,
190190
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
191191
className: selectLabelClassName,
@@ -264,7 +264,7 @@ var FormSelect = function FormSelect(_ref) {
264264
isOpen: isConfirmDialogOpen,
265265
message: selectedItemAction.confirm.message
266266
}), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopUpDialog.default, {
267-
className: "form-field__select__options-list",
267+
className: "form-field form-field-select__options-list",
268268
customPosition: {
269269
element: selectRef,
270270
position: 'bottom-right'

0 commit comments

Comments
 (0)