@yamada-ui/pagination 1.0.42-next-20241005220055 → 1.0.42-next-20241008193728

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/{chunk-CDBANJFO.mjs → chunk-GKZNNZOM.mjs} +12 -12
  2. package/dist/chunk-GKZNNZOM.mjs.map +1 -0
  3. package/dist/{chunk-UK2DDH2Q.mjs → chunk-GOSRKZFX.mjs} +19 -17
  4. package/dist/chunk-GOSRKZFX.mjs.map +1 -0
  5. package/dist/{chunk-SUUC5YDJ.mjs → chunk-PGW7Y4GO.mjs} +36 -34
  6. package/dist/chunk-PGW7Y4GO.mjs.map +1 -0
  7. package/dist/{chunk-FAA64ZR4.mjs → chunk-VPZBFCSD.mjs} +19 -11
  8. package/dist/chunk-VPZBFCSD.mjs.map +1 -0
  9. package/dist/index.js +75 -63
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +4 -4
  12. package/dist/pagination-icon.d.mts +1 -1
  13. package/dist/pagination-icon.d.ts +1 -1
  14. package/dist/pagination-icon.js +18 -10
  15. package/dist/pagination-icon.js.map +1 -1
  16. package/dist/pagination-icon.mjs +1 -1
  17. package/dist/pagination-item.d.mts +9 -8
  18. package/dist/pagination-item.d.ts +9 -8
  19. package/dist/pagination-item.js +36 -26
  20. package/dist/pagination-item.js.map +1 -1
  21. package/dist/pagination-item.mjs +3 -3
  22. package/dist/pagination.d.mts +19 -19
  23. package/dist/pagination.d.ts +19 -19
  24. package/dist/pagination.js +75 -63
  25. package/dist/pagination.js.map +1 -1
  26. package/dist/pagination.mjs +4 -4
  27. package/dist/use-pagination.d.mts +22 -22
  28. package/dist/use-pagination.d.ts +22 -22
  29. package/dist/use-pagination.js +11 -11
  30. package/dist/use-pagination.js.map +1 -1
  31. package/dist/use-pagination.mjs +1 -1
  32. package/package.json +7 -7
  33. package/dist/chunk-CDBANJFO.mjs.map +0 -1
  34. package/dist/chunk-FAA64ZR4.mjs.map +0 -1
  35. package/dist/chunk-SUUC5YDJ.mjs.map +0 -1
  36. package/dist/chunk-UK2DDH2Q.mjs.map +0 -1
@@ -1,28 +1,29 @@
1
- import { ComponentPropsWithoutRef, FC } from 'react';
1
+ import { FC } from '@yamada-ui/core';
2
+ import { ComponentPropsWithoutRef } from 'react';
2
3
 
3
4
  interface PaginationItemOptions {
4
5
  /**
5
6
  * The type of the page or item assigned to the pagination item.
6
7
  */
7
- page: number | "dots" | "prev" | "next" | "first" | "last";
8
+ page: "dots" | "first" | "last" | "next" | "prev" | number;
8
9
  /**
9
- * If `true`, the pagination item will be activated.
10
+ * If `true`, disable ripple effects when pressing a element.
10
11
  *
11
12
  * @default false
12
13
  */
13
- isActive?: boolean;
14
+ disableRipple?: boolean;
14
15
  /**
15
- * If `true`, the pagination item will be disabled.
16
+ * If `true`, the pagination item will be activated.
16
17
  *
17
18
  * @default false
18
19
  */
19
- isDisabled?: boolean;
20
+ isActive?: boolean;
20
21
  /**
21
- * If `true`, disable ripple effects when pressing a element.
22
+ * If `true`, the pagination item will be disabled.
22
23
  *
23
24
  * @default false
24
25
  */
25
- disableRipple?: boolean;
26
+ isDisabled?: boolean;
26
27
  }
27
28
  interface PaginationItemProps extends ComponentPropsWithoutRef<"button">, PaginationItemOptions {
28
29
  }
@@ -35,35 +35,41 @@ var DotsIcon = (props) => {
35
35
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
36
  "path",
37
37
  {
38
- fill: "currentColor",
39
- d: "M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"
38
+ d: "M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z",
39
+ fill: "currentColor"
40
40
  }
41
41
  ) });
