@drivy/cobalt 2.4.0 → 2.5.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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
3
 
4
- const Callout = ({ title, children, cta, variant = "neutral", illustrationUrl, }) => {
4
+ const Callout = ({ title, children, cta, variant = "neutral", illustrationUrl, className, }) => {
5
5
  // force CTA to match Callout variant
6
6
  const enforcedCTA = cta && React.isValidElement(cta)
7
7
  ? React.cloneElement(cta, {
@@ -13,7 +13,7 @@ const Callout = ({ title, children, cta, variant = "neutral", illustrationUrl, }
13
13
  "cobalt-callout--warning": variant === "warning",
14
14
  "cobalt-callout--neutral": variant === "neutral",
15
15
  "cobalt-callout--error": variant === "error",
16
- }) },
16
+ }, className) },
17
17
  React.createElement("div", { className: "cobalt-callout__content" },
18
18
  title && React.createElement("div", { className: "cobalt-callout__title" }, title),
19
19
  React.createElement("div", { className: "cobalt-callout__body" }, children),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Callout/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\nimport { SmallButtonElement } from \"../Buttons/SmallButton\"\nexport interface CalloutProps {\n children: React.ReactNode\n title?: string\n cta?: React.ReactNode\n illustrationUrl?: string\n variant: \"warning\" | \"neutral\" | \"error\"\n}\n\nexport const Callout = ({\n title,\n children,\n cta,\n variant = \"neutral\",\n illustrationUrl,\n}: CalloutProps) => {\n // force CTA to match Callout variant\n const enforcedCTA =\n cta && React.isValidElement(cta)\n ? React.cloneElement(cta as SmallButtonElement, {\n variant: variant === \"error\" ? \"primary\" : variant,\n destructive: variant === \"error\",\n })\n : cta\n\n return (\n <div\n className={cx(\"cobalt-callout\", {\n \"cobalt-callout--warning\": variant === \"warning\",\n \"cobalt-callout--neutral\": variant === \"neutral\",\n \"cobalt-callout--error\": variant === \"error\",\n })}\n >\n <div className=\"cobalt-callout__content\">\n {title && <div className=\"cobalt-callout__title\">{title}</div>}\n <div className=\"cobalt-callout__body\">{children}</div>\n {enforcedCTA}\n </div>\n {illustrationUrl && (\n <img className=\"cobalt-callout__illustration\" src={illustrationUrl} />\n )}\n </div>\n )\n}\n\nexport default Callout\n"],"names":[],"mappings":";;;AAWa,MAAA,OAAO,GAAG,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,OAAO,GAAG,SAAS,EACnB,eAAe,GACF,KAAI;;IAEjB,MAAM,WAAW,GACf,GAAG,IAAI,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC;AAC9B,UAAE,KAAK,CAAC,YAAY,CAAC,GAAyB,EAAE;YAC5C,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,GAAG,OAAO;YAClD,WAAW,EAAE,OAAO,KAAK,OAAO;SACjC,CAAC;UACF,GAAG,CAAA;AAET,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE;YAC9B,yBAAyB,EAAE,OAAO,KAAK,SAAS;YAChD,yBAAyB,EAAE,OAAO,KAAK,SAAS;YAChD,uBAAuB,EAAE,OAAO,KAAK,OAAO;SAC7C,CAAC,EAAA;QAEF,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,yBAAyB,EAAA;AACrC,YAAA,KAAK,IAAI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,KAAK,CAAO;AAC9D,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sBAAsB,EAAA,EAAE,QAAQ,CAAO;AACrD,YAAA,WAAW,CACR;AACL,QAAA,eAAe,KACd,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,8BAA8B,EAAC,GAAG,EAAE,eAAe,EAAA,CAAI,CACvE,CACG,EACP;AACH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Callout/index.tsx"],"sourcesContent":["import React from \"react\"\nimport cx from \"classnames\"\nimport { SmallButtonElement } from \"../Buttons/SmallButton\"\n\nexport type CalloutPropsType = React.PropsWithChildren<{\n title?: string\n cta?: React.ReactNode\n illustrationUrl?: string\n variant: \"warning\" | \"neutral\" | \"error\"\n className?: string\n}>\n\nexport const Callout = ({\n title,\n children,\n cta,\n variant = \"neutral\",\n illustrationUrl,\n className,\n}: CalloutPropsType) => {\n // force CTA to match Callout variant\n const enforcedCTA =\n cta && React.isValidElement(cta)\n ? React.cloneElement(cta as SmallButtonElement, {\n variant: variant === \"error\" ? \"primary\" : variant,\n destructive: variant === \"error\",\n })\n : cta\n\n return (\n <div\n className={cx(\n \"cobalt-callout\",\n {\n \"cobalt-callout--warning\": variant === \"warning\",\n \"cobalt-callout--neutral\": variant === \"neutral\",\n \"cobalt-callout--error\": variant === \"error\",\n },\n className\n )}\n >\n <div className=\"cobalt-callout__content\">\n {title && <div className=\"cobalt-callout__title\">{title}</div>}\n <div className=\"cobalt-callout__body\">{children}</div>\n {enforcedCTA}\n </div>\n {illustrationUrl && (\n <img className=\"cobalt-callout__illustration\" src={illustrationUrl} />\n )}\n </div>\n )\n}\n\nexport default Callout\n"],"names":[],"mappings":";;;MAYa,OAAO,GAAG,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,OAAO,GAAG,SAAS,EACnB,eAAe,EACf,SAAS,GACQ,KAAI;;IAErB,MAAM,WAAW,GACf,GAAG,IAAI,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC;AAC9B,UAAE,KAAK,CAAC,YAAY,CAAC,GAAyB,EAAE;YAC5C,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,GAAG,OAAO;YAClD,WAAW,EAAE,OAAO,KAAK,OAAO;SACjC,CAAC;UACF,GAAG,CAAA;AAET,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CACX,gBAAgB,EAChB;YACE,yBAAyB,EAAE,OAAO,KAAK,SAAS;YAChD,yBAAyB,EAAE,OAAO,KAAK,SAAS;YAChD,uBAAuB,EAAE,OAAO,KAAK,OAAO;AAC7C,SAAA,EACD,SAAS,CACV,EAAA;QAED,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,yBAAyB,EAAA;AACrC,YAAA,KAAK,IAAI,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,uBAAuB,EAAA,EAAE,KAAK,CAAO;AAC9D,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sBAAsB,EAAA,EAAE,QAAQ,CAAO;AACrD,YAAA,WAAW,CACR;AACL,QAAA,eAAe,KACd,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,8BAA8B,EAAC,GAAG,EAAE,eAAe,EAAA,CAAI,CACvE,CACG,EACP;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/src/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "*.scss"
