@workday/canvas-kit-preview-react 10.3.38 → 10.3.40

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.
@@ -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;AAK3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAiID,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,8FAuB5B,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;AAM3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAmID,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 radioHeight = 18;
13
14
  const StyledRadioInput = common_1.styled(layout_1.Box.as('input'))({
@@ -89,7 +90,9 @@ const StyledRadioInput = common_1.styled(layout_1.Box.as('input'))({
89
90
  },
90
91
  }),
91
92
  }));
92
- const RadioInputWrapper = common_1.styled(layout_1.Flex)({
93
+ const RadioInputWrapper = common_1.styled(layout_1.Flex, {
94
+ shouldForwardProp: prop => is_prop_valid_1.default(prop) && prop !== 'disabled' && prop !== 'variant',
95
+ })({
93
96
  // Hover Ripple element
94
97
  '::before': {
95
98
  content: "''",
@@ -115,9 +118,9 @@ const RadioInputWrapper = common_1.styled(layout_1.Flex)({
115
118
  */
116
119
  exports.StyledRadioButton = common_1.createComponent('input')({
117
120
  displayName: 'Radio',
118
- Component: ({ ...elemProps }, ref, Element) => {
119
- return (react_1.default.createElement(RadioInputWrapper, Object.assign({ height: "18px", width: "18px", flex: "0 0 auto" }, elemProps),
120
- react_1.default.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref }, elemProps)),
121
+ Component: ({ className, variant, disabled, ...elemProps }, ref, Element) => {
122
+ return (react_1.default.createElement(RadioInputWrapper, { height: "18px", width: "18px", flex: "0 0 auto", className: className, variant: variant, disabled: disabled },
123
+ 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)),
121
124
  react_1.default.createElement("span", { className: "cnvs-radio-check" })));
122
125
  },
123
126
  });
@@ -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;AAK3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAiID,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,8FAuB5B,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;AAM3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;IAC1F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAmID,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, space, 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 radioHeight = 18;
7
8
  const StyledRadioInput = styled(Box.as('input'))({
@@ -83,7 +84,9 @@ const StyledRadioInput = styled(Box.as('input'))({
83
84
  },
84
85
  }),
85
86
  }));
86
- const RadioInputWrapper = styled(Flex)({
87
+ const RadioInputWrapper = styled(Flex, {
88
+ shouldForwardProp: prop => isPropValid(prop) && prop !== 'disabled' && prop !== 'variant',
89
+ })({
87
90
  // Hover Ripple element
88
91
  '::before': {
89
92
  content: "''",
@@ -109,9 +112,9 @@ const RadioInputWrapper = styled(Flex)({
109
112
  */
110
113
  export const StyledRadioButton = createComponent('input')({
111
114
  displayName: 'Radio',
112
- Component: ({ ...elemProps }, ref, Element) => {
113
- return (React.createElement(RadioInputWrapper, Object.assign({ height: "18px", width: "18px", flex: "0 0 auto" }, elemProps),
114
- React.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref }, elemProps)),
115
+ Component: ({ className, variant, disabled, ...elemProps }, ref, Element) => {
116
+ return (React.createElement(RadioInputWrapper, { height: "18px", width: "18px", flex: "0 0 auto", className: className, variant: variant, disabled: disabled },
117
+ React.createElement(StyledRadioInput, Object.assign({ borderRadius: "circle", position: "absolute", margin: "zero", as: Element, type: "radio", ref: ref, className: className, variant: variant, disabled: disabled }, elemProps)),
115
118
  React.createElement("span", { className: "cnvs-radio-check" })));
116
119
  },
117
120
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-preview-react",
3
- "version": "10.3.38",
3
+ "version": "10.3.40",
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,10 +44,11 @@
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": "^10.3.38",
50
- "@workday/canvas-kit-styling": "^10.3.38",
50
+ "@workday/canvas-kit-react": "^10.3.40",
51
+ "@workday/canvas-kit-styling": "^10.3.40",
51
52
  "@workday/canvas-system-icons-web": "^3.0.0",
52
53
  "@workday/canvas-tokens-web": "^1.0.0",
53
54
  "@workday/design-assets-types": "^0.2.8"
@@ -58,5 +59,5 @@
58
59
  "react-hook-form": "7.36.1",
59
60
  "yup": "^0.32.11"
60
61
  },
61
- "gitHead": "4aa887025f7355a7b88ed0ca4ff3122fabb33ae8"
62
+ "gitHead": "d1f2c6e38ec2aabed91501cd3dd7fae65f520a60"
62
63
  }
@@ -11,6 +11,7 @@ import {
11
11
  import {colors, inputColors, space, 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 radioHeight = 18;
@@ -122,7 +123,9 @@ const StyledRadioInput = styled(Box.as('input'))<StyledRadioButtonProps & Styled
122
123
  })
123
124
  );
124
125
 
125
- const RadioInputWrapper = styled(Flex)<Pick<StyledRadioButtonProps, 'disabled' | 'variant'>>(
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': {
@@ -156,13 +159,19 @@ export interface StyledRadioButtonProps extends ExtractProps<typeof Box, 'input'
156
159
  */
157
160
  export const StyledRadioButton = createComponent('input')({
158
161
  displayName: 'Radio',
159
- Component: ({...elemProps}: StyledRadioButtonProps, ref, Element) => {
162
+ Component: (
163
+ {className, variant, disabled, ...elemProps}: StyledRadioButtonProps,
164
+ ref,
165
+ Element
166
+ ) => {
160
167
  return (
161
168
  <RadioInputWrapper
162
169
  height="18px"
163
170
  width="18px"
164
171
  flex="0 0 auto"
165
- {...elemProps} // This ensures our visual testing stories work properly
172
+ className={className}
173
+ variant={variant}
174
+ disabled={disabled}
166
175
  >
167
176
  <StyledRadioInput
168
177
  borderRadius="circle"
@@ -171,6 +180,9 @@ export const StyledRadioButton = createComponent('input')({
171
180
  as={Element}
172
181
  type="radio"
173
182
  ref={ref}
183
+ className={className}
184
+ variant={variant}
185
+ disabled={disabled}
174
186
  {...elemProps}
175
187
  />
176
188
  <span className="cnvs-radio-check"></span>