@drivy/cobalt 0.50.5 → 0.51.1

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":"index.js","sources":["../../../src/components/ContainedIcon/index.tsx"],"sourcesContent":["import React from \"react\"\nimport capitalize from \"../utils/capitalize\"\nimport { IconColorsType } from \"../Icon\"\nimport cx from \"classnames\"\n\ntype Extends<T, U extends T> = U\n\ntype ContainedIconColorType = Extends<\n IconColorsType,\n \"base\" | \"accent\" | \"disabled\" | \"error\" | \"info\" | \"success\" | \"connect\"\n>\n\nexport type ContainedIconPropsType = {\n icon: React.JSX.Element\n color?: ContainedIconColorType\n className?: string\n}\n\nexport function ContainedIcon({\n icon,\n color = \"base\",\n className,\n}: ContainedIconPropsType) {\n return (\n <div\n className={cx(\n className,\n `cobalt-contained-icon cobalt-contained-icon--color${capitalize(color)}`\n )}\n >\n {icon}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;AAkBM,SAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,GAAG,MAAM,EACd,SAAS,GACc,EAAA;AACvB,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CACX,SAAS,EACT,CAAA,kDAAA,EAAqD,UAAU,CAAC,KAAK,CAAC,CAAE,CAAA,CACzE,IAEA,IAAI,CACD,EACP;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/ContainedIcon/index.tsx"],"sourcesContent":["import React from \"react\"\nimport capitalize from \"../utils/capitalize\"\nimport { IconColorsType } from \"../Icon\"\nimport cx from \"classnames\"\n\ntype Extends<T, U extends T> = U\n\ntype ContainedIconColorType =\n | Extends<\n IconColorsType,\n | \"base\"\n | \"accent\"\n | \"disabled\"\n | \"error\"\n | \"info\"\n | \"success\"\n | \"connect\"\n | \"keyExchange\"\n | \"rideshare\"\n | \"accentAlt\"\n | \"disabledAlt\"\n | \"errorAlt\"\n | \"infoAlt\"\n | \"successAlt\"\n | \"connectAlt\"\n >\n | \"baseAlt\"\n\nexport type ContainedIconPropsType = {\n icon: React.JSX.Element\n color?: ContainedIconColorType\n className?: string\n}\n\nexport function ContainedIcon({\n icon,\n color = \"base\",\n className,\n}: ContainedIconPropsType) {\n return (\n <div\n className={cx(\n className,\n `cobalt-contained-icon cobalt-contained-icon--color${capitalize(color)}`\n )}\n >\n {icon}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;AAkCM,SAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,GAAG,MAAM,EACd,SAAS,GACc,EAAA;AACvB,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CACX,SAAS,EACT,CAAA,kDAAA,EAAqD,UAAU,CAAC,KAAK,CAAC,CAAE,CAAA,CACzE,IAEA,IAAI,CACD,EACP;AACH;;;;"}
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
3
 
