@vector-im/compound-web 7.8.0 → 7.9.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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const UnreadCounter_module = require("./UnreadCounter.module.css.cjs");
5
5
  function UnreadCounter({ count, ...props }) {
6
+ if (count === null)
7
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: UnreadCounter_module.default["unread-counter"] });
6
8
  return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: UnreadCounter_module.default["unread-counter"], children: count });
7
9
  }
8
10
  exports.UnreadCounter = UnreadCounter;
@@ -1 +1 @@
1
- {"version":3,"file":"UnreadCounter.cjs","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLSpanElement> {\n count: string | number;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":["jsx","styles"],"mappings":";;;;AAcO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AAEnE,SAAAA,+BAAC,UAAM,GAAG,OAAO,WAAWC,qBAAO,QAAA,gBAAgB,GAChD,UACH,OAAA;AAEJ;;"}
1
+ {"version":3,"file":"UnreadCounter.cjs","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLDivElement> {\n /**\n * The number to display.\n * If `null`, the counter will be empty.\n */\n count: string | number | null;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n if (count === null)\n return <div {...props} className={styles[\"unread-counter\"]} />;\n\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":["styles","jsx"],"mappings":";;;;AAkBO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AACrE,MAAI,UAAU;AACZ,0CAAQ,OAAK,EAAA,GAAG,OAAO,WAAWA,qBAAA,QAAO,gBAAgB,GAAG;AAG5D,SAAAC,+BAAC,UAAM,GAAG,OAAO,WAAWD,qBAAO,QAAA,gBAAgB,GAChD,UACH,OAAA;AAEJ;;"}
@@ -1,6 +1,10 @@
1
1
  import { HTMLProps } from 'react';
2
- interface UnreadCounterProps extends HTMLProps<HTMLSpanElement> {
3
- count: string | number;
2
+ interface UnreadCounterProps extends HTMLProps<HTMLDivElement> {
3
+ /**
4
+ * The number to display.
5
+ * If `null`, the counter will be empty.
6
+ */
7
+ count: string | number | null;
4
8
  }
5
9
  export declare function UnreadCounter({ count, ...props }: UnreadCounterProps): import("react/jsx-runtime").JSX.Element;
6
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"UnreadCounter.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,UAAU,kBAAmB,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC7D,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAMpE"}
1
+ {"version":3,"file":"UnreadCounter.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,UAAU,kBAAmB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CASpE"}
@@ -1,6 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import styles from "./UnreadCounter.module.css.js";
3
3
  function UnreadCounter({ count, ...props }) {
4
+ if (count === null)
5
+ return /* @__PURE__ */ jsx("div", { ...props, className: styles["unread-counter"] });
4
6
  return /* @__PURE__ */ jsx("span", { ...props, className: styles["unread-counter"], children: count });
5
7
  }
6
8
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"UnreadCounter.js","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLSpanElement> {\n count: string | number;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":[],"mappings":";;AAcO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AAEnE,SAAA,oBAAC,UAAM,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAChD,UACH,OAAA;AAEJ;"}
1
+ {"version":3,"file":"UnreadCounter.js","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLDivElement> {\n /**\n * The number to display.\n * If `null`, the counter will be empty.\n */\n count: string | number | null;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n if (count === null)\n return <div {...props} className={styles[\"unread-counter\"]} />;\n\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AACrE,MAAI,UAAU;AACZ,+BAAQ,OAAK,EAAA,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAAG;AAG5D,SAAA,oBAAC,UAAM,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAChD,UACH,OAAA;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vector-im/compound-web",
3
- "version": "7.8.0",
3
+ "version": "7.9.0",
4
4
  "description": "Compound components for the Web",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -8,11 +8,18 @@
8
8
  import React, { HTMLProps } from "react";
9
9
  import styles from "./UnreadCounter.module.css";
10
10
 
11
- interface UnreadCounterProps extends HTMLProps<HTMLSpanElement> {
12
- count: string | number;
11
+ interface UnreadCounterProps extends HTMLProps<HTMLDivElement> {
12
+ /**
13
+ * The number to display.
14
+ * If `null`, the counter will be empty.
15
+ */
16
+ count: string | number | null;
13
17
  }
14
18
 
15
19
  export function UnreadCounter({ count, ...props }: UnreadCounterProps) {
20
+ if (count === null)
21
+ return <div {...props} className={styles["unread-counter"]} />;
22
+
16
23
  return (
17
24
  <span {...props} className={styles["unread-counter"]}>
18
25
  {count}