@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,65 +1,68 @@
1
- import styled, { css, keyframes } from 'styled-components';
2
- import FormField from '@synerise/ds-form-field';
3
- import { MaskedDatePlaceholder } from './Elements/DatePicker/DatePicker.styles';
4
- var disableBlinkingCursor = function disableBlinkingCursor(props) {
5
- return css(["color:transparent;text-shadow:0 1px ", ";"], props.grey ? props.theme.palette['grey-500'] : props.theme.palette['grey-600']);
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
- export var blurPadding = "7px 40px 7px 0px";
8
- export var focusPadding = "7px 28px 7px 12px";
9
- export var blurAnimation = keyframes(["0%{padding:", ";}100%{padding:", ";}"], focusPadding, blurPadding);
10
- export var MainContent = styled.div.withConfig({
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;", ""], function (props) {
14
- return 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;"]);
15
- }, function (props) {
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;"], function (props) {
22
- return props.select ? "9px" : "6px";
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:", ";padding:", ";opacity:", ";border-radius:3px;transition:padding 0.1s ease-in,background 0.1s ease-in;transition-delay:0.2s;&&{", "}", " ", ""], function (props) {
28
- return !!props.rows && "height: " + (props.rows * 17 + 17) + "px;";
29
- }, function (props) {
30
- return props.theme.palette.white;
31
- }, blurPadding, function (props) {
32
- return props.disabled ? "0.5" : "1";
33
- }, function (props) {
34
- return !!props.disabled && css(["animation:none;textarea{cursor:not-allowed;}"]);
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;", " 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;}}"], function (props) {
44
- return disableBlinkingCursor(props);
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, function (props) {
50
- return !!props.active && css(["margin:-1px 0 0 -1px;"]);
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
- })(["", ""], function (props) {
58
- return !!props.disabled && css(["&&{cursor:not-allowed;}"]);
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:", ";"], function (props) {
64
- return props.active ? "10px" : "8px";
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 type { ReactElement, ReactNode } from 'react';
2
- import { type FormFieldCommonProps } from '@synerise/ds-form-field';
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?: ReactNode;
7
+ suffix?: boolean;
8
8
  suffixTooltip?: ReactNode;
9
9
  activeElement?: () => ReactElement;
10
10
  inactiveElement?: () => ReactElement;
@@ -1 +1 @@
1
- export {};
1
+
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './SubtleForm';
1
+ import { default as default2 } from "./SubtleForm.js";
2
+ export {
3
+ default2 as default
4
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
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.58",
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": "pnpm run build:js && pnpm run build:css && pnpm run defs",
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": "pnpm run build:js -- --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.1",
39
- "@synerise/ds-form-field": "^1.3.9",
40
- "@synerise/ds-icon": "^1.15.0",
41
- "@synerise/ds-input": "^1.6.9",
42
- "@synerise/ds-select": "^1.3.19",
43
- "@synerise/ds-tooltip": "^1.4.9",
44
- "@synerise/ds-utils": "^1.7.0",
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": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
53
+ "gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
54
54
  }