@boxcustodia/library 2.0.0-alpha.30 → 2.0.0-alpha.32
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/components/calendar/calendar.cjs.js +1 -1
- package/dist/components/calendar/calendar.es.js +33 -33
- package/dist/components/combobox/combobox.cjs.js +1 -1
- package/dist/components/combobox/combobox.es.js +302 -282
- package/dist/components/pagination/pagination.cjs.js +1 -1
- package/dist/components/pagination/pagination.es.js +70 -67
- package/dist/components/select/select.cjs.js +1 -1
- package/dist/components/select/select.es.js +168 -154
- package/dist/hooks/use-pagination/use-pagination.cjs.js +1 -1
- package/dist/hooks/use-pagination/use-pagination.es.js +39 -39
- package/dist/src/components/combobox/combobox.d.ts +31 -12
- package/dist/src/components/pagination/pagination.d.ts +6 -2
- package/dist/src/components/select/select.d.ts +38 -12
- package/package.json +1 -1
- package/src/components/calendar/calendar.tsx +3 -3
- package/src/components/combobox/combobox.stories.tsx +7 -4
- package/src/components/combobox/combobox.test.tsx +52 -15
- package/src/components/combobox/combobox.tsx +109 -23
- package/src/components/form/form.stories.tsx +3 -2
- package/src/components/pagination/pagination.test.tsx +5 -5
- package/src/components/pagination/pagination.tsx +17 -16
- package/src/components/select/select.stories.tsx +51 -13
- package/src/components/select/select.test.tsx +114 -16
- package/src/components/select/select.tsx +97 -37
- package/src/hooks/use-pagination/use-pagination.test.tsx +26 -0
- package/src/hooks/use-pagination/use-pagination.ts +9 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),F=require("../../node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.js"),v=require("react"),N=require("./pagination.model.cjs.js"),I=require("../../hooks/use-range-pagination/use-range-pagination.cjs.js"),A=require("../../node_modules/lucide-react/dist/esm/icons/chevrons-left.cjs.js"),M=require("../../node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.js"),O=require("../../node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.js"),_=require("../../node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs.js"),B=require("../../node_modules/lucide-react/dist/esm/icons/ellipsis.cjs.js"),w=require("../select/select.cjs.js"),u=require("../../lib/cn.cjs.js"),T=require("../button/button.cjs.js"),G={goToFirst:"Ir a primera página",goToPrevious:"Ir a página anterior",goToNext:"Ir a próxima página",goToLast:"Ir a última página",goToPage:a=>`Ir a la página ${a}`,total:a=>`${a} resultados`,pageInfo:(a,n)=>`Página ${a} de ${n}`,range:(a,n,t)=>`${a} - ${n} de ${t}`,morePages:"Más páginas"},L=v.createContext(null);function c(){const a=v.useContext(L);if(!a)throw new Error("Pagination primitives must be used inside <PaginationRoot>");return a}function q({totalItems:a,pageSize:n,defaultPageSize:t=N.PAGINATION_SIZES[0],onPageSizeChange:e,currentPage:i,defaultCurrentPage:s=1,onCurrentPageChange:r,siblingCount:l=1,getPageHref:g,linkComponent:m="a",texts:j,className:h,children:S,...x}){const[P=t,d]=F.useControllableState({prop:n,defaultProp:t,onChange:e}),p=I.useRangePagination({totalItems:a,pageSize:P,page:i,defaultPage:s,onPageChange:r,siblingCount:l}),b=v.useMemo(()=>({...G,...j}),[j]),y=v.useMemo(()=>({...p,currentPage:p.page,maxPage:p.pageCount,pageSize:P,totalItems:a,setPageSize:d,getPageHref:g,linkComponent:m,texts:b}),[p,P,a,d,g,m,b]);return o.jsx(L.Provider,{value:y,children:o.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:u.cn("flex items-center gap-x-4",h),...x,children:S})})}function f({page:a,isActive:n,disabled:t,ariaLabel:e,dataSlot:i,children:s,className:r,buttonProps:l}){const{goTo:g,getPageHref:m,pageSize:j,linkComponent:h}=c(),S=h,x=m?.({page:a,pageSize:Number(j)}),P=!!x&&!t,d=()=>{t||g(a)},p={"data-slot":i,"data-active":n?"true":"false","aria-current":n?"page":void 0,"aria-label":e,className:u.cn("hover:bg-accent hover:text-accent-foreground",r)};return P&&x?o.jsx(T.Button,{variant:n?"outline":"ghost",size:"icon",nativeButton:!1,render:o.jsx(S,{href:x,onClick:d,children:s}),...p,...l}):o.jsx(T.Button,{variant:n?"outline":"ghost",size:"icon",disabled:t,onClick:d,...p,...l,children:s})}function z({page:a,isActive:n,className:t,children:e,buttonProps:i}){const{currentPage:s,texts:r}=c(),l=n??a===s;return o.jsx(f,{page:a,isActive:l,ariaLabel:r.goToPage(a),dataSlot:"pagination-link",className:t,buttonProps:i,children:e??a})}function Z({className:a,buttonProps:n,children:t}){const{isFirstPage:e,texts:i}=c();return o.jsx(f,{page:1,disabled:e,ariaLabel:i.goToFirst,dataSlot:"pagination-first",className:a,buttonProps:n,children:t??o.jsx(A.default,{"data-slot":"pagination-icon"})})}function C({className:a,buttonProps:n,children:t}){const{currentPage:e,isFirstPage:i,texts:s}=c();return o.jsx(f,{page:Math.max(1,e-1),disabled:i,ariaLabel:s.goToPrevious,dataSlot:"pagination-previous",className:a,buttonProps:n,children:t??o.jsx(M.default,{"data-slot":"pagination-icon"})})}function R({className:a,buttonProps:n,children:t}){const{currentPage:e,maxPage:i,isLastPage:s,texts:r}=c();return o.jsx(f,{page:Math.min(i,e+1),disabled:s,ariaLabel:r.goToNext,dataSlot:"pagination-next",className:a,buttonProps:n,children:t??o.jsx(O.default,{"data-slot":"pagination-icon"})})}function D({className:a,buttonProps:n,children:t}){const{maxPage:e,isLastPage:i,texts:s}=c();return o.jsx(f,{page:e,disabled:i,ariaLabel:s.goToLast,dataSlot:"pagination-last",className:a,buttonProps:n,children:t??o.jsx(_.default,{"data-slot":"pagination-icon"})})}function k({className:a,...n}){const{texts:t}=c();return o.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis","data-dots":"true",className:u.cn("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",a),...n,children:[o.jsx(B.default,{}),o.jsx("span",{className:"sr-only",children:t.morePages})]})}function U({className:a,linkClassName:n,ellipsisClassName:t}){const{paginationRange:e}=c();return o.jsx("div",{role:"list","data-slot":"pagination-pages",className:u.cn("flex items-center gap-1",a),children:e.map((i,s)=>i===I.DOTS?o.jsx(k,{className:t},`dots-${s}`):o.jsx(z,{page:i,className:n},i))})}function V({children:a,className:n,...t}){const{totalItems:e,texts:i}=c(),s=typeof a=="function"?a(e):a??i.total(e);return o.jsx("span",{"data-slot":"pagination-total",className:u.cn("text-sm",n),...t,children:s})}function X({children:a,className:n,...t}){const{currentPage:e,maxPage:i,texts:s}=c(),r=typeof a=="function"?a({page:e,max:i}):a??s.pageInfo(e,i);return o.jsx("span",{"data-slot":"pagination-page-info",className:u.cn("text-sm",n),...t,children:r})}function E({children:a,className:n,...t}){const{range:e,totalItems:i,texts:s}=c(),r=typeof a=="function"?a({...e,total:i}):a??s.range(e.start,e.end,i);return o.jsx("span",{"data-slot":"pagination-range",className:u.cn("text-sm",n),...t,children:r})}function $({sizes:a=N.PAGINATION_SIZES,className:n,...t}){const{pageSize:e,setPageSize:i,goTo:s}=c(),r=g=>{i(g),s(1)},l=a.map(g=>({label:String(g),value:g}));return o.jsx(w.Select,{items:l,"data-slot":"pagination-size-select",value:e,onValueChange:g=>g!=null&&r(g),className:u.cn("border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...t})}function H({sizes:a=N.PAGINATION_SIZES,selectClassName:n,rangeClassName:t,previousClassName:e,nextClassName:i,className:s,...r}){return o.jsxs(q,{className:s,...r,children:[a&&o.jsx($,{sizes:a,className:n}),o.jsx(E,{className:t}),o.jsx(C,{className:e}),o.jsx(R,{className:i})]})}exports.Pagination=H;exports.PaginationEllipsis=k;exports.PaginationFirst=Z;exports.PaginationLast=D;exports.PaginationLink=z;exports.PaginationNext=R;exports.PaginationPageInfo=X;exports.PaginationPages=U;exports.PaginationPrevious=C;exports.PaginationRange=E;exports.PaginationRoot=q;exports.PaginationSizeSelect=$;exports.PaginationTotal=V;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i, jsxs as L } from "react/jsx-runtime";
|
|
3
3
|
import { useControllableState as k } from "../../node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js";
|
|
4
|
-
import { useMemo as
|
|
4
|
+
import { useMemo as T, createContext as $, useContext as R } from "react";
|
|
5
5
|
import { PAGINATION_SIZES as N } from "./pagination.model.es.js";
|
|
6
6
|
import { useRangePagination as E, DOTS as F } from "../../hooks/use-range-pagination/use-range-pagination.es.js";
|
|
7
7
|
import y from "../../node_modules/lucide-react/dist/esm/icons/chevrons-left.es.js";
|
|
@@ -9,9 +9,10 @@ import w from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js
|
|
|
9
9
|
import B from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.es.js";
|
|
10
10
|
import M from "../../node_modules/lucide-react/dist/esm/icons/chevrons-right.es.js";
|
|
11
11
|
import j from "../../node_modules/lucide-react/dist/esm/icons/ellipsis.es.js";
|
|
12
|
+
import { Select as A } from "../select/select.es.js";
|
|
12
13
|
import { cn as l } from "../../lib/cn.es.js";
|
|
13
|
-
import { Button as
|
|
14
|
-
const
|
|
14
|
+
import { Button as C } from "../button/button.es.js";
|
|
15
|
+
const O = {
|
|
15
16
|
goToFirst: "Ir a primera página",
|
|
16
17
|
goToPrevious: "Ir a página anterior",
|
|
17
18
|
goToNext: "Ir a próxima página",
|
|
@@ -22,7 +23,7 @@ const A = {
|
|
|
22
23
|
range: (a, t, n) => `${a} - ${t} de ${n}`,
|
|
23
24
|
morePages: "Más páginas"
|
|
24
25
|
}, z = $(null);
|
|
25
|
-
function
|
|
26
|
+
function c() {
|
|
26
27
|
const a = R(z);
|
|
27
28
|
if (!a)
|
|
28
29
|
throw new Error(
|
|
@@ -38,8 +39,8 @@ function _({
|
|
|
38
39
|
currentPage: o,
|
|
39
40
|
defaultCurrentPage: s = 1,
|
|
40
41
|
onCurrentPageChange: r,
|
|
41
|
-
siblingCount:
|
|
42
|
-
getPageHref:
|
|
42
|
+
siblingCount: u = 1,
|
|
43
|
+
getPageHref: g,
|
|
43
44
|
linkComponent: x = "a",
|
|
44
45
|
texts: h,
|
|
45
46
|
className: v,
|
|
@@ -50,36 +51,36 @@ function _({
|
|
|
50
51
|
prop: t,
|
|
51
52
|
defaultProp: n,
|
|
52
53
|
onChange: e
|
|
53
|
-
}),
|
|
54
|
+
}), p = E({
|
|
54
55
|
totalItems: a,
|
|
55
56
|
pageSize: f,
|
|
56
57
|
page: o,
|
|
57
58
|
defaultPage: s,
|
|
58
59
|
onPageChange: r,
|
|
59
|
-
siblingCount:
|
|
60
|
-
}),
|
|
61
|
-
() => ({ ...
|
|
60
|
+
siblingCount: u
|
|
61
|
+
}), S = T(
|
|
62
|
+
() => ({ ...O, ...h }),
|
|
62
63
|
[h]
|
|
63
|
-
), I =
|
|
64
|
+
), I = T(
|
|
64
65
|
() => ({
|
|
65
|
-
...
|
|
66
|
-
currentPage:
|
|
67
|
-
maxPage:
|
|
66
|
+
...p,
|
|
67
|
+
currentPage: p.page,
|
|
68
|
+
maxPage: p.pageCount,
|
|
68
69
|
pageSize: f,
|
|
69
70
|
totalItems: a,
|
|
70
71
|
setPageSize: d,
|
|
71
|
-
getPageHref:
|
|
72
|
+
getPageHref: g,
|
|
72
73
|
linkComponent: x,
|
|
73
|
-
texts:
|
|
74
|
+
texts: S
|
|
74
75
|
}),
|
|
75
76
|
[
|
|
76
|
-
|
|
77
|
+
p,
|
|
77
78
|
f,
|
|
78
79
|
a,
|
|
79
80
|
d,
|
|
80
|
-
|
|
81
|
+
g,
|
|
81
82
|
x,
|
|
82
|
-
|
|
83
|
+
S
|
|
83
84
|
]
|
|
84
85
|
);
|
|
85
86
|
return /* @__PURE__ */ i(z.Provider, { value: I, children: /* @__PURE__ */ i(
|
|
@@ -102,11 +103,11 @@ function P({
|
|
|
102
103
|
dataSlot: o,
|
|
103
104
|
children: s,
|
|
104
105
|
className: r,
|
|
105
|
-
buttonProps:
|
|
106
|
+
buttonProps: u
|
|
106
107
|
}) {
|
|
107
|
-
const { goTo:
|
|
108
|
-
n ||
|
|
109
|
-
},
|
|
108
|
+
const { goTo: g, getPageHref: x, pageSize: h, linkComponent: v } = c(), b = v, m = x?.({ page: a, pageSize: Number(h) }), f = !!m && !n, d = () => {
|
|
109
|
+
n || g(a);
|
|
110
|
+
}, p = {
|
|
110
111
|
"data-slot": o,
|
|
111
112
|
"data-active": t ? "true" : "false",
|
|
112
113
|
"aria-current": t ? "page" : void 0,
|
|
@@ -114,24 +115,24 @@ function P({
|
|
|
114
115
|
className: l("hover:bg-accent hover:text-accent-foreground", r)
|
|
115
116
|
};
|
|
116
117
|
return f && m ? /* @__PURE__ */ i(
|
|
117
|
-
|
|
118
|
+
C,
|
|
118
119
|
{
|
|
119
120
|
variant: t ? "outline" : "ghost",
|
|
120
121
|
size: "icon",
|
|
121
122
|
nativeButton: !1,
|
|
122
123
|
render: /* @__PURE__ */ i(b, { href: m, onClick: d, children: s }),
|
|
123
|
-
...
|
|
124
|
-
...
|
|
124
|
+
...p,
|
|
125
|
+
...u
|
|
125
126
|
}
|
|
126
127
|
) : /* @__PURE__ */ i(
|
|
127
|
-
|
|
128
|
+
C,
|
|
128
129
|
{
|
|
129
130
|
variant: t ? "outline" : "ghost",
|
|
130
131
|
size: "icon",
|
|
131
132
|
disabled: n,
|
|
132
133
|
onClick: d,
|
|
134
|
+
...p,
|
|
133
135
|
...u,
|
|
134
|
-
...c,
|
|
135
136
|
children: s
|
|
136
137
|
}
|
|
137
138
|
);
|
|
@@ -143,7 +144,7 @@ function D({
|
|
|
143
144
|
children: e,
|
|
144
145
|
buttonProps: o
|
|
145
146
|
}) {
|
|
146
|
-
const { currentPage: s, texts: r } =
|
|
147
|
+
const { currentPage: s, texts: r } = c();
|
|
147
148
|
return /* @__PURE__ */ i(
|
|
148
149
|
P,
|
|
149
150
|
{
|
|
@@ -157,12 +158,12 @@ function D({
|
|
|
157
158
|
}
|
|
158
159
|
);
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
+
function sa({
|
|
161
162
|
className: a,
|
|
162
163
|
buttonProps: t,
|
|
163
164
|
children: n
|
|
164
165
|
}) {
|
|
165
|
-
const { isFirstPage: e, texts: o } =
|
|
166
|
+
const { isFirstPage: e, texts: o } = c();
|
|
166
167
|
return /* @__PURE__ */ i(
|
|
167
168
|
P,
|
|
168
169
|
{
|
|
@@ -176,12 +177,12 @@ function oa({
|
|
|
176
177
|
}
|
|
177
178
|
);
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function G({
|
|
180
181
|
className: a,
|
|
181
182
|
buttonProps: t,
|
|
182
183
|
children: n
|
|
183
184
|
}) {
|
|
184
|
-
const { currentPage: e, isFirstPage: o, texts: s } =
|
|
185
|
+
const { currentPage: e, isFirstPage: o, texts: s } = c();
|
|
185
186
|
return /* @__PURE__ */ i(
|
|
186
187
|
P,
|
|
187
188
|
{
|
|
@@ -195,12 +196,12 @@ function O({
|
|
|
195
196
|
}
|
|
196
197
|
);
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
+
function U({
|
|
199
200
|
className: a,
|
|
200
201
|
buttonProps: t,
|
|
201
202
|
children: n
|
|
202
203
|
}) {
|
|
203
|
-
const { currentPage: e, maxPage: o, isLastPage: s, texts: r } =
|
|
204
|
+
const { currentPage: e, maxPage: o, isLastPage: s, texts: r } = c();
|
|
204
205
|
return /* @__PURE__ */ i(
|
|
205
206
|
P,
|
|
206
207
|
{
|
|
@@ -214,12 +215,12 @@ function G({
|
|
|
214
215
|
}
|
|
215
216
|
);
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function ra({
|
|
218
219
|
className: a,
|
|
219
220
|
buttonProps: t,
|
|
220
221
|
children: n
|
|
221
222
|
}) {
|
|
222
|
-
const { maxPage: e, isLastPage: o, texts: s } =
|
|
223
|
+
const { maxPage: e, isLastPage: o, texts: s } = c();
|
|
223
224
|
return /* @__PURE__ */ i(
|
|
224
225
|
P,
|
|
225
226
|
{
|
|
@@ -233,11 +234,11 @@ function ia({
|
|
|
233
234
|
}
|
|
234
235
|
);
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function V({
|
|
237
238
|
className: a,
|
|
238
239
|
...t
|
|
239
240
|
}) {
|
|
240
|
-
const { texts: n } =
|
|
241
|
+
const { texts: n } = c();
|
|
241
242
|
return /* @__PURE__ */ L(
|
|
242
243
|
"span",
|
|
243
244
|
{
|
|
@@ -256,12 +257,12 @@ function U({
|
|
|
256
257
|
}
|
|
257
258
|
);
|
|
258
259
|
}
|
|
259
|
-
function
|
|
260
|
+
function ga({
|
|
260
261
|
className: a,
|
|
261
262
|
linkClassName: t,
|
|
262
263
|
ellipsisClassName: n
|
|
263
264
|
}) {
|
|
264
|
-
const { paginationRange: e } =
|
|
265
|
+
const { paginationRange: e } = c();
|
|
265
266
|
return /* @__PURE__ */ i(
|
|
266
267
|
"div",
|
|
267
268
|
{
|
|
@@ -270,7 +271,7 @@ function sa({
|
|
|
270
271
|
className: l("flex items-center gap-1", a),
|
|
271
272
|
children: e.map(
|
|
272
273
|
(o, s) => o === F ? /* @__PURE__ */ i(
|
|
273
|
-
|
|
274
|
+
V,
|
|
274
275
|
{
|
|
275
276
|
className: n
|
|
276
277
|
},
|
|
@@ -287,12 +288,12 @@ function sa({
|
|
|
287
288
|
}
|
|
288
289
|
);
|
|
289
290
|
}
|
|
290
|
-
function
|
|
291
|
+
function ca({
|
|
291
292
|
children: a,
|
|
292
293
|
className: t,
|
|
293
294
|
...n
|
|
294
295
|
}) {
|
|
295
|
-
const { totalItems: e, texts: o } =
|
|
296
|
+
const { totalItems: e, texts: o } = c(), s = typeof a == "function" ? a(e) : a ?? o.total(e);
|
|
296
297
|
return /* @__PURE__ */ i(
|
|
297
298
|
"span",
|
|
298
299
|
{
|
|
@@ -303,12 +304,12 @@ function ra({
|
|
|
303
304
|
}
|
|
304
305
|
);
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
+
function la({
|
|
307
308
|
children: a,
|
|
308
309
|
className: t,
|
|
309
310
|
...n
|
|
310
311
|
}) {
|
|
311
|
-
const { currentPage: e, maxPage: o, texts: s } =
|
|
312
|
+
const { currentPage: e, maxPage: o, texts: s } = c(), r = typeof a == "function" ? a({ page: e, max: o }) : a ?? s.pageInfo(e, o);
|
|
312
313
|
return /* @__PURE__ */ i(
|
|
313
314
|
"span",
|
|
314
315
|
{
|
|
@@ -324,7 +325,7 @@ function X({
|
|
|
324
325
|
className: t,
|
|
325
326
|
...n
|
|
326
327
|
}) {
|
|
327
|
-
const { range: e, totalItems: o, texts: s } =
|
|
328
|
+
const { range: e, totalItems: o, texts: s } = c(), r = typeof a == "function" ? a({ ...e, total: o }) : a ?? s.range(e.start, e.end, o);
|
|
328
329
|
return /* @__PURE__ */ i(
|
|
329
330
|
"span",
|
|
330
331
|
{
|
|
@@ -340,27 +341,29 @@ function Z({
|
|
|
340
341
|
className: t,
|
|
341
342
|
...n
|
|
342
343
|
}) {
|
|
343
|
-
const { pageSize: e, setPageSize: o, goTo: s } =
|
|
344
|
+
const { pageSize: e, setPageSize: o, goTo: s } = c(), r = (g) => {
|
|
345
|
+
o(g), s(1);
|
|
346
|
+
}, u = a.map((g) => ({
|
|
347
|
+
label: String(g),
|
|
348
|
+
value: g
|
|
349
|
+
}));
|
|
344
350
|
return /* @__PURE__ */ i(
|
|
345
|
-
|
|
351
|
+
A,
|
|
346
352
|
{
|
|
353
|
+
items: u,
|
|
347
354
|
"data-slot": "pagination-size-select",
|
|
348
355
|
value: e,
|
|
349
|
-
|
|
350
|
-
const p = Number(c.target.value);
|
|
351
|
-
o(p), s(1);
|
|
352
|
-
},
|
|
356
|
+
onValueChange: (g) => g != null && r(g),
|
|
353
357
|
className: l(
|
|
354
358
|
"border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background",
|
|
355
359
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
356
360
|
t
|
|
357
361
|
),
|
|
358
|
-
...n
|
|
359
|
-
children: a.map((c) => /* @__PURE__ */ i("option", { value: c, "data-slot": "pagination-size-option", children: c }, c))
|
|
362
|
+
...n
|
|
360
363
|
}
|
|
361
364
|
);
|
|
362
365
|
}
|
|
363
|
-
function
|
|
366
|
+
function ua({
|
|
364
367
|
sizes: a = N,
|
|
365
368
|
selectClassName: t,
|
|
366
369
|
rangeClassName: n,
|
|
@@ -378,22 +381,22 @@ function ca({
|
|
|
378
381
|
}
|
|
379
382
|
),
|
|
380
383
|
/* @__PURE__ */ i(X, { className: n }),
|
|
381
|
-
/* @__PURE__ */ i(
|
|
382
|
-
/* @__PURE__ */ i(
|
|
384
|
+
/* @__PURE__ */ i(G, { className: e }),
|
|
385
|
+
/* @__PURE__ */ i(U, { className: o })
|
|
383
386
|
] });
|
|
384
387
|
}
|
|
385
388
|
export {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
ua as Pagination,
|
|
390
|
+
V as PaginationEllipsis,
|
|
391
|
+
sa as PaginationFirst,
|
|
392
|
+
ra as PaginationLast,
|
|
390
393
|
D as PaginationLink,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
394
|
+
U as PaginationNext,
|
|
395
|
+
la as PaginationPageInfo,
|
|
396
|
+
ga as PaginationPages,
|
|
397
|
+
G as PaginationPrevious,
|
|
395
398
|
X as PaginationRange,
|
|
396
399
|
_ as PaginationRoot,
|
|
397
400
|
Z as PaginationSizeSelect,
|
|
398
|
-
|
|
401
|
+
ca as PaginationTotal
|
|
399
402
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),O=require("react"),P=require("../../node_modules/lucide-react/dist/esm/icons/chevrons-up-down.cjs.js"),A=require("../../node_modules/@base-ui/react/use-render/useRender.cjs.js"),M=require("../../node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.js"),U=require("../../node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.js"),a=require("../../lib/cn.cjs.js"),E=require("../../node_modules/@base-ui/react/select/root/SelectRoot.cjs.js"),K=require("../../node_modules/@base-ui/react/select/trigger/SelectTrigger.cjs.js"),F=require("../../node_modules/@base-ui/react/select/icon/SelectIcon.cjs.js"),W=require("../../node_modules/@base-ui/react/merge-props/mergeProps.cjs.js"),H=require("../../node_modules/@base-ui/react/select/value/SelectValue.cjs.js"),J=require("../../node_modules/@base-ui/react/select/portal/SelectPortal.cjs.js"),Q=require("../../node_modules/@base-ui/react/select/positioner/SelectPositioner.cjs.js"),X=require("../../node_modules/@base-ui/react/select/popup/SelectPopup.cjs.js"),Y=require("../../node_modules/@base-ui/react/select/scroll-up-arrow/SelectScrollUpArrow.cjs.js"),Z=require("../../node_modules/@base-ui/react/select/list/SelectList.cjs.js"),ee=require("../../node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.cjs.js"),te=require("../../node_modules/@base-ui/react/select/item/SelectItem.cjs.js"),re=require("../../node_modules/@base-ui/react/select/item-text/SelectItemText.cjs.js"),oe=require("../../node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.cjs.js"),ne=require("../../node_modules/@base-ui/react/separator/Separator.cjs.js"),se=require("../../node_modules/@base-ui/react/select/group/SelectGroup.cjs.js"),le=require("../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.cjs.js"),ae=require("../../node_modules/@base-ui/react/select/label/SelectLabel.cjs.js"),ie=require("../input/input.cjs.js");function ce(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ue=ce(O),v=a.cn(ie.inputBaseClasses,"relative inline-flex items-center justify-between gap-2 select-none text-left text-foreground","focus-visible:border-ring","aria-invalid:border-error focus-visible:aria-invalid:ring-error/20","has-aria-invalid:border-error has-focus-visible:has-aria-invalid:ring-error/20","data-disabled:cursor-not-allowed data-disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"),j="-me-1 size-4.5 opacity-80 sm:size-4";function z({...e}){return r.jsx(E.SelectRoot,{...e})}function L({className:e,children:t,icon:n,...l}){return r.jsxs(K.SelectTrigger,{className:a.cn(v,e),"data-slot":"select-trigger",...l,children:[t,r.jsx(F.SelectIcon,{"data-slot":"select-icon",className:"text-muted-foreground hover:text-foreground transition-colors",children:n??r.jsx(P.default,{className:j})})]})}function de({className:e,render:t,children:n,icon:l,...u}){const i=t?void 0:"button",d={children:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"flex-1 truncate in-data-placeholder:text-muted-foreground/72",children:n}),l??r.jsx(P.default,{className:j})]}),className:a.cn(v,"min-w-0",e),"data-slot":"select-button",type:i};return A.useRender({defaultTagName:"button",props:W.mergeProps(d,u),render:t})}function _({className:e,...t}){return r.jsx(H.SelectValue,{className:a.cn("flex-1 truncate data-placeholder:text-muted-foreground",e),"data-slot":"select-value",...t})}function w({className:e,children:t,side:n="bottom",sideOffset:l=4,align:u="start",alignOffset:i=0,alignItemWithTrigger:d=!1,anchor:f,portalProps:c,...p}){return r.jsx(J.SelectPortal,{...c,children:r.jsx(Q.SelectPositioner,{align:u,alignItemWithTrigger:d,alignOffset:i,anchor:f,className:"z-50 select-none","data-slot":"select-positioner",side:n,sideOffset:l,children:r.jsxs(X.SelectPopup,{className:"origin-(--transform-origin) text-foreground outline-none duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2","data-slot":"select-popup",...p,children:[r.jsx(Y.SelectScrollUpArrow,{className:"top-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[200%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50% before:from-popover","data-slot":"select-scroll-up-arrow",children:r.jsx(M.default,{className:"relative size-4.5 sm:size-4"})}),r.jsx("div",{className:"relative h-full min-w-(--anchor-width) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",children:r.jsx(Z.SelectList,{className:a.cn("max-h-[min(24rem,var(--available-height))] overflow-y-auto p-1",e),"data-slot":"select-list",children:t})}),r.jsx(ee.SelectScrollDownArrow,{className:"bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[200%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50% before:from-popover","data-slot":"select-scroll-down-arrow",children:r.jsx(U.default,{className:"relative size-4.5 sm:size-4"})})]})})})}function T({className:e,children:t,...n}){return r.jsxs(te.SelectItem,{className:a.cn("grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1fr_1rem] items-center gap-2 rounded-sm py-1 px-2 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"select-item",...n,children:[r.jsx(re.SelectItemText,{className:"col-start-1 min-w-0",children:t}),r.jsx(oe.SelectItemIndicator,{className:"col-start-2",children:r.jsx("svg",{"aria-hidden":"true",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})})]})}function fe({className:e,...t}){return r.jsx(ne.Separator,{className:a.cn("mx-2 my-1 h-px bg-border",e),"data-slot":"select-separator",...t})}function pe(e){return r.jsx(se.SelectGroup,{"data-slot":"select-group",...e})}function ge(e){return r.jsx(le.SelectGroupLabel,{className:"px-2 py-1.5 font-medium text-muted-foreground text-xs","data-slot":"select-group-label",...e})}function me({className:e,...t}){return r.jsx(ae.SelectLabel,{className:a.cn("not-in-data-[slot=field]:mb-2 inline-flex cursor-default items-center gap-2 font-medium text-base/4.5 text-foreground sm:text-sm/4",e),"data-slot":"select-label",...t})}function be(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="object"){const t=e;if("label"in t)return String(t.label);if("name"in t)return String(t.name);if("title"in t)return String(t.title)}return String(e)}function Se(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="object"){const t=e;if("id"in t)return String(t.id);if("value"in t)return String(t.value)}return String(e)}function xe(e){return e!=null&&typeof e=="object"&&"disabled"in e?!!e.disabled:!1}function he(e){const{items:t,getLabel:n,getId:l,getDisabled:u,renderItem:i,placeholder:d,onValueChange:f,value:c,defaultValue:p,multiple:g,className:k,classNames:N,icon:D,"aria-invalid":y,...G}=e,q=n??be,S=l??Se,R=u??xe,m=o=>String(S(o)),x=o=>t.find(s=>m(s)===o)??null,I=ue.useRef(!1);if(process.env.NODE_ENV!=="production"&&!I.current){const o=new Set,s=new Set;for(const b of t){const h=m(b);o.has(h)&&s.add(h),o.add(h)}s.size>0&&(I.current=!0,console.warn(`[Select] Multiple items resolve to the same id (${[...s].join(", ")}). Provide a \`getId\` that returns a unique value per item.`))}const C=g?c?.map(o=>String(o)):c==null?c:String(c),V=g?p?.map(o=>String(o)):p==null?void 0:String(p),$=o=>{if(g){const b=(o??[]).map(x).filter(Boolean);f?.(b.map(S),b)}else{if(o==null){f?.(null,null);return}const s=x(o);f?.(s?S(s):null,s)}},B=o=>{const s=x(o);return s?q(s):o};return r.jsxs(z,{itemToStringLabel:B,multiple:g,value:C,defaultValue:V,onValueChange:$,...G,children:[r.jsx(L,{className:k,icon:D,...y===void 0?{}:{"aria-invalid":y},children:r.jsx(_,{placeholder:d})}),r.jsx(w,{className:N?.popup,children:t.map(o=>r.jsx(T,{value:m(o),disabled:R(o),className:N?.item,children:i?i(o):q(o)},m(o)))})]})}exports.Select=he;exports.SelectButton=de;exports.SelectContent=w;exports.SelectGroup=pe;exports.SelectGroupLabel=ge;exports.SelectItem=T;exports.SelectLabel=me;exports.SelectPopup=w;exports.SelectRoot=z;exports.SelectSeparator=fe;exports.SelectTrigger=L;exports.SelectValue=_;exports.selectTriggerClasses=v;exports.selectTriggerIconClassName=j;
|