10
10
  ],
11
11
  "engines": {
12
- "node": ">=22.14.0"
12
+ "node": ">=22.21.0"
13
13
  },
14
14
  "module": "src/index.js",
15
15
  "license": "MIT",
@@ -19,17 +19,17 @@
19
19
  "url": "https://github.com/TimPetricola"
20
20
  },
21
21
  "dependencies": {
22
- "@ark-ui/react": "5.14.1",
22
+ "@ark-ui/react": "5.26.2",
23
23
  "@juggle/resize-observer": "3.4.0",
24
- "@lottiefiles/react-lottie-player": "3.5.4",
24
+ "@lottiefiles/react-lottie-player": "3.6.0",
25
25
  "@tippyjs/react": "4.2.6",
26
26
  "classnames": "2.5.1",
27
27
  "date-fns": "2.30.0",
28
28
  "lodash.throttle": "4.1.1",
29
29
  "media-typer": "1.1.0",
30
- "nanoid": "5.1.5",
30
+ "nanoid": "5.1.6",
31
31
  "postcss": "8.5.6",
32
- "tailwindcss": "3.4.17",
32
+ "tailwindcss": "3.4.18",
33
33
  "tippy.js": "6.3.7"
34
34
  },
35
35
  "peerDependencies": {
@@ -51,7 +51,7 @@
51
51
  "@storybook/react": "7.6.20",
52
52
  "@storybook/react-webpack5": "7.6.20",
53
53
  "@svgr/cli": "7.0.0",
54
- "@testing-library/jest-dom": "6.8.0",
54
+ "@testing-library/jest-dom": "6.9.1",
55
55
  "@testing-library/react": "16.3.0",
56
56
  "@testing-library/react-hooks": "8.0.1",
57
57
  "@types/fs-extra": "11.0.4",
@@ -62,7 +62,7 @@
62
62
  "@types/react": "18.3.24",
63
63
  "@types/react-dom": "18.3.7",
64
64
  "autoprefixer": "10.4.21",
65
- "core-js": "3.45.1",
65
+ "core-js": "3.46.0",
66
66
  "css-loader": "7.1.2",
67
67
  "eslint": "8.57.1",
68
68
  "eslint-plugin-storybook": "^0.12.0",
@@ -88,7 +88,7 @@
88
88
  "rollup-plugin-copy": "3.5.0",
89
89
  "rollup-plugin-svgo": "2.0.0",
90
90
  "rollup-plugin-typescript2": "0.36.0",
91
- "sass": "1.93.0",
91
+ "sass": "1.93.2",
92
92
  "sass-loader": "13.3.3",
93
93
  "sharp-cli": "5.2.0",
94
94
  "storybook": "7.6.20",
@@ -96,8 +96,8 @@
96
96
  "stylelint": "15.11.0",
97
97
  "svg2vectordrawable": "2.9.1",
98
98
  "svgo": "3.3.2",
99
- "ts-jest": "29.4.4",
100
- "tsx": "4.20.5",
99
+ "ts-jest": "29.4.5",
100
+ "tsx": "4.20.6",
101
101
  "typescript": "5.4.5"
102
102
  },
