@harpercollins/harpercollins-design-system 1.8.62 → 1.8.64
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.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/index.d.ts +1 -1
- package/dist/cjs/types/src/utils/index.d.ts +1 -0
- package/dist/cjs/types/src/utils/utils.d.ts +27 -0
- package/dist/cjs/types/src/utils/utils.test.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/index.d.ts +1 -1
- package/dist/esm/types/src/utils/index.d.ts +1 -0
- package/dist/esm/types/src/utils/utils.d.ts +27 -0
- package/dist/esm/types/src/utils/utils.test.d.ts +1 -0
- package/dist/index.d.ts +29 -5
- package/package.json +1 -1
- package/dist/cjs/types/src/helpers/helpers.d.ts +0 -3
- package/dist/cjs/types/src/helpers/index.d.ts +0 -1
- package/dist/esm/types/src/helpers/helpers.d.ts +0 -3
- package/dist/esm/types/src/helpers/index.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { formatDate, formatNumber, formatText, formatCurrency } from "./utils";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format date to locale
|
|
3
|
+
* @param dateString - The date string to format
|
|
4
|
+
* @param format - The format to display the date in. Default is "dd MMM yyyy"
|
|
5
|
+
* @returns - The formatted date
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatDate: (dateString: string | null | undefined, format?: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Format number to locale
|
|
10
|
+
* @param number - The number to format
|
|
11
|
+
* @returns The formatted number
|
|
12
|
+
*/
|
|
13
|
+
export declare const formatNumber: (number: number | string | null | undefined) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Format text to display NULL_DISPLAY_VALUE if text is empty, null or undefined
|
|
16
|
+
* @param text
|
|
17
|
+
* @returns The formatted text
|
|
18
|
+
*/
|
|
19
|
+
export declare const formatText: (text: string | null | undefined) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Format currency value to locale and currency
|
|
22
|
+
* @param value - The value to format
|
|
23
|
+
* @param locale - The locale to format the value to
|
|
24
|
+
* @param currency - The currency to format the value to
|
|
25
|
+
* @returns The formatted currency value
|
|
26
|
+
* */
|
|
27
|
+
export declare const formatCurrency: (value: number | string | null | undefined, locale?: string, currency?: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -295,8 +295,32 @@ declare const useFetch: <T = unknown>(url: string, options?: RequestInit, deboun
|
|
|
295
295
|
error: Error | null;
|
|
296
296
|
};
|
|
297
297
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
298
|
+
/**
|
|
299
|
+
* Format date to locale
|
|
300
|
+
* @param dateString - The date string to format
|
|
301
|
+
* @param format - The format to display the date in. Default is "dd MMM yyyy"
|
|
302
|
+
* @returns - The formatted date
|
|
303
|
+
*/
|
|
304
|
+
declare const formatDate: (dateString: string | null | undefined, format?: string) => string;
|
|
305
|
+
/**
|
|
306
|
+
* Format number to locale
|
|
307
|
+
* @param number - The number to format
|
|
308
|
+
* @returns The formatted number
|
|
309
|
+
*/
|
|
310
|
+
declare const formatNumber: (number: number | string | null | undefined) => string;
|
|
311
|
+
/**
|
|
312
|
+
* Format text to display NULL_DISPLAY_VALUE if text is empty, null or undefined
|
|
313
|
+
* @param text
|
|
314
|
+
* @returns The formatted text
|
|
315
|
+
*/
|
|
316
|
+
declare const formatText: (text: string | null | undefined) => string;
|
|
317
|
+
/**
|
|
318
|
+
* Format currency value to locale and currency
|
|
319
|
+
* @param value - The value to format
|
|
320
|
+
* @param locale - The locale to format the value to
|
|
321
|
+
* @param currency - The currency to format the value to
|
|
322
|
+
* @returns The formatted currency value
|
|
323
|
+
* */
|
|
324
|
+
declare const formatCurrency: (value: number | string | null | undefined, locale?: string, currency?: string) => string;
|
|
325
|
+
|
|
326
|
+
export { Accordion, AppBar, AutoComplete as Autocomplete, AutocompleteSelectMultiple, Badge, Breadcrumb, Button, Divider, Modal as Drawer, DropDownMenu, Heading, Icon, Input, Layout, LoadingSpinner, Logo, ProgressBar, ProgressCircle, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextBlock, ToastMessages, Tooltip, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useToggle };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { formatDate, formatNumber, formatText } from "./helpers";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { formatDate, formatNumber, formatText } from "./helpers";
|