@availity/mui-pagination 0.3.13 → 0.4.1

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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.4.1](https://github.com/Availity/element/compare/@availity/mui-pagination@0.4.0...@availity/mui-pagination@0.4.1) (2025-02-06)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * enchance aria label generation for pagination ([17e7747](https://github.com/Availity/element/commit/17e77476fd71482f3ae78898a9d9886ccaf5d90f))
11
+
12
+ ## [0.4.0](https://github.com/Availity/element/compare/@availity/mui-pagination@0.3.13...@availity/mui-pagination@0.4.0) (2025-02-04)
13
+
14
+ ### Dependency Updates
15
+
16
+ * `mui-icon` updated to version `0.3.13`
17
+ * `mui-layout` updated to version `0.3.13`
18
+ * `mui-list` updated to version `0.3.13`
19
+
20
+ ### Features
21
+
22
+ * configure package.json to allow esm to be used ([5a5393d](https://github.com/Availity/element/commit/5a5393de761f52608e714dd94a05106937dd95db))
23
+
5
24
  ## [0.3.13](https://github.com/Availity/element/compare/@availity/mui-pagination@0.3.12...@availity/mui-pagination@0.3.13) (2025-01-27)
6
25
 
7
26
  ### Dependency Updates
package/dist/index.d.mts CHANGED
@@ -6,7 +6,7 @@ type PaginationProps = {
6
6
  * @default 'determined by theme' */
7
7
  size?: 'medium' | 'large';
8
8
  } & Omit<PaginationProps$1, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
9
- declare const Pagination: ({ ...rest }: PaginationProps) => JSX.Element;
9
+ declare const Pagination: (props: PaginationProps) => JSX.Element;
10
10
 
11
11
  type PaginationItemProps = Omit<PaginationItemProps$1, 'components' | 'color' | 'shape' | 'size'>;
12
12
  declare const PaginationItem: (props: PaginationItemProps) => JSX.Element;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ type PaginationProps = {
6
6
  * @default 'determined by theme' */
7
7
  size?: 'medium' | 'large';
8
8
  } & Omit<PaginationProps$1, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
9
- declare const Pagination: ({ ...rest }: PaginationProps) => JSX.Element;
9
+ declare const Pagination: (props: PaginationProps) => JSX.Element;
10
10
 
11
11
  type PaginationItemProps = Omit<PaginationItemProps$1, 'components' | 'color' | 'shape' | 'size'>;
12
12
  declare const PaginationItem: (props: PaginationItemProps) => JSX.Element;
package/dist/index.js CHANGED
@@ -22,18 +22,6 @@ var __spreadValues = (a, b) => {
22
22
  return a;
23
23
  };
24
24
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
25
  var __export = (target, all) => {
38
26
  for (var name in all)
39
27
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -95,9 +83,13 @@ var PaginationItem = (props) => {
95
83
 
96
84
  // src/lib/Pagination.tsx
97
85
  var import_jsx_runtime2 = require("react/jsx-runtime");
98
- var Pagination = (_a) => {
99
- var rest = __objRest(_a, []);
100
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Pagination.default, __spreadProps(__spreadValues({}, rest), { renderItem: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationItem, __spreadValues({}, item)) }));
86
+ var getItemAriaLabel = (type, page) => {
87
+ if (type === "page")
88
+ return `Go to page ${page}`;
89
+ return `Go to ${type} page`;
90
+ };
91
+ var Pagination = (props) => {
92
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Pagination.default, __spreadProps(__spreadValues({}, props), { getItemAriaLabel, renderItem: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationItem, __spreadValues({}, item)) }));
101
93
  };
102
94
  // Annotate the CommonJS export names for ESM import in node:
103
95
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -17,18 +17,6 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
20
 
33
21
  // src/lib/Pagination.tsx
34
22
  import { default as MuiPagination } from "@mui/material/Pagination";
@@ -63,9 +51,13 @@ var PaginationItem = (props) => {
63
51
 
64
52
  // src/lib/Pagination.tsx
65
53
  import { jsx as jsx2 } from "react/jsx-runtime";
66
- var Pagination = (_a) => {
67
- var rest = __objRest(_a, []);
68
- return /* @__PURE__ */ jsx2(MuiPagination, __spreadProps(__spreadValues({}, rest), { renderItem: (item) => /* @__PURE__ */ jsx2(PaginationItem, __spreadValues({}, item)) }));
54
+ var getItemAriaLabel = (type, page) => {
55
+ if (type === "page")
56
+ return `Go to page ${page}`;
57
+ return `Go to ${type} page`;
58
+ };
59
+ var Pagination = (props) => {
60
+ return /* @__PURE__ */ jsx2(MuiPagination, __spreadProps(__spreadValues({}, props), { getItemAriaLabel, renderItem: (item) => /* @__PURE__ */ jsx2(PaginationItem, __spreadValues({}, item)) }));
69
61
  };
70
62
  export {
71
63
  Pagination,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-pagination",
3
- "version": "0.3.13",
3
+ "version": "0.4.1",
4
4
  "description": "Availity MUI Pagination Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -23,6 +23,14 @@
23
23
  "main": "./dist/index.js",
24
24
  "module": "./dist/index.mjs",
25
25
  "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ "./package.json": "./package.json",
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.mjs",
31
+ "require": "./dist/index.js"
32
+ }
33
+ },
26
34
  "scripts": {
27
35
  "build": "tsup src/index.ts --format esm,cjs --dts",
28
36
  "dev": "tsup src/index.ts --format esm,cjs --watch --dts",
@@ -32,7 +40,7 @@
32
40
  "publish:canary": "yarn npm publish --access public --tag canary"
33
41
  },
34
42
  "devDependencies": {
35
- "@availity/mui-icon": "0.13.1",
43
+ "@availity/mui-icon": "0.14.0",
36
44
  "@mui/material": "^5.15.15",
37
45
  "react": "18.2.0",
38
46
  "react-dom": "18.2.0",
@@ -40,7 +48,7 @@
40
48
  "typescript": "^5.4.5"
41
49
  },
42
50
  "peerDependencies": {
43
- "@availity/mui-icon": "0.13.1",
51
+ "@availity/mui-icon": "0.14.0",
44
52
  "@mui/material": "^5.11.9",
45
53
  "react": ">=16.3.0"
46
54
  },
@@ -7,6 +7,13 @@ export type PaginationProps = {
7
7
  size?: 'medium' | 'large';
8
8
  } & Omit<MuiPaginationProps, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
9
9
 
10
- export const Pagination = ({ ...rest }: PaginationProps): JSX.Element => {
11
- return <MuiPagination {...rest} renderItem={(item) => <PaginationItem {...item} />} />;
10
+ const getItemAriaLabel: MuiPaginationProps['getItemAriaLabel'] = (type, page) => {
11
+ if (type === 'page') return `Go to page ${page}`;
12
+ return `Go to ${type} page`;
13
+ };
14
+
15
+ export const Pagination = (props: PaginationProps): JSX.Element => {
16
+ return (
17
+ <MuiPagination {...props} getItemAriaLabel={getItemAriaLabel} renderItem={(item) => <PaginationItem {...item} />} />
18
+ );
12
19
  };