@esportsplus/ui 0.0.104 → 0.0.106
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,4 +1,8 @@
|
|
|
1
|
+
declare const abbreviate: (number: number) => string;
|
|
2
|
+
declare const ordinal: (number: number) => string;
|
|
1
3
|
declare const _default: {
|
|
2
4
|
abbreviate: (number: number) => string;
|
|
5
|
+
ordinal: (number: number) => string;
|
|
3
6
|
};
|
|
4
7
|
export default _default;
|
|
8
|
+
export { abbreviate, ordinal };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.ordinal = exports.abbreviate = void 0;
|
|
4
|
+
let formatter = null, suffixes = ['th', 'st', 'nd', 'rd'];
|
|
4
5
|
const abbreviate = (number) => {
|
|
5
6
|
if (formatter === null) {
|
|
6
7
|
formatter = new Intl.NumberFormat('en-GB', {
|
|
@@ -10,4 +11,10 @@ const abbreviate = (number) => {
|
|
|
10
11
|
}
|
|
11
12
|
return formatter.format(number);
|
|
12
13
|
};
|
|
13
|
-
exports.
|
|
14
|
+
exports.abbreviate = abbreviate;
|
|
15
|
+
const ordinal = (number) => {
|
|
16
|
+
let value = number % 100;
|
|
17
|
+
return suffixes[(value - 20) % 10] || suffixes[value] || suffixes[0];
|
|
18
|
+
};
|
|
19
|
+
exports.ordinal = ordinal;
|
|
20
|
+
exports.default = { abbreviate, ordinal };
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.title = exports.suptitle = exports.subtitle = void 0;
|
|
4
4
|
const subtitle = () => {
|
|
5
5
|
return {
|
|
6
|
-
class: 'page-subtitle --margin-top --margin-
|
|
6
|
+
class: 'page-subtitle --margin-top --margin-200 --text-crop-bottom'
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
exports.subtitle = subtitle;
|
|
@@ -16,7 +16,7 @@ const suptitle = () => {
|
|
|
16
16
|
exports.suptitle = suptitle;
|
|
17
17
|
const title = (subtitle, suptitle) => {
|
|
18
18
|
return {
|
|
19
|
-
class: `page-title --line-height-200 --margin-
|
|
19
|
+
class: `page-title --line-height-200 --margin-200 ${!subtitle && '--text-crop-bottom'} ${suptitle ? '--margin-top' : '--text-crop-top'}`
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
exports.title = title;
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
let formatter: null | Intl.NumberFormat = null
|
|
1
|
+
let formatter: null | Intl.NumberFormat = null,
|
|
2
|
+
suffixes = ['th', 'st', 'nd', 'rd'];
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
const abbreviate = (number: number) => {
|
|
@@ -12,5 +13,12 @@ const abbreviate = (number: number) => {
|
|
|
12
13
|
return formatter.format(number);
|
|
13
14
|
};
|
|
14
15
|
|
|
16
|
+
const ordinal = (number: number) => {
|
|
17
|
+
let value = number % 100;
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
return suffixes[(value - 20) % 10] || suffixes[value] || suffixes[0];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export default { abbreviate, ordinal };
|
|
24
|
+
export { abbreviate, ordinal };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const subtitle = () => {
|
|
2
2
|
return {
|
|
3
|
-
class: 'page-subtitle --margin-top --margin-
|
|
3
|
+
class: 'page-subtitle --margin-top --margin-200 --text-crop-bottom'
|
|
4
4
|
};
|
|
5
5
|
};
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ const suptitle = () => {
|
|
|
13
13
|
|
|
14
14
|
const title = (subtitle: unknown, suptitle: unknown) => {
|
|
15
15
|
return {
|
|
16
|
-
class: `page-title --line-height-200 --margin-
|
|
16
|
+
class: `page-title --line-height-200 --margin-200 ${!subtitle && '--text-crop-bottom'} ${suptitle ? '--margin-top' : '--text-crop-top'}`
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
|