@cerberus-design/react 0.11.1-next-b643296 → 0.11.1-next-2ed68bd

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.
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/index.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ formatNotifyCount: () => formatNotifyCount
24
+ });
25
+ module.exports = __toCommonJS(utils_exports);
26
+ function formatNotifyCount(count) {
27
+ if (count > 99) return "99+";
28
+ return count.toString();
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ formatNotifyCount
33
+ });
34
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,kBAAkB,OAAuB;AACvD,MAAI,QAAQ,GAAI,QAAO;AACvB,SAAO,MAAM,SAAS;AACxB;","names":[]}
@@ -965,6 +965,24 @@ declare interface FileUploaderProps extends InputHTMLAttributes<HTMLInputElement
965
965
  export { FileUploaderProps }
966
966
  export { FileUploaderProps as FileUploaderProps_alias_1 }
967
967
 
968
+ /**
969
+ * This module contains utility functions that are used across your app.
970
+ * @module Utils
971
+ */
972
+ /**
973
+ * Formats the count of notifications to be displayed in the notification badge.
974
+ * @param count - The number of notifications.
975
+ * @returns The formatted count of notifications.
976
+ * @example
977
+ * ```tsx
978
+ * const count = formatNotifyCount(100)
979
+ * console.log(count) // '99+'
980
+ * ```
981
+ */
982
+ declare function formatNotifyCount(count: number): string;
983
+ export { formatNotifyCount }
984
+ export { formatNotifyCount as formatNotifyCount_alias_1 }
985
+
968
986
  export { getClientRect }
969
987
 
970
988
  export { getFirstCollision }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ProgressBar
3
3
  } from "./chunk-KCANMM64.js";
4
- import {
5
- FieldMessage
6
- } from "./chunk-JWIJHSI6.js";
7
4
  import {
8
5
  IconButton
9
6
  } from "./chunk-APD6IX5R.js";
7
+ import {
8
+ FieldMessage
9
+ } from "./chunk-JWIJHSI6.js";
10
10
  import {
11
11
  Avatar
12
12
  } from "./chunk-ZX6DBC2Z.js";
@@ -225,4 +225,4 @@ export {
225
225
  processStatus,
226
226
  FileStatus
227
227
  };
228
- //# sourceMappingURL=chunk-YMJMB6OP.js.map
228
+ //# sourceMappingURL=chunk-6EJXHRAP.js.map
@@ -0,0 +1,10 @@
1
+ // src/utils/index.ts
2
+ function formatNotifyCount(count) {
3
+ if (count > 99) return "99+";
4
+ return count.toString();
5
+ }
6
+
7
+ export {
8
+ formatNotifyCount
9
+ };
10
+ //# sourceMappingURL=chunk-UTGEFJ3L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n"],"mappings":";AAeO,SAAS,kBAAkB,OAAuB;AACvD,MAAI,QAAQ,GAAI,QAAO;AACvB,SAAO,MAAM,SAAS;AACxB;","names":[]}
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  FileStatus,
4
4
  processStatus
5
- } from "../chunk-YMJMB6OP.js";
5
+ } from "../chunk-6EJXHRAP.js";
6
6
  import "../chunk-KCANMM64.js";
7
- import "../chunk-JWIJHSI6.js";
8
7
  import "../chunk-APD6IX5R.js";
8
+ import "../chunk-JWIJHSI6.js";
9
9
  import "../chunk-ZX6DBC2Z.js";
10
10
  import "../chunk-UZDVOIW5.js";
11
11
  import "../chunk-BUVVRQLZ.js";
@@ -10,6 +10,9 @@ import {
10
10
  ThemeProvider,
11
11
  useThemeContext
12
12
  } from "./chunk-EB37HRCN.js";
13
+ import {
14
+ Tag
15
+ } from "./chunk-BOCAJC3S.js";
13
16
  import {
14
17
  Tbody
15
18
  } from "./chunk-PKQTTFWA.js";
@@ -32,6 +35,9 @@ import {
32
35
  ConfirmModal,
33
36
  useConfirmModal
34
37
  } from "./chunk-X4Y4WTRU.js";
