@drivy/cobalt 0.25.0 → 0.26.0

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 (66) hide show
  1. package/cjs/tokens/theme.js +86 -79
  2. package/cjs/tokens/theme.js.map +1 -1
  3. package/components/Callout/index.js +3 -1
  4. package/components/Callout/index.js.map +1 -1
  5. package/components/Flash/index.js +1 -1
  6. package/components/Flash/index.js.map +1 -1
  7. package/components/Rating/RatingIcons.js +2 -2
  8. package/components/Rating/RatingIcons.js.map +1 -1
  9. package/package.json +13 -13
  10. package/styles/components/BasicCell/index.scss +8 -6
  11. package/styles/components/BulletList/index.scss +2 -2
  12. package/styles/components/Buttons/GhostButton/index.scss +4 -4
  13. package/styles/components/Buttons/index.scss +5 -3
  14. package/styles/components/Calendar/CalendarRangePicker/index.scss +39 -17
  15. package/styles/components/Calendar/CalendarView/index.scss +10 -9
  16. package/styles/components/Callout/index.scss +37 -29
  17. package/styles/components/Card/index.scss +9 -10
  18. package/styles/components/Cell/index.scss +5 -4
  19. package/styles/components/Chip/index.scss +12 -15
  20. package/styles/components/EmptyState/index.scss +5 -5
  21. package/styles/components/Flash/index.scss +21 -7
  22. package/styles/components/Form/Autocomplete/index.scss +3 -3
  23. package/styles/components/Form/CheckablePill.scss +3 -3
  24. package/styles/components/Form/Checkmark.scss +3 -3
  25. package/styles/components/Form/ComposedField.scss +2 -2
  26. package/styles/components/Form/Fieldset.scss +6 -6
  27. package/styles/components/Form/Hint.scss +3 -3
  28. package/styles/components/Form/RadioWithDetails.scss +1 -1
  29. package/styles/components/Form/Select.scss +1 -1
  30. package/styles/components/Form/Slider.scss +7 -7
  31. package/styles/components/Form/Stepper.scss +2 -2
  32. package/styles/components/Form/TextArea.scss +2 -2
  33. package/styles/components/Form/TextInput.scss +1 -1
  34. package/styles/components/Form/ToggleSwitch.scss +4 -4
  35. package/styles/components/Form/field.scss +5 -5
  36. package/styles/components/Form/form.scss +2 -2
  37. package/styles/components/Helper/index.scss +1 -1
  38. package/styles/components/Icon/iconColors.scss +46 -42
  39. package/styles/components/Icon/index.scss +9 -2
  40. package/styles/components/Modal/index.scss +1 -1
  41. package/styles/components/Note/index.scss +2 -2
  42. package/styles/components/Pill/index.scss +3 -5
  43. package/styles/components/Popover/index.scss +1 -1
  44. package/styles/components/PriceTable/index.scss +1 -1
  45. package/styles/components/ProgressBar/index.scss +6 -5
  46. package/styles/components/Rating/index.scss +3 -3
  47. package/styles/components/TabBar/index.scss +9 -12
  48. package/styles/components/Tabs/index.scss +9 -11
  49. package/styles/components/Tag/index.scss +3 -2
  50. package/styles/core/_colors-map.scss +83 -76
  51. package/styles/core/card.scss +1 -0
  52. package/styles/core/color.scss +4 -0
  53. package/styles/core/fonts.scss +0 -2
  54. package/styles/core/global-variables.scss +1 -1
  55. package/styles/core/text.scss +29 -8
  56. package/styles/core/theme.scss +64 -57
  57. package/styles/core/typography.scss +14 -12
  58. package/styles/fonts/README.md +2 -2
  59. package/styles/fonts/{BrandFont.woff → placeholder-BrandFont.woff} +0 -0
  60. package/styles/global/typography.scss +1 -1
  61. package/styles/index.scss +1 -1
  62. package/tokens/theme.js +86 -79
  63. package/tokens/theme.js.map +1 -1
  64. package/types/components/Icon/index.d.ts +1 -1
  65. package/types/tokens/index.d.ts +73 -66
  66. package/utilities.css +132 -108
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const background = {
6
+ primary: "grey.lighter/white/black.500",
7
+ secondary: "white/white/black.300",
8
+ secondaryInteractive: {
9
+ DEFAULT: "white/white/black.300",
10
+ hover: "grey.lighter/navy.50/black.300"
11
+ },
6
12
  accent: "purple/purple.500/purpleDeep.400",
7
13
  accentInteractive: {
8
14
  DEFAULT: "purple/purple.500/purpleDeep.400",
@@ -13,30 +19,58 @@ const background = {
13
19
  DEFAULT: "indigo/purple.100/purpleDeep.900",
14
20
  hover: "indigo/purpleLight.100/purpleDeep.900"
15
21
  },
16
- connect: "turquoise/turquoise.500/turquoise.500",
17
- connectInteractive: {
18
- DEFAULT: "turquoise/turquoise.500/turquoise.500",
19
- hover: "turquoise/turquoise.700/turquoise.500"
20
- },
21
- driver: "deprecatedDriver/yellow.500/yellow.500",
22
+ info: "grey.lighter/yellow.100/yellow.1000",
22
23
  error: "red/red.500/red.500",
23
24
  errorInteractive: {
24
25
  DEFAULT: "red/red.500/red.500",
25
26
  hover: "red/red.700/red.500"
26
27
  },
27
28
  errorAlt: "graphite/red.100/red.900",
28
- info: "grey.lighter/yellow.100/yellow.1000",
29
- neutral: "grey.light/navy.100/black.50",
30
- neutralAlt: "grey.lighter/navy.50/black.100",
29
+ success: "green/green.700/green.700",
30
+ successAlt: "graphite/green.100/green.1000",
31
+ connect: "turquoise/turquoise.500/turquoise.500",
32
+ connectInteractive: {
33
+ DEFAULT: "turquoise/turquoise.500/turquoise.500",
34
+ hover: "turquoise/turquoise.700/turquoise.500"
35
+ },
36
+ driver: "deprecatedDriver/yellow.500/yellow.500",
31
37
  owner: "indigo.dark/navy.700/navy.700",
32
- primary: "grey.lighter/white/black.500",
33
- secondary: "white/white/black.300",
34
- secondaryInteractive: {
35
- DEFAULT: "white/white/black.300",
36
- hover: "grey.lighter/navy.50/black.300"
38
+ disabled: "grey.light/navy.100/black.50",
39
+ neutral: "grey.light/navy.100/black.50",
40
+ neutralAlt: "grey.lighter/navy.50/black.100"
41
+ };
42
+ const text = {
43
+ base: "graphite/navy.700/grey.100",
44
+ baseInteractive: {
45
+ DEFAULT: "graphite/navy.700/grey.100",
46
+ hover: "graphite/navy.900/grey.100"
47
+ },
48
+ subdued: "graphite.light/navy.300/grey.300",
49
+ subduedInteractive: {
50
+ DEFAULT: "graphite.light/navy.300/grey.300",
51
+ hover: "graphite/navy.500/grey.300"
52
+ },
53
+ accent: "purple/purple.500/purpleDeep.400",
54
+ accentInteractive: {
55
+ DEFAULT: "blue/purple.500/purpleDeep.400",
56
+ hover: "blue/purple.700/purpleDeep.400"
57
+ },
58
+ accentAlt: "white/purple.500/grey.100",
59
+ accentAltInteractive: {
60
+ DEFAULT: "white/purple.500/grey.100",
61
+ hover: "indigo/purple.700/grey.100"
37
62
  },
63
+ info: "graphite.light/yellow.900/yellow.300",
64
+ error: "red/red.500/red.400",
65
+ errorAlt: "white/red.500/red.500",
38
66
  success: "green/green.700/green.700",
39
- successAlt: "graphite/green.100/green.1000"
67
+ successAlt: "white/green.900/green.100",
68
+ connect: "turquoise/turquoise.500/turquoise.500",
69
+ driver: "graphite/navy.700/navy.700",
70
+ owner: "white/white/grey.100",
71
+ warning: "coral/orange.500/orange.300",
72
+ infoAlt: "turquoise/yellow.500/yellow.700",
73
+ inversed: "white/white/white"
40
74
  };
41
75
  const buttonBackground = {
42
76
  selected: "indigo/purple.100/purpleDeep.900",
@@ -128,14 +162,17 @@ const buttonLabel = {
128
162
  press: "blue/purple.900/purpleDeep.400"
129
163
  }
130
164
  };
131
- const fill = {
132
- accent: "purple/purple.500/purpleDeep.400",
133
- accentAlt: "purple/purple.100/purpleDeep.900",
134
- disabled: "grey.dark/navy.300/grey.300",
135
- secondary: "turquoise/yellow.500/yellow.500",
136
- subdued: "grey.light/navy.100/black.50"
137
- };
138
165
  const icon = {
166
+ base: "graphite/navy.500/grey.100",
167
+ baseInteractive: {
168
+ DEFAULT: "graphite/navy.500/grey.100",
169
+ hover: "graphite/navy.700/grey.100"
170
+ },
171
+ subdued: "graphite.light/navy.300/grey.300",
172
+ subduedInteractive: {
173
+ DEFAULT: "graphite.light/navy.300/grey.300",
174
+ hover: "graphite/navy.500/grey.300"
175
+ },
139
176
  accent: "purple/purple.500/purpleDeep.400",
140
177
  accentInteractive: {
141
178
  DEFAULT: "purple/purple.500/purpleDeep.400",
@@ -146,29 +183,27 @@ const icon = {
146
183
  DEFAULT: "white/purple.500/grey.100",
147
184
  hover: "indigo/purple.700/grey.100"
148
185
  },
149
- base: "graphite/navy.500/grey.100",
150
- baseInteractive: {
151
- DEFAULT: "graphite/navy.500/grey.100",
152
- hover: "graphite/navy.700/grey.100"
153
- },
154
- connect: "turquoise/turquoise.500/white",
155
- driver: "graphite/navy.700//navy.700",
186
+ info: "graphite.light/yellow.900/yellow.300",
156
187
  error: "red/red.500/red.400",
157
188
  errorAlt: "red/red.500/red.200",
158
- info: "graphite.light/yellow.900/yellow.300",
159
- infoAlt: "turquoise/yellow.500/yellow.700",
160
- inversed: "white/white/white",
161
- owner: "white/white/white",
162
- subdued: "graphite.light/navy.300/grey.300",
163
- subduedInteractive: {
164
- DEFAULT: "graphite.light/navy.300/grey.300",
165
- hover: "graphite/navy.500/grey.300"
166
- },
167
189
  success: "green/green.700/green.700",
168
190
  successAlt: "white/green.900/green.100",
169
- warning: "coral/orange.500/orange.300"
191
+ connect: "turquoise/turquoise.500/white",
192
+ driver: "graphite/navy.700//navy.700",
193
+ owner: "white/white/white",
194
+ warning: "coral/orange.500/orange.300",
195
+ infoAlt: "turquoise/yellow.500/yellow.700",
196
+ inversed: "white/white/white",
197
+ disabled: "grey.lighter/navy.100/black.50"
170
198
  };
171
199
  const stroke = {
200
+ base: "grey/navy.100/black.50",
201
+ baseInteractive: {
202
+ DEFAULT: "grey/navy.100/black.50",
203
+ hover: "graphite.light/navy.300/purpleDeep.400",
204
+ press: "graphite/navy.500/purpleDeep.400"
205
+ },
206
+ subdued: "grey.light/navy.100/black.50",
172
207
  accent: "indigo/purple.500/purpleDeep.400",
173
208
  accentInteractive: {
174
209
  DEFAULT: "indigo/purple.500/purpleDeep.400",
@@ -176,60 +211,32 @@ const stroke = {
176
211
  press: "indigo.dark/purple.900/purpleDeep.400"
177
212
  },
178
213
  accentAlt: "purple/purple.300/purpleDeep.700",
179
- base: "grey/navy.100/black.50",
180
- baseInteractive: {
181
- DEFAULT: "grey/navy.100/black.50",
182
- hover: "graphite.light/navy.300/purpleDeep.400",
183
- press: "graphite/navy.500/purpleDeep.400"
184
- },
185
214
  error: "red/red.500/red.200",
186
215
  errorAlt: "red/red.500/red.200",
187
- subdued: "grey.light/navy.100/black.50",
188
216
  success: "green/green.500/green.700",
189
217
  successAlt: "green/green.500/green.700"
190
218
  };
191
- const text = {
219
+ const fill = {
220
+ base: "graphite/navy.500/grey.100",
221
+ secondary: "turquoise/yellow.500/yellow.500",
222
+ subdued: "grey.light/navy.100/black.50",
192
223
  accent: "purple/purple.500/purpleDeep.400",
193
- accentInteractive: {
194
- DEFAULT: "blue/purple.500/purpleDeep.400",
195
- hover: "blue/purple.700/purpleDeep.400"
196
- },
197
- accentAlt: "white/purple.500/grey.100",
198
- accentAltInteractive: {
199
- DEFAULT: "white/purple.500/grey.100",
200
- hover: "indigo/purple.700/grey.100"
201
- },
202
- base: "graphite/navy.700/grey.100",
203
- baseInteractive: {
204
- DEFAULT: "graphite/navy.700/grey.100",
205
- hover: "graphite/navy.900/grey.100"
206
- },
207
- connect: "turquoise/turquoise.500/turquoise.500",
208
- driver: "graphite/navy.700/navy.700",
209
- error: "red/red.500/red.400",
210
- errorAlt: "white/red.500/red.500",
211
- info: "graphite.light/yellow.900/yellow.300",
212
- infoAlt: "turquoise/yellow.500/yellow.700",
213
- inversed: "white/white/white",
214
- owner: "white/white/grey.100",
215
- subdued: "graphite.light/navy.300/grey.300",
216
- subduedInteractive: {
217
- DEFAULT: "graphite.light/navy.300/grey.300",
218
- hover: "graphite/navy.500/grey.300"
219
- },
220
- success: "green/green.700/green.700",
221
- successAlt: "white/green.900/green.100",
222
- warning: "coral/orange.500/orange.300"
224
+ accentAlt: "purple/purple.100/purpleDeep.900",
225
+ success: "red/red.500/red.500",
226
+ error: "green/green.500/green.700",
227
+ negative: "red/red.150/red.900",
228
+ neutral: "grey.lighter/navy.50/black.100",
229
+ disabled: "grey.dark/navy.300/grey.300"
223
230
  };
224
231
  var _theme = {
225
232
  background: background,
233
+ text: text,
226
234
  buttonBackground: buttonBackground,
227
235
  buttonIcon: buttonIcon,
228
236
  buttonLabel: buttonLabel,
229
- fill: fill,
230
237
  icon: icon,
231
238
  stroke: stroke,
232
- text: text
239
+ fill: fill
233
240
  };
234
241
 
235
242
  exports.background = background;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"theme.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
+ import '../Icon/index.js';
4
+ import CloseIcon from '../Icon/__generated__/CloseIcon.js';
3
5
 
4
6
  const Callout = ({ title, children, status = "info", close, }) => (React.createElement("div", { className: cx("cobalt-Callout cobalt-bottom_margin_tight", {
5
7
  "cobalt-Callout--info": status === "info",
@@ -9,7 +11,7 @@ const Callout = ({ title, children, status = "info", close, }) => (React.createE
9
11
  title && React.createElement("div", { className: "cobalt-Callout__Title" }, title),
10
12
  React.createElement("p", null, children),
11
13
  close && (React.createElement("button", { className: "cobalt-Callout__Close", onClick: close, type: "button" },
12
- React.createElement("span", { "aria-hidden": "true" }, "\u00D7")))));
14
+ React.createElement(CloseIcon, { color: "subduedInteractive", contained: true, size: 16 })))));
13
15
 
14
16
  export { Callout, Callout as default };
15
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Callout/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\n\nexport interface CalloutProps {\n children: React.ReactNode\n title?: string\n status: \"info\" | \"error\" | \"success\"\n close?: () => void\n}\n\nexport const Callout = ({\n title,\n children,\n status = \"info\",\n close,\n}: CalloutProps) => (\n <div\n className={cx(\"cobalt-Callout cobalt-bottom_margin_tight\", {\n \"cobalt-Callout--info\": status === \"info\",\n \"cobalt-Callout--error\": status === \"error\",\n \"cobalt-Callout--success\": status === \"success\",\n })}\n >\n {title && <div className=\"cobalt-Callout__Title\">{title}</div>}\n <p>{children}</p>\n {close && (\n <button className=\"cobalt-Callout__Close\" onClick={close} type=\"button\">\n <span aria-hidden=\"true\">×</span>\n </button>\n )}\n </div>\n)\n\nexport default Callout\n"],"names":[],"mappings":";;;AAUa,MAAA,OAAO,GAAG,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,MAAM,EACf,KAAK,GACQ,MACb,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,2CAA2C,EAAE;QACzD,sBAAsB,EAAE,MAAM,KAAK,MAAM;QACzC,uBAAuB,EAAE,MAAM,KAAK,OAAO;QAC3C,yBAAyB,EAAE,MAAM,KAAK,SAAS;KAChD,CAAC,EAAA;AAED,IAAA,KAAK,IAAI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,KAAK,CAAO;AAC9D,IAAA,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,IAAA,EAAI,QAAQ,CAAK;AAChB,IAAA,KAAK,KACJ,KAAQ,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAA;AACrE,QAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,EAAS,EAAA,QAAA,CAAA,CAC1B,CACV,CACG;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Callout/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\nimport { CloseIcon } from \"../Icon\"\n\nexport interface CalloutProps {\n children: React.ReactNode\n title?: string\n status: \"info\" | \"error\" | \"success\"\n close?: () => void\n}\n\nexport const Callout = ({\n title,\n children,\n status = \"info\",\n close,\n}: CalloutProps) => (\n <div\n className={cx(\"cobalt-Callout cobalt-bottom_margin_tight\", {\n \"cobalt-Callout--info\": status === \"info\",\n \"cobalt-Callout--error\": status === \"error\",\n \"cobalt-Callout--success\": status === \"success\",\n })}\n >\n {title && <div className=\"cobalt-Callout__Title\">{title}</div>}\n <p>{children}</p>\n {close && (\n <button className=\"cobalt-Callout__Close\" onClick={close} type=\"button\">\n <CloseIcon color=\"subduedInteractive\" contained size={16} />\n </button>\n )}\n </div>\n)\n\nexport default Callout\n"],"names":[],"mappings":";;;;;AAWa,MAAA,OAAO,GAAG,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,MAAM,EACf,KAAK,GACQ,MACb,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,2CAA2C,EAAE;QACzD,sBAAsB,EAAE,MAAM,KAAK,MAAM;QACzC,uBAAuB,EAAE,MAAM,KAAK,OAAO;QAC3C,yBAAyB,EAAE,MAAM,KAAK,SAAS;KAChD,CAAC,EAAA;AAED,IAAA,KAAK,IAAI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,KAAK,CAAO;AAC9D,IAAA,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,IAAA,EAAI,QAAQ,CAAK;AAChB,IAAA,KAAK,KACJ,KAAQ,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAA;AACrE,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAC,EAAA,KAAK,EAAC,oBAAoB,EAAC,SAAS,EAAA,IAAA,EAAC,IAAI,EAAE,EAAE,EAAI,CAAA,CACrD,CACV,CACG;;;;"}
@@ -19,7 +19,7 @@ const Flash = ({ children, status = "info" }) => {
19
19
  const iconColor = STATUS_ICON_COLOR_MAP[status]
20
20
  ? STATUS_ICON_COLOR_MAP[status]
21
21
  : "turquoise";
22
- return (React.createElement("div", { className: "cobalt-Flash" },
22
+ return (React.createElement("div", { className: `cobalt-Flash cobalt-Flash--${status}` },
23
23
  React.createElement("div", { className: "cobalt-Flash__wrapper" },
24
24
  React.createElement("span", { className: "cobalt-Flash__Icon" },
25
25
  React.createElement(Icon, { source: icon, size: ICON_SIZE, color: iconColor })),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Flash/index.tsx"],"sourcesContent":["import React from \"react\"\nimport { Icon, IconColorsType, IconSources } from \"../Icon\"\n\nexport type FlashStatus = \"info\" | \"success\" | \"error\"\n\nexport interface FlashProps {\n children: React.ReactNode\n status: FlashStatus\n}\n\nconst ICON_SIZE = 20\n\nconst STATUS_ICONS_MAP: { [k in FlashStatus]: IconSources } = {\n info: \"infoFilled\",\n success: \"checkCircle\",\n error: \"contextualWarningCircleFilled\",\n}\n\nconst STATUS_ICON_COLOR_MAP: { [k in FlashStatus]: IconColorsType } = {\n info: \"turquoise\",\n success: \"green\",\n error: \"red\",\n}\n\nexport const Flash = ({ children, status = \"info\" }: FlashProps) => {\n const icon = STATUS_ICONS_MAP[status]\n ? STATUS_ICONS_MAP[status]\n : \"infoFilled\"\n\n const iconColor: IconColorsType = STATUS_ICON_COLOR_MAP[status]\n ? STATUS_ICON_COLOR_MAP[status]\n : \"turquoise\"\n\n return (\n <div className=\"cobalt-Flash\">\n <div className=\"cobalt-Flash__wrapper\">\n <span className=\"cobalt-Flash__Icon\">\n <Icon source={icon} size={ICON_SIZE} color={iconColor} />\n </span>\n <span className=\"cobalt-Flash__content\">{children}</span>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";;;AAUA,MAAM,SAAS,GAAG,EAAE,CAAA;AAEpB,MAAM,gBAAgB,GAAwC;AAC5D,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,KAAK,EAAE,+BAA+B;CACvC,CAAA;AAED,MAAM,qBAAqB,GAA2C;AACpE,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,KAAK,EAAE,KAAK;CACb,CAAA;AAEM,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAc,KAAI;AACjE,IAAA,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC;AACnC,UAAE,gBAAgB,CAAC,MAAM,CAAC;UACxB,YAAY,CAAA;AAEhB,IAAA,MAAM,SAAS,GAAmB,qBAAqB,CAAC,MAAM,CAAC;AAC7D,UAAE,qBAAqB,CAAC,MAAM,CAAC;UAC7B,WAAW,CAAA;AAEf,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,cAAc,EAAA;QAC3B,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;YACpC,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,oBAAoB,EAAA;AAClC,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAI,CACpD;YACP,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,QAAQ,CAAQ,CACrD,CACF,EACP;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Flash/index.tsx"],"sourcesContent":["import React from \"react\"\nimport { Icon, IconColorsType, IconSources } from \"../Icon\"\n\nexport type FlashStatus = \"info\" | \"success\" | \"error\"\n\nexport interface FlashProps {\n children: React.ReactNode\n status: FlashStatus\n}\n\nconst ICON_SIZE = 20\n\nconst STATUS_ICONS_MAP: { [k in FlashStatus]: IconSources } = {\n info: \"infoFilled\",\n success: \"checkCircle\",\n error: \"contextualWarningCircleFilled\",\n}\n\nconst STATUS_ICON_COLOR_MAP: { [k in FlashStatus]: IconColorsType } = {\n info: \"turquoise\",\n success: \"green\",\n error: \"red\",\n}\n\nexport const Flash = ({ children, status = \"info\" }: FlashProps) => {\n const icon = STATUS_ICONS_MAP[status]\n ? STATUS_ICONS_MAP[status]\n : \"infoFilled\"\n\n const iconColor: IconColorsType = STATUS_ICON_COLOR_MAP[status]\n ? STATUS_ICON_COLOR_MAP[status]\n : \"turquoise\"\n\n return (\n <div className={`cobalt-Flash cobalt-Flash--${status}`}>\n <div className=\"cobalt-Flash__wrapper\">\n <span className=\"cobalt-Flash__Icon\">\n <Icon source={icon} size={ICON_SIZE} color={iconColor} />\n </span>\n <span className=\"cobalt-Flash__content\">{children}</span>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";;;AAUA,MAAM,SAAS,GAAG,EAAE,CAAA;AAEpB,MAAM,gBAAgB,GAAwC;AAC5D,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,KAAK,EAAE,+BAA+B;CACvC,CAAA;AAED,MAAM,qBAAqB,GAA2C;AACpE,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,KAAK,EAAE,KAAK;CACb,CAAA;AAEM,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAc,KAAI;AACjE,IAAA,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC;AACnC,UAAE,gBAAgB,CAAC,MAAM,CAAC;UACxB,YAAY,CAAA;AAEhB,IAAA,MAAM,SAAS,GAAmB,qBAAqB,CAAC,MAAM,CAAC;AAC7D,UAAE,qBAAqB,CAAC,MAAM,CAAC;UAC7B,WAAW,CAAA;AAEf,IAAA,QACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,CAAA,2BAAA,EAA8B,MAAM,CAAE,CAAA,EAAA;QACpD,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA;YACpC,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,oBAAoB,EAAA;AAClC,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAI,CACpD;YACP,KAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,QAAQ,CAAQ,CACrD,CACF,EACP;AACH;;;;"}
@@ -4,8 +4,8 @@ import cx from 'classnames';
4
4
  import '../Icon/index.js';
5
5
  import StarIcon from '../Icon/__generated__/StarIcon.js';
6
6
 
7
- const defaultRatingIcon = React.createElement(StarIcon, { color: "turquoise" });
8
- const itemEmptyColor = "grey";
7
+ const defaultRatingIcon = React.createElement(StarIcon, { color: "infoAlt" });
8
+ const itemEmptyColor = "disabled";
9
9
  function roundHalf(num) {
10
10
  const temp = num * 2;
11
11
  return temp % 1 === 0.5 ? Math.floor(temp) / 2 : Math.round(temp) / 2;
@@ -1 +1 @@
1
- {"version":3,"file":"RatingIcons.js","sources":["../../../src/components/Rating/RatingIcons.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback } from \"react\"\nimport { nanoid } from \"nanoid\"\nimport cx from \"classnames\"\nimport { IconProps, StarIcon } from \"../Icon\"\n\nexport type RatingIconsPropsType = {\n className?: string\n max?: 5 | 10\n value: number\n size?: IconProps[\"size\"] | 48\n editable?: boolean\n disabled?: boolean\n onChange?: (newValue: number) => void\n icon?: JSX.Element | JSX.Element[]\n}\n\nexport type RatingIconPropsType = {\n icon: JSX.Element\n status?: \"full\" | \"half\" | \"empty\"\n size?: RatingIconsPropsType[\"size\"]\n}\n\nexport const defaultRatingIcon = <StarIcon color={\"turquoise\"} />\nconst itemEmptyColor: IconProps[\"color\"] = \"grey\"\n\nexport function roundHalf(num: number) {\n const temp = num * 2\n return temp % 1 === 0.5 ? Math.floor(temp) / 2 : Math.round(temp) / 2\n}\n\nexport function computeItemStatus(\n ratingValue: number,\n itemValue: number,\n icon: RatingIconsPropsType[\"icon\"]\n): RatingIconPropsType[\"status\"] {\n let itemStatus: RatingIconPropsType[\"status\"] = \"empty\"\n if (!Array.isArray(icon)) {\n // gauge\n const isHalfItem = itemValue > ratingValue && ratingValue > itemValue - 1\n if (isHalfItem) {\n itemStatus = \"half\"\n } else if (itemValue <= ratingValue) {\n itemStatus = \"full\"\n }\n } else if (itemValue === ratingValue) {\n // radio\n itemStatus = \"full\"\n }\n\n return itemStatus\n}\n\nexport const RatingIcon = ({\n icon,\n status = \"full\",\n size = 24,\n}: RatingIconPropsType) => {\n if (status === \"half\") {\n return (\n <>\n {React.cloneElement(icon, {\n color: itemEmptyColor,\n size,\n })}\n <div className=\"cobalt-rating-icons__icon-half-container\">\n {React.cloneElement(icon, { size })}\n </div>\n </>\n )\n } else {\n const iconColor: IconProps[\"color\"] =\n status === \"empty\" ? itemEmptyColor : icon.props.color\n\n return React.cloneElement(icon, {\n color: iconColor,\n size,\n })\n }\n}\n\nexport const RatingIcons = ({\n className,\n max = 5,\n value,\n size = 24,\n editable = false,\n onChange,\n icon = defaultRatingIcon,\n}: RatingIconsPropsType) => {\n const name = useRef(nanoid())\n\n const items = useRef(\n Array.from(new Array(Array.isArray(icon) ? icon.length : max))\n )\n\n const [ratingValue, setRatingValue] = useState(() =>\n editable ? Math.floor(value) : roundHalf(value)\n )\n const [selectedIndex, setSelectedIndex] = useState(-1) // used to enforce selection effect (icon scale reset)\n\n const resetSelection = useCallback(() => {\n setSelectedIndex(-1)\n }, [])\n\n const itemSize = size === 48 ? 16 : size\n\n // input element is used for a11y purpose ( focus feedback and keyboard selection )\n return (\n <div\n className={cx(\"cobalt-rating-icons\", className, {\n \"cobalt-rating-icons--icon-size-48\": size === 48,\n })}\n onPointerLeave={() => {\n if (editable) {\n ;(document.activeElement as HTMLInputElement).blur()\n }\n }}\n >\n {items.current.map((_value, idx) => {\n const itemValue = idx + 1\n\n const itemStatus = computeItemStatus(ratingValue, itemValue, icon)\n\n return (\n <label\n className={cx(\"cobalt-rating-icons__icon-wrapper\", {\n \"cobalt-rating-icons__icon-wrapper--selected\":\n selectedIndex === idx,\n })}\n key={idx}\n onClick={() => {\n if (editable) {\n setRatingValue(itemValue)\n setSelectedIndex(idx)\n }\n }}\n onMouseEnter={(e) => {\n if (editable) {\n ;(e.target as HTMLElement).focus()\n\n resetSelection()\n }\n }}\n >\n <input\n tabIndex={\n editable &&\n (ratingValue === itemValue ||\n (ratingValue === 0 && itemValue === 1))\n ? 0\n : -1\n }\n name={name.current}\n type=\"radio\"\n value={itemValue}\n onChange={() => {\n onChange && onChange(itemValue)\n }}\n disabled={!editable}\n />\n {\n <RatingIcon\n icon={Array.isArray(icon) ? icon[idx] : icon}\n status={itemStatus}\n size={itemSize}\n />\n }\n </label>\n )\n })}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;AAsBa,MAAA,iBAAiB,GAAG,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,WAAW,EAAA,EAAI;AACjE,MAAM,cAAc,GAAuB,MAAM,CAAA;AAE3C,SAAU,SAAS,CAAC,GAAW,EAAA;AACnC,IAAA,MAAM,IAAI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C,iBAAC,EACD,QAAQ,EAAE,CAAC,QAAQ,EACnB,CAAA;AAEA,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACT,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAC5C,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,QAAQ,EACd,CAAA,CAEE,EACT;KACF,CAAC,CACE,EACP;AACH;;;;"}
1
+ {"version":3,"file":"RatingIcons.js","sources":["../../../src/components/Rating/RatingIcons.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback } from \"react\"\nimport { nanoid } from \"nanoid\"\nimport cx from \"classnames\"\nimport { IconProps, StarIcon } from \"../Icon\"\n\nexport type RatingIconsPropsType = {\n className?: string\n max?: 5 | 10\n value: number\n size?: IconProps[\"size\"] | 48\n editable?: boolean\n disabled?: boolean\n onChange?: (newValue: number) => void\n icon?: JSX.Element | JSX.Element[]\n}\n\nexport type RatingIconPropsType = {\n icon: JSX.Element\n status?: \"full\" | \"half\" | \"empty\"\n size?: RatingIconsPropsType[\"size\"]\n}\n\nexport const defaultRatingIcon = <StarIcon color=\"infoAlt\" />\nconst itemEmptyColor: IconProps[\"color\"] = \"disabled\"\n\nexport function roundHalf(num: number) {\n const temp = num * 2\n return temp % 1 === 0.5 ? Math.floor(temp) / 2 : Math.round(temp) / 2\n}\n\nexport function computeItemStatus(\n ratingValue: number,\n itemValue: number,\n icon: RatingIconsPropsType[\"icon\"]\n): RatingIconPropsType[\"status\"] {\n let itemStatus: RatingIconPropsType[\"status\"] = \"empty\"\n if (!Array.isArray(icon)) {\n // gauge\n const isHalfItem = itemValue > ratingValue && ratingValue > itemValue - 1\n if (isHalfItem) {\n itemStatus = \"half\"\n } else if (itemValue <= ratingValue) {\n itemStatus = \"full\"\n }\n } else if (itemValue === ratingValue) {\n // radio\n itemStatus = \"full\"\n }\n\n return itemStatus\n}\n\nexport const RatingIcon = ({\n icon,\n status = \"full\",\n size = 24,\n}: RatingIconPropsType) => {\n if (status === \"half\") {\n return (\n <>\n {React.cloneElement(icon, {\n color: itemEmptyColor,\n size,\n })}\n <div className=\"cobalt-rating-icons__icon-half-container\">\n {React.cloneElement(icon, { size })}\n </div>\n </>\n )\n } else {\n const iconColor: IconProps[\"color\"] =\n status === \"empty\" ? itemEmptyColor : icon.props.color\n\n return React.cloneElement(icon, {\n color: iconColor,\n size,\n })\n }\n}\n\nexport const RatingIcons = ({\n className,\n max = 5,\n value,\n size = 24,\n editable = false,\n onChange,\n icon = defaultRatingIcon,\n}: RatingIconsPropsType) => {\n const name = useRef(nanoid())\n\n const items = useRef(\n Array.from(new Array(Array.isArray(icon) ? icon.length : max))\n )\n\n const [ratingValue, setRatingValue] = useState(() =>\n editable ? Math.floor(value) : roundHalf(value)\n )\n const [selectedIndex, setSelectedIndex] = useState(-1) // used to enforce selection effect (icon scale reset)\n\n const resetSelection = useCallback(() => {\n setSelectedIndex(-1)\n }, [])\n\n const itemSize = size === 48 ? 16 : size\n\n // input element is used for a11y purpose ( focus feedback and keyboard selection )\n return (\n <div\n className={cx(\"cobalt-rating-icons\", className, {\n \"cobalt-rating-icons--icon-size-48\": size === 48,\n })}\n onPointerLeave={() => {\n if (editable) {\n ;(document.activeElement as HTMLInputElement).blur()\n }\n }}\n >\n {items.current.map((_value, idx) => {\n const itemValue = idx + 1\n\n const itemStatus = computeItemStatus(ratingValue, itemValue, icon)\n\n return (\n <label\n className={cx(\"cobalt-rating-icons__icon-wrapper\", {\n \"cobalt-rating-icons__icon-wrapper--selected\":\n selectedIndex === idx,\n })}\n key={idx}\n onClick={() => {\n if (editable) {\n setRatingValue(itemValue)\n setSelectedIndex(idx)\n }\n }}\n onMouseEnter={(e) => {\n if (editable) {\n ;(e.target as HTMLElement).focus()\n\n resetSelection()\n }\n }}\n >\n <input\n tabIndex={\n editable &&\n (ratingValue === itemValue ||\n (ratingValue === 0 && itemValue === 1))\n ? 0\n : -1\n }\n name={name.current}\n type=\"radio\"\n value={itemValue}\n onChange={() => {\n onChange && onChange(itemValue)\n }}\n disabled={!editable}\n />\n {\n <RatingIcon\n icon={Array.isArray(icon) ? icon[idx] : icon}\n status={itemStatus}\n size={itemSize}\n />\n }\n </label>\n )\n })}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;AAsBa,MAAA,iBAAiB,GAAG,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAC,SAAS,EAAA,EAAG;AAC7D,MAAM,cAAc,GAAuB,UAAU,CAAA;AAE/C,SAAU,SAAS,CAAC,GAAW,EAAA;AACnC,IAAA,MAAM,IAAI,GAAG,GAAG,GAAG,CAAC,CAAA;IACpB,OAAO,IAAI,GAAG,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACvE,CAAC;SAEe,iBAAiB,CAC/B,WAAmB,EACnB,SAAiB,EACjB,IAAkC,EAAA;IAElC,IAAI,UAAU,GAAkC,OAAO,CAAA;AACvD,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;;QAExB,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,IAAI,WAAW,GAAG,SAAS,GAAG,CAAC,CAAA;AACzE,QAAA,IAAI,UAAU,EAAE;YACd,UAAU,GAAG,MAAM,CAAA;AACpB,SAAA;aAAM,IAAI,SAAS,IAAI,WAAW,EAAE;YACnC,UAAU,GAAG,MAAM,CAAA;AACpB,SAAA;AACF,KAAA;SAAM,IAAI,SAAS,KAAK,WAAW,EAAE;;QAEpC,UAAU,GAAG,MAAM,CAAA;AACpB,KAAA;AAED,IAAA,OAAO,UAAU,CAAA;AACnB,CAAC;AAEY,MAAA,UAAU,GAAG,CAAC,EACzB,IAAI,EACJ,MAAM,GAAG,MAAM,EACf,IAAI,GAAG,EAAE,GACW,K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oBAAA,cAAc,EAAE,CAAA;AACjB,iBAAA;aACF,EAAA;YAED,KACE,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,QAAQ,EACN,QAAQ;qBACP,WAAW,KAAK,SAAS;yBACvB,WAAW,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC,CAAC,CAAC;AACvC,sBAAE,CAAC;sBACD,CAAC,CAAC,EAER,IAAI,EAAE,IAAI,CAAC,OAAO,EAClB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,MAAK;AACb,oBAAA,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAA;AACjC,iBAAC,EACD,QAAQ,EAAE,CAAC,QAAQ,EACnB,CAAA;AAEA,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACT,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAC5C,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,QAAQ,EACd,CAAA,CAEE,EACT;KACF,CAAC,CACE,EACP;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -47,35 +47,35 @@
47
47
  "@getaround-eu/stylelint-config": "1.2.5",
48
48
  "@getaround-eu/ts-config": "2.2.0",
49
49
  "@percy/storybook": "3.3.1",
50
- "@rollup/plugin-json": "5.0.1",
50
+ "@rollup/plugin-json": "5.0.2",
51
51
  "@rushstack/eslint-patch": "1.2.0",
52
- "@storybook/addon-essentials": "6.5.13",
53
- "@storybook/addons": "6.5.13",
54
- "@storybook/builder-webpack5": "6.5.13",
55
- "@storybook/manager-webpack5": "6.5.13",
56
- "@storybook/react": "6.5.13",
52
+ "@storybook/addon-essentials": "6.5.14",
53
+ "@storybook/addons": "6.5.14",
54
+ "@storybook/builder-webpack5": "6.5.14",
55
+ "@storybook/manager-webpack5": "6.5.14",
56
+ "@storybook/react": "6.5.14",
57
57
  "@svgr/cli": "6.5.1",
58
58
  "@testing-library/jest-dom": "5.16.5",
59
59
  "@testing-library/react": "13.4.0",
60
60
  "@testing-library/react-hooks": "8.0.1",
61
61
  "@types/classnames": "2.3.0",
62
- "@types/jest": "29.2.3",
62
+ "@types/jest": "29.2.4",
63
63
  "@types/lodash.throttle": "4.1.7",
64
64
  "@types/media-typer": "1.1.1",
65
- "@types/react": "18.0.25",
65
+ "@types/react": "18.0.26",
66
66
  "@whitespace/storybook-addon-html": "^5.0.3",
67
67
  "autoprefixer": "10.4.13",
68
68
  "core-js": "3.26.1",
69
69
  "css-loader": "6.7.2",
70
- "eslint": "8.28.0",
70
+ "eslint": "8.29.0",
71
71
  "file-loader": "6.2.0",
72
72
  "jest": "29.3.1",
73
73
  "jest-environment-jsdom": "29.3.1",
74
74
  "nested-object-access": "^0.2.5",
75
75
  "np": "7.6.2",
76
76
  "postcss-flexbugs-fixes": "5.0.2",
77
- "postcss-loader": "7.0.1",
78
- "prettier": "2.7.1",
77
+ "postcss-loader": "7.0.2",
78
+ "prettier": "2.8.0",
79
79
  "raw-loader": "4.0.2",
80
80
  "react": "18.2.0",
81
81
  "react-dom": "18.2.0",
@@ -92,7 +92,7 @@
92
92
  "sharp": "0.31.2",
93
93
  "sharp-cli": "3.0.0",
94
94
  "style-loader": "3.3.1",
95
- "stylelint": "14.15.0",
95
+ "stylelint": "14.16.0",
96
96
  "svg2vectordrawable": "2.9.1",
97
97
  "svgo": "3.0.2",
98
98
  "ts-jest": "29.0.3",
@@ -1,5 +1,7 @@
1
1
  .cobalt- {
2
2
  &BasicCell {
3
+ @include text-color(base);
4
+
3
5
  display: flex;
4
6
  align-items: center;
5
7
  }
@@ -12,12 +14,12 @@
12
14
  }
13
15
 
14
16
  &BasicCell__Title {
17
+ // TOFIX to replace by small
15
18
  @include text-style-title-tiny;
16
19
  }
17
20
 
18
21
  &BasicCell__Content {
19
- @include text-style-body;
20
- @include text-style--bodySubdued;
22
+ @include c-text-body-md;
21
23
  }
22
24
 
23
25
  &BasicCell__Thumb {
@@ -37,18 +39,18 @@
37
39
  }
38
40
 
39
41
  &BasicCell__LeftAddon {
40
- padding-right: spacing(tight);
42
+ padding-right: spacing(sm);
41
43
  }
42
44
 
43
45
  &BasicCell__RightAddonIcon {
44
- padding-left: spacing(tight);
46
+ padding-left: spacing(sm);
45
47
  margin-left: auto;
46
48
  }
47
49
 
48
50
  &BasicCell--large {
49
51
  .cobalt-BasicCell__Title {
50
- @include text-style-title-small;
51
- margin-bottom: spacing(unit);
52
+ @include c-text-title-sm;
53
+ margin-bottom: spacing("2xs");
52
54
  }
53
55
 
54
56
  .cobalt-BasicCell__Thumb {
@@ -4,7 +4,7 @@
4
4
  align-items: center;
5
5
 
6
6
  &:not(:last-child) {
7
- margin-bottom: spacing(tight);
7
+ margin-bottom: spacing(sm);
8
8
  }
9
9
 
10
10
  .cobalt-BulletList--iconPositionTop & {
@@ -15,7 +15,7 @@
15
15
  &BulletListItem__Icon {
16
16
  display: flex;
17
17
  flex-shrink: 0;
18
- margin-right: spacing(extra-tight);
18
+ margin-right: spacing(xs);
19
19
  }
20
20
 
21
21
  &BulletListItem__Content {
@@ -22,12 +22,12 @@
22
22
  }
23
23
 
24
24
  &.cob-Button__ghost--standalone {
25
- margin-left: #{spacing() * -1};
26
- margin-right: #{spacing() * -1};
25
+ margin-left: #{spacing(md) * -1};
26
+ margin-right: #{spacing(md) * -1};
27
27
 
28
28
  &.cob-Button--large {
29
- margin-left: #{spacing(medium) * -1};
30
- margin-right: #{spacing(medium) * -1};
29
+ margin-left: #{spacing(lg) * -1};
30
+ margin-right: #{spacing(lg) * -1};
31
31
  }
32
32
  }
33
33
 
@@ -28,7 +28,7 @@
28
28
  $height: 40px,
29
29
  $line-height: 20px,
30
30
  $font-size: 16px,
31
- $horizontal-padding: spacing()
31
+ $horizontal-padding: spacing(md)
32
32
  );
33
33
 
34
34
  position: relative;
@@ -135,7 +135,7 @@
135
135
  $height: 56px,
136
136
  $line-height: 24px,
137
137
  $font-size: 18px,
138
- $horizontal-padding: spacing(medium)
138
+ $horizontal-padding: spacing(lg)
139
139
  );
140
140
  }
141
141
  }
@@ -157,7 +157,9 @@
157
157
  &__item {
158
158
  margin-top: spacing(sm);
159
159
 
160
- &:not(.cobalt-buttons-group__item--fullWidth):not(.cobalt-buttons-group__item--xs\:fullWidth) {
160
+ &:not(.cobalt-buttons-group__item--fullWidth):not(
161
+ .cobalt-buttons-group__item--xs\:fullWidth
162
+ ) {
161
163
  margin-right: spacing(sm);
162
164
  }
163
165