42
42
  };
43
+ DotsIcon.displayName = "DotIcon";
44
+ DotsIcon.__ui__ = "DotIcon";
43
45
  var FirstIcon = (props) => {
44
46
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
47
  "path",
46
48
  {
47
- fill: "currentColor",
48
- d: "M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"
49
+ d: "M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z",
50
+ fill: "currentColor"
49
51
  }
50
52
  ) });
51
53
  };
54
+ FirstIcon.displayName = "LastIcon";
55
+ FirstIcon.__ui__ = "LastIcon";
52
56
  var LastIcon = (props) => {
53
57
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
58
  "path",
55
59
  {
56
- fill: "currentColor",
57
- d: "M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"
60
+ d: "M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z",
61
+ fill: "currentColor"
58
62
  }
59
63
  ) });
60
64
  };
65
+ LastIcon.displayName = "LastIcon";
66
+ LastIcon.__ui__ = "LastIcon";
61
67
  var PrevIcon = (props) => {
62
68
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
69
  "path",
64
70
  {
65
- fill: "currentColor",
66
- d: "M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"
71
+ d: "M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z",
72
+ fill: "currentColor"
67
73
  }
68
74
  ) });
69
75
  };
@@ -71,11 +77,13 @@ var NextIcon = (props) => {
71
77
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
78
  "path",
73
79
  {
74
- fill: "currentColor",
75
- d: "M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"
80
+ d: "M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z",
81
+ fill: "currentColor"
76
82
  }
77
83
  ) });
78
84
  };
85
+ NextIcon.displayName = "NextIcon";
86
+ NextIcon.__ui__ = "NextIcon";
79
87
 
80
88
  // src/use-pagination.ts
81
89
  var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
@@ -83,26 +91,26 @@ var import_use_value = require("@yamada-ui/use-value");
83
91
  var import_utils = require("@yamada-ui/utils");
84
92
  var import_react = require("react");
85
93
  var [PaginationProvider, usePaginationContext] = (0, import_utils.createContext)({
86
- strict: false,
87
- name: "PaginationContext"
94
+ name: "PaginationContext",
95
+ errorMessage: `usePaginationContext returned is 'undefined'. Seems you forgot to wrap the components in "<Pagination />"`
88
96
  });
89
97
 
90
98
  // src/pagination-item.tsx
91
99
  var import_jsx_runtime2 = require("react/jsx-runtime");
92
100
  var iconMap = {
93
101
  dots: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DotsIcon, {}),
94
- next: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NextIcon, {}),
95
- prev: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PrevIcon, {}),
96
102
  first: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FirstIcon, {}),
97
- last: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LastIcon, {})
103
+ last: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LastIcon, {}),
104
+ next: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NextIcon, {}),
105
+ prev: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PrevIcon, {})
98
106
  };
