@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,65 +1,68 @@
|
|
|
1
|
-
import styled, { css, keyframes } from
|
|
2
|
-
import FormField from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import styled, { css, keyframes } from "styled-components";
|
|
2
|
+
import FormField from "@synerise/ds-form-field";
|
|
3
|
+
import { TextareaWrapper } from "@synerise/ds-input/dist/Textarea/Textarea.styles";
|
|
4
|
+
import { hexToRgba } from "@synerise/ds-utils";
|
|
5
|
+
import { MaskedDatePlaceholder } from "./Elements/DatePicker/DatePicker.styles.js";
|
|
6
|
+
const VERTICAL_PADDING = "8px";
|
|
7
|
+
const VERTICAL_PADDING_TEXTAREA = "6px";
|
|
8
|
+
const getFocusPadding = ({
|
|
9
|
+
hasSuffix = true,
|
|
10
|
+
state = "hovered"
|
|
11
|
+
}) => {
|
|
12
|
+
const verticalPadding = state === "focused" ? VERTICAL_PADDING_TEXTAREA : VERTICAL_PADDING;
|
|
13
|
+
return `${verticalPadding} ${hasSuffix ? "28px" : "8px"} ${verticalPadding} ${state === "focused" ? "8px" : "7px"}`;
|
|
6
14
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
const getBlurPadding = ({
|
|
16
|
+
hasSuffix = true
|
|
17
|
+
}) => {
|
|
18
|
+
return hasSuffix ? `8px 16px 8px 0` : `8px 40px 8px 0`;
|
|
19
|
+
};
|
|
20
|
+
const getBlurAnimation = (props) => {
|
|
21
|
+
return keyframes(["0%{padding:", ";}100%{padding:", "}"], getFocusPadding(props), getBlurPadding(props));
|
|
22
|
+
};
|
|
23
|
+
const MainContent = /* @__PURE__ */ styled.div.withConfig({
|
|
11
24
|
displayName: "SubtleFormstyles__MainContent",
|
|
12
25
|
componentId: "sc-1wunvof-0"
|
|
13
|
-
})(["", " width:100%;height:100%;transition:color 0.1s ease-in 0.2s;", ""],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return !!props.hasMargin && "margin-top:1px;\n";
|
|
17
|
-
});
|
|
18
|
-
export var Suffix = styled.div.withConfig({
|
|
26
|
+
})(["", " width:100%;height:100%;transition:color 0.1s ease-in 0.2s;", ""], (props) => props.breakWord ? css(["display:flex;align-items:flex-start;flex:1;word-wrap:break-word;overflow-wrap:break-word;"]) : css(["overflow-wrap:nowrap;display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;"]), (props) => !!props.hasMargin && `margin-top:1px;
|
|
27
|
+
`);
|
|
28
|
+
const Suffix = /* @__PURE__ */ styled.div.withConfig({
|
|
19
29
|
displayName: "SubtleFormstyles__Suffix",
|
|
20
30
|
componentId: "sc-1wunvof-1"
|
|
21
|
-
})(["position:absolute;right:", ";top:6px;display:flex;opacity:0;height:24px;transition:opacity 0.1s ease-in;transition-delay:0.2s;margin-top:-2px;cursor:pointer;"],
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
export var Inactive = styled.div.withConfig({
|
|
31
|
+
})(["position:absolute;right:", ";top:6px;display:flex;opacity:0;height:24px;transition:opacity 0.1s ease-in;transition-delay:0.2s;margin-top:-2px;cursor:pointer;"], (props) => props.select ? `9px` : `6px`);
|
|
32
|
+
const Inactive = /* @__PURE__ */ styled.div.withConfig({
|
|
25
33
|
displayName: "SubtleFormstyles__Inactive",
|
|
26
34
|
componentId: "sc-1wunvof-2"
|
|
27
|
-
})(["position:relative;width:100%;height:32px;display:flex;", " align-items:flex-start;background:
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
}, function (props) {
|
|
36
|
-
return props.blurred && !props.disabled && css(["animation:", " 0.1s ease-in;"], blurAnimation);
|
|
37
|
-
}, function (props) {
|
|
38
|
-
return !props.disabled && css(["&:hover{padding:", ";background:", ";", "{", " ", "{left:12px;", "}}", "{opacity:1;}}"], focusPadding, props.theme.palette['grey-050'], MainContent, props.mask && "color: transparent;", MaskedDatePlaceholder, props.mask && "color: " + props.theme.palette['grey-600'] + ";", Suffix);
|
|
39
|
-
});
|
|
40
|
-
export var ValueArea = styled.textarea.withConfig({
|
|
35
|
+
})(["position:relative;width:100%;height:32px;display:flex;", " align-items:flex-start;background:transparent;padding:", ";opacity:", ";border-radius:3px;transition:padding 0.1s ease-in,background 0.1s ease-in;transition-delay:0.2s;&&{", "}", " ", ""], (props) => !!props.$rows && `height: ${props.$rows * 17 + 17}px;`, (props) => getBlurPadding({
|
|
36
|
+
hasSuffix: props.isSuffixVisible
|
|
37
|
+
}), (props) => props.$disabled ? `0.5` : `1`, (props) => !!props.$disabled && css(["animation:none;textarea{cursor:not-allowed;}"]), (props) => props.$blurred && !props.$disabled && css(["animation:", " 0.1s ease-in;"], getBlurAnimation({
|
|
38
|
+
hasSuffix: props.isSuffixVisible
|
|
39
|
+
})), (props) => !props.$disabled && css(["&:hover{padding:", ";background:", ";", "{", " ", "{left:12px;", "}}", "{opacity:1;}}"], getFocusPadding({
|
|
40
|
+
hasSuffix: props.isSuffixVisible
|
|
41
|
+
}), hexToRgba(props.theme.palette["grey-300"], 0.4), MainContent, props.$mask && `color: transparent;`, MaskedDatePlaceholder, props.$mask && `color: ${props.theme.palette["grey-600"]};`, Suffix));
|
|
42
|
+
const ValueArea = /* @__PURE__ */ styled.textarea.withConfig({
|
|
41
43
|
displayName: "SubtleFormstyles__ValueArea",
|
|
42
44
|
componentId: "sc-1wunvof-3"
|
|
43
|
-
})(["&&{font-variant-numeric:normal;word-wrap:break-word;overflow-wrap:break-word;", "
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
export var Container = styled.div.withConfig({
|
|
45
|
+
})(["&&{font-variant-numeric:normal;word-wrap:break-word;overflow-wrap:break-word;color:transparent;text-shadow:0 1px ", ";width:100%;height:100%;background:transparent;border:none;padding:0;margin:0;overflow:auto;outline:none;box-shadow:none;resize:none;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}}"], (props) => props.isPlaceholder ? props.theme.palette["grey-500"] : props.theme.palette["grey-600"]);
|
|
46
|
+
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
47
47
|
displayName: "SubtleFormstyles__Container",
|
|
48
48
|
componentId: "sc-1wunvof-4"
|
|
49
|
-
})(["&.ds-subtle-input{", "{line-height:18px;}.ant-input::placeholder{line-height:16px;}}position:relative;width:100%;", " > div{margin:0;}.ds-subtle-select{.ant-select-selector:{transition:all 0s linear !important;}}&& .ant-input-number-input::placeholder{padding-bottom:8px;}", ""], Inactive,
|
|
50
|
-
|
|
51
|
-
}, function (props) {
|
|
52
|
-
return !!props.disabled && css(["&&{cursor:not-allowed;}"]);
|
|
53
|
-
});
|
|
54
|
-
export var Subtle = styled.div.withConfig({
|
|
49
|
+
})(["&.ds-subtle-input{", "{line-height:18px;}.ant-input::placeholder{line-height:16px;}}position:relative;width:100%;", " > div{margin:0;}.ds-subtle-select{.ant-select-selector:{transition:all 0s linear !important;}}&& .ant-input-number-input::placeholder{padding-bottom:8px;}", ""], Inactive, (props) => !!props.active && css(["margin:-1px 0 0 -1px;"]), (props) => !!props.disabled && css(["&&{cursor:not-allowed;}"]));
|
|
50
|
+
const Subtle = /* @__PURE__ */ styled.div.withConfig({
|
|
55
51
|
displayName: "SubtleFormstyles__Subtle",
|
|
56
52
|
componentId: "sc-1wunvof-5"
|
|
57
|
-
})(["", ""],
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
export var SubtleFormField = styled(FormField).withConfig({
|
|
53
|
+
})(["", " ", "{", "}"], (props) => !!props.$disabled && css(["&&{cursor:not-allowed;}"]), TextareaWrapper, (props) => props.hasError ? `background-color: ${hexToRgba(props.theme.palette["red-100"], 0.4)};` : `background-color: ${hexToRgba(props.theme.palette["blue-100"], 0.4)};`);
|
|
54
|
+
const SubtleFormField = /* @__PURE__ */ styled(FormField).withConfig({
|
|
61
55
|
displayName: "SubtleFormstyles__SubtleFormField",
|
|
62
56
|
componentId: "sc-1wunvof-6"
|
|
63
|
-
})(["gap:", ";"],
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
})(["gap:", ";"], (props) => props.$active ? `9px` : `8px`);
|
|
58
|
+
export {
|
|
59
|
+
Container,
|
|
60
|
+
Inactive,
|
|
61
|
+
MainContent,
|
|
62
|
+
Subtle,
|
|
63
|
+
SubtleFormField,
|
|
64
|
+
Suffix,
|
|
65
|
+
ValueArea,
|
|
66
|
+
getBlurPadding,
|
|
67
|
+
getFocusPadding
|
|
68
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { FormFieldCommonProps } from '@synerise/ds-form-field';
|
|
3
3
|
export type SubtleFieldProps = {
|
|
4
4
|
active?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
labelTooltip?: FormFieldCommonProps['tooltip'];
|
|
7
|
-
suffix?:
|
|
7
|
+
suffix?: boolean;
|
|
8
8
|
suffixTooltip?: ReactNode;
|
|
9
9
|
activeElement?: () => ReactElement;
|
|
10
10
|
inactiveElement?: () => ReactElement;
|
package/dist/SubtleForm.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/dist/index.js
CHANGED
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-subtle-form",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.60",
|
|
4
4
|
"description": "SubtleForm UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-date-picker": "^1.4.
|
|
39
|
-
"@synerise/ds-form-field": "^1.3.
|
|
40
|
-
"@synerise/ds-icon": "^1.15.
|
|
41
|
-
"@synerise/ds-input": "^1.6.
|
|
42
|
-
"@synerise/ds-select": "^1.3.
|
|
43
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
44
|
-
"@synerise/ds-utils": "^1.7.
|
|
38
|
+
"@synerise/ds-date-picker": "^1.4.3",
|
|
39
|
+
"@synerise/ds-form-field": "^1.3.11",
|
|
40
|
+
"@synerise/ds-icon": "^1.15.2",
|
|
41
|
+
"@synerise/ds-input": "^1.6.11",
|
|
42
|
+
"@synerise/ds-select": "^1.3.21",
|
|
43
|
+
"@synerise/ds-tooltip": "^1.4.11",
|
|
44
|
+
"@synerise/ds-utils": "^1.7.1",
|
|
45
45
|
"calculate-size": "^1.1.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"react": ">=16.9.0 <= 18.3.1",
|
|
51
51
|
"styled-components": "^5.3.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
|
|
54
54
|
}
|