38
+ import {
39
+ Radio
40
+ } from "./chunk-FTPZHG6J.js";
35
41
  import {
36
42
  Option,
37
43
  Select
@@ -53,8 +59,8 @@ import {
53
59
  Tr
54
60
  } from "./chunk-B4CVET74.js";
55
61
  import {
56
- Tag
57
- } from "./chunk-BOCAJC3S.js";
62
+ NavMenuLink
63
+ } from "./chunk-KBBASJIY.js";
58
64
  import {
59
65
  NavMenuList,
60
66
  getPosition
@@ -78,9 +84,6 @@ import {
78
84
  import {
79
85
  Portal
80
86
  } from "./chunk-GLY7GU5S.js";
81
- import {
82
- Radio
83
- } from "./chunk-FTPZHG6J.js";
84
87
  import {
85
88
  Input
86
89
  } from "./chunk-UJKS4DDN.js";
@@ -103,8 +106,8 @@ import {
103
106
  ModalHeading
104
107
  } from "./chunk-2UXE5PDG.js";
105
108
  import {
106
- NavMenuLink
107
- } from "./chunk-KBBASJIY.js";
109
+ CircularProgress
110
+ } from "./chunk-6QHOKCV3.js";
108
111
  import {
109
112
  Droppable
110
113
  } from "./chunk-TKI2CKHH.js";
@@ -124,19 +127,19 @@ import {
124
127
  import {
125
128
  FileStatus,
126
129
  processStatus
127
- } from "./chunk-YMJMB6OP.js";
130
+ } from "./chunk-6EJXHRAP.js";
128
131
  import {
129
132
  ProgressBar
130
133
  } from "./chunk-KCANMM64.js";
134
+ import {
135
+ IconButton
136
+ } from "./chunk-APD6IX5R.js";
131
137
  import {
132
138
  FieldMessage
133
139
  } from "./chunk-JWIJHSI6.js";
134
140
  import {
135
141
  FileUploader
136
142
  } from "./chunk-HCB5NQ5J.js";
137
- import {
138
- IconButton
139
- } from "./chunk-APD6IX5R.js";
140
143
  import {
141
144
  MODE_KEY,
142
145
  THEME_KEY,
@@ -145,6 +148,9 @@ import {
145
148
  import {
146
149
  useToggle
147
150
  } from "./chunk-REO5GUNC.js";
151
+ import {
152
+ formatNotifyCount
153
+ } from "./chunk-UTGEFJ3L.js";
148
154
  import {
149
155
  Admonition,
150
156
  AdmonitionDescription,
@@ -163,9 +169,6 @@ import {
163
169
  Field,
164
170
  useFieldContext
165
171
  } from "./chunk-UZDVOIW5.js";
166
- import {
167
- CircularProgress
168
- } from "./chunk-6QHOKCV3.js";
169
172
  import {
170
173
  Show
171
174
  } from "./chunk-BUVVRQLZ.js";
@@ -259,6 +262,7 @@ export {
259
262
  Tr,
260
263
  createNavTriggerProps,
261
264
  defineIcons,
265
+ formatNotifyCount,
262
266
  getPosition,
263
267
  processStatus,
264
268
  trapFocus,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Admonition'\nexport * from './components/Avatar'\nexport * from './components/Button'\nexport * from './components/Checkbox'\nexport * from './components/CircularProgress'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/Fieldset'\nexport * from './components/FieldsetLabel'\nexport * from './components/FileStatus'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Legend'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/Radio'\nexport * from './components/Select'\nexport * from './components/Spinner'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Admonition'\nexport * from './components/Avatar'\nexport * from './components/Button'\nexport * from './components/Checkbox'\nexport * from './components/CircularProgress'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/Fieldset'\nexport * from './components/FieldsetLabel'\nexport * from './components/FileStatus'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Legend'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/Radio'\nexport * from './components/Select'\nexport * from './components/Spinner'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\nexport * from './utils/index'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,cAAc;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ formatNotifyCount
3
+ } from "../chunk-UTGEFJ3L.js";
4
+ export {
5
+ formatNotifyCount
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerberus-design/react",
3
- "version": "0.11.1-next-b643296",
3
+ "version": "0.11.1-next-2ed68bd",
4
4
  "description": "The Cerberus Design React component library.",
5
5
  "browserslist": "> 0.25%, not dead",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  "react-dom": "^18",
27
27
  "tsup": "^8.1.0",
28
28
  "@cerberus-design/configs": "0.0.0",
29
- "@cerberus-design/styled-system": "0.11.1-next-b643296"
29
+ "@cerberus-design/styled-system": "0.11.1-next-2ed68bd"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"
package/src/index.ts CHANGED
@@ -75,6 +75,7 @@ export * from './aria-helpers/trap-focus.aria'
75
75
  // utils
76
76
 
77
77
  export * from './config/defineIcons'
78
+ export * from './utils/index'
78
79
 
79
80
  // shared types
80
81
 
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This module contains utility functions that are used across your app.
3
+ * @module Utils
4
+ */
5
+
6
+ /**
7
+ * Formats the count of notifications to be displayed in the notification badge.
8
+ * @param count - The number of notifications.
9
+ * @returns The formatted count of notifications.
10
+ * @example
11
+ * ```tsx
12
+ * const count = formatNotifyCount(100)
13
+ * console.log(count) // '99+'
14
+ * ```
15
+ */
16
+ export function formatNotifyCount(count: number): string {
17
+ if (count > 99) return '99+'
18
+ return count.toString()
19
+ }