@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 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
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import type { FormFieldProps } from './FormField.types';
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
- var _excluded = ["label", "tooltip", "id", "rightSide", "tooltipConfig", "description", "errorText", "children"];
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, { useId } from 'react';
5
- import * as S from './FormField.styles';
6
- import { ContentAboveElement } from './components/ContentAboveElement';
7
- import { ContentBelowElement } from './components/ContentBelowElement';
8
- var FormField = function FormField(_ref) {
9
- var label = _ref.label,
10
- tooltip = _ref.tooltip,
11
- id = _ref.id,
12
- rightSide = _ref.rightSide,
13
- tooltipConfig = _ref.tooltipConfig,
14
- description = _ref.description,
15
- errorText = _ref.errorText,
16
- children = _ref.children,
17
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
18
- var uniqueId = useId();
19
- var hasContent = Boolean(label || rightSide || description || errorText);
20
- return /*#__PURE__*/React.createElement(S.FormFieldWrapper, _extends({
21
- hasContent: hasContent
22
- }, rest), /*#__PURE__*/React.createElement(ContentAboveElement, {
23
- label: label,
24
- rightSide: rightSide,
25
- id: id || uniqueId,
26
- tooltip: tooltip,
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("styled-components").StyledComponent<"div", any, {
1
+ export declare const FormFieldWrapper: import('styled-components').StyledComponent<"div", any, {
2
2
  hasContent?: boolean;
3
3
  }, never>;
4
- export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const Description: import("styled-components").StyledComponent<"div", any, {
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("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>;
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>;
@@ -1,44 +1,54 @@
1
- import styled from 'styled-components';
2
- import { Description as BaseDescription, ErrorText as BaseErrorText, Label, macro } from '@synerise/ds-typography';
3
- export var FormFieldWrapper = styled.div.withConfig({
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
- })(["", ""], function (props) {
7
- return props.hasContent && "display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: stretch;\n justify-content: flex-start;\n ";
8
- });
9
- export var ErrorText = styled(BaseErrorText).withConfig({
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
- export var Description = styled(BaseDescription).withConfig({
16
+ const Description = /* @__PURE__ */ styled(Description$1).withConfig({
14
17
  displayName: "FormFieldstyles__Description",
15
18
  componentId: "sc-584zv-2"
16
19
  })([""]);
17
- export var FormFieldLabelWrapper = styled(Label).withConfig({
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
- export var IconWrapper = styled.span.withConfig({
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;"], function (props) {
25
- return props.theme.palette['grey-400'];
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
- export var ContentAbove = styled.div.withConfig({
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
- export var ContentBelow = styled.div.withConfig({
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
- export var RightSide = styled.div.withConfig({
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:", ";"], function (props) {
43
- return props.theme.palette['grey-500'];
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 type { ReactNode } from 'react';
2
- import type { TooltipProps } from '@synerise/ds-tooltip';
3
- import type { WithHTMLAttributes } from '@synerise/ds-utils';
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
  };
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import type { ContentAboveProps } from '../FormField.types';
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 React from 'react';
2
- import * as S from '../FormField.styles';
3
- import { FormFieldLabel } from './FormFieldLabel';
4
- export var ContentAboveElement = function ContentAboveElement(_ref) {
5
- var label = _ref.label,
6
- id = _ref.id,
7
- tooltip = _ref.tooltip,
8
- tooltipConfig = _ref.tooltipConfig,
9
- rightSide = _ref.rightSide;
10
- return label || rightSide ? /*#__PURE__*/React.createElement(S.ContentAbove, null, /*#__PURE__*/React.createElement(FormFieldLabel, {
11
- label: label,
12
- id: id,
13
- tooltip: tooltip,
14
- tooltipConfig: tooltipConfig
15
- }), /*#__PURE__*/React.createElement(S.RightSide, null, rightSide)) : /*#__PURE__*/React.createElement(React.Fragment, null);
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 { type ContentBelowProps } from '../FormField.types';
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 React from 'react';
2
- import * as S from '../FormField.styles';
3
- export var ContentBelowElement = function ContentBelowElement(_ref) {
4
- var description = _ref.description,
5
- errorText = _ref.errorText;
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
- var hasErrorMessage = Boolean(errorText);
10
- return /*#__PURE__*/React.createElement(S.ContentBelow, null, hasErrorMessage && /*#__PURE__*/React.createElement(S.ErrorText, null, errorText), description && /*#__PURE__*/React.createElement(S.Description, null, description));
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 { type FormFieldLabelProps } from '../FormField.types';
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
- var _excluded = ["id", "label", "tooltip", "tooltipConfig", "children"];
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 from 'react';
5
- import Icon, { InfoFillS } from '@synerise/ds-icon';
6
- import Tooltip from '@synerise/ds-tooltip';
7
- import { Text } from '@synerise/ds-typography';
8
- import * as S from '../FormField.styles';
9
- export var FormFieldLabel = function FormFieldLabel(_ref) {
10
- var id = _ref.id,
11
- label = _ref.label,
12
- tooltip = _ref.tooltip,
13
- tooltipConfig = _ref.tooltipConfig,
14
- children = _ref.children,
15
- htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
16
- return /*#__PURE__*/React.createElement(React.Fragment, null, (label || children) && /*#__PURE__*/React.createElement(S.FormFieldLabelWrapper, _extends({
17
- htmlFor: id
18
- }, htmlAttributes), /*#__PURE__*/React.createElement(Text, {
19
- ellipsis: {
20
- tooltip: label || children
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
+ };
@@ -1,3 +1,8 @@
1
- export { FormFieldLabel } from './FormFieldLabel';
2
- export { ContentAboveElement } from './ContentAboveElement';
3
- export { ContentBelowElement } from './ContentBelowElement';
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
- export { default } from './FormField';
2
- export * from './components';
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 '@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-form-field",
3
- "version": "1.3.9",
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": "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,10 +35,10 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-icon": "^1.15.0",
39
- "@synerise/ds-tooltip": "^1.4.9",
40
- "@synerise/ds-typography": "^1.1.12",
41
- "@synerise/ds-utils": "^1.7.0"
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": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
51
+ "gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
52
52
  }