4
- const Note = ({ children, fullWidth = false, className }) => (React.createElement("div", { className: cx("cobalt-Note", className, {
4
+ const Note = ({ children, fullWidth = false, className, isError = false, }) => (React.createElement("div", { className: cx("cobalt-Note", className, {
5
5
  "cobalt-Note--fullWidth": fullWidth,
6
+ "cobalt-Note--error": isError,
6
7
  }) }, children));
7
8
 
8
9
  export { Note, Note as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Note/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport interface NoteProps {\n children: React.ReactNode\n /**\n * will fill available width\n * @default false\n */\n fullWidth?: boolean\n className?: string\n}\n\nexport const Note = ({ children, fullWidth = false, className }: NoteProps) => (\n <div\n className={cx(\"cobalt-Note\", className, {\n \"cobalt-Note--fullWidth\": fullWidth,\n })}\n >\n {children}\n </div>\n)\n\nexport default Note\n"],"names":[],"mappings":";;;AAaa,MAAA,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,EAAa,MACxE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE;AACtC,QAAA,wBAAwB,EAAE,SAAS;AACpC,KAAA,CAAC,EAED,EAAA,QAAQ,CACL;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Note/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport interface NoteProps {\n children: React.ReactNode\n /**\n * will fill available width\n * @default false\n */\n fullWidth?: boolean\n className?: string\n isError?: boolean\n}\n\nexport const Note = ({\n children,\n fullWidth = false,\n className,\n isError = false,\n}: NoteProps) => (\n <div\n className={cx(\"cobalt-Note\", className, {\n \"cobalt-Note--fullWidth\": fullWidth,\n \"cobalt-Note--error\": isError,\n })}\n >\n {children}\n </div>\n)\n\nexport default Note\n"],"names":[],"mappings":";;;AAcO,MAAM,IAAI,GAAG,CAAC,EACnB,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,SAAS,EACT,OAAO,GAAG,KAAK,GACL,MACV,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE;AACtC,QAAA,wBAAwB,EAAE,SAAS;AACnC,QAAA,oBAAoB,EAAE,OAAO;AAC9B,KAAA,CAAC,EAED,EAAA,QAAQ,CACL;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "0.50.5",
3
+ "version": "0.51.1",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/src/index.d.ts",
@@ -60,13 +60,13 @@
60
60
  "@storybook/react-webpack5": "7.6.20",
61
61
  "@svgr/cli": "7.0.0",
62
62
  "@testing-library/jest-dom": "6.6.3",
63
- "@testing-library/react": "16.1.0",
63
+ "@testing-library/react": "16.2.0",
64
64
  "@testing-library/react-hooks": "8.0.1",
65
65
  "@types/fs-extra": "11.0.4",
66
66
  "@types/jest": "29.5.14",
67
67
  "@types/lodash.throttle": "4.1.9",
68
68
  "@types/media-typer": "1.1.3",
69
- "@types/node": "20.17.13",
69
+ "@types/node": "20.17.16",
70
70
  "@types/react": "18.3.18",
71
71
  "@types/react-dom": "18.3.5",
72
72
  "autoprefixer": "10.4.20",
@@ -1,7 +1,5 @@
1
1
  .cobalt-contained-icon {
2
- @include bg-color(neutralAlt);
3
-
4
- --containerSize: 40px;
2
+ --containerSize: 48px;
5
3
 
6
4
  width: var(--containerSize);
7
5
  height: var(--containerSize);
@@ -23,6 +21,64 @@
23
21
  }
24
22
 
25
23
  &--colorAccent {
24
+ .cobalt-Icon {
25
+ @include semantic-color(icon, accent, fill);
26
+ }
27
+ }
28
+
29
+ &--colorDisabled {
30
+ .cobalt-Icon {
31
+ @include semantic-color(icon, subdued, fill);
32
+ }
33
+ }
34
+
35
+ &--colorError {
36
+ .cobalt-Icon {
37
+ @include semantic-color(icon, error, fill);
38
+ }
39
+ }
40
+
41
+ &--colorInfo {
42
+ .cobalt-Icon {
43
+ @include semantic-color(icon, infoAlt, fill);
44
+ }
45
+ }
46
+
47
+ &--colorSuccess {
48
+ .cobalt-Icon {
49
+ @include semantic-color(icon, success, fill);
50
+ }
51
+ }
52
+
53
+ &--colorConnect {
54
+ @include bg-color(connect);
55
+
56
+ .cobalt-Icon {
57
+ @include semantic-color(icon, onConnect, fill);
58
+ }
59
+ }
60
+
61
+ &--colorKeyExchange {
62
+ @include bg-color(keyExchange);
63
+
64
+ .cobalt-Icon {
65
+ @include semantic-color(icon, onKeyExchange, fill);
66
+ }
67
+ }
68
+
69
+ &--colorRideshare {
70
+ @include bg-color(rideshare);
71
+
72
+ .cobalt-Icon {
73
+ @include semantic-color(icon, onRideshare, fill);
74
+ }
75
+ }
76
+
77
+ &--colorBaseAlt {
78
+ @include bg-color(neutralAlt);
79
+ }
80
+
81
+ &--colorAccentAlt {
26
82
  @include bg-color(accentAlt);
27
83
 
28
84
  .cobalt-Icon {
@@ -30,7 +86,7 @@
30
86
  }
31
87
  }
32
88
 
33
- &--colorDisabled {
89
+ &--colorDisabledAlt {
34
90
  @include bg-color(disabled);
35
91
 
36
92
  .cobalt-Icon {
@@ -38,7 +94,7 @@
38
94
  }
39
95
  }
40
96
 
41
- &--colorError {
97
+ &--colorErrorAlt {
42
98
  @include bg-color(errorAlt);
43
99
 
44
100
  .cobalt-Icon {
@@ -46,7 +102,7 @@
46
102
  }
47
103
  }
48
104
 
49
- &--colorInfo {
105
+ &--colorInfoAlt {
50
106
  @include bg-color(info);
51
107
 
52
108
  .cobalt-Icon {
@@ -54,7 +110,7 @@
54
110
  }
55
111
  }
56
112
 
57
- &--colorSuccess {
113
+ &--colorSuccessAlt {
58
114
  @include bg-color(successAlt);
59
115
 
60
116
  .cobalt-Icon {
@@ -62,7 +118,7 @@
62
118
  }
63
119
  }
64
120
 
65
- &--colorConnect {
121
+ &--colorConnectAlt {
66
122
  @include bg-color(connectAlt);
67
123
 
68
124
  .cobalt-Icon {
@@ -1,15 +1,9 @@
1
1
  .cobalt- {
2
2
  &Note {
3
- @include c-text-body-md;
4
- @include text-color(info);
5
- @include bg-color(info);
3
+ @apply c-text-body-md c-bg-info c-text-info c-p-sm c-rounded-lg;
6
4
 
7
5
  display: inline-block;
8
6
 
9
- padding: spacing(sm);
10
-
11
- border-radius: border-radius(lg);
12
-
13
7
  a {
14
8
  color: inherit;
15
9
  }
@@ -18,4 +12,8 @@
18
12
  &Note--fullWidth {
19
13
  display: block;
20
14
  }
15
+
16
+ &Note--error {
17
+ @apply c-bg-errorAlt c-text-error;
18
+ }
21
19
  }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { IconColorsType } from "../Icon";
3
3
  type Extends<T, U extends T> = U;
4
- type ContainedIconColorType = Extends<IconColorsType, "base" | "accent" | "disabled" | "error" | "info" | "success" | "connect">;
4
+ type ContainedIconColorType = Extends<IconColorsType, "base" | "accent" | "disabled" | "error" | "info" | "success" | "connect" | "keyExchange" | "rideshare" | "accentAlt" | "disabledAlt" | "errorAlt" | "infoAlt" | "successAlt" | "connectAlt"> | "baseAlt";
5
5
  export type ContainedIconPropsType = {
6
6
  icon: React.JSX.Element;
7
7
  color?: ContainedIconColorType;
@@ -7,6 +7,7 @@ export interface NoteProps {
7
7
  */
8
8
  fullWidth?: boolean;
9
9
  className?: string;
10
+ isError?: boolean;
10
11
  }
11
- export declare const Note: ({ children, fullWidth, className }: NoteProps) => React.JSX.Element;
12
+ export declare const Note: ({ children, fullWidth, className, isError, }: NoteProps) => React.JSX.Element;
12
13
  export default Note;
@@ -1 +1 @@
1
- {"version":3,"file":"getCobaltTailwindcssConfig.js","sources":["../../utils/getCobaltTailwindcssConfig.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireGetCobaltTailwindcssConfig } from \"/Users/cedric/Dev/drivy/cobalt/utils/getCobaltTailwindcssConfig.js\";\nvar getCobaltTailwindcssConfigExports = requireGetCobaltTailwindcssConfig();\nexport { getCobaltTailwindcssConfigExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(getCobaltTailwindcssConfigExports);"],"names":[],"mappings":";;;AAEA,IAAI,iCAAiC,GAAG,iCAAiC,EAAE,CAAC;AAE5E,iCAAe,aAAa,uBAAuB,CAAC,iCAAiC,CAAC;;;;"}
1
+ {"version":3,"file":"getCobaltTailwindcssConfig.js","sources":["../../utils/getCobaltTailwindcssConfig.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireGetCobaltTailwindcssConfig } from \"/Users/thibaudesnouf/sources/cobalt/utils/getCobaltTailwindcssConfig.js\";\nvar getCobaltTailwindcssConfigExports = requireGetCobaltTailwindcssConfig();\nexport { getCobaltTailwindcssConfigExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(getCobaltTailwindcssConfigExports);"],"names":[],"mappings":";;;AAEA,IAAI,iCAAiC,GAAG,iCAAiC,EAAE,CAAC;AAE5E,iCAAe,aAAa,uBAAuB,CAAC,iCAAiC,CAAC;;;;"}