99
107
  var PaginationItem = ({
100
108
  className,
109
+ children,
110
+ disableRipple,
101
111
  isActive,
102
- page,
103
112
  isDisabled,
104
- disableRipple,
105
- children,
113
+ page,
106
114
  ...rest
107
115
  }) => {
108
116
  var _a;
@@ -113,24 +121,24 @@ var PaginationItem = ({
113
121
  });
114
122
  children != null ? children : children = (_a = iconMap[page]) != null ? _a : page;
115
123
  const css = {
116
- position: "relative",
117
- overflow: "hidden",
118
- userSelect: "none",
124
+ alignItems: "center",
119
125
  display: "flex",
120
126
  justifyContent: "center",
121
- alignItems: "center",
127
+ overflow: "hidden",
128
+ position: "relative",
129
+ userSelect: "none",
122
130
  ...styles.item,
123
131
  ...styles[page]
124
132
  };
125
133
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
126
134
  import_core.ui.button,
127
135
  {
128
- className: (0, import_utils2.cx)("ui-pagination__item", className),
129
136
  type: "button",
130
- tabIndex: page !== "dots" ? 0 : -1,
131
- disabled: isDisabled,
132
- "data-selected": (0, import_utils2.dataAttr)(isActive),
137
+ className: (0, import_utils2.cx)("ui-pagination__item", className),
133
138
  "data-disabled": (0, import_utils2.dataAttr)(isDisabled),
139
+ "data-selected": (0, import_utils2.dataAttr)(isActive),
140
+ disabled: isDisabled,
141
+ tabIndex: page !== "dots" ? 0 : -1,
134
142
  __css: css,
135
143
  ...rest,
136
144
  onPointerDown,
@@ -141,6 +149,8 @@ var PaginationItem = ({
141
149
  }
142
150
  );
143
151
  };
152
+ PaginationItem.displayName = "PaginationItem";
153
+ PaginationItem.__ui__ = "PaginationItem";
144
154
  // Annotate the CommonJS export names for ESM import in node:
145
155
  0 && (module.exports = {
146
156
  PaginationItem
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/pagination-item.tsx","../src/pagination-icon.tsx","../src/use-pagination.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { ui } from \"@yamada-ui/core\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx, dataAttr } from \"@yamada-ui/utils\"\nimport type { ComponentPropsWithoutRef, FC, ReactNode } from \"react\"\nimport {\n DotsIcon,\n FirstIcon,\n LastIcon,\n NextIcon,\n PrevIcon,\n} from \"./pagination-icon\"\nimport { usePaginationContext } from \"./use-pagination\"\n\ninterface PaginationItemOptions {\n /**\n * The type of the page or item assigned to the pagination item.\n */\n page: number | \"dots\" | \"prev\" | \"next\" | \"first\" | \"last\"\n /**\n * If `true`, the pagination item will be activated.\n *\n * @default false\n */\n isActive?: boolean\n /**\n * If `true`, the pagination item will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n}\n\nexport interface PaginationItemProps\n extends ComponentPropsWithoutRef<\"button\">,\n PaginationItemOptions {}\n\nconst iconMap: {\n [key in number | \"dots\" | \"prev\" | \"next\" | \"first\" | \"last\"]: ReactNode\n} = {\n dots: <DotsIcon />,\n next: <NextIcon />,\n prev: <PrevIcon />,\n first: <FirstIcon />,\n last: <LastIcon />,\n}\n\nexport const PaginationItem: FC<PaginationItemProps> = ({\n className,\n isActive,\n page,\n isDisabled,\n disableRipple,\n children,\n ...rest\n}) => {\n const styles = usePaginationContext()\n const { onPointerDown, ...rippleProps } = useRipple({\n ...rest,\n isDisabled: disableRipple || isDisabled,\n })\n\n children ??= iconMap[page] ?? page\n\n const css: CSSUIObject = {\n position: \"relative\",\n overflow: \"hidden\",\n userSelect: \"none\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n ...styles.item,\n ...styles[page],\n }\n\n return (\n <ui.button\n className={cx(\"ui-pagination__item\", className)}\n type=\"button\"\n tabIndex={page !== \"dots\" ? 0 : -1}\n disabled={isDisabled}\n data-selected={dataAttr(isActive)}\n data-disabled={dataAttr(isDisabled)}\n __css={css}\n {...rest}\n onPointerDown={onPointerDown}\n >\n {children}\n\n <Ripple isDisabled={disableRipple || isDisabled} {...rippleProps} />\n </ui.button>\n )\n}\n","import type { IconProps } from \"@yamada-ui/icon\"\nimport { Icon } from \"@yamada-ui/icon\"\nimport type { FC } from \"react\"\n\nexport const DotsIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z\"\n />\n </Icon>\n )\n}\n\nexport const FirstIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z\"\n />\n </Icon>\n )\n}\n\nexport const LastIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z\"\n />\n </Icon>\n )\n}\n\nexport const PrevIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z\"\n />\n </Icon>\n )\n}\n\nexport const NextIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z\"\n />\n </Icon>\n )\n}\n","import type { CSSUIObject, Token } from \"@yamada-ui/core\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\n\ninterface PaginationContext {\n [key: string]: CSSUIObject\n}\n\nexport const [PaginationProvider, usePaginationContext] =\n createContext<PaginationContext>({\n strict: false,\n name: \"PaginationContext\",\n })\n\nexport const computedRange = (start: number, end: number) =>\n Array.from({ length: end - start + 1 }, (_, index) => index + start)\n\nexport interface UsePaginationProps {\n /**\n * The page of the pagination.\n * Should be less than `total` and greater than `1`.\n */\n page?: number\n /**\n * The initial page of the pagination.\n * Should be less than `total` and greater than `1`.\n *\n * @default 1\n */\n defaultPage?: number\n /**\n * The total number of pages in pagination.\n */\n total: number\n /** Number of siblings displayed on the left/right side of selected page.\n *\n * @default 1\n */\n siblings?: Token<number>\n /**\n * Number of elements visible on the left/right edges.\n *\n * @default 1\n */\n boundaries?: Token<number>\n /**\n * If `true`, the pagination all item will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * The callback invoked when the page changes.\n */\n onChange?: (page: number) => void\n}\n\nexport const usePagination = ({\n page,\n defaultPage = 1,\n total,\n siblings: _siblings = 1,\n boundaries: _boundaries = 1,\n isDisabled = false,\n onChange: onChangeProp,\n}: UsePaginationProps) => {\n const siblings = useValue(_siblings)\n const boundaries = useValue(_boundaries)\n\n const [currentPage, setCurrentPage] = useControllableState({\n value: page,\n defaultValue: defaultPage,\n onChange: onChangeProp,\n })\n\n const onFirst = useCallback(() => setCurrentPage(1), [setCurrentPage])\n\n const onLast = useCallback(\n () => setCurrentPage(total),\n [setCurrentPage, total],\n )\n\n const onPrev = useCallback(\n () => setCurrentPage((prev) => (prev === 1 ? prev : prev - 1)),\n [setCurrentPage],\n )\n\n const onNext = useCallback(\n () => setCurrentPage((prev) => (prev === total ? prev : prev + 1)),\n [setCurrentPage, total],\n )\n\n const onChange = useCallback(\n (page: number) => setCurrentPage(page),\n [setCurrentPage],\n )\n\n const range = useMemo((): (number | \"dots\")[] => {\n const minimumTotal = siblings * 2 + 3 + boundaries * 2\n\n if (minimumTotal >= total) return computedRange(1, total)\n\n const prevSiblings = Math.max(currentPage - siblings, boundaries)\n const nextSiblings = Math.min(currentPage + siblings, total - boundaries)\n\n const prevDots = prevSiblings > boundaries + 2\n const nextDots = nextSiblings < total - (boundaries + 1)\n\n if (!prevDots && nextDots) {\n const prevPages = siblings * 2 + boundaries + 2\n\n return [\n ...computedRange(1, prevPages),\n \"dots\",\n ...computedRange(total - (boundaries - 1), total),\n ]\n }\n\n if (prevDots && !nextDots) {\n const nextPages = boundaries + 1 + 2 * siblings\n\n return [\n ...computedRange(1, boundaries),\n \"dots\",\n ...computedRange(total - nextPages, total),\n ]\n }\n\n return [\n ...computedRange(1, boundaries),\n \"dots\",\n ...computedRange(prevSiblings, nextSiblings),\n \"dots\",\n ...computedRange(total - boundaries + 1, total),\n ]\n }, [boundaries, siblings, currentPage, total])\n\n return {\n currentPage,\n total,\n isDisabled,\n onFirst,\n onLast,\n onPrev,\n onNext,\n onChange,\n range,\n }\n}\n\nexport type UsePaginationReturn = ReturnType<typeof usePagination>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAmB;AACnB,oBAAkC;AAClC,IAAAA,gBAA6B;;;ACF7B,kBAAqB;AAMf;AAHC,IAAM,WAA0B,CAAC,UAAU;AAChD,SACE,4CAAC,oBAAK,SAAQ,aAAa,GAAG,OAC5B;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAEO,IAAM,YAA2B,CAAC,UAAU;AACjD,SACE,4CAAC,oBAAK,SAAQ,aAAa,GAAG,OAC5B;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAEO,IAAM,WAA0B,CAAC,UAAU;AAChD,SACE,4CAAC,oBAAK,SAAQ,aAAa,GAAG,OAC5B;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAEO,IAAM,WAA0B,CAAC,UAAU;AAChD,SACE,4CAAC,oBAAK,SAAQ,aAAa,GAAG,OAC5B;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAEO,IAAM,WAA0B,CAAC,UAAU;AAChD,SACE,4CAAC,oBAAK,SAAQ,aAAa,GAAG,OAC5B;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;;;ACxDA,oCAAqC;AACrC,uBAAyB;AACzB,mBAA8B;AAC9B,mBAAqC;AAM9B,IAAM,CAAC,oBAAoB,oBAAoB,QACpD,4BAAiC;AAAA,EAC/B,QAAQ;AAAA,EACR,MAAM;AACR,CAAC;;;AFgCK,IAAAC,sBAAA;AAHR,IAAM,UAEF;AAAA,EACF,MAAM,6CAAC,YAAS;AAAA,EAChB,MAAM,6CAAC,YAAS;AAAA,EAChB,MAAM,6CAAC,YAAS;AAAA,EAChB,OAAO,6CAAC,aAAU;AAAA,EAClB,MAAM,6CAAC,YAAS;AAClB;AAEO,IAAM,iBAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AA7DN;AA8DE,QAAM,SAAS,qBAAqB;AACpC,QAAM,EAAE,eAAe,GAAG,YAAY,QAAI,yBAAU;AAAA,IAClD,GAAG;AAAA,IACH,YAAY,iBAAiB;AAAA,EAC/B,CAAC;AAED,4CAAa,aAAQ,IAAI,MAAZ,YAAiB;AAE9B,QAAM,MAAmB;AAAA,IACvB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,GAAG,OAAO;AAAA,IACV,GAAG,OAAO,IAAI;AAAA,EAChB;AAEA,SACE;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC,eAAW,kBAAG,uBAAuB,SAAS;AAAA,MAC9C,MAAK;AAAA,MACL,UAAU,SAAS,SAAS,IAAI;AAAA,MAChC,UAAU;AAAA,MACV,qBAAe,wBAAS,QAAQ;AAAA,MAChC,qBAAe,wBAAS,UAAU;AAAA,MAClC,OAAO;AAAA,MACN,GAAG;AAAA,MACJ;AAAA,MAEC;AAAA;AAAA,QAED,6CAAC,wBAAO,YAAY,iBAAiB,YAAa,GAAG,aAAa;AAAA;AAAA;AAAA,EACpE;AAEJ;","names":["import_utils","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../src/pagination-item.tsx","../src/pagination-icon.tsx","../src/use-pagination.ts"],"sourcesContent":["import type { CSSUIObject, FC } from \"@yamada-ui/core\"\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport { ui } from \"@yamada-ui/core\"\nimport { Ripple, useRipple } from \"@yamada-ui/ripple\"\nimport { cx, dataAttr } from \"@yamada-ui/utils\"\nimport {\n DotsIcon,\n FirstIcon,\n LastIcon,\n NextIcon,\n PrevIcon,\n} from \"./pagination-icon\"\nimport { usePaginationContext } from \"./use-pagination\"\n\ninterface PaginationItemOptions {\n /**\n * The type of the page or item assigned to the pagination item.\n */\n page: \"dots\" | \"first\" | \"last\" | \"next\" | \"prev\" | number\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * If `true`, the pagination item will be activated.\n *\n * @default false\n */\n isActive?: boolean\n /**\n * If `true`, the pagination item will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n}\n\nexport interface PaginationItemProps\n extends ComponentPropsWithoutRef<\"button\">,\n PaginationItemOptions {}\n\nconst iconMap: {\n [key in \"dots\" | \"first\" | \"last\" | \"next\" | \"prev\" | number]: ReactNode\n} = {\n dots: <DotsIcon />,\n first: <FirstIcon />,\n last: <LastIcon />,\n next: <NextIcon />,\n prev: <PrevIcon />,\n}\n\nexport const PaginationItem: FC<PaginationItemProps> = ({\n className,\n children,\n disableRipple,\n isActive,\n isDisabled,\n page,\n ...rest\n}) => {\n const styles = usePaginationContext()\n const { onPointerDown, ...rippleProps } = useRipple({\n ...rest,\n isDisabled: disableRipple || isDisabled,\n })\n\n children ??= iconMap[page] ?? page\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n position: \"relative\",\n userSelect: \"none\",\n ...styles.item,\n ...styles[page],\n }\n\n return (\n <ui.button\n type=\"button\"\n className={cx(\"ui-pagination__item\", className)}\n data-disabled={dataAttr(isDisabled)}\n data-selected={dataAttr(isActive)}\n disabled={isDisabled}\n tabIndex={page !== \"dots\" ? 0 : -1}\n __css={css}\n {...rest}\n onPointerDown={onPointerDown}\n >\n {children}\n\n <Ripple isDisabled={disableRipple || isDisabled} {...rippleProps} />\n </ui.button>\n )\n}\nPaginationItem.displayName = \"PaginationItem\"\nPaginationItem.__ui__ = \"PaginationItem\"\n","import type { FC } from \"@yamada-ui/core\"\nimport type { IconProps } from \"@yamada-ui/icon\"\nimport { Icon } from \"@yamada-ui/icon\"\n\nexport const DotsIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n d=\"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z\"\n fill=\"currentColor\"\n />\n </Icon>\n )\n}\nDotsIcon.displayName = \"DotIcon\"\nDotsIcon.__ui__ = \"DotIcon\"\n\nexport const FirstIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n d=\"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z\"\n fill=\"currentColor\"\n />\n </Icon>\n )\n}\n\nFirstIcon.displayName = \"LastIcon\"\nFirstIcon.__ui__ = \"LastIcon\"\n\nexport const LastIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n d=\"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z\"\n fill=\"currentColor\"\n />\n </Icon>\n )\n}\nLastIcon.displayName = \"LastIcon\"\nLastIcon.__ui__ = \"LastIcon\"\n\nexport const PrevIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n d=\"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z\"\n fill=\"currentColor\"\n />\n </Icon>\n )\n}\n\nexport const NextIcon: FC<IconProps> = (props) => {\n return (\n <Icon viewBox=\"0 0 16 16\" {...props}>\n <path\n d=\"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z\"\n fill=\"currentColor\"\n />\n </Icon>\n )\n}\nNextIcon.displayName = \"NextIcon\"\nNextIcon.__ui__ = \"NextIcon\"\n","import type { CSSUIObject, Token } from \"@yamada-ui/core\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\n\ninterface PaginationContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [PaginationProvider, usePaginationContext] =\n createContext<PaginationContext>({\n name: \"PaginationContext\",\n errorMessage: `usePaginationContext returned is 'undefined'. Seems you forgot to wrap the components in \"<Pagination />\"`,\n })\n\nexport const computedRange = (start: number, end: number) =>\n Array.from({ length: end - start + 1 }, (_, index) => index + start)\n\nexport interface UsePaginationProps {\n /**\n * The total number of pages in pagination.\n */\n total: number\n /**\n * Number of elements visible on the left/right edges.\n *\n * @default 1\n */\n boundaries?: Token<number>\n /**\n * The initial page of the pagination.\n * Should be less than `total` and greater than `1`.\n *\n * @default 1\n */\n defaultPage?: number\n /**\n * If `true`, the pagination all item will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * The page of the pagination.\n * Should be less than `total` and greater than `1`.\n */\n page?: number\n /** Number of siblings displayed on the left/right side of selected page.\n *\n * @default 1\n */\n siblings?: Token<number>\n /**\n * The callback invoked when the page changes.\n */\n onChange?: (page: number) => void\n}\n\nexport const usePagination = ({\n boundaries: _boundaries = 1,\n defaultPage = 1,\n isDisabled = false,\n page,\n siblings: _siblings = 1,\n total,\n onChange: onChangeProp,\n}: UsePaginationProps) => {\n const siblings = useValue(_siblings)\n const boundaries = useValue(_boundaries)\n\n const [currentPage, setCurrentPage] = useControllableState({\n defaultValue: defaultPage,\n value: page,\n onChange: onChangeProp,\n })\n\n const onFirst = useCallback(() => setCurrentPage(1), [setCurrentPage])\n\n const onLast = useCallback(\n () => setCurrentPage(total),\n [setCurrentPage, total],\n )\n\n const onPrev = useCallback(\n () => setCurrentPage((prev) => (prev === 1 ? prev : prev - 1)),\n [setCurrentPage],\n )\n\n const onNext = useCallback(\n () => setCurrentPage((prev) => (prev === total ? prev : prev + 1)),\n [setCurrentPage, total],\n )\n\n const onChange = useCallback(\n (page: number) => setCurrentPage(page),\n [setCurrentPage],\n )\n\n const range = useMemo((): (\"dots\" | number)[] => {\n const minimumTotal = siblings * 2 + 3 + boundaries * 2\n\n if (minimumTotal >= total) return computedRange(1, total)\n\n const prevSiblings = Math.max(currentPage - siblings, boundaries)\n const nextSiblings = Math.min(currentPage + siblings, total - boundaries)\n\n const prevDots = prevSiblings > boundaries + 2\n const nextDots = nextSiblings < total - (boundaries + 1)\n\n if (!prevDots && nextDots) {\n const prevPages = siblings * 2 + boundaries + 2\n\n return [\n ...computedRange(1, prevPages),\n \"dots\",\n ...computedRange(total - (boundaries - 1), total),\n ]\n }\n\n if (prevDots && !nextDots) {\n const nextPages = boundaries + 1 + 2 * siblings\n\n return [\n ...computedRange(1, boundaries),\n \"dots\",\n ...computedRange(total - nextPages, total),\n ]\n }\n\n return [\n ...computedRange(1, boundaries),\n \"dots\",\n ...computedRange(prevSiblings, nextSiblings),\n \"dots\",\n ...computedRange(total - boundaries + 1, total),\n ]\n }, [boundaries, siblings, currentPage, total])\n\n return {\n currentPage,\n isDisabled,\n range,\n total,\n onChange,\n onFirst,\n onLast,\n onNext,\n onPrev,\n }\n}\n\nexport type UsePaginationReturn = ReturnType<typeof usePagination>\n"],"mappings":"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","names":["import_utils","import_jsx_runtime"]}
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  import {
3
3
  PaginationItem
4
- } from "./chunk-UK2DDH2Q.mjs";
5
- import "./chunk-FAA64ZR4.mjs";
6
- import "./chunk-CDBANJFO.mjs";
4
+ } from "./chunk-GOSRKZFX.mjs";
5
+ import "./chunk-VPZBFCSD.mjs";
6
+ import "./chunk-GKZNNZOM.mjs";
7
7
  export {
8
8
  PaginationItem
9
9
  };
@@ -9,10 +9,6 @@ interface PaginationOptions {
9
9
  * The pagination button component to use.
10
10
  */
11
11
  component?: FC<PaginationItemProps>;
12
- /**
13
- * Props for button element.
14
- */
15
- itemProps?: HTMLUIProps<"button">;
16
12
  /**
17
13
  * If `true`, display the control buttons.
18
14
  *
@@ -20,41 +16,45 @@ interface PaginationOptions {
20
16
  */
21
17
  withControls?: Token<boolean>;
22
18
  /**
23
- * Props for inner element.
19
+ * If `true`, display the edge buttons.
20
+ *
21
+ * @default false
24
22
  */
25
- innerProps?: HTMLUIProps;
23
+ withEdges?: Token<boolean>;
26
24
  /**
27
- * Props for control button element.
25
+ * Props for next of the control button element.
28
26
  */
29
- controlProps?: HTMLUIProps<"button">;
27
+ controlNextProps?: HTMLUIProps<"button">;
30
28
  /**
31
29
  * Props for previous of the control button element.
32
30
  */
33
31
  controlPrevProps?: HTMLUIProps<"button">;
34
32
  /**
35
- * Props for next of the control button element.
33
+ * Props for control button element.
36
34
  */
37
- controlNextProps?: HTMLUIProps<"button">;
35
+ controlProps?: HTMLUIProps<"button">;
38
36
  /**
39
- * If `true`, display the edge buttons.
40
- *
41
- * @default false
37
+ * Props for first of the edge button element.
42
38
  */
43
- withEdges?: Token<boolean>;
39
+ edgeFirstProps?: HTMLUIProps<"button">;
40
+ /**
41
+ * Props for last of the edge button element.
42
+ */
43
+ edgeLastProps?: HTMLUIProps<"button">;
44
44
  /**
45
45
  * Props for edge button element.
46
46
  */
47
47
  edgeProps?: HTMLUIProps<"button">;
48
48
  /**
49
- * Props for first of the edge button element.
49
+ * Props for inner element.
50
50
  */
51
- edgeFirstProps?: HTMLUIProps<"button">;
51
+ innerProps?: HTMLUIProps;
52
52
  /**
53
- * Props for last of the edge button element.
53
+ * Props for button element.
54
54
  */
55
- edgeLastProps?: HTMLUIProps<"button">;
55
+ itemProps?: HTMLUIProps<"button">;
56
56
  }
57
- interface PaginationProps extends Omit<HTMLUIProps, "onChange" | "children" | "page">, ThemeProps<"Pagination">, UsePaginationProps, PaginationOptions {
57
+ interface PaginationProps extends Omit<HTMLUIProps, "children" | "onChange" | "page">, ThemeProps<"Pagination">, UsePaginationProps, PaginationOptions {
58
58
  }
59
59
  /**
60
60
  * `Pagination` is a component for managing the pagination and navigation of content.
@@ -9,10 +9,6 @@ interface PaginationOptions {
9
9
  * The pagination button component to use.
10
10
  */
11
11
  component?: FC<PaginationItemProps>;
12
- /**
13
- * Props for button element.
14
- */
15
- itemProps?: HTMLUIProps<"button">;
16
12
  /**
17
13
  * If `true`, display the control buttons.
18
14
  *
@@ -20,41 +16,45 @@ interface PaginationOptions {
20
16
  */
21
17
  withControls?: Token<boolean>;
22
18
  /**
23
- * Props for inner element.
19
+ * If `true`, display the edge buttons.
20
+ *
21
+ * @default false
24
22
  */
25
- innerProps?: HTMLUIProps;
23
+ withEdges?: Token<boolean>;
26
24
  /**
27
- * Props for control button element.
25
+ * Props for next of the control button element.
28
26
  */
29
- controlProps?: HTMLUIProps<"button">;
27
+ controlNextProps?: HTMLUIProps<"button">;
30
28
  /**
31
29
  * Props for previous of the control button element.
32
30
  */
33
31
  controlPrevProps?: HTMLUIProps<"button">;
34
32
  /**
35
- * Props for next of the control button element.
33
+ * Props for control button element.
36
34
  */
37
- controlNextProps?: HTMLUIProps<"button">;
35
+ controlProps?: HTMLUIProps<"button">;
38
36
  /**
39
- * If `true`, display the edge buttons.
40
- *
41
- * @default false
37
+ * Props for first of the edge button element.
42
38
  */
43
- withEdges?: Token<boolean>;
39
+ edgeFirstProps?: HTMLUIProps<"button">;
40
+ /**
41
+ * Props for last of the edge button element.
42
+ */
43
+ edgeLastProps?: HTMLUIProps<"button">;
44
44
  /**
45
45
  * Props for edge button element.
46
46
  */
47
47
  edgeProps?: HTMLUIProps<"button">;
48
48
  /**
49
- * Props for first of the edge button element.
49
+ * Props for inner element.
50
50
  */
51
- edgeFirstProps?: HTMLUIProps<"button">;
51
+ innerProps?: HTMLUIProps;
52
52
  /**
53
- * Props for last of the edge button element.
53
+ * Props for button element.
54
54
  */
55
- edgeLastProps?: HTMLUIProps<"button">;
55
+ itemProps?: HTMLUIProps<"button">;
56
56
  }
57
- interface PaginationProps extends Omit<HTMLUIProps, "onChange" | "children" | "page">, ThemeProps<"Pagination">, UsePaginationProps, PaginationOptions {
57
+ interface PaginationProps extends Omit<HTMLUIProps, "children" | "onChange" | "page">, ThemeProps<"Pagination">, UsePaginationProps, PaginationOptions {
58
58
  }
59
59
  /**
60
60
  * `Pagination` is a component for managing the pagination and navigation of content.