@synerise/ds-radio 1.0.13 → 1.0.14

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,17 @@
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.0.14](https://github.com/synerise/synerise-design/compare/@synerise/ds-radio@1.0.13...@synerise/ds-radio@1.0.14) (2025-07-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **radio:** new prop label ([7a527d8](https://github.com/synerise/synerise-design/commit/7a527d8cff0b4d513deecaf0bb3b19645e478bba))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.0.13](https://github.com/synerise/synerise-design/compare/@synerise/ds-radio@1.0.12...@synerise/ds-radio@1.0.13) (2025-07-01)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-radio
package/README.md CHANGED
@@ -15,14 +15,16 @@ Radio UI Component
15
15
 
16
16
  #### Radio
17
17
 
18
- | Property | Description | Type | Default |
19
- | -------------- | -------------------------------------------------------------------- | --------- | ------- |
20
- | autoFocus | get focus when component mounted | boolean | `false` |
21
- | checked | Specifies whether the radio is selected. | boolean | - |
22
- | description | radio input description | ReactNode | - |
23
- | defaultChecked | Specifies the initial state: whether or not the radio is selected. | boolean | `false` |
24
- | disabled | Disable radio | boolean | `false` |
25
- | value | According to value for comparison, to determine whether the selected | any | - |
18
+ | Property | Description | Type | Default |
19
+ | -------------- | -------------------------------------------------------------------- | ---------- | ------- |
20
+ | autoFocus | get focus when component mounted | boolean | `false` |
21
+ | checked | Specifies whether the radio is selected. | boolean | - |
22
+ | description | radio input description | ReactNode | - |
23
+ | defaultChecked | Specifies the initial state: whether or not the radio is selected. | boolean | `false` |
24
+ | disabled | Disable radio | boolean | `false` |
25
+ | value | According to value for comparison, to determine whether the selected | any | - |
26
+ | label | radio input label | ReactNode | - |
27
+ | children | radio input children `deprecated, use label instead` | ReactNode | - |
26
28
 
27
29
  #### RadioGroup
28
30
 
package/dist/Radio.d.ts CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import '@synerise/ds-core/dist/js/style';
3
3
  import { type RadioGroupProps, type RadioProps } from './Radio.types';
4
4
  import './style/index.less';
5
- declare const Radio: (({ description, ...antdRadioButtonProps }: RadioProps) => React.JSX.Element) & {
5
+ declare const Radio: (({ description, label, children, ...antdRadioButtonProps }: RadioProps) => React.JSX.Element) & {
6
6
  Group: ({ children, fullWidth, big, ...props }: RadioGroupProps) => React.JSX.Element;
7
7
  Button: React.ForwardRefExoticComponent<import("antd/lib/radio/radioButton").RadioButtonProps & React.RefAttributes<any>>;
8
8
  };
package/dist/Radio.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["children", "fullWidth", "big"],
2
- _excluded2 = ["description"];
2
+ _excluded2 = ["description", "label", "children"];
3
3
  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); }
4
4
  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; }
5
5
  import AntdRadio from 'antd/lib/radio';
@@ -19,8 +19,12 @@ var Group = function Group(_ref) {
19
19
  };
