beez-ui 2.7.1 → 3.0.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +43 -13
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/dist/components/account-menu.d.ts +4 -3
  5. package/dist/components/account-menu.js +63 -54
  6. package/dist/components/alert.d.ts +15 -15
  7. package/dist/components/alert.js +289 -270
  8. package/dist/components/animated-theme-toggler.js +1 -1
  9. package/dist/components/avatar.d.ts +56 -31
  10. package/dist/components/avatar.js +394 -277
  11. package/dist/components/badge.d.ts +8 -28
  12. package/dist/components/badge.js +55 -108
  13. package/dist/components/calendar.d.ts +36 -26
  14. package/dist/components/calendar.js +132 -1227
  15. package/dist/components/card.d.ts +36 -25
  16. package/dist/components/card.js +895 -72
  17. package/dist/components/carousel.d.ts +63 -47
  18. package/dist/components/carousel.js +496 -777
  19. package/dist/components/data-table.d.ts +5 -4
  20. package/dist/components/data-table.js +7 -6
  21. package/dist/components/dialog-surface.d.ts +23 -1
  22. package/dist/components/dialog-surface.js +99 -3
  23. package/dist/components/dialog.d.ts +80 -45
  24. package/dist/components/dialog.js +258 -503
  25. package/dist/components/dropdown-menu.d.ts +56 -73
  26. package/dist/components/dropdown-menu.js +79 -714
  27. package/dist/components/field.d.ts +3 -1
  28. package/dist/components/field.js +49 -39
  29. package/dist/components/filter-presets-bar.js +2 -2
  30. package/dist/components/filter-query-bar.js +1 -1
  31. package/dist/components/hover-card.d.ts +42 -41
  32. package/dist/components/hover-card.js +57 -483
  33. package/dist/components/pagination.d.ts +53 -31
  34. package/dist/components/pagination.js +176 -412
  35. package/dist/components/popover.d.ts +11 -23
  36. package/dist/components/popover.js +19 -304
  37. package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
  38. package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
  39. package/dist/components/primitives/avatar.d.ts +46 -0
  40. package/dist/components/primitives/avatar.js +267 -0
  41. package/dist/components/primitives/calendar.d.ts +37 -0
  42. package/dist/components/primitives/calendar.js +1250 -0
  43. package/dist/components/primitives/carousel.d.ts +106 -0
  44. package/dist/components/primitives/carousel.js +928 -0
  45. package/dist/components/primitives/dialog.d.ts +62 -0
  46. package/dist/components/primitives/dialog.js +490 -0
  47. package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
  48. package/dist/components/primitives/dropdown-menu-items.js +265 -0
  49. package/dist/components/primitives/dropdown-menu.d.ts +64 -0
  50. package/dist/components/primitives/dropdown-menu.js +557 -0
  51. package/dist/components/primitives/hover-card.d.ts +50 -0
  52. package/dist/components/primitives/hover-card.js +507 -0
  53. package/dist/components/primitives/pagination.d.ts +65 -0
  54. package/dist/components/primitives/pagination.js +373 -0
  55. package/dist/components/primitives/popover.d.ts +22 -0
  56. package/dist/components/primitives/popover.js +213 -0
  57. package/dist/components/primitives/select.d.ts +36 -0
  58. package/dist/components/primitives/select.js +407 -0
  59. package/dist/components/primitives/tooltip.d.ts +30 -0
  60. package/dist/components/primitives/tooltip.js +277 -0
  61. package/dist/components/radio-group.d.ts +30 -17
  62. package/dist/components/radio-group.js +266 -315
  63. package/dist/components/rich-link-editor.js +1 -1
  64. package/dist/components/select.d.ts +51 -42
  65. package/dist/components/select.js +163 -495
  66. package/dist/components/skeleton.d.ts +16 -15
  67. package/dist/components/skeleton.js +99 -205
  68. package/dist/components/split-button.js +1 -1
  69. package/dist/components/switch.d.ts +3 -6
  70. package/dist/components/switch.js +163 -170
  71. package/dist/components/tabs.d.ts +3 -11
  72. package/dist/components/tabs.js +61 -75
  73. package/dist/components/themed-toaster.d.ts +1 -1
  74. package/dist/components/themed-toaster.js +1 -1
  75. package/dist/components/toaster.d.ts +1 -1
  76. package/dist/components/toaster.js +1 -1
  77. package/dist/components/tooltip.d.ts +36 -31
  78. package/dist/components/tooltip.js +44 -284
  79. package/dist/constants/alert.d.ts +5 -1
  80. package/dist/constants/alert.js +5 -1
  81. package/dist/constants/avatar.d.ts +24 -1
  82. package/dist/constants/avatar.js +19 -0
  83. package/dist/constants/calendar.d.ts +12 -0
  84. package/dist/constants/calendar.js +12 -0
  85. package/dist/constants/card.d.ts +23 -0
  86. package/dist/constants/card.js +20 -0
  87. package/dist/constants/carousel.d.ts +31 -13
  88. package/dist/constants/carousel.js +32 -11
  89. package/dist/constants/dialog.d.ts +6 -1
  90. package/dist/constants/dialog.js +5 -1
  91. package/dist/constants/dropdown-menu.d.ts +2 -2
  92. package/dist/constants/dropdown-menu.js +2 -2
  93. package/dist/constants/pagination.d.ts +13 -2
  94. package/dist/constants/pagination.js +13 -2
  95. package/dist/constants/select.d.ts +4 -2
  96. package/dist/constants/select.js +4 -2
  97. package/dist/constants/switch.d.ts +5 -16
  98. package/dist/constants/switch.js +6 -14
  99. package/dist/hooks/use-today.d.ts +7 -0
  100. package/dist/hooks/use-today.js +50 -0
  101. package/dist/hooks.d.ts +1 -0
  102. package/dist/hooks.js +1 -0
  103. package/dist/index.d.ts +0 -1
  104. package/dist/index.js +0 -1
  105. package/dist/motion/glide-indicator.d.ts +1 -1
  106. package/dist/motion/glide-indicator.js +1 -1
  107. package/dist/motion/presence.d.ts +0 -1
  108. package/dist/motion/presence.js +0 -1
  109. package/dist/styles.css +1 -1
  110. package/package.json +1 -6
