@eqtylab/equality 5.4.1 → 5.4.3
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/CHANGELOG.md +27 -0
- package/dist/index.cjs +49 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -14
- package/dist/index.d.ts +27 -14
- package/dist/index.js +49 -20
- package/dist/index.js.map +1 -1
- package/dist/nav-list.module.module.css.module.css +1 -1
- package/dist/pagination.module.module.css.module.css +38 -0
- package/dist/theme.module.module.css.module.css +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to Equality are recorded here, following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
4
4
|
|
|
5
|
+
## 5.4.3 - 2026-11-16
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Improve nav list group label contrast
|
|
10
|
+
|
|
11
|
+
## 5.4.2 - 2026-11-10
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `Pagination` fills its container's width, as it measures its own width to choose a layout. In a
|
|
16
|
+
parent that sizes to its content, such as `w-fit`, `inline-flex` or a right-aligned flex row, give
|
|
17
|
+
it a width; side margins on it now overflow its parent.
|
|
18
|
+
- `Pagination`'s info reads "51–75 of 146 agents", then the items-per-page dropdown labelled "per
|
|
19
|
+
page". It read "Showing 51 to [25] of 146 agents", with the page size where the range's end
|
|
20
|
+
belongs, so past page 1 it read as "51 to 25". Screen readers hear "51 to 75 of 146 agents".
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- `Pagination` fits a phone, where its row ran off the screen. Below 42rem it keeps one line: the
|
|
25
|
+
count without its noun, the items-per-page dropdown, labelled "per page" where it fits, and
|
|
26
|
+
previous, current page and next. When even that doesn't fit, the page buttons wrap below the
|
|
27
|
+
count and stay on the right.
|
|
28
|
+
- `Pagination` shows a `currentPage` outside 1 to the last page, such as after a filter shrinks
|
|
29
|
+
the list, as the nearest page. It had shown no current page and a count such as "95–95 of 95".
|
|
30
|
+
Clamp your own page state too, or the list shows an empty page.
|
|
31
|
+
|
|
5
32
|
## 5.4.1 - 2026-11-09
|
|
6
33
|
|
|
7
34
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -3929,7 +3929,7 @@ var ChevronRightIcon3 = LucideIcons.ChevronRight;
|
|
|
3929
3929
|
var ChevronsLeftIcon = LucideIcons.ChevronsLeft;
|
|
3930
3930
|
var ChevronsRightIcon = LucideIcons.ChevronsRight;
|
|
3931
3931
|
var Pagination = ({
|
|
3932
|
-
currentPage,
|
|
3932
|
+
currentPage: requestedPage,
|
|
3933
3933
|
totalItems,
|
|
3934
3934
|
filteredItems,
|
|
3935
3935
|
itemsPerPage,
|
|
@@ -3944,6 +3944,7 @@ var Pagination = ({
|
|
|
3944
3944
|
scrollTargetRef
|
|
3945
3945
|
}) => {
|
|
3946
3946
|
const totalPages = Math.ceil(filteredItems / itemsPerPage);
|
|
3947
|
+
const currentPage = Math.min(Math.max(requestedPage, 1), Math.max(totalPages, 1));
|
|
3947
3948
|
const startItem = Math.min(filteredItems, 1 + (currentPage - 1) * itemsPerPage);
|
|
3948
3949
|
const endItem = Math.min(currentPage * itemsPerPage, filteredItems);
|
|
3949
3950
|
const hasFilteredItems = filteredItems > 0;
|
|
@@ -4010,6 +4011,7 @@ var Pagination = ({
|
|
|
4010
4011
|
onClick: () => handlePageChange(i),
|
|
4011
4012
|
"aria-label": `Page ${i} of ${totalPages}`,
|
|
4012
4013
|
"aria-current": currentPage === i ? "page" : void 0,
|
|
4014
|
+
className: cn(currentPage !== i && styles43__default.default["wide-only"]),
|
|
4013
4015
|
children: i
|
|
4014
4016
|
},
|
|
4015
4017
|
i
|
|
@@ -4019,30 +4021,55 @@ var Pagination = ({
|
|
|
4019
4021
|
return pageButtons;
|
|
4020
4022
|
};
|
|
4021
4023
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(styles43__default.default["pagination"], className), children: [
|
|
4022
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4023
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4024
|
-
"
|
|
4025
|
-
|
|
4026
|
-
|
|
4024
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles43__default.default["info-container"], children: [
|
|
4025
|
+
showInfo && hasFilteredItems && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4026
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": "true", children: [
|
|
4027
|
+
startItem,
|
|
4028
|
+
"\u2013",
|
|
4029
|
+
endItem,
|
|
4030
|
+
" of ",
|
|
4031
|
+
filteredItems,
|
|
4032
|
+
type && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles43__default.default["wide-only"], children: [
|
|
4033
|
+
" ",
|
|
4034
|
+
type
|
|
4035
|
+
] })
|
|
4036
|
+
] }),
|
|
4037
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles43__default.default["spoken-count"], children: [
|
|
4038
|
+
startItem,
|
|
4039
|
+
" to ",
|
|
4040
|
+
endItem,
|
|
4041
|
+
" of ",
|
|
4042
|
+
filteredItems,
|
|
4043
|
+
" ",
|
|
4044
|
+
type
|
|
4045
|
+
] })
|
|
4027
4046
|
] }),
|
|
4028
|
-
onItemsPerPageChange
|
|
4047
|
+
showInfo && hasFilteredItems && onItemsPerPageChange && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4048
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Select, { value: itemsPerPage.toString(), onValueChange: handleItemsPerPageChange, children: [
|
|
4049
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4050
|
+
SelectTrigger,
|
|
4051
|
+
{
|
|
4052
|
+
className: styles43__default.default["items-per-page-trigger"],
|
|
4053
|
+
"aria-label": "Items per page",
|
|
4054
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {})
|
|
4055
|
+
}
|
|
4056
|
+
),
|
|
4057
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: option.toString(), children: option }, option)) })
|
|
4058
|
+
] }),
|
|
4029
4059
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4030
|
-
|
|
4060
|
+
"span",
|
|
4031
4061
|
{
|
|
4032
|
-
className:
|
|
4033
|
-
|
|
4034
|
-
|
|
4062
|
+
className: cn(
|
|
4063
|
+
styles43__default.default["page-size-label"],
|
|
4064
|
+
filteredItems < 100 && styles43__default.default["page-size-label--short"],
|
|
4065
|
+
filteredItems >= 100 && filteredItems < 1e3 && styles43__default.default["page-size-label--medium"]
|
|
4066
|
+
),
|
|
4067
|
+
"aria-hidden": "true",
|
|
4068
|
+
children: "per page"
|
|
4035
4069
|
}
|
|
4036
|
-
)
|
|
4037
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: option.toString(), children: option }, option)) })
|
|
4038
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: endItem }),
|
|
4039
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
4040
|
-
"of ",
|
|
4041
|
-
filteredItems,
|
|
4042
|
-
" ",
|
|
4043
|
-
type
|
|
4070
|
+
)
|
|
4044
4071
|
] })
|
|
4045
|
-
] })
|
|
4072
|
+
] }),
|
|
4046
4073
|
/* @__PURE__ */ jsxRuntime.jsxs("nav", { className: styles43__default.default["page-navigation-container"], "aria-label": "Pagination", children: [
|
|
4047
4074
|
showFirstLastButtons && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4048
4075
|
Button,
|
|
@@ -4052,6 +4079,7 @@ var Pagination = ({
|
|
|
4052
4079
|
onClick: handleFirstPage,
|
|
4053
4080
|
disabled: isFirstPage,
|
|
4054
4081
|
"aria-label": "First page",
|
|
4082
|
+
className: styles43__default.default["wide-only"],
|
|
4055
4083
|
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsLeftIcon, {})
|
|
4056
4084
|
}
|
|
4057
4085
|
),
|
|
@@ -4086,6 +4114,7 @@ var Pagination = ({
|
|
|
4086
4114
|
onClick: handleLastPage,
|
|
4087
4115
|
disabled: isLastPage,
|
|
4088
4116
|
"aria-label": `Last page (${totalPages})`,
|
|
4117
|
+
className: styles43__default.default["wide-only"],
|
|
4089
4118
|
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsRightIcon, {})
|
|
4090
4119
|
}
|
|
4091
4120
|
)
|