@drivy/cobalt 0.37.3 → 0.37.4

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.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cx from 'classnames';
3
3
 
4
4
  const RadioWithDetails = ({ icon, title, description, className, ...inputProps }) => {
5
- return (React.createElement("label", { className: cx("cobalt-radio-with-details", className) },
5
+ return (React.createElement("label", { className: cx("cobalt-radio-with-details", !description && "cobalt-radio-with-details--noDescription", className) },
6
6
  React.createElement("input", { ...inputProps, type: "radio", className: "cobalt-radio-with-details__input" }),
7
7
  React.createElement("div", { className: "cobalt-radio-with-details__inner" },
8
8
  icon &&
@@ -1 +1 @@
1
- {"version":3,"file":"RadioWithDetails.js","sources":["../../../src/components/Form/RadioWithDetails.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport type RadioWithDetailsPropsType = {\n icon?: JSX.Element\n title: string\n description: string\n name: string\n className?: string\n} & React.InputHTMLAttributes<HTMLInputElement>\n\nconst RadioWithDetails = ({\n icon,\n title,\n description,\n className,\n ...inputProps\n}: RadioWithDetailsPropsType) => {\n return (\n <label className={cx(\"cobalt-radio-with-details\", className)}>\n <input\n {...inputProps}\n type=\"radio\"\n className=\"cobalt-radio-with-details__input\"\n />\n <div className=\"cobalt-radio-with-details__inner\">\n {icon &&\n React.cloneElement(icon, {\n className: \"cobalt-radio-with-details__icon\",\n })}\n <div className=\"cobalt-radio-with-details__content\">\n <p className=\"cobalt-radio-with-details__title\">{title}</p>\n {description && (\n <p className=\"cobalt-radio-with-details__description\">\n {description}\n </p>\n )}\n </div>\n <div className=\"cobalt-radio-with-details__visual-input\" />\n </div>\n </label>\n )\n}\n\nexport default RadioWithDetails\n"],"names":[],"mappings":";;;AAWA,MAAM,gBAAgB,GAAG,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,UAAU,EACa,KAAI;IAC9B,QACE,+BAAO,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAAA;QAC1D,KACM,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GAAA,UAAU,EACd,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,kCAAkC,EAC5C,CAAA;QACF,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,kCAAkC,EAAA;YAC9C,IAAI;AACH,gBAAA,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE;AACvB,oBAAA,SAAS,EAAE,iCAAiC;iBAC7C,CAAC;YACJ,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,oCAAoC,EAAA;AACjD,gBAAA,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,kCAAkC,EAAA,EAAE,KAAK,CAAK;gBAC1D,WAAW,KACV,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,wCAAwC,EAClD,EAAA,WAAW,CACV,CACL,CACG;AACN,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,yCAAyC,GAAG,CACvD,CACA,EACT;AACH;;;;"}
1
+ {"version":3,"file":"RadioWithDetails.js","sources":["../../../src/components/Form/RadioWithDetails.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport type RadioWithDetailsPropsType = {\n icon?: JSX.Element\n title: string\n description?: string\n name: string\n className?: string\n} & React.InputHTMLAttributes<HTMLInputElement>\n\nconst RadioWithDetails = ({\n icon,\n title,\n description,\n className,\n ...inputProps\n}: RadioWithDetailsPropsType) => {\n return (\n <label\n className={cx(\n \"cobalt-radio-with-details\",\n !description && \"cobalt-radio-with-details--noDescription\",\n className\n )}\n >\n <input\n {...inputProps}\n type=\"radio\"\n className=\"cobalt-radio-with-details__input\"\n />\n <div className=\"cobalt-radio-with-details__inner\">\n {icon &&\n React.cloneElement(icon, {\n className: \"cobalt-radio-with-details__icon\",\n })}\n <div className=\"cobalt-radio-with-details__content\">\n <p className=\"cobalt-radio-with-details__title\">{title}</p>\n {description && (\n <p className=\"cobalt-radio-with-details__description\">\n {description}\n </p>\n )}\n </div>\n <div className=\"cobalt-radio-with-details__visual-input\" />\n </div>\n </label>\n )\n}\n\nexport default RadioWithDetails\n"],"names":[],"mappings":";;;AAWA,MAAM,gBAAgB,GAAG,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,UAAU,EACa,KAAI;AAC9B,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,SAAS,EAAE,EAAE,CACX,2BAA2B,EAC3B,CAAC,WAAW,IAAI,0CAA0C,EAC1D,SAAS,CACV,EAAA;QAED,KACM,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GAAA,UAAU,EACd,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,kCAAkC,EAC5C,CAAA;QACF,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,kCAAkC,EAAA;YAC9C,IAAI;AACH,gBAAA,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE;AACvB,oBAAA,SAAS,EAAE,iCAAiC;iBAC7C,CAAC;YACJ,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,oCAAoC,EAAA;AACjD,gBAAA,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,kCAAkC,EAAA,EAAE,KAAK,CAAK;gBAC1D,WAAW,KACV,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,wCAAwC,EAClD,EAAA,WAAW,CACV,CACL,CACG;AACN,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,yCAAyC,GAAG,CACvD,CACA,EACT;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "0.37.3",
3
+ "version": "0.37.4",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@juggle/resize-observer": "3.4.0",
23
+ "@lottiefiles/react-lottie-player": "3.5.3",
23
24
  "@reach/accordion": "0.16.1",
24
25
  "@reach/alert": "0.16.0",
25
26
  "@reach/combobox": "0.16.3",
@@ -142,4 +142,14 @@
142
142
  cursor: not-allowed;
143
143
  }
144
144
  }
145
+
146
+ &.cobalt-radio-with-details--noDescription {
147
+ .cobalt-radio-with-details__inner {
148
+ align-items: center !important;
149
+
150
+ .cobalt-radio-with-details__visual-input {
151
+ top: 0 !important;
152
+ }
153
+ }
154
+ }
145
155
  }
@@ -2,7 +2,7 @@ import React from "react";
2
2
  export type RadioWithDetailsPropsType = {
3
3
  icon?: JSX.Element;
4
4
  title: string;
5
- description: string;
5
+ description?: string;
6
6
  name: string;
7
7
  className?: string;
8
8
  } & React.InputHTMLAttributes<HTMLInputElement>;