@synerise/ds-subtle-form 1.1.58 → 1.1.60
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/CHANGELOG.md +10 -0
- package/dist/Elements/DatePicker/DatePicker.d.ts +2 -2
- package/dist/Elements/DatePicker/DatePicker.js +64 -95
- package/dist/Elements/DatePicker/DatePicker.styles.d.ts +2 -2
- package/dist/Elements/DatePicker/DatePicker.styles.js +9 -11
- package/dist/Elements/DatePicker/DatePicker.types.d.ts +3 -3
- package/dist/Elements/DatePicker/DatePicker.types.js +1 -1
- package/dist/Elements/DatePicker/utils.js +9 -5
- package/dist/Elements/Field/Field.d.ts +2 -2
- package/dist/Elements/Field/Field.js +41 -65
- package/dist/Elements/Input/Input.d.ts +2 -2
- package/dist/Elements/Input/Input.js +44 -73
- package/dist/Elements/Input/Input.types.d.ts +2 -2
- package/dist/Elements/Input/Input.types.js +1 -1
- package/dist/Elements/Select/Select.d.ts +2 -2
- package/dist/Elements/Select/Select.js +40 -77
- package/dist/Elements/Select/Select.styles.d.ts +1 -1
- package/dist/Elements/Select/Select.styles.js +6 -5
- package/dist/Elements/Select/Select.types.d.ts +2 -2
- package/dist/Elements/Select/Select.types.js +1 -1
- package/dist/Elements/TextArea/TextArea.d.ts +3 -3
- package/dist/Elements/TextArea/TextArea.js +91 -109
- package/dist/Elements/TextArea/TextArea.types.d.ts +4 -3
- package/dist/Elements/TextArea/TextArea.types.js +1 -1
- package/dist/SubtleForm.d.ts +5 -5
- package/dist/SubtleForm.js +9 -7
- package/dist/SubtleForm.styles.d.ts +24 -17
- package/dist/SubtleForm.styles.js +53 -50
- package/dist/SubtleForm.types.d.ts +3 -3
- package/dist/SubtleForm.types.js +1 -1
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +11 -11
|
@@ -1,84 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _useState2 = useState(false),
|
|
29
|
-
blurred = _useState2[0],
|
|
30
|
-
setBlurred = _useState2[1];
|
|
31
|
-
var containerRef = useRef(null);
|
|
32
|
-
var hasError = error || !!errorText;
|
|
33
|
-
var handleDeactivate = useCallback(function () {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useCallback } from "react";
|
|
3
|
+
import { useTheme } from "@synerise/ds-core";
|
|
4
|
+
import Icon, { AngleDownS } from "@synerise/ds-icon";
|
|
5
|
+
import Select from "@synerise/ds-select";
|
|
6
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
7
|
+
import { Subtle, SubtleFormField, Inactive, MainContent, Suffix } from "../../SubtleForm.styles.js";
|
|
8
|
+
import { SelectContainer } from "./Select.styles.js";
|
|
9
|
+
const SubtleSelect = ({
|
|
10
|
+
disabled,
|
|
11
|
+
value,
|
|
12
|
+
suffix = true,
|
|
13
|
+
suffixTooltip,
|
|
14
|
+
label,
|
|
15
|
+
children,
|
|
16
|
+
labelTooltip,
|
|
17
|
+
placeholder,
|
|
18
|
+
error,
|
|
19
|
+
errorText,
|
|
20
|
+
dropdownAlign = {},
|
|
21
|
+
...rest
|
|
22
|
+
}) => {
|
|
23
|
+
const [active, setActive] = useState(false);
|
|
24
|
+
const [blurred, setBlurred] = useState(false);
|
|
25
|
+
const containerRef = useRef(null);
|
|
26
|
+
const hasError = error || !!errorText;
|
|
27
|
+
const handleDeactivate = useCallback(() => {
|
|
34
28
|
setActive(false);
|
|
35
29
|
setBlurred(true);
|
|
36
30
|
}, []);
|
|
37
|
-
|
|
31
|
+
const handleActivate = useCallback(() => {
|
|
38
32
|
setActive(true);
|
|
39
33
|
setBlurred(false);
|
|
40
34
|
}, []);
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, active && !blurred || hasError ? /*#__PURE__*/React.createElement(Select, _extends({
|
|
54
|
-
disabled: disabled,
|
|
55
|
-
autoFocus: !hasError,
|
|
56
|
-
size: "middle",
|
|
57
|
-
onBlur: handleDeactivate,
|
|
58
|
-
value: value,
|
|
59
|
-
placeholder: placeholder,
|
|
60
|
-
errorText: errorText,
|
|
61
|
-
error: error,
|
|
62
|
-
defaultOpen: !hasError,
|
|
63
|
-
dropdownAlign: _extends({
|
|
64
|
-
offset: [0, 8]
|
|
65
|
-
}, dropdownAlign)
|
|
66
|
-
}, rest), children) : /*#__PURE__*/React.createElement(S.Inactive, {
|
|
67
|
-
className: "inactive-content",
|
|
68
|
-
onClick: !disabled ? handleActivate : undefined,
|
|
69
|
-
blurred: blurred,
|
|
70
|
-
disabled: disabled
|
|
71
|
-
}, /*#__PURE__*/React.createElement(S.MainContent, {
|
|
72
|
-
className: "main-content",
|
|
73
|
-
hasMargin: true
|
|
74
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, value && !!String(value).trim() ? value : placeholder)), !active && !disabled && /*#__PURE__*/React.createElement(S.Suffix, {
|
|
75
|
-
select: true
|
|
76
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
77
|
-
title: suffixTooltip
|
|
78
|
-
}, suffix != null ? suffix : /*#__PURE__*/React.createElement(Icon, {
|
|
79
|
-
component: /*#__PURE__*/React.createElement(AngleDownS, null),
|
|
80
|
-
color: theme.palette['grey-600']
|
|
81
|
-
})))))));
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
return /* @__PURE__ */ jsx(Subtle, { className: "ds-subtle-form", $disabled: disabled, children: /* @__PURE__ */ jsx(SubtleFormField, { $active: active, label, tooltip: labelTooltip, children: /* @__PURE__ */ jsx(SelectContainer, { ref: containerRef, className: "ds-subtle-select", active, children: active && !blurred || hasError ? /* @__PURE__ */ jsx(Select, { disabled, autoFocus: !hasError, size: "middle", onBlur: handleDeactivate, value, placeholder, errorText, error, defaultOpen: !hasError, dropdownAlign: {
|
|
37
|
+
offset: [0, 8],
|
|
38
|
+
...dropdownAlign
|
|
39
|
+
}, ...rest, children }) : /* @__PURE__ */ jsxs(Inactive, { className: "inactive-content", onClick: !disabled ? handleActivate : void 0, $blurred: blurred, $disabled: disabled, children: [
|
|
40
|
+
/* @__PURE__ */ jsx(MainContent, { className: "main-content", hasMargin: true, children: /* @__PURE__ */ jsx(Fragment, { children: value && !!String(value).trim() ? value : placeholder }) }),
|
|
41
|
+
!active && !disabled && suffix && /* @__PURE__ */ jsx(Suffix, { select: true, children: /* @__PURE__ */ jsx(Tooltip, { title: suffixTooltip, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}), color: theme.palette["grey-600"] }) }) })
|
|
42
|
+
] }) }) }) });
|
|
43
|
+
};
|
|
44
|
+
SubtleSelect.displayName = "SubtleSelect";
|
|
45
|
+
export {
|
|
46
|
+
SubtleSelect as default
|
|
82
47
|
};
|
|
83
|
-
SubtleSelect.displayName = 'SubtleSelect';
|
|
84
|
-
export default SubtleSelect;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
const SelectContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "Selectstyles__SelectContainer",
|
|
4
4
|
componentId: "sc-u85d8m-0"
|
|
5
|
-
})(["position:relative;min-height:32px;width:100%;", " .ant-select-focused{.ds-status{margin:-1px 0 0 0;}}.ds-status{margin:0;}div.ant-select-selector{transition:border 0s linear !important;}"],
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
})(["position:relative;min-height:32px;width:100%;", " .ant-select-focused{.ds-status{margin:-1px 0 0 0;}}.ds-status{margin:0;}div.ant-select-selector{transition:border 0s linear !important;}"], (props) => props.active && css(["margin:-2px 0 0 -1px;"]));
|
|
6
|
+
export {
|
|
7
|
+
SelectContainer
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Props as DsSelectProps } from '@synerise/ds-select/dist/Select.types';
|
|
2
|
+
import { SubtleFieldProps } from '../../SubtleForm.types';
|
|
3
3
|
export type SubtleSelectProps = {
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
} & SubtleFieldProps & DsSelectProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SubtleTextAreaProps } from './TextArea.types';
|
|
3
3
|
declare const SubtleTextArea: {
|
|
4
|
-
({ disabled, minRows, maxRows, value, onChange, placeholder, label, labelTooltip, suffixTooltip, suffix, error, errorText, textAreaProps, ...rest }: SubtleTextAreaProps): React.JSX.Element;
|
|
4
|
+
({ disabled, minRows, maxRows, value, onChange, placeholder, label, labelTooltip, suffixTooltip, suffix, error, errorText, textAreaProps, active: activeProp, onActivate, ...rest }: SubtleTextAreaProps): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default SubtleTextArea;
|
|
@@ -1,64 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _useState3 = useState(minRows),
|
|
41
|
-
visibleRows = _useState3[0],
|
|
42
|
-
setVisibleRows = _useState3[1];
|
|
43
|
-
var theme = useTheme();
|
|
44
|
-
var hasError = error || !!errorText;
|
|
45
|
-
var calculateTextHeight = useCallback(function () {
|
|
46
|
-
var textHeight = 0;
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import calculateSize from "calculate-size";
|
|
3
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
4
|
+
import { useTheme } from "@synerise/ds-core";
|
|
5
|
+
import Icon, { EditS } from "@synerise/ds-icon";
|
|
6
|
+
import { TextArea } from "@synerise/ds-input";
|
|
7
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
8
|
+
import { Subtle, SubtleFormField, Container, getFocusPadding, Inactive, MainContent, ValueArea, Suffix } from "../../SubtleForm.styles.js";
|
|
9
|
+
const FONT = "Graphik LCG Web";
|
|
10
|
+
const FONT_SIZE = "13px";
|
|
11
|
+
const ROW_HEIGHT_PX = 17;
|
|
12
|
+
const HORIZONTAL_PADDING_PX = 20;
|
|
13
|
+
const VERTICAL_PADDING_PX = 7;
|
|
14
|
+
const SubtleTextArea = ({
|
|
15
|
+
disabled,
|
|
16
|
+
minRows = 1,
|
|
17
|
+
maxRows,
|
|
18
|
+
value,
|
|
19
|
+
onChange,
|
|
20
|
+
placeholder,
|
|
21
|
+
label,
|
|
22
|
+
labelTooltip,
|
|
23
|
+
suffixTooltip,
|
|
24
|
+
suffix,
|
|
25
|
+
error,
|
|
26
|
+
errorText,
|
|
27
|
+
textAreaProps,
|
|
28
|
+
active: activeProp,
|
|
29
|
+
onActivate,
|
|
30
|
+
...rest
|
|
31
|
+
}) => {
|
|
32
|
+
const [active, setActive] = useState(activeProp ?? false);
|
|
33
|
+
const [blurred, setBlurred] = useState(false);
|
|
34
|
+
const containerRef = useRef(null);
|
|
35
|
+
const [visibleRows, setVisibleRows] = useState(minRows);
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
const hasError = error || !!errorText;
|
|
38
|
+
const calculateTextHeight = useCallback(() => {
|
|
39
|
+
let textHeight = 0;
|
|
47
40
|
if (!!value && !!containerRef.current) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
const {
|
|
42
|
+
height
|
|
43
|
+
} = calculateSize(value, {
|
|
44
|
+
width: `${containerRef.current.offsetWidth - 2 * HORIZONTAL_PADDING_PX}px`,
|
|
45
|
+
font: FONT,
|
|
46
|
+
fontSize: FONT_SIZE
|
|
47
|
+
});
|
|
54
48
|
textHeight = height;
|
|
55
49
|
}
|
|
56
50
|
return textHeight;
|
|
57
51
|
}, [value, containerRef]);
|
|
58
|
-
useEffect(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const keyboardBasedLines = Number(value?.split("\n").length);
|
|
54
|
+
const refBasedLines = Math.floor((calculateTextHeight() + 2 * VERTICAL_PADDING_PX) / ROW_HEIGHT_PX);
|
|
55
|
+
const lines = Math.max(Number(refBasedLines), keyboardBasedLines);
|
|
62
56
|
if (lines && lines < minRows) {
|
|
63
57
|
setVisibleRows(minRows);
|
|
64
58
|
return;
|
|
@@ -71,65 +65,53 @@ var SubtleTextArea = function SubtleTextArea(_ref) {
|
|
|
71
65
|
setVisibleRows(lines);
|
|
72
66
|
}
|
|
73
67
|
}, [minRows, maxRows, value, calculateTextHeight]);
|
|
74
|
-
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (activeProp !== void 0) {
|
|
70
|
+
setActive(activeProp);
|
|
71
|
+
}
|
|
72
|
+
}, [activeProp]);
|
|
73
|
+
const handleDeactivate = useCallback((event) => {
|
|
75
74
|
if (textAreaProps) {
|
|
76
|
-
|
|
75
|
+
const {
|
|
76
|
+
onBlur
|
|
77
|
+
} = textAreaProps;
|
|
77
78
|
onBlur && onBlur(event);
|
|
78
79
|
}
|
|
80
|
+
if (activeProp === false) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
79
83
|
setActive(false);
|
|
80
84
|
setBlurred(true);
|
|
81
|
-
}, [textAreaProps]);
|
|
82
|
-
|
|
85
|
+
}, [textAreaProps, activeProp]);
|
|
86
|
+
const handleActivate = useCallback(() => {
|
|
83
87
|
setActive(true);
|
|
84
88
|
setBlurred(false);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
ref: containerRef,
|
|
94
|
-
className: "ds-subtle-textarea",
|
|
95
|
-
active: active,
|
|
96
|
-
disabled: disabled
|
|
97
|
-
}, (active || hasError) && !disabled ? /*#__PURE__*/React.createElement(TextArea, _extends({
|
|
98
|
-
autoFocus: !hasError && !disabled,
|
|
99
|
-
onChange: !disabled ? function (event) {
|
|
100
|
-
onChange && onChange(event.currentTarget.value);
|
|
101
|
-
} : undefined,
|
|
102
|
-
onBlur: !disabled ? handleDeactivate : undefined,
|
|
103
|
-
value: value,
|
|
104
|
-
rows: visibleRows + 1,
|
|
105
|
-
style: {
|
|
106
|
-
margin: 0,
|
|
107
|
-
padding: focusPadding
|
|
108
|
-
},
|
|
109
|
-
placeholder: placeholder,
|
|
110
|
-
error: error,
|
|
111
|
-
errorText: errorText,
|
|
112
|
-
wrapperStyle: {
|
|
113
|
-
margin: 0
|
|
89
|
+
onActivate?.();
|
|
90
|
+
}, [onActivate]);
|
|
91
|
+
const handleFocus = useCallback((event) => {
|
|
92
|
+
if (textAreaProps) {
|
|
93
|
+
const {
|
|
94
|
+
onFocus
|
|
95
|
+
} = textAreaProps;
|
|
96
|
+
onFocus && onFocus(event);
|
|
114
97
|
}
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
title: suffixTooltip
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
98
|
+
}, [textAreaProps]);
|
|
99
|
+
return /* @__PURE__ */ jsx(Subtle, { className: "ds-subtle-form", hasError: error, children: /* @__PURE__ */ jsx(SubtleFormField, { $active: active, label, tooltip: labelTooltip, children: /* @__PURE__ */ jsx(Container, { ref: containerRef, className: "ds-subtle-textarea", active, disabled, children: (active || hasError) && !disabled ? /* @__PURE__ */ jsx(TextArea, { autoFocus: !hasError && !disabled, onChange: !disabled ? (event) => {
|
|
100
|
+
onChange && onChange(event.currentTarget.value);
|
|
101
|
+
} : void 0, onBlur: !disabled ? handleDeactivate : void 0, onFocus: !disabled ? handleFocus : void 0, value, rows: visibleRows + 1, style: {
|
|
102
|
+
margin: 0,
|
|
103
|
+
padding: getFocusPadding({
|
|
104
|
+
hasSuffix: suffix,
|
|
105
|
+
state: "focused"
|
|
106
|
+
})
|
|
107
|
+
}, placeholder, error, errorText, wrapperStyle: {
|
|
108
|
+
margin: 0
|
|
109
|
+
}, ...rest, ...textAreaProps }) : /* @__PURE__ */ jsxs(Inactive, { $rows: visibleRows, onClick: !disabled ? handleActivate : void 0, $blurred: blurred, $disabled: disabled, isSuffixVisible: suffix, children: [
|
|
110
|
+
/* @__PURE__ */ jsx(MainContent, { breakWord: true, children: /* @__PURE__ */ jsx(ValueArea, { disabled, value: value && !!value.trim() ? value : placeholder, onBlur: !disabled ? handleDeactivate : void 0, isPlaceholder: !value && !!placeholder }) }),
|
|
111
|
+
suffix && /* @__PURE__ */ jsx(Suffix, { children: /* @__PURE__ */ jsx(Tooltip, { title: suffixTooltip, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(EditS, {}), color: theme.palette["grey-600"] }) }) })
|
|
112
|
+
] }) }) }) });
|
|
113
|
+
};
|
|
114
|
+
SubtleTextArea.displayName = "SubtleTextArea";
|
|
115
|
+
export {
|
|
116
|
+
SubtleTextArea as default
|
|
133
117
|
};
|
|
134
|
-
SubtleTextArea.displayName = 'SubtleTextArea';
|
|
135
|
-
export default SubtleTextArea;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RawTextAreaProps } from '@synerise/ds-input/dist/Textarea/Textarea.types';
|
|
2
|
+
import { SubtleFieldProps } from '../../SubtleForm.types';
|
|
3
3
|
export type SubtleTextAreaProps = {
|
|
4
4
|
minRows?: number;
|
|
5
5
|
maxRows?: number;
|
|
@@ -8,7 +8,8 @@ export type SubtleTextAreaProps = {
|
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
autoSize?: TextareaAutosize;
|
|
10
10
|
error?: boolean;
|
|
11
|
-
|
|
11
|
+
onActivate?: () => void;
|
|
12
|
+
textAreaProps?: RawTextAreaProps;
|
|
12
13
|
} & SubtleFieldProps;
|
|
13
14
|
export type TextareaAutosize = {
|
|
14
15
|
minRows: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/dist/SubtleForm.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
declare const SubtleForm: {
|
|
2
2
|
(): null;
|
|
3
3
|
TextArea: {
|
|
4
|
-
({ disabled, minRows, maxRows, value, onChange, placeholder, label, labelTooltip, suffixTooltip, suffix, error, errorText, textAreaProps, ...rest }: import(
|
|
4
|
+
({ disabled, minRows, maxRows, value, onChange, placeholder, label, labelTooltip, suffixTooltip, suffix, error, errorText, textAreaProps, active: activeProp, onActivate, ...rest }: import('./Elements/TextArea/TextArea.types').SubtleTextAreaProps): import("react").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
Select: {
|
|
8
|
-
({ disabled, value, suffix, suffixTooltip, label, children, labelTooltip, placeholder, error, errorText, dropdownAlign, ...rest }: import(
|
|
8
|
+
({ disabled, value, suffix, suffixTooltip, label, children, labelTooltip, placeholder, error, errorText, dropdownAlign, ...rest }: import('./Elements/Select/Select.types').SubtleSelectProps): import("react").JSX.Element;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
DatePicker: {
|
|
12
|
-
({ value, suffix, suffixTooltip, format: dateFormat, label, children, labelTooltip, placeholder, onApply, onClear, errorText, error, activeProp, onDropdownVisibleChange, disabled, ...rest }: import(
|
|
12
|
+
({ value, suffix, suffixTooltip, format: dateFormat, label, children, labelTooltip, placeholder, onApply, onClear, errorText, error, activeProp, onDropdownVisibleChange, disabled, ...rest }: import('./Elements/DatePicker/DatePicker.types').SubtleDatePickerProps): import("react").JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
Field: {
|
|
16
|
-
({ disabled, suffix, suffixTooltip, label, labelTooltip, activeElement, inactiveElement, mask, maskVisible, errorText, active: activeProp, }: import(
|
|
16
|
+
({ disabled, suffix, suffixTooltip, label, labelTooltip, activeElement, inactiveElement, mask, maskVisible, errorText, active: activeProp, }: import('./SubtleForm.types').SubtleFieldProps): import("react").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
Input: {
|
|
20
|
-
({ disabled, value, onChange, placeholder, label, labelTooltip, suffixTooltip, suffix, error, errorText, inputProps, ...rest }: import(
|
|
20
|
+
({ disabled, value, onChange, placeholder, label, labelTooltip, suffixTooltip, suffix, error, errorText, inputProps, ...rest }: import('./Elements/Input/Input.types').SubtleInputProps): import("react").JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
package/dist/SubtleForm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import SubtleDatePicker from
|
|
2
|
-
import SubtleField from
|
|
3
|
-
import SubtleInput from
|
|
4
|
-
import SubtleSelect from
|
|
5
|
-
import SubtleTextArea from
|
|
6
|
-
|
|
1
|
+
import SubtleDatePicker from "./Elements/DatePicker/DatePicker.js";
|
|
2
|
+
import SubtleField from "./Elements/Field/Field.js";
|
|
3
|
+
import SubtleInput from "./Elements/Input/Input.js";
|
|
4
|
+
import SubtleSelect from "./Elements/Select/Select.js";
|
|
5
|
+
import SubtleTextArea from "./Elements/TextArea/TextArea.js";
|
|
6
|
+
const SubtleForm = () => {
|
|
7
7
|
return null;
|
|
8
8
|
};
|
|
9
9
|
SubtleForm.TextArea = SubtleTextArea;
|
|
@@ -11,4 +11,6 @@ SubtleForm.Select = SubtleSelect;
|
|
|
11
11
|
SubtleForm.DatePicker = SubtleDatePicker;
|
|
12
12
|
SubtleForm.Field = SubtleField;
|
|
13
13
|
SubtleForm.Input = SubtleInput;
|
|
14
|
-
export
|
|
14
|
+
export {
|
|
15
|
+
SubtleForm as default
|
|
16
|
+
};
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type PaddingProps = {
|
|
2
|
+
hasSuffix?: boolean;
|
|
3
|
+
state?: 'hovered' | 'focused';
|
|
4
|
+
};
|
|
5
|
+
export declare const getFocusPadding: ({ hasSuffix, state, }: PaddingProps) => string;
|
|
6
|
+
export declare const getBlurPadding: ({ hasSuffix }: PaddingProps) => "8px 16px 8px 0" | "8px 40px 8px 0";
|
|
7
|
+
export declare const MainContent: import('styled-components').StyledComponent<"div", any, {
|
|
5
8
|
hasMargin?: boolean;
|
|
6
9
|
breakWord?: boolean;
|
|
7
10
|
}, never>;
|
|
8
|
-
export declare const Suffix: import(
|
|
11
|
+
export declare const Suffix: import('styled-components').StyledComponent<"div", any, {
|
|
9
12
|
select?: boolean;
|
|
10
13
|
}, never>;
|
|
11
|
-
export declare const Inactive: import(
|
|
12
|
-
rows?: number;
|
|
13
|
-
blurred: boolean;
|
|
14
|
-
mask?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
14
|
+
export declare const Inactive: import('styled-components').StyledComponent<"div", any, {
|
|
15
|
+
$rows?: number;
|
|
16
|
+
$blurred: boolean;
|
|
17
|
+
$mask?: boolean;
|
|
18
|
+
$disabled?: boolean;
|
|
19
|
+
isSuffixVisible?: boolean;
|
|
20
|
+
isTextareaComponent?: boolean;
|
|
16
21
|
}, never>;
|
|
17
|
-
export declare const ValueArea: import(
|
|
18
|
-
|
|
22
|
+
export declare const ValueArea: import('styled-components').StyledComponent<"textarea", any, {
|
|
23
|
+
isPlaceholder: boolean;
|
|
19
24
|
}, never>;
|
|
20
|
-
export declare const Container: import(
|
|
25
|
+
export declare const Container: import('styled-components').StyledComponent<"div", any, {
|
|
21
26
|
active?: boolean;
|
|
22
27
|
disabled?: boolean;
|
|
23
28
|
}, never>;
|
|
24
|
-
export declare const Subtle: import(
|
|
25
|
-
disabled?: boolean;
|
|
29
|
+
export declare const Subtle: import('styled-components').StyledComponent<"div", any, {
|
|
30
|
+
$disabled?: boolean;
|
|
31
|
+
hasError?: boolean;
|
|
26
32
|
}, never>;
|
|
27
|
-
export declare const SubtleFormField: import(
|
|
28
|
-
active: boolean;
|
|
33
|
+
export declare const SubtleFormField: import('styled-components').StyledComponent<({ label, tooltip, id, rightSide, tooltipConfig, description, errorText, children, ...rest }: import('@synerise/ds-form-field').FormFieldProps) => React.JSX.Element, any, {
|
|
34
|
+
$active: boolean;
|
|
29
35
|
}, never>;
|
|
36
|
+
export {};
|