@@ -1,426 +1,190 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
- import { cva } from "class-variance-authority";
4
- import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
5
- import { PAGINATION_DEFAULT_COPY } from "../constants/pagination.js";
6
- import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
7
- import { cn } from "../lib/utils.js";
8
- import { useArcPress } from "../motion/arc-press.js";
9
- import { GlideSlot } from "../motion/glide-slot.js";
10
- import { useAttachedElement } from "../motion/use-attached-element.js";
11
- import { Link } from "./link.js";
3
+ import { PAGINATION_DEFAULT_COPY, PAGINATION_FIRST_PAGE, PAGINATION_WINDOW_SIZE } from "../constants/pagination.js";
4
+ import { PaginationButton, PaginationContent, PaginationItem, PaginationLink, PaginationRoot, PaginationStep } from "./primitives/pagination.js";
12
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
6
  /**
14
- * Landmark that holds the page controls.
15
- * @param props - Native `nav` attributes; `aria-label` defaults to Spanish copy.
16
- * @returns The navigation landmark.
7
+ * Lists the pages of the window around the current page.
8
+ * @param currentPage - Clamped current page.
9
+ * @param pageCount - Total pages.
10
+ * @returns The visible page numbers, in order.
17
11
  */
18
- function Pagination(t0) {
19
- const $ = _c(8);
20
- let className;
21
- let props;
22
- if ($[0] !== t0) {
23
- ({className, ...props} = t0);
24
- $[0] = t0;
25
- $[1] = className;
26
- $[2] = props;
27
- } else {
28
- className = $[1];
29
- props = $[2];
30
- }
31
- let t1;
32
- if ($[3] !== className) {
33
- t1 = cn("mx-auto flex w-full justify-center", className);
34
- $[3] = className;
35
- $[4] = t1;
36
- } else {
37
- t1 = $[4];
38
- }
39
- let t2;
40
- if ($[5] !== props || $[6] !== t1) {
41
- t2 = /* @__PURE__ */ _jsx("nav", {
42
- role: "navigation",
43
- "aria-label": PAGINATION_DEFAULT_COPY.navigationLabel,
44
- "data-slot": "pagination",
45
- className: t1,
46
- ...props
47
- });
48
- $[5] = props;
49
- $[6] = t1;
50
- $[7] = t2;
51
- } else {
52
- t2 = $[7];
53
- }
54
- return t2;
55
- }
56
- /** Lists page links; the current page's mark glides to the newly selected page. */
57
- function PaginationContent(t0) {
58
- const $ = _c(8);
59
- let className;
60
- let props;
61
- if ($[0] !== t0) {
62
- ({className, ...props} = t0);
63
- $[0] = t0;
64
- $[1] = className;
65
- $[2] = props;
66
- } else {
67
- className = $[1];
68
- props = $[2];
69
- }
70
- let t1;
71
- if ($[3] !== className) {
72
- t1 = cn("flex flex-wrap items-center gap-(--space-1)", className);
73
- $[3] = className;
74
- $[4] = t1;
75
- } else {
76
- t1 = $[4];
77
- }
78
- let t2;
79
- if ($[5] !== props || $[6] !== t1) {
80
- t2 = /* @__PURE__ */ _jsx(GlideSlot, {
81
- preset: "pagination",
82
- children: /* @__PURE__ */ _jsx("ul", {
83
- "data-slot": "pagination-content",
84
- className: t1,
85
- ...props
86
- })
87
- });
88
- $[5] = props;
89
- $[6] = t1;
90
- $[7] = t2;
91
- } else {
92
- t2 = $[7];
93
- }
94
- return t2;
95
- }
96
- function PaginationItem(t0) {
97
- const $ = _c(4);
98
- let props;
99
- if ($[0] !== t0) {
100
- ({...props} = t0);
101
- $[0] = t0;
102
- $[1] = props;
103
- } else {
104
- props = $[1];
105
- }
106
- let t1;
107
- if ($[2] !== props) {
108
- t1 = /* @__PURE__ */ _jsx("li", {
109
- "data-slot": "pagination-item",
110
- ...props
111
- });
112
- $[2] = props;
113
- $[3] = t1;
114
- } else {
115
- t1 = $[3];
116
- }
117
- return t1;
12
+ function getVisiblePages(currentPage, pageCount) {
13
+ const halfWindow = Math.floor(PAGINATION_WINDOW_SIZE / 2);
14
+ const start = Math.max(PAGINATION_FIRST_PAGE, Math.min(pageCount - PAGINATION_WINDOW_SIZE + 1, currentPage - halfWindow));
15
+ return Array.from({ length: Math.min(pageCount, PAGINATION_WINDOW_SIZE) }, (_, index) => start + index);
118
16
  }
119
17
  /**
120
- * Arc's page control: a control-height square for numbers, padded for labelled arrows. The current page draws the
121
- * raised mark (border, surface and resting shadow) that the glide copies while it travels.
122
- */
123
- const paginationLinkVariants = cva("relative inline-flex h-(--control-height-sm) min-w-(--control-height-sm) shrink-0 cursor-pointer items-center justify-center gap-1 rounded-(--radius-control) border border-transparent bg-transparent font-sans text-xs font-medium whitespace-nowrap text-text-secondary tabular-nums no-underline [-webkit-tap-highlight-color:transparent] transition-[color,background-color,border-color,box-shadow,opacity] duration-(--duration-fast) ease-(--ease-standard) select-none motion-reduce:transition-none hover-fine:bg-surface-muted hover-fine:text-foreground aria-[current=page]:border-border aria-[current=page]:bg-surface aria-[current=page]:text-foreground aria-[current=page]:shadow-(--shadow-resting) aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
124
- variants: { size: {
125
- default: "px-(--space-3)",
126
- xs: "px-(--space-2)",
127
- sm: "px-(--space-2)",
128
- lg: "px-(--space-4)",
129
- icon: "px-0",
130
- "icon-xs": "px-0",
131
- "icon-sm": "px-0",
132
- "icon-lg": "px-0"
133
- } },
134
- defaultVariants: { size: "icon" }
135
- });
136
- /**
137
- * One page, rendered through the provider's `Link` adapter or the `component` passed to it.
138
- * @param props - `isActive` marks the current page (`aria-current="page"`); `size` keeps the previous size names
139
- * and only changes the horizontal padding; every other prop reaches the link. With `aria-disabled` the link
140
- * stays visible but never navigates, whether clicked or activated with Enter, and `onClick` is not called.
141
- * @returns The page link.
18
+ * Previous and next arrows around a five page window. Disabled arrows keep `aria-disabled` and never request a page.
19
+ * @param props - Current page, page count or next-page flag, handlers and copy.
20
+ * @returns The navigation landmark.
142
21
  */
