@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.
Files changed (34) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/Elements/DatePicker/DatePicker.d.ts +2 -2
  3. package/dist/Elements/DatePicker/DatePicker.js +64 -95
  4. package/dist/Elements/DatePicker/DatePicker.styles.d.ts +2 -2
  5. package/dist/Elements/DatePicker/DatePicker.styles.js +9 -11
  6. package/dist/Elements/DatePicker/DatePicker.types.d.ts +3 -3
  7. package/dist/Elements/DatePicker/DatePicker.types.js +1 -1
  8. package/dist/Elements/DatePicker/utils.js +9 -5
  9. package/dist/Elements/Field/Field.d.ts +2 -2
  10. package/dist/Elements/Field/Field.js +41 -65
  11. package/dist/Elements/Input/Input.d.ts +2 -2
  12. package/dist/Elements/Input/Input.js +44 -73
  13. package/dist/Elements/Input/Input.types.d.ts +2 -2
  14. package/dist/Elements/Input/Input.types.js +1 -1
  15. package/dist/Elements/Select/Select.d.ts +2 -2
  16. package/dist/Elements/Select/Select.js +40 -77
  17. package/dist/Elements/Select/Select.styles.d.ts +1 -1
  18. package/dist/Elements/Select/Select.styles.js +6 -5
  19. package/dist/Elements/Select/Select.types.d.ts +2 -2
  20. package/dist/Elements/Select/Select.types.js +1 -1
  21. package/dist/Elements/TextArea/TextArea.d.ts +3 -3
  22. package/dist/Elements/TextArea/TextArea.js +91 -109
  23. package/dist/Elements/TextArea/TextArea.types.d.ts +4 -3
  24. package/dist/Elements/TextArea/TextArea.types.js +1 -1
  25. package/dist/SubtleForm.d.ts +5 -5
  26. package/dist/SubtleForm.js +9 -7
  27. package/dist/SubtleForm.styles.d.ts +24 -17
  28. package/dist/SubtleForm.styles.js +53 -50
  29. package/dist/SubtleForm.types.d.ts +3 -3
  30. package/dist/SubtleForm.types.js +1 -1
  31. package/dist/index.js +4 -1
  32. package/dist/modules.d.js +1 -1
  33. package/dist/modules.d.ts +0 -0
  34. package/package.json +11 -11
