@synerise/ds-radio 1.1.1 → 1.1.3
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/README.md +12 -10
- package/dist/Radio.d.ts +3 -5
- package/dist/Radio.js +25 -30
- package/dist/Radio.styles.d.ts +7 -7
- package/dist/Radio.styles.js +24 -29
- package/dist/Radio.types.d.ts +2 -2
- package/dist/Radio.types.js +1 -1
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +6 -6
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.1.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-radio@1.1.2...@synerise/ds-radio@1.1.3) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-radio
|
|
9
|
+
|
|
10
|
+
## [1.1.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-radio@1.1.1...@synerise/ds-radio@1.1.2) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-radio
|
|
13
|
+
|
|
6
14
|
## [1.1.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-radio@1.1.0...@synerise/ds-radio@1.1.1) (2026-03-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-radio
|
package/README.md
CHANGED
|
@@ -28,16 +28,18 @@ Radio UI Component
|
|
|
28
28
|
|
|
29
29
|
#### RadioGroup
|
|
30
30
|
|
|
31
|
-
| Property | Description
|
|
32
|
-
| ------------ |
|
|
33
|
-
| defaultValue | Default selected value
|
|
34
|
-
| disabled | Disable all radio buttons
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
31
|
+
| Property | Description | Type | Default |
|
|
32
|
+
| ------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------- |
|
|
33
|
+
| defaultValue | Default selected value | any | - |
|
|
34
|
+
| disabled | Disable all radio buttons | boolean | `false` |
|
|
35
|
+
| fullWidth | Makes the group `display: flex; width: 100%` with each button taking equal space | boolean | - |
|
|
36
|
+
| big | When combined with `fullWidth`, sets button height to `48px` instead of `32px` | boolean | - |
|
|
37
|
+
| name | The name property of all input[type="radio"] children | string | - |
|
|
38
|
+
| options | Set children optional | string[] / `Array<{ label: string value: string disabled?: boolean }>` | - |
|
|
39
|
+
| size | Size for radio button style | `large` / `default` / `small` | `default` |
|
|
40
|
+
| value | Used for setting the currently selected value | any | - |
|
|
41
|
+
| onChange | The callback function that is triggered when the state changes | (e:Event) => void | - |
|
|
42
|
+
| buttonStyle | Style type of radio button | `outline` / `solid` | `outline` |
|
|
41
43
|
|
|
42
44
|
### Methods
|
|
43
45
|
|
package/dist/Radio.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '
|
|
3
|
-
import { type RadioGroupProps, type RadioProps } from './Radio.types';
|
|
4
|
-
import './style/index.less';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RadioGroupProps, RadioProps } from './Radio.types';
|
|
5
3
|
declare const Radio: (({ description, label, children, ...antdRadioButtonProps }: RadioProps) => React.JSX.Element) & {
|
|
6
4
|
Group: ({ children, fullWidth, big, ...props }: RadioGroupProps) => React.JSX.Element;
|
|
7
|
-
Button: React.ForwardRefExoticComponent<import(
|
|
5
|
+
Button: React.ForwardRefExoticComponent<import('antd/lib/radio/radioButton').RadioButtonProps & React.RefAttributes<any>>;
|
|
8
6
|
};
|
|
9
7
|
export default Radio;
|
package/dist/Radio.js
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
import AntdRadio from 'antd/lib/radio';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import '@synerise/ds-core/dist/js/style';
|
|
8
|
-
import * as S from './Radio.styles';
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import AntdRadio from "antd/lib/radio";
|
|
3
|
+
import { RadioWrapper, AntRadio, Label, AdditionalData, Description, AntRadioGroup } from "./Radio.styles.js";
|
|
9
4
|
import "./style/index.css";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
big: big
|
|
18
|
-
}, props), children);
|
|
5
|
+
const Group = ({
|
|
6
|
+
children,
|
|
7
|
+
fullWidth,
|
|
8
|
+
big,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(AntRadioGroup, { fullWidth, big, ...props, children });
|
|
19
12
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
disabled: antdRadioButtonProps.disabled
|
|
29
|
-
}
|
|
13
|
+
const RadioComponent = ({
|
|
14
|
+
description,
|
|
15
|
+
label,
|
|
16
|
+
children,
|
|
17
|
+
...antdRadioButtonProps
|
|
18
|
+
}) => {
|
|
19
|
+
return /* @__PURE__ */ jsxs(RadioWrapper, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx(AntRadio, { ...antdRadioButtonProps, children: label ? /* @__PURE__ */ jsx(Label, { disabled: antdRadioButtonProps.disabled, children: label }) : children }),
|
|
21
|
+
description && /* @__PURE__ */ jsx(AdditionalData, { children: /* @__PURE__ */ jsx(Description, { disabled: antdRadioButtonProps.disabled, children: description }) })
|
|
22
|
+
] });
|
|
30
23
|
};
|
|
31
|
-
|
|
32
|
-
Group
|
|
24
|
+
const Radio = Object.assign(RadioComponent, {
|
|
25
|
+
Group,
|
|
33
26
|
Button: AntdRadio.Button
|
|
34
27
|
});
|
|
35
|
-
export
|
|
28
|
+
export {
|
|
29
|
+
Radio as default
|
|
30
|
+
};
|
package/dist/Radio.styles.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const RadioWrapper: import(
|
|
3
|
-
export declare const Description: import(
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const RadioWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Description: import('styled-components').StyledComponent<"div", any, {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
}, never>;
|
|
6
|
-
export declare const Label: import(
|
|
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
7
|
disabled?: boolean;
|
|
8
8
|
}, never>;
|
|
9
|
-
export declare const AdditionalData: import(
|
|
10
|
-
export declare const AntRadio: import(
|
|
11
|
-
export declare const AntRadioGroup: import(
|
|
9
|
+
export declare const AdditionalData: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const AntRadio: import('styled-components').StyledComponent<({ ...rest }: any) => React.JSX.Element, any, {}, never>;
|
|
11
|
+
export declare const AntRadioGroup: import('styled-components').StyledComponent<React.MemoExoticComponent<React.ForwardRefExoticComponent<import('antd/lib/radio').RadioGroupProps & React.RefAttributes<HTMLDivElement>>>, any, {
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
big?: boolean;
|
|
14
14
|
}, never>;
|
package/dist/Radio.styles.js
CHANGED
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import { macro } from '@synerise/ds-typography/';
|
|
8
|
-
export var RadioWrapper = styled.div.withConfig({
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import AntdRadio from "antd/lib/radio";
|
|
3
|
+
import styled, { css } from "styled-components";
|
|
4
|
+
import { FormFieldLabel } from "@synerise/ds-form-field";
|
|
5
|
+
import { macro } from "@synerise/ds-typography/";
|
|
6
|
+
const RadioWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
9
7
|
displayName: "Radiostyles__RadioWrapper",
|
|
10
8
|
componentId: "sc-137n5jf-0"
|
|
11
9
|
})(["&{display:block;margin-bottom:15px;}"]);
|
|
12
|
-
|
|
10
|
+
const Description = /* @__PURE__ */ styled.div.withConfig({
|
|
13
11
|
displayName: "Radiostyles__Description",
|
|
14
12
|
componentId: "sc-137n5jf-1"
|
|
15
|
-
})(["color:", ";", " ", ""],
|
|
16
|
-
|
|
17
|
-
}, function (props) {
|
|
18
|
-
return props.disabled ? "opacity: 0.4;" : '';
|
|
19
|
-
}, macro.small);
|
|
20
|
-
export var Label = styled(FormFieldLabel).withConfig({
|
|
13
|
+
})(["color:", ";", " ", ""], (props) => props.theme.palette["grey-600"], (props) => props.disabled ? `opacity: 0.4;` : "", macro.small);
|
|
14
|
+
const Label = /* @__PURE__ */ styled(FormFieldLabel).withConfig({
|
|
21
15
|
displayName: "Radiostyles__Label",
|
|
22
16
|
componentId: "sc-137n5jf-2"
|
|
23
|
-
})(["", ""],
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// @deprecated - all styles are now defined in Description
|
|
28
|
-
export var AdditionalData = styled.div.withConfig({
|
|
17
|
+
})(["", ""], (props) => props.disabled ? `opacity: 0.4;` : "");
|
|
18
|
+
const AdditionalData = /* @__PURE__ */ styled.div.withConfig({
|
|
29
19
|
displayName: "Radiostyles__AdditionalData",
|
|
30
20
|
componentId: "sc-137n5jf-3"
|
|
31
21
|
})(["margin:4px 8px 15px 28px;"]);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}).withConfig({
|
|
22
|
+
const AntRadio = /* @__PURE__ */ styled(({
|
|
23
|
+
...rest
|
|
24
|
+
}) => /* @__PURE__ */ jsx(AntdRadio, { ...rest })).withConfig({
|
|
36
25
|
displayName: "Radiostyles__AntRadio",
|
|
37
26
|
componentId: "sc-137n5jf-4"
|
|
38
27
|
})([".ant-radio{height:16px;top:0;}.ant-radio + span{flex-grow:1;}"]);
|
|
39
|
-
|
|
28
|
+
const AntRadioGroup = /* @__PURE__ */ styled(AntdRadio.Group).withConfig({
|
|
40
29
|
displayName: "Radiostyles__AntRadioGroup",
|
|
41
30
|
componentId: "sc-137n5jf-5"
|
|
42
|
-
})(["", ""],
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
})(["", ""], (props) => 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"));
|
|
32
|
+
export {
|
|
33
|
+
AdditionalData,
|
|
34
|
+
AntRadio,
|
|
35
|
+
AntRadioGroup,
|
|
36
|
+
Description,
|
|
37
|
+
Label,
|
|
38
|
+
RadioWrapper
|
|
39
|
+
};
|
package/dist/Radio.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RadioGroupProps as AntdRadioGroupProps, RadioProps as AntdRadioProps } from 'antd/lib/radio';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
export type RadioProps = AntdRadioProps & {
|
|
4
4
|
description?: ReactNode;
|
|
5
5
|
label?: ReactNode;
|
package/dist/Radio.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
File without changes
|
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-radio",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Radio 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,8 +35,8 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-form-field": "^1.3.
|
|
39
|
-
"@synerise/ds-typography": "^1.1.
|
|
38
|
+
"@synerise/ds-form-field": "^1.3.10",
|
|
39
|
+
"@synerise/ds-typography": "^1.1.13"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@synerise/ds-core": "*",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react": ">=16.9.0 <= 18.3.1",
|
|
45
45
|
"styled-components": "^5.3.3"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
48
48
|
}
|