@moderneinc/design-system-components 7.7.0-next.f97145 → 7.7.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.
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +13 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/formatCount.d.ts +3 -0
- package/package.json +10 -10
|
@@ -39,7 +39,7 @@ export interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'>
|
|
|
39
39
|
* - Typography: semanticTypography.tooltip (12px/1.5 line-height), fontWeight.semiBold (600) for the title
|
|
40
40
|
*/
|
|
41
41
|
export declare const ModTooltip: {
|
|
42
|
-
({ variant, title, description, children, arrow, placement, ...props }: ModTooltipProps): import("react").JSX.Element;
|
|
42
|
+
({ variant, title, description, children, arrow, placement, describeChild, ...props }: ModTooltipProps): import("react").JSX.Element;
|
|
43
43
|
displayName: string;
|
|
44
44
|
};
|
|
45
45
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3131,7 +3131,7 @@ interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'> {
|
|
|
3131
3131
|
* - Typography: semanticTypography.tooltip (12px/1.5 line-height), fontWeight.semiBold (600) for the title
|
|
3132
3132
|
*/
|
|
3133
3133
|
declare const ModTooltip: {
|
|
3134
|
-
({ variant, title, description, children, arrow, placement, ...props }: ModTooltipProps): react.JSX.Element;
|
|
3134
|
+
({ variant, title, description, children, arrow, placement, describeChild, ...props }: ModTooltipProps): react.JSX.Element;
|
|
3135
3135
|
displayName: string;
|
|
3136
3136
|
};
|
|
3137
3137
|
|
package/dist/index.esm.js
CHANGED
|
@@ -3392,6 +3392,13 @@ const ModLoadingSpinner = ({
|
|
|
3392
3392
|
};
|
|
3393
3393
|
ModLoadingSpinner.displayName = "ModLoadingSpinner";
|
|
3394
3394
|
|
|
3395
|
+
const formatCount = (value, locales) => new Intl.NumberFormat(locales).format(value);
|
|
3396
|
+
const paginationRangeLabel = (page, pageSize, rowCount, locales) => {
|
|
3397
|
+
const start = page * pageSize + 1;
|
|
3398
|
+
const end = Math.min((page + 1) * pageSize, rowCount);
|
|
3399
|
+
return `${formatCount(start, locales)}-${formatCount(end, locales)} of ${formatCount(rowCount, locales)}`;
|
|
3400
|
+
};
|
|
3401
|
+
|
|
3395
3402
|
const StyledFooter = styled(Box, {
|
|
3396
3403
|
shouldForwardProp: (prop) => prop !== "showShadow"
|
|
3397
3404
|
})(({ theme, showShadow = false }) => ({
|
|
@@ -3515,10 +3522,7 @@ const ModFooter = ({
|
|
|
3515
3522
|
return paginationInfo;
|
|
3516
3523
|
}
|
|
3517
3524
|
if (paginationModel && rowCount > 0) {
|
|
3518
|
-
|
|
3519
|
-
const start = page * pageSize + 1;
|
|
3520
|
-
const end = Math.min((page + 1) * pageSize, rowCount);
|
|
3521
|
-
return `${start}-${end} of ${rowCount}`;
|
|
3525
|
+
return paginationRangeLabel(paginationModel.page, paginationModel.pageSize, rowCount);
|
|
3522
3526
|
}
|
|
3523
3527
|
return "0-0 of 0";
|
|
3524
3528
|
};
|
|
@@ -3598,7 +3602,7 @@ const ModFooter = ({
|
|
|
3598
3602
|
}
|
|
3599
3603
|
return /* @__PURE__ */ jsxs(StyledFooter, { showShadow, sx: { justifyContent: "space-between" }, children: [
|
|
3600
3604
|
showSelected ? /* @__PURE__ */ jsxs(SelectedText, { children: [
|
|
3601
|
-
selectedCount,
|
|
3605
|
+
formatCount(selectedCount),
|
|
3602
3606
|
" selected"
|
|
3603
3607
|
] }) : /* @__PURE__ */ jsx(Box, {}),
|
|
3604
3608
|
/* @__PURE__ */ jsxs(PaginationContainer, { children: [
|
|
@@ -4868,8 +4872,10 @@ const ModTooltip = ({
|
|
|
4868
4872
|
children,
|
|
4869
4873
|
arrow = false,
|
|
4870
4874
|
placement,
|
|
4875
|
+
describeChild,
|
|
4871
4876
|
...props
|
|
4872
4877
|
}) => {
|
|
4878
|
+
const accessibleName = typeof title === "string" && !description && !describeChild ? title : void 0;
|
|
4873
4879
|
const titleContent = description ? /* @__PURE__ */ jsxs(Stack, { sx: { gap: `${spacing.spacing_1_4}px` }, children: [
|
|
4874
4880
|
/* @__PURE__ */ jsx(Typography, { variant: "inherit", sx: { fontWeight: typography.fontWeight.semiBold }, children: title }),
|
|
4875
4881
|
/* @__PURE__ */ jsx(Typography, { variant: "inherit", children: description })
|
|
@@ -4881,6 +4887,8 @@ const ModTooltip = ({
|
|
|
4881
4887
|
title: titleContent,
|
|
4882
4888
|
arrow,
|
|
4883
4889
|
placement,
|
|
4890
|
+
describeChild,
|
|
4891
|
+
"aria-label": accessibleName,
|
|
4884
4892
|
...props,
|
|
4885
4893
|
children
|
|
4886
4894
|
}
|