@@ -1,84 +1,47 @@
1
- var _excluded = ["disabled", "value", "suffix", "suffixTooltip", "label", "children", "labelTooltip", "placeholder", "error", "errorText", "dropdownAlign"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useCallback, useRef, useState } from 'react';
5
- import { useTheme } from '@synerise/ds-core';
6
- import Icon, { AngleDownS } from '@synerise/ds-icon';
7
- import Select from '@synerise/ds-select';
8
- import Tooltip from '@synerise/ds-tooltip';
9
- import * as S from '../../SubtleForm.styles';
10
- import { SelectContainer } from './Select.styles';
11
- var SubtleSelect = function SubtleSelect(_ref) {
12
- var disabled = _ref.disabled,
13
- value = _ref.value,
14
- suffix = _ref.suffix,
15
- suffixTooltip = _ref.suffixTooltip,
16
- label = _ref.label,
17
- children = _ref.children,
18
- labelTooltip = _ref.labelTooltip,
19
- placeholder = _ref.placeholder,
20
- error = _ref.error,
21
- errorText = _ref.errorText,
22
- _ref$dropdownAlign = _ref.dropdownAlign,
23
- dropdownAlign = _ref$dropdownAlign === void 0 ? {} : _ref$dropdownAlign,
24
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
25
- var _useState = useState(false),
26
- active = _useState[0],
27
- setActive = _useState[1];
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
- var handleActivate = useCallback(function () {
31
+ const handleActivate = useCallback(() => {
38
32
  setActive(true);
39
33
  setBlurred(false);
40
34
  }, []);
41
- var theme = useTheme();
42
- return /*#__PURE__*/React.createElement(S.Subtle, {
43
- className: "ds-subtle-form",
44
- disabled: disabled
45
- }, /*#__PURE__*/React.createElement(S.SubtleFormField, {
46
- active: active,
47
- label: label,
48
- tooltip: labelTooltip
49
- }, /*#__PURE__*/React.createElement(SelectContainer, {
50
- ref: containerRef,
51
- className: "ds-subtle-select",
52
- active: active
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,3 +1,3 @@
1
- export declare const SelectContainer: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const SelectContainer: import('styled-components').StyledComponent<"div", any, {
2
2
  active: boolean;
3
3
  }, never>;
@@ -1,7 +1,8 @@
1
- import styled, { css } from 'styled-components';
2
- export var SelectContainer = styled.div.withConfig({
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;}"], function (props) {
6
- return props.active && css(["margin:-2px 0 0 -1px;"]);
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 { type Props as DsSelectProps } from '@synerise/ds-select/dist/Select.types';
2
- import { type SubtleFieldProps } from '../../SubtleForm.types';
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
- export {};
1
+
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { type SubtleTextAreaProps } from './TextArea.types';
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
- var _excluded = ["disabled", "minRows", "maxRows", "value", "onChange", "placeholder", "label", "labelTooltip", "suffixTooltip", "suffix", "error", "errorText", "textAreaProps"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import calculateSize from 'calculate-size';
5
- import React, { useCallback, useEffect, useRef, useState } from 'react';
6
- import { useTheme } from '@synerise/ds-core';
7
- import Icon, { EditS } from '@synerise/ds-icon';
8
- import { TextArea } from '@synerise/ds-input';
9
- import Tooltip from '@synerise/ds-tooltip';
10
- import * as S from '../../SubtleForm.styles';
11
- import { focusPadding } from '../../SubtleForm.styles';
12
- var FONT = 'Graphik LCG Web';
13
- var FONT_SIZE = '13px';
14
- var ROW_HEIGHT_PX = 17;
15
- var HORIZONTAL_PADDING_PX = 20;
16
- var VERTICAL_PADDING_PX = 7;
17
- var SubtleTextArea = function SubtleTextArea(_ref) {
18
- var disabled = _ref.disabled,
19
- _ref$minRows = _ref.minRows,
20
- minRows = _ref$minRows === void 0 ? 1 : _ref$minRows,
21
- maxRows = _ref.maxRows,
22
- value = _ref.value,
23
- onChange = _ref.onChange,
24
- placeholder = _ref.placeholder,
25
- label = _ref.label,
26
- labelTooltip = _ref.labelTooltip,
27
- suffixTooltip = _ref.suffixTooltip,
28
- suffix = _ref.suffix,
29
- error = _ref.error,
30
- errorText = _ref.errorText,
31
- textAreaProps = _ref.textAreaProps,
32
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
33
- var _useState = useState(false),
34
- active = _useState[0],
35
- setActive = _useState[1];
36
- var _useState2 = useState(false),
37
- blurred = _useState2[0],
38
- setBlurred = _useState2[1];
39
- var containerRef = useRef(null);
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
- var _calculateSize = calculateSize(value, {
49
- width: containerRef.current.offsetWidth - 2 * HORIZONTAL_PADDING_PX + "px",
50
- font: FONT,
51
- fontSize: FONT_SIZE
52
- }),
53
- height = _calculateSize.height;
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(function () {
59
- var keyboardBasedLines = Number(value == null ? void 0 : value.split('\n').length);
60
- var refBasedLines = Math.floor((calculateTextHeight() + 2 * VERTICAL_PADDING_PX) / ROW_HEIGHT_PX);
61
- var lines = Math.max(Number(refBasedLines), keyboardBasedLines);
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
- var handleDeactivate = useCallback(function (event) {
68
+ useEffect(() => {
69
+ if (activeProp !== void 0) {
70
+ setActive(activeProp);
71
+ }
72
+ }, [activeProp]);
73
+ const handleDeactivate = useCallback((event) => {
75
74
  if (textAreaProps) {
76
- var onBlur = textAreaProps.onBlur;
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
- var handleActivate = useCallback(function () {
85
+ }, [textAreaProps, activeProp]);
86
+ const handleActivate = useCallback(() => {
83
87
  setActive(true);
84
88
  setBlurred(false);
85
- }, []);
86
- return /*#__PURE__*/React.createElement(S.Subtle, {
87
- className: "ds-subtle-form"
88
- }, /*#__PURE__*/React.createElement(S.SubtleFormField, {
89
- active: active,
90
- label: label,
91
- tooltip: labelTooltip
92
- }, /*#__PURE__*/React.createElement(S.Container, {
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
- }, rest, textAreaProps)) : /*#__PURE__*/React.createElement(S.Inactive, {
116
- rows: visibleRows,
117
- onClick: !disabled ? handleActivate : undefined,
118
- blurred: blurred,
119
- disabled: disabled
120
- }, /*#__PURE__*/React.createElement(S.MainContent, {
121
- breakWord: true
122
- }, /*#__PURE__*/React.createElement(S.ValueArea, {
123
- disabled: disabled,
124
- value: value && !!value.trim() ? value : placeholder,
125
- onBlur: !disabled ? handleDeactivate : undefined,
126
- grey: !value && !!placeholder
127
- })), /*#__PURE__*/React.createElement(S.Suffix, null, /*#__PURE__*/React.createElement(Tooltip, {
128
- title: suffixTooltip
129
- }, suffix != null ? suffix : /*#__PURE__*/React.createElement(Icon, {
130
- component: /*#__PURE__*/React.createElement(EditS, null),
131
- color: theme.palette['grey-600']
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 { type TextAreaProps } from '@synerise/ds-input/dist/Textarea/Textarea.types';
2
- import { type SubtleFieldProps } from '../../SubtleForm.types';
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
- textAreaProps?: TextAreaProps;
11
+ onActivate?: () => void;
12
+ textAreaProps?: RawTextAreaProps;
12
13
  } & SubtleFieldProps;
13
14
  export type TextareaAutosize = {
14
15
  minRows: number;
@@ -1 +1 @@
1
- export {};
1
+
@@ -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("./Elements/TextArea/TextArea.types").SubtleTextAreaProps): import("react").JSX.Element;
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("./Elements/Select/Select.types").SubtleSelectProps): import("react").JSX.Element;
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("./Elements/DatePicker/DatePicker.types").SubtleDatePickerProps): import("react").JSX.Element;
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("./SubtleForm.types").SubtleFieldProps): import("react").JSX.Element;
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("./Elements/Input/Input.types").SubtleInputProps): import("react").JSX.Element;
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
  };
@@ -1,9 +1,9 @@
1
- import SubtleDatePicker from './Elements/DatePicker/DatePicker';
2
- import SubtleField from './Elements/Field/Field';
3
- import SubtleInput from './Elements/Input/Input';
4
- import SubtleSelect from './Elements/Select/Select';
5
- import SubtleTextArea from './Elements/TextArea/TextArea';
6
- var SubtleForm = function SubtleForm() {
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 default SubtleForm;
14
+ export {
15
+ SubtleForm as default
16
+ };
@@ -1,29 +1,36 @@
1
- export declare const blurPadding = "7px 40px 7px 0px";
2
- export declare const focusPadding = "7px 28px 7px 12px";
3
- export declare const blurAnimation: import("styled-components").Keyframes;
4
- export declare const MainContent: import("styled-components").StyledComponent<"div", any, {
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("styled-components").StyledComponent<"div", any, {
11
+ export declare const Suffix: import('styled-components').StyledComponent<"div", any, {
9
12
  select?: boolean;
10
13
  }, never>;
11
- export declare const Inactive: import("styled-components").StyledComponent<"div", any, {
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("styled-components").StyledComponent<"textarea", any, {
18
- grey: boolean;
22
+ export declare const ValueArea: import('styled-components').StyledComponent<"textarea", any, {
23
+ isPlaceholder: boolean;
19
24
  }, never>;
20
- export declare const Container: import("styled-components").StyledComponent<"div", any, {
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("styled-components").StyledComponent<"div", any, {
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("styled-components").StyledComponent<({ label, tooltip, id, rightSide, tooltipConfig, description, errorText, children, ...rest }: import("@synerise/ds-form-field").FormFieldProps) => React.JSX.Element, any, {
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 {};