@trackunit/react-form-components 0.0.42 → 0.0.43

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.
Files changed (3) hide show
  1. package/index.cjs +2 -1
  2. package/index.js +2 -1
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -466,7 +466,8 @@ const NumberField = React.forwardRef((_a, ref) => {
466
466
  */
467
467
  const OptionCard = React.forwardRef((_a, ref) => {
468
468
  var { icon, heading, subheading, description, disabled, id, value, className, dataTestId } = _a, rest = __rest(_a, ["icon", "heading", "subheading", "description", "disabled", "id", "value", "className", "dataTestId"]);
469
- return (jsxRuntime.jsxs(Container$3, Object.assign({ "data-testid": dataTestId }, { children: [jsxRuntime.jsx("input", Object.assign({ ref: ref, id: id, type: "radio", value: value, className: "hidden peer" }, rest)), jsxRuntime.jsxs(Label, Object.assign({ htmlFor: id, className: className, "$disabled": disabled }, { children: [disabled && icon && React.cloneElement(icon, { className: `${icon.props.className} text-secondary-400` }), !disabled && icon, heading && (jsxRuntime.jsx(reactComponents.Heading, Object.assign({ variant: "secondary", subtle: disabled }, { children: heading }))), (subheading || description) && (jsxRuntime.jsxs(Content, { children: [subheading && (jsxRuntime.jsx(reactComponents.Text, Object.assign({ weight: "thick", align: "center", subtle: disabled }, { children: subheading }))), description && (jsxRuntime.jsx(reactComponents.Text, Object.assign({ subtle: true, align: "center" }, { children: description })))] }))] }))] })));
469
+ const htmlForId = id !== null && id !== void 0 ? id : "option-card-" + uuid.v4();
470
+ return (jsxRuntime.jsxs(Container$3, Object.assign({ "data-testid": dataTestId }, { children: [jsxRuntime.jsx("input", Object.assign({ ref: ref, id: htmlForId, type: "radio", value: value, className: "hidden peer" }, rest)), jsxRuntime.jsxs(Label, Object.assign({ htmlFor: htmlForId, className: className, "$disabled": disabled }, { children: [disabled && icon && React.cloneElement(icon, { className: `${icon.props.className} text-secondary-400` }), !disabled && icon, heading && (jsxRuntime.jsx(reactComponents.Heading, Object.assign({ variant: "secondary", subtle: disabled }, { children: heading }))), (subheading || description) && (jsxRuntime.jsxs(Content, { children: [subheading && (jsxRuntime.jsx(reactComponents.Text, Object.assign({ weight: "thick", align: "center", subtle: disabled }, { children: subheading }))), description && (jsxRuntime.jsx(reactComponents.Text, Object.assign({ subtle: true, align: "center" }, { children: description })))] }))] }))] })));
470
471
  });
471
472
  const Container$3 = tailwindStyledComponents.tw.div `
472
473
  contents
package/index.js CHANGED
@@ -437,7 +437,8 @@ const NumberField = forwardRef((_a, ref) => {
437
437
  */
438
438
  const OptionCard = forwardRef((_a, ref) => {
439
439
  var { icon, heading, subheading, description, disabled, id, value, className, dataTestId } = _a, rest = __rest(_a, ["icon", "heading", "subheading", "description", "disabled", "id", "value", "className", "dataTestId"]);
440
- return (jsxs(Container$3, Object.assign({ "data-testid": dataTestId }, { children: [jsx("input", Object.assign({ ref: ref, id: id, type: "radio", value: value, className: "hidden peer" }, rest)), jsxs(Label, Object.assign({ htmlFor: id, className: className, "$disabled": disabled }, { children: [disabled && icon && cloneElement(icon, { className: `${icon.props.className} text-secondary-400` }), !disabled && icon, heading && (jsx(Heading, Object.assign({ variant: "secondary", subtle: disabled }, { children: heading }))), (subheading || description) && (jsxs(Content, { children: [subheading && (jsx(Text, Object.assign({ weight: "thick", align: "center", subtle: disabled }, { children: subheading }))), description && (jsx(Text, Object.assign({ subtle: true, align: "center" }, { children: description })))] }))] }))] })));
440
+ const htmlForId = id !== null && id !== void 0 ? id : "option-card-" + v4();
441
+ return (jsxs(Container$3, Object.assign({ "data-testid": dataTestId }, { children: [jsx("input", Object.assign({ ref: ref, id: htmlForId, type: "radio", value: value, className: "hidden peer" }, rest)), jsxs(Label, Object.assign({ htmlFor: htmlForId, className: className, "$disabled": disabled }, { children: [disabled && icon && cloneElement(icon, { className: `${icon.props.className} text-secondary-400` }), !disabled && icon, heading && (jsx(Heading, Object.assign({ variant: "secondary", subtle: disabled }, { children: heading }))), (subheading || description) && (jsxs(Content, { children: [subheading && (jsx(Text, Object.assign({ weight: "thick", align: "center", subtle: disabled }, { children: subheading }))), description && (jsx(Text, Object.assign({ subtle: true, align: "center" }, { children: description })))] }))] }))] })));
441
442
  });
442
443
  const Container$3 = tw.div `
443
444
  contents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {