@synerise/ds-form-field 1.3.9 → 1.3.11
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 +8 -0
- package/dist/FormField.d.ts +2 -2
- package/dist/FormField.js +26 -32
- package/dist/FormField.styles.d.ts +9 -9
- package/dist/FormField.styles.js +30 -20
- package/dist/FormField.types.d.ts +3 -3
- package/dist/FormField.types.js +1 -1
- package/dist/components/ContentAboveElement.d.ts +2 -2
- package/dist/components/ContentAboveElement.js +18 -16
- package/dist/components/ContentBelowElement.d.ts +2 -2
- package/dist/components/ContentBelowElement.js +15 -8
- package/dist/components/FormFieldLabel.d.ts +2 -2
- package/dist/components/FormFieldLabel.js +21 -32
- package/dist/components/index.js +8 -3
- package/dist/index.js +10 -2
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-form-field@1.3.10...@synerise/ds-form-field@1.3.11) (2026-04-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-form-field
|
|
9
|
+
|
|
10
|
+
## [1.3.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-form-field@1.3.9...@synerise/ds-form-field@1.3.10) (2026-03-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-form-field
|
|
13
|
+
|
|
6
14
|
## [1.3.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-form-field@1.3.8...@synerise/ds-form-field@1.3.9) (2026-03-20)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-form-field
|
package/dist/FormField.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormFieldProps } from './FormField.types';
|
|
3
3
|
declare const FormField: ({ label, tooltip, id, rightSide, tooltipConfig, description, errorText, children, ...rest }: FormFieldProps) => React.JSX.Element;
|
|
4
4
|
export default FormField;
|
package/dist/FormField.js
CHANGED
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tooltipConfig: tooltipConfig
|
|
28
|
-
}), /*#__PURE__*/React.createElement(S.FormFieldComponent, null, children), /*#__PURE__*/React.createElement(ContentBelowElement, {
|
|
29
|
-
description: description,
|
|
30
|
-
errorText: errorText
|
|
31
|
-
}));
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { FormFieldWrapper, FormFieldComponent } from "./FormField.styles.js";
|
|
4
|
+
import { ContentAboveElement } from "./components/ContentAboveElement.js";
|
|
5
|
+
import { ContentBelowElement } from "./components/ContentBelowElement.js";
|
|
6
|
+
const FormField = ({
|
|
7
|
+
label,
|
|
8
|
+
tooltip,
|
|
9
|
+
id,
|
|
10
|
+
rightSide,
|
|
11
|
+
tooltipConfig,
|
|
12
|
+
description,
|
|
13
|
+
errorText,
|
|
14
|
+
children,
|
|
15
|
+
...rest
|
|
16
|
+
}) => {
|
|
17
|
+
const uniqueId = useId();
|
|
18
|
+
const hasContent = Boolean(label || rightSide || description || errorText);
|
|
19
|
+
return /* @__PURE__ */ jsxs(FormFieldWrapper, { hasContent, ...rest, children: [
|
|
20
|
+
/* @__PURE__ */ jsx(ContentAboveElement, { label, rightSide, id: id || uniqueId, tooltip, tooltipConfig }),
|
|
21
|
+
/* @__PURE__ */ jsx(FormFieldComponent, { children }),
|
|
22
|
+
/* @__PURE__ */ jsx(ContentBelowElement, { description, errorText })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
FormField as default
|
|
32
27
|
};
|
|
33
|
-
export default FormField;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const FormFieldWrapper: import(
|
|
1
|
+
export declare const FormFieldWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
2
2
|
hasContent?: boolean;
|
|
3
3
|
}, never>;
|
|
4
|
-
export declare const ErrorText: import(
|
|
5
|
-
export declare const Description: import(
|
|
4
|
+
export declare const ErrorText: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const Description: import('styled-components').StyledComponent<"div", any, {
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}, never>;
|
|
8
|
-
export declare const FormFieldLabelWrapper: import(
|
|
9
|
-
export declare const IconWrapper: import(
|
|
10
|
-
export declare const FormFieldComponent: import(
|
|
11
|
-
export declare const ContentAbove: import(
|
|
12
|
-
export declare const ContentBelow: import(
|
|
13
|
-
export declare const RightSide: import(
|
|
8
|
+
export declare const FormFieldLabelWrapper: import('styled-components').StyledComponent<"label", any, {}, never>;
|
|
9
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
10
|
+
export declare const FormFieldComponent: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const ContentAbove: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const ContentBelow: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const RightSide: import('styled-components').StyledComponent<"div", any, {}, never>;
|
package/dist/FormField.styles.js
CHANGED
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { Description as
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Label, macro, Description as Description$1, ErrorText as ErrorText$1 } from "@synerise/ds-typography";
|
|
3
|
+
const FormFieldWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "FormFieldstyles__FormFieldWrapper",
|
|
5
5
|
componentId: "sc-584zv-0"
|
|
6
|
-
})(["", ""],
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
})(["", ""], (props) => props.hasContent && `display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
align-items: stretch;
|
|
10
|
+
justify-content: flex-start;
|
|
11
|
+
`);
|
|
12
|
+
const ErrorText = /* @__PURE__ */ styled(ErrorText$1).withConfig({
|
|
10
13
|
displayName: "FormFieldstyles__ErrorText",
|
|
11
14
|
componentId: "sc-584zv-1"
|
|
12
15
|
})(["margin:0;"]);
|
|
13
|
-
|
|
16
|
+
const Description = /* @__PURE__ */ styled(Description$1).withConfig({
|
|
14
17
|
displayName: "FormFieldstyles__Description",
|
|
15
18
|
componentId: "sc-584zv-2"
|
|
16
19
|
})([""]);
|
|
17
|
-
|
|
20
|
+
const FormFieldLabelWrapper = /* @__PURE__ */ styled(Label).withConfig({
|
|
18
21
|
displayName: "FormFieldstyles__FormFieldLabelWrapper",
|
|
19
22
|
componentId: "sc-584zv-3"
|
|
20
23
|
})(["", ";height:17px;display:flex;align-items:center;cursor:pointer;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;"], macro.heading);
|
|
21
|
-
|
|
24
|
+
const IconWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
22
25
|
displayName: "FormFieldstyles__IconWrapper",
|
|
23
26
|
componentId: "sc-584zv-4"
|
|
24
|
-
})(["display:inline-block;color:", ";margin-top:-1px;"],
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
export var FormFieldComponent = styled.div.withConfig({
|
|
27
|
+
})(["display:inline-block;color:", ";margin-top:-1px;"], (props) => props.theme.palette["grey-400"]);
|
|
28
|
+
const FormFieldComponent = /* @__PURE__ */ styled.div.withConfig({
|
|
28
29
|
displayName: "FormFieldstyles__FormFieldComponent",
|
|
29
30
|
componentId: "sc-584zv-5"
|
|
30
31
|
})([""]);
|
|
31
|
-
|
|
32
|
+
const ContentAbove = /* @__PURE__ */ styled.div.withConfig({
|
|
32
33
|
displayName: "FormFieldstyles__ContentAbove",
|
|
33
34
|
componentId: "sc-584zv-6"
|
|
34
35
|
})(["display:flex;justify-content:space-between;min-height:18px;"]);
|
|
35
|
-
|
|
36
|
+
const ContentBelow = /* @__PURE__ */ styled.div.withConfig({
|
|
36
37
|
displayName: "FormFieldstyles__ContentBelow",
|
|
37
38
|
componentId: "sc-584zv-7"
|
|
38
39
|
})(["display:flex;flex-direction:column;gap:4px;"]);
|
|
39
|
-
|
|
40
|
+
const RightSide = /* @__PURE__ */ styled.div.withConfig({
|
|
40
41
|
displayName: "FormFieldstyles__RightSide",
|
|
41
42
|
componentId: "sc-584zv-8"
|
|
42
|
-
})(["font-weight:500;flex:1 0 auto;text-align:end;color:", ";"],
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
})(["font-weight:500;flex:1 0 auto;text-align:end;color:", ";"], (props) => props.theme.palette["grey-500"]);
|
|
44
|
+
export {
|
|
45
|
+
ContentAbove,
|
|
46
|
+
ContentBelow,
|
|
47
|
+
Description,
|
|
48
|
+
ErrorText,
|
|
49
|
+
FormFieldComponent,
|
|
50
|
+
FormFieldLabelWrapper,
|
|
51
|
+
FormFieldWrapper,
|
|
52
|
+
IconWrapper,
|
|
53
|
+
RightSide
|
|
54
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipProps } from '@synerise/ds-tooltip';
|
|
3
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
4
4
|
export type ContentAboveProps = BaseLabelProps & {
|
|
5
5
|
rightSide?: ReactNode;
|
|
6
6
|
};
|
package/dist/FormField.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ContentAboveProps } from '../FormField.types';
|
|
3
3
|
export declare const ContentAboveElement: ({ label, id, tooltip, tooltipConfig, rightSide, }: ContentAboveProps) => React.JSX.Element;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { FormFieldLabel } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ContentAbove, RightSide } from "../FormField.styles.js";
|
|
3
|
+
import { FormFieldLabel } from "./FormFieldLabel.js";
|
|
4
|
+
const ContentAboveElement = ({
|
|
5
|
+
label,
|
|
6
|
+
id,
|
|
7
|
+
tooltip,
|
|
8
|
+
tooltipConfig,
|
|
9
|
+
rightSide
|
|
10
|
+
}) => {
|
|
11
|
+
return label || rightSide ? /* @__PURE__ */ jsxs(ContentAbove, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(FormFieldLabel, { label, id, tooltip, tooltipConfig }),
|
|
13
|
+
/* @__PURE__ */ jsx(RightSide, { children: rightSide })
|
|
14
|
+
] }) : /* @__PURE__ */ jsx(Fragment, {});
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
ContentAboveElement
|
|
18
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ContentBelowProps } from '../FormField.types';
|
|
3
3
|
export declare const ContentBelowElement: ({ description, errorText, }: ContentBelowProps) => React.JSX.Element | null;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ContentBelow, ErrorText, Description } from "../FormField.styles.js";
|
|
3
|
+
const ContentBelowElement = ({
|
|
4
|
+
description,
|
|
5
|
+
errorText
|
|
6
|
+
}) => {
|
|
6
7
|
if (!errorText && !description) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
}
|
|
10
|
+
const hasErrorMessage = Boolean(errorText);
|
|
11
|
+
return /* @__PURE__ */ jsxs(ContentBelow, { children: [
|
|
12
|
+
hasErrorMessage && /* @__PURE__ */ jsx(ErrorText, { children: errorText }),
|
|
13
|
+
description && /* @__PURE__ */ jsx(Description, { children: description })
|
|
14
|
+
] });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
ContentBelowElement
|
|
18
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormFieldLabelProps } from '../FormField.types';
|
|
3
3
|
export declare const FormFieldLabel: ({ id, label, tooltip, tooltipConfig, children, ...htmlAttributes }: FormFieldLabelProps) => React.JSX.Element;
|
|
@@ -1,32 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, label || children), (tooltip || tooltipConfig) && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
23
|
-
title: tooltip,
|
|
24
|
-
placement: "top",
|
|
25
|
-
trigger: "hover"
|
|
26
|
-
}, tooltipConfig), /*#__PURE__*/React.createElement(S.IconWrapper, {
|
|
27
|
-
"data-testid": "label-tooltip-trigger"
|
|
28
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
-
size: 24,
|
|
30
|
-
component: /*#__PURE__*/React.createElement(InfoFillS, null)
|
|
31
|
-
})))));
|
|
32
|
-
};
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Icon, { InfoFillS } from "@synerise/ds-icon";
|
|
3
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
4
|
+
import { Text } from "@synerise/ds-typography";
|
|
5
|
+
import { FormFieldLabelWrapper, IconWrapper } from "../FormField.styles.js";
|
|
6
|
+
const FormFieldLabel = ({
|
|
7
|
+
id,
|
|
8
|
+
label,
|
|
9
|
+
tooltip,
|
|
10
|
+
tooltipConfig,
|
|
11
|
+
children,
|
|
12
|
+
...htmlAttributes
|
|
13
|
+
}) => /* @__PURE__ */ jsx(Fragment, { children: (label || children) && /* @__PURE__ */ jsxs(FormFieldLabelWrapper, { htmlFor: id, ...htmlAttributes, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Text, { ellipsis: {
|
|
15
|
+
tooltip: label || children
|
|
16
|
+
}, children: label || children }),
|
|
17
|
+
(tooltip || tooltipConfig) && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, placement: "top", trigger: "hover", ...tooltipConfig, children: /* @__PURE__ */ jsx(IconWrapper, { "data-testid": "label-tooltip-trigger", children: /* @__PURE__ */ jsx(Icon, { size: 24, component: /* @__PURE__ */ jsx(InfoFillS, {}) }) }) })
|
|
18
|
+
] }) });
|
|
19
|
+
export {
|
|
20
|
+
FormFieldLabel
|
|
21
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { FormFieldLabel } from "./FormFieldLabel.js";
|
|
2
|
+
import { ContentAboveElement } from "./ContentAboveElement.js";
|
|
3
|
+
import { ContentBelowElement } from "./ContentBelowElement.js";
|
|
4
|
+
export {
|
|
5
|
+
ContentAboveElement,
|
|
6
|
+
ContentBelowElement,
|
|
7
|
+
FormFieldLabel
|
|
8
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { default as default2 } from "./FormField.js";
|
|
2
|
+
import { FormFieldLabel } from "./components/FormFieldLabel.js";
|
|
3
|
+
import { ContentAboveElement } from "./components/ContentAboveElement.js";
|
|
4
|
+
import { ContentBelowElement } from "./components/ContentBelowElement.js";
|
|
5
|
+
export {
|
|
6
|
+
ContentAboveElement,
|
|
7
|
+
ContentBelowElement,
|
|
8
|
+
FormFieldLabel,
|
|
9
|
+
default2 as default
|
|
10
|
+
};
|
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-form-field",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"description": "FormField 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,10 +35,10 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-icon": "^1.15.
|
|
39
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
40
|
-
"@synerise/ds-typography": "^1.1.
|
|
41
|
-
"@synerise/ds-utils": "^1.7.
|
|
38
|
+
"@synerise/ds-icon": "^1.15.2",
|
|
39
|
+
"@synerise/ds-tooltip": "^1.4.11",
|
|
40
|
+
"@synerise/ds-typography": "^1.1.14",
|
|
41
|
+
"@synerise/ds-utils": "^1.7.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@testing-library/user-event": "^14.6.1"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react": ">=16.9.0 <= 18.3.1",
|
|
49
49
|
"styled-components": "^5.3.3"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
|
|
52
52
|
}
|