103
103
  "keywords": [
@@ -0,0 +1,7 @@
1
+ .cobalt-notice {
2
+ @apply c-text-body-sm c-text-onSurfaceVariant c-flex c-gap-xs;
3
+
4
+ &__content {
5
+ padding-top: 1px;
6
+ }
7
+ }
@@ -37,3 +37,4 @@
37
37
  @import "./components/ContainedIcon/index";
38
38
  @import "./components/PlateNumber/index";
39
39
  @import "./components/Sidepanel/index";
40
+ @import "./components/Notice/index";
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
- export interface CalloutProps {
3
- children: React.ReactNode;
2
+ export type BannerPropsType = React.PropsWithChildren<{
4
3
  title?: string;
5
4
  cta?: React.ReactNode;
6
5
  illustrationUrl?: string;
7
6
  illustrationHeight?: number;
8
7
  variant: "secondary" | "tertiary" | "business";
9
- }
10
- export declare const Banner: ({ title, children, cta, variant, illustrationUrl, illustrationHeight, }: CalloutProps) => React.JSX.Element;
8
+ className?: string;
9
+ }>;
10
+ export declare const Banner: ({ title, children, cta, variant, illustrationUrl, illustrationHeight, className, }: BannerPropsType) => React.JSX.Element;
11
11
  export default Banner;
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- export interface CalloutProps {
3
- children: React.ReactNode;
2
+ export type CalloutPropsType = React.PropsWithChildren<{
4
3
  title?: string;
5
4
  cta?: React.ReactNode;
6
5
  illustrationUrl?: string;
7
6
  variant: "warning" | "neutral" | "error";
8
- }
9
- export declare const Callout: ({ title, children, cta, variant, illustrationUrl, }: CalloutProps) => React.JSX.Element;
7
+ className?: string;
8
+ }>;
9
+ export declare const Callout: ({ title, children, cta, variant, illustrationUrl, className, }: CalloutPropsType) => React.JSX.Element;
10
10
  export default Callout;
@@ -0,0 +1,6 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ export type NoticePropsType = PropsWithChildren<{
3
+ withIcon?: boolean;
4
+ }>;
5
+ export declare const Notice: ({ withIcon, children }: NoticePropsType) => React.JSX.Element;
6
+ export default Notice;