20
20
  var RadioComponent = function RadioComponent(_ref2) {
21
21
  var description = _ref2.description,
22
+ label = _ref2.label,
23
+ children = _ref2.children,
22
24
  antdRadioButtonProps = _objectWithoutPropertiesLoose(_ref2, _excluded2);
23
- return /*#__PURE__*/React.createElement(S.RadioWrapper, null, /*#__PURE__*/React.createElement(S.AntRadio, antdRadioButtonProps), /*#__PURE__*/React.createElement(S.AdditionalData, null, description && /*#__PURE__*/React.createElement(S.Description, {
25
+ return /*#__PURE__*/React.createElement(S.RadioWrapper, null, /*#__PURE__*/React.createElement(S.AntRadio, antdRadioButtonProps, label ? /*#__PURE__*/React.createElement(S.Label, {
26
+ disabled: antdRadioButtonProps.disabled
27
+ }, label) : children), /*#__PURE__*/React.createElement(S.AdditionalData, null, description && /*#__PURE__*/React.createElement(S.Description, {
24
28
  disabled: antdRadioButtonProps.disabled
25
29
  }, description)));
26
30
  };
@@ -3,6 +3,9 @@ export declare const RadioWrapper: import("styled-components").StyledComponent<"
3
3
  export declare const Description: import("styled-components").StyledComponent<"div", any, {
4
4
  disabled?: boolean | undefined;
5
5
  }, never>;
6
+ export declare const Label: import("styled-components").StyledComponent<({ id, label, tooltip, tooltipConfig, children, ...htmlAttributes }: import("@synerise/ds-form-field").FormFieldLabelProps) => React.JSX.Element, any, {
7
+ disabled?: boolean | undefined;
8
+ }, never>;
6
9
  export declare const AdditionalData: import("styled-components").StyledComponent<"div", any, {}, never>;
7
10
  export declare const AntRadio: import("styled-components").StyledComponent<({ ...rest }: any) => React.JSX.Element, any, {}, never>;
8
11
  export declare const AntRadioGroup: import("styled-components").StyledComponent<React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd/lib/radio").RadioGroupProps & React.RefAttributes<HTMLDivElement>>>, any, {
@@ -3,6 +3,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  import AntdRadio from 'antd/lib/radio';
4
4
  import React from 'react';
5
5
  import styled, { css } from 'styled-components';
6
+ import { FormFieldLabel } from '@synerise/ds-form-field';
6
7
  import { macro } from '@synerise/ds-typography/';
7
8
  export var RadioWrapper = styled.div.withConfig({
8
9
  displayName: "Radiostyles__RadioWrapper",
@@ -16,22 +17,28 @@ export var Description = styled.div.withConfig({
16
17
  }, function (props) {
17
18
  return props.disabled ? "opacity: 0.4;" : '';
18
19
  }, macro.small);
20
+ export var Label = styled(FormFieldLabel).withConfig({
21
+ displayName: "Radiostyles__Label",
22
+ componentId: "sc-137n5jf-2"
23
+ })(["", ""], function (props) {
24
+ return props.disabled ? "opacity: 0.4;" : '';
25
+ });
19
26
 
20
27
  // @deprecated - all styles are now defined in Description
21
28
  export var AdditionalData = styled.div.withConfig({
22
29
  displayName: "Radiostyles__AdditionalData",
23
- componentId: "sc-137n5jf-2"
30
+ componentId: "sc-137n5jf-3"
24
31
  })(["margin:4px 8px 15px 28px;"]);
25
32
  export var AntRadio = styled(function (_ref) {
26
33
  var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
27
34
  return /*#__PURE__*/React.createElement(AntdRadio, rest);
28
35
  }).withConfig({
29
36
  displayName: "Radiostyles__AntRadio",
30
- componentId: "sc-137n5jf-3"
37
+ componentId: "sc-137n5jf-4"
31
38
  })([".ant-radio{height:16px;top:0;}.ant-radio + span{flex-grow:1;}"]);
32
39
  export var AntRadioGroup = styled(AntdRadio.Group).withConfig({
33
40
  displayName: "Radiostyles__AntRadioGroup",
34
- componentId: "sc-137n5jf-4"
41
+ componentId: "sc-137n5jf-5"
35
42
  })(["", ""], function (props) {
36
43
  return props.fullWidth && css(["&&{display:flex;width:100%;label{flex:1;height:", ";display:flex;align-items:center;justify-content:center;font-weight:500;}}"], props.big ? '48px' : '32px');
37
44
  });
@@ -2,7 +2,15 @@ import { type RadioGroupProps as AntdRadioGroupProps, type RadioProps as AntdRad
2
2
  import { type ReactNode } from 'react';
3
3
  export type RadioProps = AntdRadioProps & {
4
4
  description?: ReactNode;
5
+ label?: ReactNode;
6
+ /**
7
+ * @deprecated, use label instead
8
+ */
9
+ children?: ReactNode;
5
10
  };
11
+ /**
12
+ * @deprecated, use RadioProps instead
13
+ */
6
14
  export type Props = RadioProps;
7
15
  export type RadioGroupProps = AntdRadioGroupProps & {
8
16
  fullWidth?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-radio",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Radio UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -34,6 +34,7 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
+ "@synerise/ds-form-field": "^1.1.8",
37
38
  "@synerise/ds-typography": "^1.0.13",
38
39
  "@synerise/ds-utils": "^1.3.1"
39
40
  },
@@ -43,5 +44,5 @@
43
44
  "react": ">=16.9.0 <= 18.3.1",
44
45
  "styled-components": "^5.3.3"
45
46
  },
46
- "gitHead": "4512641033ba3581a3df208143c547fcfed45895"
47
+ "gitHead": "2161bdb04f3db0f79b7d0465ce6b41121f1543ef"
47
48
  }