143
- function PaginationLink(t0) {
144
- const $ = _c(19);
145
- let className;
146
- let isActive;
147
- let onClick;
148
- let props;
149
- let t1;
150
- if ($[0] !== t0) {
151
- ({className, isActive, size: t1, onClick, ...props} = t0);
152
- $[0] = t0;
153
- $[1] = className;
154
- $[2] = isActive;
155
- $[3] = onClick;
156
- $[4] = props;
157
- $[5] = t1;
158
- } else {
159
- className = $[1];
160
- isActive = $[2];
161
- onClick = $[3];
162
- props = $[4];
163
- t1 = $[5];
164
- }
165
- const size = t1 === undefined ? "icon" : t1;
166
- const isDisabled = props["aria-disabled"] === true || props["aria-disabled"] === "true";
167
- let t2;
168
- if ($[6] !== isDisabled || $[7] !== onClick) {
169
- t2 = function handleClick(event) {
170
- if (isDisabled) {
171
- event.preventDefault();
172
- return;
173
- }
174
- onClick?.(event);
175
- };
176
- $[6] = isDisabled;
177
- $[7] = onClick;
178
- $[8] = t2;
179
- } else {
180
- t2 = $[8];
181
- }
182
- const handleClick = t2;
183
- const t3 = isActive ? "page" : undefined;
184
- let t4;
185
- if ($[9] !== className || $[10] !== size) {
186
- t4 = cn(paginationLinkVariants({ size }), className);
187
- $[9] = className;
188
- $[10] = size;
189
- $[11] = t4;
190
- } else {
191
- t4 = $[11];
192
- }
193
- let t5;
194
- if ($[12] !== handleClick || $[13] !== isActive || $[14] !== props || $[15] !== size || $[16] !== t3 || $[17] !== t4) {
195
- t5 = /* @__PURE__ */ _jsx(Link, {
196
- "aria-current": t3,
197
- "data-slot": "pagination-link",
198
- "data-active": isActive,
199
- "data-size": size,
200
- className: t4,
201
- ...props,
202
- onClick: handleClick
203
- });
204
- $[12] = handleClick;
205
- $[13] = isActive;
206
- $[14] = props;
207
- $[15] = size;
208
- $[16] = t3;
209
- $[17] = t4;
210
- $[18] = t5;
211
- } else {
212
- t5 = $[18];
213
- }
214
- return t5;
215
- }
216
- /** A previous or next arrow: Arc presses it in, while page numbers stay still and let the mark travel. */
217
- function PaginationStep(t0) {
218
- const $ = _c(6);
219
- let props;
220
- let ref;
221
- if ($[0] !== t0) {
222
- ({ref, ...props} = t0);
223
- $[0] = t0;
224
- $[1] = props;
225
- $[2] = ref;
226
- } else {
227
- props = $[1];
228
- ref = $[2];
229
- }
230
- const reduceMotion = usePrefersReducedMotion();
231
- const [element, attach] = useAttachedElement(ref);
232
- useArcPress(element, !reduceMotion);
233
- let t1;
234
- if ($[3] !== attach || $[4] !== props) {
235
- t1 = /* @__PURE__ */ _jsx(PaginationLink, {
236
- ref: attach,
237
- size: "default",
238
- ...props
239
- });
240
- $[3] = attach;
241
- $[4] = props;
242
- $[5] = t1;
243
- } else {
244
- t1 = $[5];
245
- }
246
- return t1;
247
- }
248
- function PaginationPrevious(t0) {
249
- const $ = _c(13);
250
- let className;
251
- let props;
252
- let t1;
253
- if ($[0] !== t0) {
254
- ({className, text: t1, ...props} = t0);
255
- $[0] = t0;
256
- $[1] = className;
257
- $[2] = props;
258
- $[3] = t1;
259
- } else {
260
- className = $[1];
261
- props = $[2];
262
- t1 = $[3];
263
- }
264
- const text = t1 === undefined ? PAGINATION_DEFAULT_COPY.previousText : t1;
265
- let t2;
266
- if ($[4] !== className) {
267
- t2 = cn("pl-(--space-2)", className);
268
- $[4] = className;
269
- $[5] = t2;
270
- } else {
271
- t2 = $[5];
272
- }
273
- let t3;
274
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
275
- t3 = /* @__PURE__ */ _jsx(ChevronLeftIcon, {
276
- "data-icon": "inline-start",
277
- "aria-hidden": "true"
278
- });
279
- $[6] = t3;
280
- } else {
281
- t3 = $[6];
282
- }
283
- let t4;
284
- if ($[7] !== text) {
285
- t4 = /* @__PURE__ */ _jsx("span", {
286
- className: "hidden sm:block",
287
- children: text
288
- });
289
- $[7] = text;
290
- $[8] = t4;
291
- } else {
292
- t4 = $[8];
293
- }
294
- let t5;
295
- if ($[9] !== props || $[10] !== t2 || $[11] !== t4) {
296
- t5 = /* @__PURE__ */ _jsxs(PaginationStep, {
297
- "aria-label": PAGINATION_DEFAULT_COPY.previousLabel,
298
- className: t2,
299
- ...props,
300
- children: [t3, t4]
301
- });
302
- $[9] = props;
303
- $[10] = t2;
304
- $[11] = t4;
305
- $[12] = t5;
306
- } else {
307
- t5 = $[12];
308
- }
309
- return t5;
310
- }
311
- function PaginationNext(t0) {
312
- const $ = _c(13);
313
- let className;
314
- let props;
315
- let t1;
316
- if ($[0] !== t0) {
317
- ({className, text: t1, ...props} = t0);
318
- $[0] = t0;
319
- $[1] = className;
320
- $[2] = props;
321
- $[3] = t1;
322
- } else {
323
- className = $[1];
324
- props = $[2];
325
- t1 = $[3];
326
- }
327
- const text = t1 === undefined ? PAGINATION_DEFAULT_COPY.nextText : t1;
328
- let t2;
329
- if ($[4] !== className) {
330
- t2 = cn("pr-(--space-2)", className);
331
- $[4] = className;
332
- $[5] = t2;
333
- } else {
334
- t2 = $[5];
335
- }
336
- let t3;
337
- if ($[6] !== text) {
338
- t3 = /* @__PURE__ */ _jsx("span", {
339
- className: "hidden sm:block",
340
- children: text
341
- });
342
- $[6] = text;
343
- $[7] = t3;
344
- } else {
345
- t3 = $[7];
346
- }
347
- let t4;
348
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
349
- t4 = /* @__PURE__ */ _jsx(ChevronRightIcon, {
350
- "data-icon": "inline-end",
351
- "aria-hidden": "true"
352
- });
353
- $[8] = t4;
354
- } else {
355
- t4 = $[8];
356
- }
22
+ function Pagination(t0) {
23
+ const $ = _c(43);
24
+ const { page, pageCount, hasNextPage: t1, onPageChange, getHref, label: t2, previousLabel: t3, nextLabel: t4, className } = t0;
25
+ const hasNextPage = t1 === undefined ? false : t1;
26
+ const label = t2 === undefined ? PAGINATION_DEFAULT_COPY.navigationLabel : t2;
27
+ const previousLabel = t3 === undefined ? PAGINATION_DEFAULT_COPY.previousText : t3;
28
+ const nextLabel = t4 === undefined ? PAGINATION_DEFAULT_COPY.nextText : t4;
29
+ const isCursor = pageCount === undefined;
30
+ const safePageCount = isCursor ? 0 : Math.max(0, Math.floor(pageCount));
31
+ if (!isCursor && safePageCount === 0) {
32
+ let t5;
33
+ if ($[0] !== className || $[1] !== label) {
34
+ t5 = /* @__PURE__ */ _jsx(PaginationRoot, {
35
+ "aria-label": label,
36
+ className
37
+ });
38
+ $[0] = className;
39
+ $[1] = label;
40
+ $[2] = t5;
41
+ } else {
42
+ t5 = $[2];
43
+ }
44
+ return t5;
45
+ }
46
+ const lowestPage = Math.max(PAGINATION_FIRST_PAGE, Math.floor(page));
47
+ const currentPage = isCursor ? lowestPage : Math.min(lowestPage, safePageCount);
48
+ const isFirst = currentPage <= PAGINATION_FIRST_PAGE;
49
+ const isLast = isCursor ? !hasNextPage : currentPage >= safePageCount;
357
50
  let t5;
358
- if ($[9] !== props || $[10] !== t2 || $[11] !== t3) {
359
- t5 = /* @__PURE__ */ _jsxs(PaginationStep, {
360
- "aria-label": PAGINATION_DEFAULT_COPY.nextLabel,
361
- className: t2,
362
- ...props,
363
- children: [t3, t4]
51
+ if ($[3] !== getHref) {
52
+ t5 = (target) => getHref?.(target);
53
+ $[3] = getHref;
54
+ $[4] = t5;
55
+ } else {
56
+ t5 = $[4];
57
+ }
58
+ const hrefOf = t5;
59
+ const t6 = previousLabel === PAGINATION_DEFAULT_COPY.previousText ? PAGINATION_DEFAULT_COPY.previousLabel : previousLabel;
60
+ const t7 = isFirst ? currentPage : currentPage - 1;
61
+ let t8;
62
+ if ($[5] !== hrefOf || $[6] !== t7) {
63
+ t8 = hrefOf(t7);
64
+ $[5] = hrefOf;
65
+ $[6] = t7;
66
+ $[7] = t8;
67
+ } else {
68
+ t8 = $[7];
69
+ }
70
+ let t9;
71
+ if ($[8] !== currentPage || $[9] !== onPageChange) {
72
+ t9 = (event) => onPageChange?.(currentPage - 1, event);
73
+ $[8] = currentPage;
74
+ $[9] = onPageChange;
75
+ $[10] = t9;
76
+ } else {
77
+ t9 = $[10];
78
+ }
79
+ let t10;
80
+ if ($[11] !== isFirst || $[12] !== previousLabel || $[13] !== t6 || $[14] !== t8 || $[15] !== t9) {
81
+ t10 = /* @__PURE__ */ _jsx(PaginationItem, { children: /* @__PURE__ */ _jsx(PaginationStep, {
82
+ direction: "previous",
83
+ text: previousLabel,
84
+ label: t6,
85
+ href: t8,
86
+ disabled: isFirst,
87
+ onClick: t9
88
+ }) });
89
+ $[11] = isFirst;
90
+ $[12] = previousLabel;
91
+ $[13] = t6;
92
+ $[14] = t8;
93
+ $[15] = t9;
94
+ $[16] = t10;
95
+ } else {
96
+ t10 = $[16];
97
+ }
98
+ let t11;
99
+ if ($[17] !== currentPage || $[18] !== getHref || $[19] !== isCursor || $[20] !== onPageChange || $[21] !== safePageCount) {
100
+ t11 = isCursor ? null : getVisiblePages(currentPage, safePageCount).map((pageNumber) => {
101
+ const controlProps = {
102
+ isActive: pageNumber === currentPage,
103
+ "aria-label": `${PAGINATION_DEFAULT_COPY.pageLabelPrefix} ${pageNumber}`,
104
+ onClick: (event_0) => onPageChange?.(pageNumber, event_0),
105
+ children: pageNumber
106
+ };
107
+ return /* @__PURE__ */ _jsx(PaginationItem, { children: getHref ? /* @__PURE__ */ _jsx(PaginationLink, {
108
+ href: getHref(pageNumber),
109
+ ...controlProps
110
+ }) : /* @__PURE__ */ _jsx(PaginationButton, { ...controlProps }) }, pageNumber);
364
111
  });
365
- $[9] = props;
366
- $[10] = t2;
367
- $[11] = t3;
368
- $[12] = t5;
369
- } else {
370
- t5 = $[12];
371
- }
372
- return t5;
373
- }
374
- function PaginationEllipsis(t0) {
375
- const $ = _c(10);
376
- let className;
377
- let props;
378
- if ($[0] !== t0) {
379
- ({className, ...props} = t0);
380
- $[0] = t0;
381
- $[1] = className;
382
- $[2] = props;
383
- } else {
384
- className = $[1];
385
- props = $[2];
386
- }
387
- let t1;
388
- if ($[3] !== className) {
389
- t1 = cn("flex size-(--control-height-sm) items-center justify-center text-text-muted [&_svg:not([class*='size-'])]:size-4", className);
390
- $[3] = className;
391
- $[4] = t1;
392
- } else {
393
- t1 = $[4];
394
- }
395
- let t2;
396
- let t3;
397
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
398
- t2 = /* @__PURE__ */ _jsx(MoreHorizontalIcon, {});
399
- t3 = /* @__PURE__ */ _jsx("span", {
400
- className: "sr-only",
401
- children: PAGINATION_DEFAULT_COPY.morePages
402
- });
403
- $[5] = t2;
404
- $[6] = t3;
405
- } else {
406
- t2 = $[5];
407
- t3 = $[6];
408
- }
409
- let t4;
410
- if ($[7] !== props || $[8] !== t1) {
411
- t4 = /* @__PURE__ */ _jsxs("span", {
412
- "aria-hidden": true,
413
- "data-slot": "pagination-ellipsis",
414
- className: t1,
415
- ...props,
416
- children: [t2, t3]
112
+ $[17] = currentPage;
113
+ $[18] = getHref;
114
+ $[19] = isCursor;
115
+ $[20] = onPageChange;
116
+ $[21] = safePageCount;
117
+ $[22] = t11;
118
+ } else {
119
+ t11 = $[22];
120
+ }
121
+ const t12 = nextLabel === PAGINATION_DEFAULT_COPY.nextText ? PAGINATION_DEFAULT_COPY.nextLabel : nextLabel;
122
+ const t13 = isLast ? currentPage : currentPage + 1;
123
+ let t14;
124
+ if ($[23] !== hrefOf || $[24] !== t13) {
125
+ t14 = hrefOf(t13);
126
+ $[23] = hrefOf;
127
+ $[24] = t13;
128
+ $[25] = t14;
129
+ } else {
130
+ t14 = $[25];
131
+ }
132
+ let t15;
133
+ if ($[26] !== currentPage || $[27] !== onPageChange) {
134
+ t15 = (event_1) => onPageChange?.(currentPage + 1, event_1);
135
+ $[26] = currentPage;
136
+ $[27] = onPageChange;
137
+ $[28] = t15;
138
+ } else {
139
+ t15 = $[28];
140
+ }
141
+ let t16;
142
+ if ($[29] !== isLast || $[30] !== nextLabel || $[31] !== t12 || $[32] !== t14 || $[33] !== t15) {
143
+ t16 = /* @__PURE__ */ _jsx(PaginationItem, { children: /* @__PURE__ */ _jsx(PaginationStep, {
144
+ direction: "next",
145
+ text: nextLabel,
146
+ label: t12,
147
+ href: t14,
148
+ disabled: isLast,
149
+ onClick: t15
150
+ }) });
151
+ $[29] = isLast;
152
+ $[30] = nextLabel;
153
+ $[31] = t12;
154
+ $[32] = t14;
155
+ $[33] = t15;
156
+ $[34] = t16;
157
+ } else {
158
+ t16 = $[34];
159
+ }
160
+ let t17;
161
+ if ($[35] !== t10 || $[36] !== t11 || $[37] !== t16) {
162
+ t17 = /* @__PURE__ */ _jsxs(PaginationContent, { children: [
163
+ t10,
164
+ t11,
165
+ t16
166
+ ] });
167
+ $[35] = t10;
168
+ $[36] = t11;
169
+ $[37] = t16;
170
+ $[38] = t17;
171
+ } else {
172
+ t17 = $[38];
173
+ }
174
+ let t18;
175
+ if ($[39] !== className || $[40] !== label || $[41] !== t17) {
176
+ t18 = /* @__PURE__ */ _jsx(PaginationRoot, {
177
+ "aria-label": label,
178
+ className,
179
+ children: t17
417
180
  });
418
- $[7] = props;
419
- $[8] = t1;
420
- $[9] = t4;
181
+ $[39] = className;
182
+ $[40] = label;
183
+ $[41] = t17;
184
+ $[42] = t18;
421
185
  } else {
422
- t4 = $[9];
186
+ t18 = $[42];
423
187
  }
424
- return t4;
188
+ return t18;
425
189
  }
426
- export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
190
+ export { Pagination };
@@ -1,29 +1,17 @@
1
1
  /**
2
2
  * Arc's Popover (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a raised panel with Arc's panel radius
3
3
  * and floating shadow that starts a few pixels toward its trigger and settles on a spring, leaving faster than it
4
- * arrives. It keeps the Radix composition and adds Arc's `PopoverClose`.
4
+ * arrives. It follows Arc's composition: `Popover`, `PopoverTrigger`, `PopoverContent` and `PopoverClose`.
5
5
  */
6
- import * as React from "react";
7
- import { Popover as PopoverPrimitive } from "radix-ui";
8
- declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
9
- declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
10
- /** Closes the popover that contains it, such as a "Listo" or "Cancelar" button inside the panel. */
11
- declare function PopoverClose({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Close>): React.JSX.Element;
6
+ import type { ComponentProps } from "react";
7
+ import { Popover, PopoverClose, PopoverContent as PopoverContentPrimitive, PopoverTrigger } from "./primitives/popover.js";
8
+ export type PopoverContentProps = ComponentProps<typeof PopoverContentPrimitive>;
12
9
  /**
13
- * Renders Arc's panel: raised surface, hairline border, panel radius and floating shadow, kept inside the viewport.
14
- * Content taller than the room left on the placed side scrolls inside the panel instead of running off screen.
15
- * @param props - Radix content properties. `align` defaults to `center`, `sideOffset` to 6px and `collisionPadding`
16
- * to 10px.
17
- * @returns The portaled panel.
10
+ * Renders the portaled panel anchored to the trigger, kept inside the viewport; content taller than the room left
11
+ * scrolls inside the panel.
12
+ * @param props - Radix content properties. Arc's defaults: `align="start"`, a 6px `sideOffset` and a 10px
13
+ * `collisionPadding`.
14
+ * @returns The panel.
18
15
  */
19
- declare function PopoverContent({ className, align, sideOffset, collisionPadding, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
20
- declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
21
- /**
22
- * Groups popover headings with compact spacing.
23
- * @param props - Primitive properties and optional consumer overrides.
24
- * @returns The styled primitive with its original interaction contract.
25
- */
26
- declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
27
- declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
28
- declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
29
- export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
16
+ declare function PopoverContent({ align, ...props }: PopoverContentProps): import("react").JSX.Element;
17
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger };