@workday/canvas-kit-preview-react 9.1.41 → 9.1.42
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/dist/commonjs/radio/lib/StyledRadioButton.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/StyledRadioButton.js +7 -4
- package/dist/es6/radio/lib/StyledRadioButton.d.ts.map +1 -1
- package/dist/es6/radio/lib/StyledRadioButton.js +7 -4
- package/package.json +4 -3
- package/radio/lib/StyledRadioButton.tsx +15 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledRadioButton.d.ts","sourceRoot":"","sources":["../../../../radio/lib/StyledRadioButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,YAAY,EACZ,SAAS,EACV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,GAAG,EAAO,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledRadioButton.d.ts","sourceRoot":"","sources":["../../../../radio/lib/StyledRadioButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,YAAY,EACZ,SAAS,EACV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,GAAG,EAAO,MAAM,kCAAkC,CAAC;AAO3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAgID,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC;IAC/E,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8FAgC5B,CAAC"}
|
|
@@ -8,6 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
9
9
|
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
10
10
|
const layout_1 = require("@workday/canvas-kit-react/layout");
|
|
11
|
+
const is_prop_valid_1 = __importDefault(require("@emotion/is-prop-valid"));
|
|
11
12
|
const radioWidth = 18;
|
|
12
13
|
const rippleRadius = (tokens_1.spaceNumbers.l - radioWidth) / 2;
|
|
13
14
|
const radioHeight = 18;
|
|
@@ -90,7 +91,9 @@ const StyledRadioInput = common_1.styled(layout_1.Box.as('input'))({
|
|
|
90
91
|
},
|
|
91
92
|
}),
|
|
92
93
|
}));
|
|
93
|
-
const RadioInputWrapper = common_1.styled(layout_1.Flex
|
|
94
|
+
const RadioInputWrapper = common_1.styled(layout_1.Flex, {
|
|
95
|
+
shouldForwardProp: prop => is_prop_valid_1.default(prop) && prop !== 'disabled' && prop !== 'variant',
|
|
96
|
+
})({
|
|
94
97
|
// Hover Ripple element
|
|
95
98
|
'::before': {
|
|
96
99
|
content: "''",
|
|
@@ -114,9 +117,9 @@ const RadioInputWrapper = common_1.styled(layout_1.Flex)({
|
|
|
114
117
|
*/
|
|
115
118
|
exports.StyledRadioButton = common_1.createComponent('input')({
|
|
116
119
|
displayName: 'Radio',
|
|
117
|
-
Component: ({ ...elemProps }, ref, Element) => {
|
|
118
|
-
return (react_1.default.createElement(RadioInputWrapper,
|
|
119
|
-
react_1.default.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref }, elemProps)),
|
|
120
|
+
Component: ({ className, variant, disabled, ...elemProps }, ref, Element) => {
|
|
121
|
+
return (react_1.default.createElement(RadioInputWrapper, { height: "18px", width: "18px", flex: "0 0 auto", className: className, variant: variant, disabled: disabled },
|
|
122
|
+
react_1.default.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref, className: className, variant: variant, disabled: disabled }, elemProps)),
|
|
120
123
|
react_1.default.createElement("span", { className: "cnvs-radio-check" })));
|
|
121
124
|
},
|
|
122
125
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledRadioButton.d.ts","sourceRoot":"","sources":["../../../../radio/lib/StyledRadioButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,YAAY,EACZ,SAAS,EACV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,GAAG,EAAO,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledRadioButton.d.ts","sourceRoot":"","sources":["../../../../radio/lib/StyledRadioButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,YAAY,EACZ,SAAS,EACV,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,GAAG,EAAO,MAAM,kCAAkC,CAAC;AAO3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAgID,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC;IAC/E,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8FAgC5B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { styled, focusRing, mouseFocusBehavior, createComponent, } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { colors, inputColors, spaceNumbers, borderRadius } from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
import { Box, Flex } from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import isPropValid from '@emotion/is-prop-valid';
|
|
5
6
|
const radioWidth = 18;
|
|
6
7
|
const rippleRadius = (spaceNumbers.l - radioWidth) / 2;
|
|
7
8
|
const radioHeight = 18;
|
|
@@ -84,7 +85,9 @@ const StyledRadioInput = styled(Box.as('input'))({
|
|
|
84
85
|
},
|
|
85
86
|
}),
|
|
86
87
|
}));
|
|
87
|
-
const RadioInputWrapper = styled(Flex
|
|
88
|
+
const RadioInputWrapper = styled(Flex, {
|
|
89
|
+
shouldForwardProp: prop => isPropValid(prop) && prop !== 'disabled' && prop !== 'variant',
|
|
90
|
+
})({
|
|
88
91
|
// Hover Ripple element
|
|
89
92
|
'::before': {
|
|
90
93
|
content: "''",
|
|
@@ -108,9 +111,9 @@ const RadioInputWrapper = styled(Flex)({
|
|
|
108
111
|
*/
|
|
109
112
|
export const StyledRadioButton = createComponent('input')({
|
|
110
113
|
displayName: 'Radio',
|
|
111
|
-
Component: ({ ...elemProps }, ref, Element) => {
|
|
112
|
-
return (React.createElement(RadioInputWrapper,
|
|
113
|
-
React.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref }, elemProps)),
|
|
114
|
+
Component: ({ className, variant, disabled, ...elemProps }, ref, Element) => {
|
|
115
|
+
return (React.createElement(RadioInputWrapper, { height: "18px", width: "18px", flex: "0 0 auto", className: className, variant: variant, disabled: disabled },
|
|
116
|
+
React.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref, className: className, variant: variant, disabled: disabled }, elemProps)),
|
|
114
117
|
React.createElement("span", { className: "cnvs-radio-check" })));
|
|
115
118
|
},
|
|
116
119
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-preview-react",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.42",
|
|
4
4
|
"description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,9 +44,10 @@
|
|
|
44
44
|
"react": ">=16.14"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@emotion/is-prop-valid": "^1.1.1",
|
|
47
48
|
"@emotion/react": "^11.7.1",
|
|
48
49
|
"@emotion/styled": "^11.6.0",
|
|
49
|
-
"@workday/canvas-kit-react": "^9.1.
|
|
50
|
+
"@workday/canvas-kit-react": "^9.1.42",
|
|
50
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
51
52
|
"@workday/design-assets-types": "^0.2.8"
|
|
52
53
|
},
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"react-hook-form": "7.36.1",
|
|
57
58
|
"yup": "^0.32.11"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "905c1fc2a76b91054fe872adea18035e9d3f0e41"
|
|
60
61
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import {colors, inputColors, spaceNumbers, borderRadius} from '@workday/canvas-kit-react/tokens';
|
|
12
12
|
|
|
13
13
|
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
14
|
+
import isPropValid from '@emotion/is-prop-valid';
|
|
14
15
|
|
|
15
16
|
const radioWidth = 18;
|
|
16
17
|
const rippleRadius = (spaceNumbers.l - radioWidth) / 2;
|
|
@@ -122,7 +123,9 @@ const StyledRadioInput = styled(Box.as('input'))<StyledRadioButtonProps & Styled
|
|
|
122
123
|
})
|
|
123
124
|
);
|
|
124
125
|
|
|
125
|
-
const RadioInputWrapper = styled(Flex
|
|
126
|
+
const RadioInputWrapper = styled(Flex, {
|
|
127
|
+
shouldForwardProp: prop => isPropValid(prop) && prop !== 'disabled' && prop !== 'variant',
|
|
128
|
+
})<Pick<StyledRadioButtonProps, 'variant' | 'disabled'>>(
|
|
126
129
|
{
|
|
127
130
|
// Hover Ripple element
|
|
128
131
|
'::before': {
|
|
@@ -154,13 +157,19 @@ export interface StyledRadioButtonProps extends ExtractProps<typeof Box, 'input'
|
|
|
154
157
|
*/
|
|
155
158
|
export const StyledRadioButton = createComponent('input')({
|
|
156
159
|
displayName: 'Radio',
|
|
157
|
-
Component: (
|
|
160
|
+
Component: (
|
|
161
|
+
{className, variant, disabled, ...elemProps}: StyledRadioButtonProps,
|
|
162
|
+
ref,
|
|
163
|
+
Element
|
|
164
|
+
) => {
|
|
158
165
|
return (
|
|
159
166
|
<RadioInputWrapper
|
|
160
167
|
height="18px"
|
|
161
168
|
width="18px"
|
|
162
169
|
flex="0 0 auto"
|
|
163
|
-
{
|
|
170
|
+
className={className}
|
|
171
|
+
variant={variant}
|
|
172
|
+
disabled={disabled}
|
|
164
173
|
>
|
|
165
174
|
<StyledRadioInput
|
|
166
175
|
borderRadius="circle"
|
|
@@ -169,6 +178,9 @@ export const StyledRadioButton = createComponent('input')({
|
|
|
169
178
|
as={Element}
|
|
170
179
|
type="radio"
|
|
171
180
|
ref={ref}
|
|
181
|
+
className={className}
|
|
182
|
+
variant={variant}
|
|
183
|
+
disabled={disabled}
|
|
172
184
|
{...elemProps}
|
|
173
185
|
/>
|
|
174
186
|
<span className="cnvs-radio-check"></span>
|