@boxcustodia/library 2.0.0-alpha.22 → 2.0.0-alpha.24

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/dist/components/calendar/calendar.cjs.js +1 -1
  2. package/dist/components/calendar/calendar.es.js +43 -44
  3. package/dist/components/date-picker/date-input.cjs.js +1 -1
  4. package/dist/components/date-picker/date-input.es.js +160 -140
  5. package/dist/components/pagination/pagination.cjs.js +1 -1
  6. package/dist/components/pagination/pagination.es.js +37 -35
  7. package/dist/components/popover/popover.cjs.js +1 -1
  8. package/dist/components/popover/popover.es.js +1 -1
  9. package/dist/components/scroll-area/scroll-area.cjs.js +1 -1
  10. package/dist/components/scroll-area/scroll-area.es.js +4 -4
  11. package/dist/components/select/select.cjs.js +1 -1
  12. package/dist/components/select/select.es.js +94 -90
  13. package/dist/components/tag/tag.cjs.js +1 -1
  14. package/dist/components/tag/tag.es.js +37 -18
  15. package/dist/hooks/use-action/use-action.cjs.js +1 -0
  16. package/dist/hooks/use-action/use-action.es.js +41 -0
  17. package/dist/hooks/use-pagination/use-pagination.cjs.js +1 -1
  18. package/dist/hooks/use-pagination/use-pagination.es.js +77 -32
  19. package/dist/hooks/use-range-pagination/use-range-pagination.cjs.js +1 -1
  20. package/dist/hooks/use-range-pagination/use-range-pagination.es.js +8 -5
  21. package/dist/hooks/use-selection/use-selection.cjs.js +1 -1
  22. package/dist/hooks/use-selection/use-selection.es.js +95 -33
  23. package/dist/hooks/use-session-storage/use-session-storage.cjs.js +1 -0
  24. package/dist/hooks/use-session-storage/use-session-storage.es.js +57 -0
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.es.js +61 -63
  27. package/dist/src/components/select/select.d.ts +9 -2
  28. package/dist/src/components/tag/tag.d.ts +2 -1
  29. package/dist/src/hooks/index.d.ts +2 -3
  30. package/dist/src/hooks/internal/index.d.ts +1 -0
  31. package/dist/src/hooks/internal/serializer.d.ts +4 -0
  32. package/dist/src/hooks/use-action/index.d.ts +1 -0
  33. package/dist/src/hooks/use-action/use-action.d.ts +22 -0
  34. package/dist/src/hooks/use-local-storage/use-local-storage.d.ts +2 -4
  35. package/dist/src/hooks/use-pagination/use-pagination.d.ts +47 -32
  36. package/dist/src/hooks/use-range-pagination/use-range-pagination.d.ts +16 -10
  37. package/dist/src/hooks/use-selection/use-selection.d.ts +39 -45
  38. package/dist/src/hooks/use-session-storage/index.d.ts +1 -0
  39. package/dist/src/hooks/use-session-storage/use-session-storage.d.ts +11 -0
  40. package/package.json +1 -1
  41. package/src/components/calendar/calendar.tsx +10 -8
  42. package/src/components/combobox/combobox.stories.tsx +16 -0
  43. package/src/components/date-picker/date-input.tsx +23 -2
  44. package/src/components/form/form.tsx +3 -2
  45. package/src/components/pagination/pagination.tsx +5 -3
  46. package/src/components/popover/popover.tsx +1 -1
  47. package/src/components/scroll-area/scroll-area.tsx +2 -2
  48. package/src/components/select/select.tsx +14 -3
  49. package/src/components/tag/tag.stories.tsx +47 -2
  50. package/src/components/tag/tag.tsx +28 -6
  51. package/src/hooks/index.ts +2 -3
  52. package/src/hooks/internal/index.ts +1 -0
  53. package/src/hooks/internal/serializer.ts +4 -0
  54. package/src/hooks/use-action/index.ts +1 -0
  55. package/src/hooks/{use-mutation/use-mutation.stories.tsx → use-action/use-action.stories.tsx} +34 -34
  56. package/src/hooks/{use-mutation/use-mutation.test.ts → use-action/use-action.test.ts} +53 -53
  57. package/src/hooks/{use-mutation/use-mutation.ts → use-action/use-action.ts} +20 -20
  58. package/src/hooks/use-click-outside/use-click-outside.stories.tsx +0 -1
  59. package/src/hooks/use-clipboard/use-clipboard.stories.tsx +0 -1
  60. package/src/hooks/use-document-title/use-document-title.stories.tsx +0 -1
  61. package/src/hooks/use-is-visible/use-is-visible.test.tsx +1 -1
  62. package/src/hooks/use-local-storage/use-local-storage.stories.tsx +0 -1
  63. package/src/hooks/use-local-storage/use-local-storage.ts +2 -5
  64. package/src/hooks/use-media-query/use-media-query.stories.tsx +0 -1
  65. package/src/hooks/use-pagination/use-pagination.stories.tsx +720 -57
  66. package/src/hooks/use-pagination/use-pagination.test.tsx +560 -48
  67. package/src/hooks/use-pagination/use-pagination.ts +266 -0
  68. package/src/hooks/use-prevent-page-close/use-prevent-page-close.stories.tsx +0 -1
  69. package/src/hooks/use-range-pagination/use-range-pagination.test.tsx +2 -2
  70. package/src/hooks/use-range-pagination/use-range-pagination.tsx +24 -21
  71. package/src/hooks/use-selection/use-selection.stories.tsx +339 -84
  72. package/src/hooks/use-selection/use-selection.test.tsx +417 -2
  73. package/src/hooks/use-selection/use-selection.ts +212 -102
  74. package/src/hooks/use-session-storage/index.ts +1 -0
  75. package/src/hooks/use-session-storage/use-session-storage.stories.tsx +122 -0
  76. package/src/hooks/use-session-storage/use-session-storage.test.ts +164 -0
  77. package/src/hooks/use-session-storage/use-session-storage.ts +115 -0
  78. package/dist/hooks/use-async/use-async.cjs.js +0 -1
  79. package/dist/hooks/use-async/use-async.es.js +0 -57
  80. package/dist/hooks/use-focus-trap/scope-tab.cjs.js +0 -1
  81. package/dist/hooks/use-focus-trap/scope-tab.es.js +0 -21
  82. package/dist/hooks/use-focus-trap/tabbable.cjs.js +0 -1
  83. package/dist/hooks/use-focus-trap/tabbable.es.js +0 -38
  84. package/dist/hooks/use-focus-trap/use-focus-trap.cjs.js +0 -1
  85. package/dist/hooks/use-focus-trap/use-focus-trap.es.js +0 -34
  86. package/dist/hooks/use-mutation/use-mutation.cjs.js +0 -1
  87. package/dist/hooks/use-mutation/use-mutation.es.js +0 -41
  88. package/dist/src/hooks/use-async/index.d.ts +0 -1
  89. package/dist/src/hooks/use-async/use-async.d.ts +0 -21
  90. package/dist/src/hooks/use-focus-trap/index.d.ts +0 -1
  91. package/dist/src/hooks/use-focus-trap/scope-tab.d.ts +0 -1
  92. package/dist/src/hooks/use-focus-trap/tabbable.d.ts +0 -4
  93. package/dist/src/hooks/use-focus-trap/use-focus-trap.d.ts +0 -1
  94. package/dist/src/hooks/use-mutation/index.d.ts +0 -1
  95. package/dist/src/hooks/use-mutation/use-mutation.d.ts +0 -22
  96. package/dist/src/hooks/use-mutation/use-mutation.test.d.ts +0 -1
  97. package/src/hooks/use-async/index.ts +0 -1
  98. package/src/hooks/use-async/use-async.stories.tsx +0 -272
  99. package/src/hooks/use-async/use-async.test.ts +0 -397
  100. package/src/hooks/use-async/use-async.ts +0 -135
  101. package/src/hooks/use-focus-trap/index.ts +0 -1
  102. package/src/hooks/use-focus-trap/scope-tab.ts +0 -38
  103. package/src/hooks/use-focus-trap/tabbable.ts +0 -70
  104. package/src/hooks/use-focus-trap/use-focus-trap.stories.tsx +0 -37
  105. package/src/hooks/use-focus-trap/use-focus-trap.test.ts +0 -355
  106. package/src/hooks/use-focus-trap/use-focus-trap.ts +0 -78
  107. package/src/hooks/use-mutation/index.ts +0 -1
  108. package/src/hooks/use-pagination/use-pagination.tsx +0 -84
  109. /package/dist/src/hooks/{use-async/use-async.test.d.ts → use-action/use-action.test.d.ts} +0 -0
  110. /package/dist/src/hooks/{use-focus-trap/use-focus-trap.test.d.ts → use-session-storage/use-session-storage.test.d.ts} +0 -0
@@ -2,11 +2,11 @@
2
2
  import { jsx as i, jsxs as L } from "react/jsx-runtime";
3
3
  import { useControllableState as k } from "@radix-ui/react-use-controllable-state";
4
4
  import { ChevronsLeft as $, ChevronLeft as R, ChevronRight as F, ChevronsRight as y, MoreHorizontal as E } from "lucide-react";
5
- import { useMemo as T, createContext as M, useContext as w } from "react";
5
+ import { useMemo as S, createContext as M, useContext as w } from "react";
6
6
  import { PAGINATION_SIZES as N } from "./pagination.model.es.js";
7
7
  import { useRangePagination as B, DOTS as j } from "../../hooks/use-range-pagination/use-range-pagination.es.js";
8
8
  import { cn as l } from "../../lib/cn.es.js";
9
- import { Button as C } from "../button/button.es.js";
9
+ import { Button as T } from "../button/button.es.js";
10
10
  const A = {
11
11
  goToFirst: "Ir a primera página",
12
12
  goToPrevious: "Ir a página anterior",
@@ -35,45 +35,47 @@ function _({
35
35
  defaultCurrentPage: s = 1,
36
36
  onCurrentPageChange: r,
37
37
  siblingCount: c = 1,
38
- getPageHref: u,
38
+ getPageHref: p,
39
39
  linkComponent: x = "a",
40
40
  texts: h,
41
41
  className: v,
42
42
  children: b,
43
- ...p
43
+ ...d
44
44
  }) {
45
- const [d = n, f] = k({
45
+ const [f = n, m] = k({
46
46
  prop: t,
47
47
  defaultProp: n,
48
48
  onChange: e
49
- }), m = B({
49
+ }), u = B({
50
50
  totalItems: a,
51
- pageSize: d,
52
- currentPage: o,
53
- defaultCurrentPage: s,
54
- onCurrentPageChange: r,
51
+ pageSize: f,
52
+ page: o,
53
+ defaultPage: s,
54
+ onPageChange: r,
55
55
  siblingCount: c
56
- }), S = T(
56
+ }), C = S(
57
57
  () => ({ ...A, ...h }),
58
58
  [h]
59
- ), I = T(
59
+ ), I = S(
60
60
  () => ({
61
- ...m,
62
- pageSize: d,
61
+ ...u,
62
+ currentPage: u.page,
63
+ maxPage: u.pageCount,
64
+ pageSize: f,
63
65
  totalItems: a,
64
- setPageSize: f,
65
- getPageHref: u,
66
+ setPageSize: m,
67
+ getPageHref: p,
66
68
  linkComponent: x,
67
- texts: S
69
+ texts: C
68
70
  }),
69
71
  [
70
- m,
71
- d,
72
- a,
73
- f,
74
72
  u,
73
+ f,
74
+ a,
75
+ m,
76
+ p,
75
77
  x,
76
- S
78
+ C
77
79
  ]
78
80
  );
79
81
  return /* @__PURE__ */ i(z.Provider, { value: I, children: /* @__PURE__ */ i(
@@ -83,7 +85,7 @@ function _({
83
85
  "aria-label": "pagination",
84
86
  "data-slot": "pagination",
85
87
  className: l("flex items-center gap-x-4", v),
86
- ...p,
88
+ ...d,
87
89
  children: b
88
90
  }
89
91
  ) });
@@ -98,33 +100,33 @@ function P({
98
100
  className: r,
99
101
  buttonProps: c
100
102
  }) {
101
- const { goTo: u, getPageHref: x, pageSize: h, linkComponent: v } = g(), b = v, p = x?.({ page: a, pageSize: Number(h) }), d = !!p && !n, f = () => {
102
- n || u(a);
103
- }, m = {
103
+ const { goTo: p, getPageHref: x, pageSize: h, linkComponent: v } = g(), b = v, d = x?.({ page: a, pageSize: Number(h) }), f = !!d && !n, m = () => {
104
+ n || p(a);
105
+ }, u = {
104
106
  "data-slot": o,
105
107
  "data-active": t ? "true" : "false",
106
108
  "aria-current": t ? "page" : void 0,
107
109
  "aria-label": e,
108
110
  className: l("hover:bg-accent hover:text-accent-foreground", r)
109
111
  };
110
- return d && p ? /* @__PURE__ */ i(
111
- C,
112
+ return f && d ? /* @__PURE__ */ i(
113
+ T,
112
114
  {
113
115
  variant: t ? "outline" : "ghost",
114
116
  size: "icon",
115
117
  nativeButton: !1,
116
- render: /* @__PURE__ */ i(b, { href: p, onClick: f, children: s }),
117
- ...m,
118
+ render: /* @__PURE__ */ i(b, { href: d, onClick: m, children: s }),
119
+ ...u,
118
120
  ...c
119
121
  }
120
122
  ) : /* @__PURE__ */ i(
121
- C,
123
+ T,
122
124
  {
123
125
  variant: t ? "outline" : "ghost",
124
126
  size: "icon",
125
127
  disabled: n,
126
- onClick: f,
127
- ...m,
128
+ onClick: m,
129
+ ...u,
128
130
  ...c,
129
131
  children: s
130
132
  }
@@ -341,8 +343,8 @@ function X({
341
343
  "data-slot": "pagination-size-select",
342
344
  value: e,
343
345
  onChange: (c) => {
344
- const u = Number(c.target.value);
345
- o(u), s(1);
346
+ const p = Number(c.target.value);
347
+ o(p), s(1);
346
348
  },
347
349
  className: l(
348
350
  "border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background",
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("@base-ui/react/popover"),s=require("../../lib/cn.cjs.js"),y=t.Popover.createHandle,P=t.Popover.Root;function x({className:e,children:r,...a}){return o.jsx(t.Popover.Trigger,{className:e,"data-slot":"popover-trigger",...a,children:r})}function h({children:e,className:r,side:a="bottom",align:i="center",sideOffset:d=4,alignOffset:l=0,tooltipStyle:n=!1,matchTriggerWidth:p=!1,anchor:c,portalProps:v,viewportClassName:u,...g}){return o.jsx(t.Popover.Portal,{...v,children:o.jsx(t.Popover.Positioner,{align:i,alignOffset:l,anchor:c,className:"z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none","data-slot":"popover-positioner",side:a,sideOffset:d,style:p?{width:"var(--anchor-width)"}:void 0,children:o.jsx(t.Popover.Popup,{className:s.cn("relative flex h-(--popup-height,auto) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",p?"w-full":"w-(--popup-width,auto) max-w-72",n&&"w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]",r),"data-slot":"popover-popup",...g,children:o.jsx(t.Popover.Viewport,{className:s.cn("relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 [--viewport-inline-padding:--spacing(4)] has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity",n?"py-1 [--viewport-inline-padding:--spacing(2)]":"not-data-transitioning:overflow-y-auto",u),"data-slot":"popover-viewport",children:e})})})})}function j({...e}){return o.jsx(t.Popover.Close,{"data-slot":"popover-close",...e})}function w({className:e,...r}){return o.jsx(t.Popover.Title,{className:s.cn("font-semibold text-lg leading-none",e),"data-slot":"popover-title",...r})}function f({className:e,...r}){return o.jsx(t.Popover.Description,{className:s.cn("text-muted-foreground text-sm",e),"data-slot":"popover-description",...r})}function C({trigger:e,children:r,title:a,description:i,side:d,align:l,sideOffset:n,alignOffset:p,tooltipStyle:c,matchTriggerWidth:v,anchor:u,className:g,classNames:m,...b}){return o.jsxs(P,{...b,children:[e!==void 0&&o.jsx(x,{render:e}),o.jsxs(h,{side:d,align:l,sideOffset:n,alignOffset:p,tooltipStyle:c,matchTriggerWidth:v,anchor:u,className:g,viewportClassName:m?.viewport,children:[(a??i)&&o.jsxs("div",{className:"mb-2",children:[a&&o.jsx(w,{children:a}),i&&o.jsx(f,{children:i})]}),r]})]})}Object.defineProperty(exports,"PopoverPrimitive",{enumerable:!0,get:()=>t.Popover});exports.Popover=C;exports.PopoverClose=j;exports.PopoverContent=h;exports.PopoverCreateHandle=y;exports.PopoverDescription=f;exports.PopoverPopup=h;exports.PopoverRoot=P;exports.PopoverTitle=w;exports.PopoverTrigger=x;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("@base-ui/react/popover"),s=require("../../lib/cn.cjs.js"),y=t.Popover.createHandle,P=t.Popover.Root;function x({className:e,children:r,...a}){return o.jsx(t.Popover.Trigger,{className:e,"data-slot":"popover-trigger",...a,children:r})}function h({children:e,className:r,side:a="bottom",align:i="center",sideOffset:d=4,alignOffset:l=0,tooltipStyle:n=!1,matchTriggerWidth:p=!1,anchor:c,portalProps:v,viewportClassName:u,...g}){return o.jsx(t.Popover.Portal,{...v,children:o.jsx(t.Popover.Positioner,{align:i,alignOffset:l,anchor:c,className:"z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none","data-slot":"popover-positioner",side:a,sideOffset:d,style:p?{width:"var(--anchor-width)"}:void 0,children:o.jsx(t.Popover.Popup,{className:s.cn("relative flex h-(--popup-height,auto) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-md has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",p?"w-full":"w-(--popup-width,auto) max-w-72",n&&"w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]",r),"data-slot":"popover-popup",...g,children:o.jsx(t.Popover.Viewport,{className:s.cn("relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 [--viewport-inline-padding:--spacing(4)] has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity",n?"py-1 [--viewport-inline-padding:--spacing(2)]":"not-data-transitioning:overflow-y-auto",u),"data-slot":"popover-viewport",children:e})})})})}function j({...e}){return o.jsx(t.Popover.Close,{"data-slot":"popover-close",...e})}function w({className:e,...r}){return o.jsx(t.Popover.Title,{className:s.cn("font-semibold text-lg leading-none",e),"data-slot":"popover-title",...r})}function f({className:e,...r}){return o.jsx(t.Popover.Description,{className:s.cn("text-muted-foreground text-sm",e),"data-slot":"popover-description",...r})}function C({trigger:e,children:r,title:a,description:i,side:d,align:l,sideOffset:n,alignOffset:p,tooltipStyle:c,matchTriggerWidth:v,anchor:u,className:g,classNames:m,...b}){return o.jsxs(P,{...b,children:[e!==void 0&&o.jsx(x,{render:e}),o.jsxs(h,{side:d,align:l,sideOffset:n,alignOffset:p,tooltipStyle:c,matchTriggerWidth:v,anchor:u,className:g,viewportClassName:m?.viewport,children:[(a??i)&&o.jsxs("div",{className:"mb-2",children:[a&&o.jsx(w,{children:a}),i&&o.jsx(f,{children:i})]}),r]})]})}Object.defineProperty(exports,"PopoverPrimitive",{enumerable:!0,get:()=>t.Popover});exports.Popover=C;exports.PopoverClose=j;exports.PopoverContent=h;exports.PopoverCreateHandle=y;exports.PopoverDescription=f;exports.PopoverPopup=h;exports.PopoverRoot=P;exports.PopoverTitle=w;exports.PopoverTrigger=x;
@@ -48,7 +48,7 @@ function b({
48
48
  e.Popup,
49
49
  {
50
50
  className: d(
51
- "relative flex h-(--popup-height,auto) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
51
+ "relative flex h-(--popup-height,auto) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-md has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
52
52
  p ? "w-full" : "w-(--popup-width,auto) max-w-72",
53
53
  n && "w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]",
54
54
  a
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("@base-ui/react/scroll-area"),t=require("../../lib/cn.cjs.js");function c({className:o,children:e,scrollFade:l=!1,scrollbarGutter:s=!1,...n}){return r.jsxs(a.ScrollArea.Root,{className:t.cn("size-full min-h-0",o),...n,children:[r.jsx(a.ScrollArea.Viewport,{className:t.cn("h-full rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-y:overscroll-y-contain data-has-overflow-x:overscroll-x-contain",l&&"mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",s&&"data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"),"data-slot":"scroll-area-viewport",children:e}),r.jsx(i,{orientation:"vertical"}),r.jsx(i,{orientation:"horizontal"}),r.jsx(a.ScrollArea.Corner,{"data-slot":"scroll-area-corner"})]})}function i({className:o,orientation:e="vertical",...l}){return r.jsx(a.ScrollArea.Scrollbar,{className:t.cn("m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",o),"data-slot":"scroll-area-scrollbar",orientation:e,...l,children:r.jsx(a.ScrollArea.Thumb,{className:"relative flex-1 rounded-full bg-foreground/20","data-slot":"scroll-area-thumb"})})}Object.defineProperty(exports,"ScrollAreaPrimitive",{enumerable:!0,get:()=>a.ScrollArea});exports.ScrollArea=c;exports.ScrollBar=i;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("@base-ui/react/scroll-area"),t=require("../../lib/cn.cjs.js");function c({className:e,children:o,scrollFade:l=!1,scrollbarGutter:s=!1,...n}){return r.jsxs(a.ScrollArea.Root,{className:t.cn("flex min-h-0 size-full flex-col",e),...n,children:[r.jsx(a.ScrollArea.Viewport,{className:t.cn("min-h-0 flex-1 rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-y:overscroll-y-contain data-has-overflow-x:overscroll-x-contain",l&&"mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",s&&"data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"),"data-slot":"scroll-area-viewport",children:o}),r.jsx(i,{orientation:"vertical"}),r.jsx(i,{orientation:"horizontal"}),r.jsx(a.ScrollArea.Corner,{"data-slot":"scroll-area-corner"})]})}function i({className:e,orientation:o="vertical",...l}){return r.jsx(a.ScrollArea.Scrollbar,{className:t.cn("m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",e),"data-slot":"scroll-area-scrollbar",orientation:o,...l,children:r.jsx(a.ScrollArea.Thumb,{className:"relative flex-1 rounded-full bg-foreground/20","data-slot":"scroll-area-thumb"})})}Object.defineProperty(exports,"ScrollAreaPrimitive",{enumerable:!0,get:()=>a.ScrollArea});exports.ScrollArea=c;exports.ScrollBar=i;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs as c, jsx as a } from "react/jsx-runtime";
3
3
  import { ScrollArea as r } from "@base-ui/react/scroll-area";
4
- import { ScrollArea as g } from "@base-ui/react/scroll-area";
4
+ import { ScrollArea as x } from "@base-ui/react/scroll-area";
5
5
  import { cn as i } from "../../lib/cn.es.js";
6
6
  function m({
7
7
  className: o,
@@ -13,14 +13,14 @@ function m({
13
13
  return /* @__PURE__ */ c(
14
14
  r.Root,
15
15
  {
16
- className: i("size-full min-h-0", o),
16
+ className: i("flex min-h-0 size-full flex-col", o),
17
17
  ...n,
18
18
  children: [
19
19
  /* @__PURE__ */ a(
20
20
  r.Viewport,
21
21
  {
22
22
  className: i(
23
- "h-full rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-y:overscroll-y-contain data-has-overflow-x:overscroll-x-contain",
23
+ "min-h-0 flex-1 rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-has-overflow-y:overscroll-y-contain data-has-overflow-x:overscroll-x-contain",
24
24
  e && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
25
25
  s && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"
26
26
  ),
@@ -62,6 +62,6 @@ function t({
62
62
  }
63
63
  export {
64
64
  m as ScrollArea,
65
- g as ScrollAreaPrimitive,
65
+ x as ScrollAreaPrimitive,
66
66
  t as ScrollBar
67
67
  };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),B=require("@base-ui/react/merge-props"),o=require("@base-ui/react/select"),U=require("@base-ui/react/use-render"),x=require("lucide-react"),s=require("../../lib/cn.cjs.js"),A=require("../input/input.cjs.js"),v=s.cn(A.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"),S="-me-1 size-4.5 opacity-80 sm:size-4";function I({...e}){return t.jsx(o.Select.Root,{...e})}function z({className:e,children:r,...l}){return t.jsxs(o.Select.Trigger,{className:s.cn(v,e),"data-slot":"select-trigger",...l,children:[r,t.jsx(o.Select.Icon,{"data-slot":"select-icon",className:"text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(x.ChevronsUpDownIcon,{className:S})})]})}function M({className:e,render:r,children:l,...c}){const d=r?void 0:"button",i={children:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 truncate in-data-placeholder:text-muted-foreground/72",children:l}),t.jsx(x.ChevronsUpDownIcon,{className:S})]}),className:s.cn(v,"min-w-0",e),"data-slot":"select-button",type:d};return U.useRender({defaultTagName:"button",props:B.mergeProps(i,c),render:r})}function C({className:e,...r}){return t.jsx(o.Select.Value,{className:s.cn("flex-1 truncate data-placeholder:text-muted-foreground",e),"data-slot":"select-value",...r})}function j({className:e,children:r,side:l="bottom",sideOffset:c=4,align:d="start",alignOffset:i=0,alignItemWithTrigger:h=!1,anchor:u,portalProps:f,...p}){return t.jsx(o.Select.Portal,{...f,children:t.jsx(o.Select.Positioner,{align:d,alignItemWithTrigger:h,alignOffset:i,anchor:u,className:"z-50 select-none","data-slot":"select-positioner",side:l,sideOffset:c,children:t.jsxs(o.Select.Popup,{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:[t.jsx(o.Select.ScrollUpArrow,{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:t.jsx(x.ChevronUpIcon,{className:"relative size-4.5 sm:size-4"})}),t.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:t.jsx(o.Select.List,{className:s.cn("max-h-[min(24rem,var(--available-height))] overflow-y-auto p-1",e),"data-slot":"select-list",children:r})}),t.jsx(o.Select.ScrollDownArrow,{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:t.jsx(x.ChevronDownIcon,{className:"relative size-4.5 sm:size-4"})})]})})})}function L({className:e,children:r,...l}){return t.jsxs(o.Select.Item,{className:s.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",...l,children:[t.jsx(o.Select.ItemText,{className:"col-start-1 min-w-0",children:r}),t.jsx(o.Select.ItemIndicator,{className:"col-start-2",children:t.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:t.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})})]})}function O({className:e,...r}){return t.jsx(o.Select.Separator,{className:s.cn("mx-2 my-1 h-px bg-border",e),"data-slot":"select-separator",...r})}function F(e){return t.jsx(o.Select.Group,{"data-slot":"select-group",...e})}function W(e){return t.jsx(o.Select.GroupLabel,{className:"px-2 py-1.5 font-medium text-muted-foreground text-xs","data-slot":"select-group-label",...e})}function E({className:e,...r}){return t.jsx(o.Select.Label,{className:s.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",...r})}function H(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="object"){const r=e;if("label"in r)return String(r.label);if("name"in r)return String(r.name);if("title"in r)return String(r.title)}return String(e)}function J(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="object"){const r=e;if("id"in r)return String(r.id);if("value"in r)return String(r.value)}return String(e)}function K(e){return e!=null&&typeof e=="object"&&"disabled"in e?!!e.disabled:!1}function Q(e){const{items:r,getLabel:l,getId:c,getDisabled:d,renderItem:i,placeholder:h,onValueChange:u,value:f,defaultValue:p,multiple:b,className:P,classNames:w,"aria-invalid":N,...T}=e,y=l??H,a=c??J,_=d??K,k=b?f?.map(a):f!=null?a(f):void 0,D=b?p?.map(a):p!=null?a(p):void 0,G=n=>{if(b){const m=(n??[]).map(R=>r.find(V=>a(V)===R)??null).filter(Boolean);u?.(m)}else{if(n==null){u?.(null);return}const g=r.find(m=>a(m)===n)??null;u?.(g)}},q=n=>{const g=r.find(m=>a(m)===n);return g?y(g):n};return t.jsxs(I,{itemToStringLabel:q,multiple:b,value:k,defaultValue:D,onValueChange:G,...T,children:[t.jsx(z,{className:P,...N===void 0?{}:{"aria-invalid":N},children:t.jsx(C,{placeholder:h})}),t.jsx(j,{className:w?.popup,children:r.map(n=>t.jsx(L,{value:a(n),disabled:_(n),className:w?.item,children:i?i(n):y(n)},a(n)))})]})}Object.defineProperty(exports,"SelectPrimitive",{enumerable:!0,get:()=>o.Select});exports.Select=Q;exports.SelectButton=M;exports.SelectContent=j;exports.SelectGroup=F;exports.SelectGroupLabel=W;exports.SelectItem=L;exports.SelectLabel=E;exports.SelectPopup=j;exports.SelectRoot=I;exports.SelectSeparator=O;exports.SelectTrigger=z;exports.SelectValue=C;exports.selectTriggerClasses=v;exports.selectTriggerIconClassName=S;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),U=require("@base-ui/react/merge-props"),o=require("@base-ui/react/select"),A=require("@base-ui/react/use-render"),h=require("lucide-react"),s=require("../../lib/cn.cjs.js"),M=require("../input/input.cjs.js"),v=s.cn(M.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"),S="-me-1 size-4.5 opacity-80 sm:size-4";function I({...e}){return t.jsx(o.Select.Root,{...e})}function z({className:e,children:r,icon:l,...i}){return t.jsxs(o.Select.Trigger,{className:s.cn(v,e),"data-slot":"select-trigger",...i,children:[r,t.jsx(o.Select.Icon,{"data-slot":"select-icon",className:"text-muted-foreground hover:text-foreground transition-colors",children:l??t.jsx(h.ChevronsUpDownIcon,{className:S})})]})}function O({className:e,render:r,children:l,icon:i,...d}){const c=r?void 0:"button",u={children:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 truncate in-data-placeholder:text-muted-foreground/72",children:l}),i??t.jsx(h.ChevronsUpDownIcon,{className:S})]}),className:s.cn(v,"min-w-0",e),"data-slot":"select-button",type:c};return A.useRender({defaultTagName:"button",props:U.mergeProps(u,d),render:r})}function C({className:e,...r}){return t.jsx(o.Select.Value,{className:s.cn("flex-1 truncate data-placeholder:text-muted-foreground",e),"data-slot":"select-value",...r})}function j({className:e,children:r,side:l="bottom",sideOffset:i=4,align:d="start",alignOffset:c=0,alignItemWithTrigger:u=!1,anchor:f,portalProps:p,...g}){return t.jsx(o.Select.Portal,{...p,children:t.jsx(o.Select.Positioner,{align:d,alignItemWithTrigger:u,alignOffset:c,anchor:f,className:"z-50 select-none","data-slot":"select-positioner",side:l,sideOffset:i,children:t.jsxs(o.Select.Popup,{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",...g,children:[t.jsx(o.Select.ScrollUpArrow,{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:t.jsx(h.ChevronUpIcon,{className:"relative size-4.5 sm:size-4"})}),t.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:t.jsx(o.Select.List,{className:s.cn("max-h-[min(24rem,var(--available-height))] overflow-y-auto p-1",e),"data-slot":"select-list",children:r})}),t.jsx(o.Select.ScrollDownArrow,{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:t.jsx(h.ChevronDownIcon,{className:"relative size-4.5 sm:size-4"})})]})})})}function L({className:e,children:r,...l}){return t.jsxs(o.Select.Item,{className:s.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",...l,children:[t.jsx(o.Select.ItemText,{className:"col-start-1 min-w-0",children:r}),t.jsx(o.Select.ItemIndicator,{className:"col-start-2",children:t.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:t.jsx("path",{d:"M5.252 12.7 10.2 18.63 18.748 5.37"})})})]})}function F({className:e,...r}){return t.jsx(o.Select.Separator,{className:s.cn("mx-2 my-1 h-px bg-border",e),"data-slot":"select-separator",...r})}function W(e){return t.jsx(o.Select.Group,{"data-slot":"select-group",...e})}function E(e){return t.jsx(o.Select.GroupLabel,{className:"px-2 py-1.5 font-medium text-muted-foreground text-xs","data-slot":"select-group-label",...e})}function H({className:e,...r}){return t.jsx(o.Select.Label,{className:s.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",...r})}function J(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="object"){const r=e;if("label"in r)return String(r.label);if("name"in r)return String(r.name);if("title"in r)return String(r.title)}return String(e)}function K(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number")return String(e);if(typeof e=="object"){const r=e;if("id"in r)return String(r.id);if("value"in r)return String(r.value)}return String(e)}function Q(e){return e!=null&&typeof e=="object"&&"disabled"in e?!!e.disabled:!1}function X(e){const{items:r,getLabel:l,getId:i,getDisabled:d,renderItem:c,placeholder:u,onValueChange:f,value:p,defaultValue:g,multiple:x,className:P,classNames:w,icon:T,"aria-invalid":N,..._}=e,y=l??J,a=i??K,k=d??Q,D=x?p?.map(a):p!=null?a(p):void 0,G=x?g?.map(a):g!=null?a(g):void 0,q=n=>{if(x){const b=(n??[]).map(V=>r.find(B=>a(B)===V)??null).filter(Boolean);f?.(b)}else{if(n==null){f?.(null);return}const m=r.find(b=>a(b)===n)??null;f?.(m)}},R=n=>{const m=r.find(b=>a(b)===n);return m?y(m):n};return t.jsxs(I,{itemToStringLabel:R,multiple:x,value:D,defaultValue:G,onValueChange:q,..._,children:[t.jsx(z,{className:P,icon:T,...N===void 0?{}:{"aria-invalid":N},children:t.jsx(C,{placeholder:u})}),t.jsx(j,{className:w?.popup,children:r.map(n=>t.jsx(L,{value:a(n),disabled:k(n),className:w?.item,children:c?c(n):y(n)},a(n)))})]})}Object.defineProperty(exports,"SelectPrimitive",{enumerable:!0,get:()=>o.Select});exports.Select=X;exports.SelectButton=O;exports.SelectContent=j;exports.SelectGroup=W;exports.SelectGroupLabel=E;exports.SelectItem=L;exports.SelectLabel=H;exports.SelectPopup=j;exports.SelectRoot=I;exports.SelectSeparator=F;exports.SelectTrigger=z;exports.SelectValue=C;exports.selectTriggerClasses=v;exports.selectTriggerIconClassName=S;
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as b, Fragment as D } from "react/jsx-runtime";
3
- import { mergeProps as T } from "@base-ui/react/merge-props";
2
+ import { jsx as r, jsxs as h, Fragment as T } from "react/jsx-runtime";
3
+ import { mergeProps as G } from "@base-ui/react/merge-props";
4
4
  import { Select as o } from "@base-ui/react/select";
5
- import { Select as de } from "@base-ui/react/select";
6
- import { useRender as G } from "@base-ui/react/use-render";
7
- import { ChevronsUpDownIcon as N, ChevronUpIcon as V, ChevronDownIcon as B } from "lucide-react";
5
+ import { Select as ce } from "@base-ui/react/select";
6
+ import { useRender as V } from "@base-ui/react/use-render";
7
+ import { ChevronsUpDownIcon as N, ChevronUpIcon as B, ChevronDownIcon as R } from "lucide-react";
8
8
  import { cn as s } from "../../lib/cn.es.js";
9
- import { inputBaseClasses as R } from "../input/input.es.js";
9
+ import { inputBaseClasses as U } from "../input/input.es.js";
10
10
  const y = s(
11
- R,
11
+ U,
12
12
  "relative inline-flex items-center justify-between gap-2 select-none text-left text-foreground",
13
13
  "focus-visible:border-ring",
14
14
  "aria-invalid:border-error focus-visible:aria-invalid:ring-error/20",
@@ -16,22 +16,23 @@ const y = s(
16
16
  "data-disabled:cursor-not-allowed data-disabled:opacity-50",
17
17
  "[&_svg]:pointer-events-none [&_svg]:shrink-0"
18
18
  ), I = "-me-1 size-4.5 opacity-80 sm:size-4";
19
- function U({
19
+ function A({
20
20
  ...e
21
21
  }) {
22
22
  return /* @__PURE__ */ r(o.Root, { ...e });
23
23
  }
24
- function A({
24
+ function F({
25
25
  className: e,
26
26
  children: t,
27
- ...n
27
+ icon: n,
28
+ ...i
28
29
  }) {
29
- return /* @__PURE__ */ b(
30
+ return /* @__PURE__ */ h(
30
31
  o.Trigger,
31
32
  {
32
33
  className: s(y, e),
33
34
  "data-slot": "select-trigger",
34
- ...n,
35
+ ...i,
35
36
  children: [
36
37
  t,
37
38
  /* @__PURE__ */ r(
@@ -39,35 +40,36 @@ function A({
39
40
  {
40
41
  "data-slot": "select-icon",
41
42
  className: "text-muted-foreground hover:text-foreground transition-colors",
42
- children: /* @__PURE__ */ r(N, { className: I })
43
+ children: n ?? /* @__PURE__ */ r(N, { className: I })
43
44
  }
44
45
  )
45
46
  ]
46
47
  }
47
48
  );
48
49
  }
49
- function te({
50
+ function re({
50
51
  className: e,
51
52
  render: t,
52
53
  children: n,
53
- ...d
54
+ icon: i,
55
+ ...c
54
56
  }) {
55
- const c = t ? void 0 : "button", i = {
56
- children: /* @__PURE__ */ b(D, { children: [
57
+ const d = t ? void 0 : "button", u = {
58
+ children: /* @__PURE__ */ h(T, { children: [
57
59
  /* @__PURE__ */ r("span", { className: "flex-1 truncate in-data-placeholder:text-muted-foreground/72", children: n }),
58
- /* @__PURE__ */ r(N, { className: I })
60
+ i ?? /* @__PURE__ */ r(N, { className: I })
59
61
  ] }),
60
62
  className: s(y, "min-w-0", e),
61
63
  "data-slot": "select-button",
62
- type: c
64
+ type: d
63
65
  };
64
- return G({
66
+ return V({
65
67
  defaultTagName: "button",
66
- props: T(i, d),
68
+ props: G(u, c),
67
69
  render: t
68
70
  });
69
71
  }
70
- function F({
72
+ function M({
71
73
  className: e,
72
74
  ...t
73
75
  }) {
@@ -83,42 +85,42 @@ function F({
83
85
  }
84
86
  );
85
87
  }
86
- function M({
88
+ function W({
87
89
  className: e,
88
90
  children: t,
89
91
  side: n = "bottom",
90
- sideOffset: d = 4,
92
+ sideOffset: i = 4,
91
93
  align: c = "start",
92
- alignOffset: i = 0,
93
- alignItemWithTrigger: v = !1,
94
- anchor: u,
95
- portalProps: f,
96
- ...m
94
+ alignOffset: d = 0,
95
+ alignItemWithTrigger: u = !1,
96
+ anchor: f,
97
+ portalProps: m,
98
+ ...p
97
99
  }) {
98
- return /* @__PURE__ */ r(o.Portal, { ...f, children: /* @__PURE__ */ r(
100
+ return /* @__PURE__ */ r(o.Portal, { ...m, children: /* @__PURE__ */ r(
99
101
  o.Positioner,
100
102
  {
101
103
  align: c,
102
- alignItemWithTrigger: v,
103
- alignOffset: i,
104
- anchor: u,
104
+ alignItemWithTrigger: u,
105
+ alignOffset: d,
106
+ anchor: f,
105
107
  className: "z-50 select-none",
106
108
  "data-slot": "select-positioner",
107
109
  side: n,
108
- sideOffset: d,
109
- children: /* @__PURE__ */ b(
110
+ sideOffset: i,
111
+ children: /* @__PURE__ */ h(
110
112
  o.Popup,
111
113
  {
112
114
  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",
113
115
  "data-slot": "select-popup",
114
- ...m,
116
+ ...p,
115
117
  children: [
116
118
  /* @__PURE__ */ r(
117
119
  o.ScrollUpArrow,
118
120
  {
119
121
  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",
120
122
  "data-slot": "select-scroll-up-arrow",
121
- children: /* @__PURE__ */ r(V, { className: "relative size-4.5 sm:size-4" })
123
+ children: /* @__PURE__ */ r(B, { className: "relative size-4.5 sm:size-4" })
122
124
  }
123
125
  ),
124
126
  /* @__PURE__ */ r("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: /* @__PURE__ */ r(
@@ -137,7 +139,7 @@ function M({
137
139
  {
138
140
  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",
139
141
  "data-slot": "select-scroll-down-arrow",
140
- children: /* @__PURE__ */ r(B, { className: "relative size-4.5 sm:size-4" })
142
+ children: /* @__PURE__ */ r(R, { className: "relative size-4.5 sm:size-4" })
141
143
  }
142
144
  )
143
145
  ]
@@ -146,12 +148,12 @@ function M({
146
148
  }
147
149
  ) });
148
150
  }
149
- function W({
151
+ function $({
150
152
  className: e,
151
153
  children: t,
152
154
  ...n
153
155
  }) {
154
- return /* @__PURE__ */ b(
156
+ return /* @__PURE__ */ h(
155
157
  o.Item,
156
158
  {
157
159
  className: s(
@@ -182,7 +184,7 @@ function W({
182
184
  }
183
185
  );
184
186
  }
185
- function re({
187
+ function oe({
186
188
  className: e,
187
189
  ...t
188
190
  }) {
@@ -195,10 +197,10 @@ function re({
195
197
  }
196
198
  );
197
199
  }
198
- function oe(e) {
200
+ function ae(e) {
199
201
  return /* @__PURE__ */ r(o.Group, { "data-slot": "select-group", ...e });
200
202
  }
201
- function ae(e) {
203
+ function ne(e) {
202
204
  return /* @__PURE__ */ r(
203
205
  o.GroupLabel,
204
206
  {
@@ -208,7 +210,7 @@ function ae(e) {
208
210
  }
209
211
  );
210
212
  }
211
- function ne({
213
+ function le({
212
214
  className: e,
213
215
  ...t
214
216
  }) {
@@ -224,7 +226,7 @@ function ne({
224
226
  }
225
227
  );
226
228
  }
227
- function $(e) {
229
+ function q(e) {
228
230
  if (e == null) return "";
229
231
  if (typeof e == "string" || typeof e == "number") return String(e);
230
232
  if (typeof e == "object") {
@@ -235,7 +237,7 @@ function $(e) {
235
237
  }
236
238
  return String(e);
237
239
  }
238
- function q(e) {
240
+ function E(e) {
239
241
  if (e == null) return "";
240
242
  if (typeof e == "string" || typeof e == "number") return String(e);
241
243
  if (typeof e == "object") {
@@ -245,66 +247,68 @@ function q(e) {
245
247
  }
246
248
  return String(e);
247
249
  }
248
- function E(e) {
250
+ function H(e) {
249
251
  return e != null && typeof e == "object" && "disabled" in e ? !!e.disabled : !1;
250
252
  }
251
- function le(e) {
253
+ function se(e) {
252
254
  const {
253
255
  items: t,
254
256
  getLabel: n,
255
- getId: d,
257
+ getId: i,
256
258
  getDisabled: c,
257
- renderItem: i,
258
- placeholder: v,
259
- onValueChange: u,
260
- value: f,
261
- defaultValue: m,
262
- multiple: h,
259
+ renderItem: d,
260
+ placeholder: u,
261
+ onValueChange: f,
262
+ value: m,
263
+ defaultValue: p,
264
+ multiple: v,
263
265
  className: z,
264
266
  classNames: x,
267
+ icon: L,
265
268
  "aria-invalid": S,
266
- ...L
267
- } = e, w = n ?? $, l = d ?? q, C = c ?? E, _ = h ? f?.map(l) : f != null ? l(f) : void 0, P = h ? m?.map(l) : m != null ? l(m) : void 0;
268
- return /* @__PURE__ */ b(
269
- U,
269
+ ...C
270
+ } = e, w = n ?? q, l = i ?? E, _ = c ?? H, P = v ? m?.map(l) : m != null ? l(m) : void 0, j = v ? p?.map(l) : p != null ? l(p) : void 0;
271
+ return /* @__PURE__ */ h(
272
+ A,
270
273
  {
271
274
  itemToStringLabel: (a) => {
272
- const p = t.find((g) => l(g) === a);
273
- return p ? w(p) : a;
275
+ const g = t.find((b) => l(b) === a);
276
+ return g ? w(g) : a;
274
277
  },
275
- multiple: h,
276
- value: _,
277
- defaultValue: P,
278
+ multiple: v,
279
+ value: P,
280
+ defaultValue: j,
278
281
  onValueChange: (a) => {
279
- if (h) {
280
- const g = (a ?? []).map((j) => t.find((k) => l(k) === j) ?? null).filter(Boolean);
281
- u?.(g);
282
+ if (v) {
283
+ const b = (a ?? []).map((k) => t.find((D) => l(D) === k) ?? null).filter(Boolean);
284
+ f?.(b);
282
285
  } else {
283
286
  if (a == null) {
284
- u?.(null);
287
+ f?.(null);
285
288
  return;
286
289
  }
287
- const p = t.find((g) => l(g) === a) ?? null;
288
- u?.(p);
290
+ const g = t.find((b) => l(b) === a) ?? null;
291
+ f?.(g);
289
292
  }
290
293
  },
291
- ...L,
294
+ ...C,
292
295
  children: [
293
296
  /* @__PURE__ */ r(
294
- A,
297
+ F,
295
298
  {
296
299
  className: z,
300
+ icon: L,
297
301
  ...S === void 0 ? {} : { "aria-invalid": S },
298
- children: /* @__PURE__ */ r(F, { placeholder: v })
302
+ children: /* @__PURE__ */ r(M, { placeholder: u })
299
303
  }
300
304
  ),
301
- /* @__PURE__ */ r(M, { className: x?.popup, children: t.map((a) => /* @__PURE__ */ r(
302
- W,
305
+ /* @__PURE__ */ r(W, { className: x?.popup, children: t.map((a) => /* @__PURE__ */ r(
306
+ $,
303
307
  {
304
308
  value: l(a),
305
- disabled: C(a),
309
+ disabled: _(a),
306
310
  className: x?.item,
307
- children: i ? i(a) : w(a)
311
+ children: d ? d(a) : w(a)
308
312
  },
309
313
  l(a)
310
314
  )) })
@@ -313,19 +317,19 @@ function le(e) {
313
317
  );
314
318
  }
315
319
  export {
316
- le as Select,
317
- te as SelectButton,
318
- M as SelectContent,
319
- oe as SelectGroup,
320
- ae as SelectGroupLabel,
321
- W as SelectItem,
322
- ne as SelectLabel,
323
- M as SelectPopup,
324
- de as SelectPrimitive,
325
- U as SelectRoot,
326
- re as SelectSeparator,
327
- A as SelectTrigger,
328
- F as SelectValue,
320
+ se as Select,
321
+ re as SelectButton,
322
+ W as SelectContent,
323
+ ae as SelectGroup,
324
+ ne as SelectGroupLabel,
325
+ $ as SelectItem,
326
+ le as SelectLabel,
327
+ W as SelectPopup,
328
+ ce as SelectPrimitive,
329
+ A as SelectRoot,
330
+ oe as SelectSeparator,
331
+ F as SelectTrigger,
332
+ M as SelectValue,
329
333
  y as selectTriggerClasses,
330
334
  I as selectTriggerIconClassName
331
335
  };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@base-ui/react/merge-props"),o=require("@base-ui/react/use-render"),t=require("class-variance-authority"),g=require("../../lib/cn.cjs.js"),e=t.cva("group/tag inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-error aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",error:"bg-error/10 text-error focus-visible:ring-error/20 dark:bg-error/20 dark:focus-visible:ring-error/40 [a]:hover:bg-error/20",success:"bg-success/10 text-success focus-visible:ring-success/20 dark:bg-success/20 dark:focus-visible:ring-success/40 [a]:hover:bg-success/20",warning:"bg-warning/10 text-warning focus-visible:ring-warning/20 dark:bg-warning/20 dark:focus-visible:ring-warning/40 [a]:hover:bg-warning/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function u({className:i,variant:r="default",render:n,...a}){return o.useRender({defaultTagName:"span",props:s.mergeProps({className:g.cn(e({variant:r}),i)},a),render:n,state:{slot:"tag",variant:r}})}exports.Tag=u;exports.tagVariants=e;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@base-ui/react/merge-props"),g=require("@base-ui/react/use-render"),u=require("class-variance-authority"),b=require("../../lib/cn.cjs.js"),t=u.cva("group/tag inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-error aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",error:"bg-error/10 text-error focus-visible:ring-error/20 dark:bg-error/20 dark:focus-visible:ring-error/40 [a]:hover:bg-error/20",success:"bg-success/10 text-success focus-visible:ring-success/20 dark:bg-success/20 dark:focus-visible:ring-success/40 [a]:hover:bg-success/20",warning:"bg-warning/10 text-warning focus-visible:ring-warning/20 dark:bg-warning/20 dark:focus-visible:ring-warning/40 [a]:hover:bg-warning/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"},color:{gray:"bg-gray-100 text-gray-600",red:"bg-red-100 text-red-600",orange:"bg-orange-100 text-orange-600",amber:"bg-amber-100 text-amber-600",green:"bg-green-100 text-green-600",teal:"bg-teal-100 text-teal-600",cyan:"bg-cyan-100 text-cyan-600",sky:"bg-sky-100 text-sky-600",blue:"bg-blue-100 text-blue-600",indigo:"bg-indigo-100 text-indigo-600",violet:"bg-violet-100 text-violet-600",purple:"bg-purple-100 text-purple-600",pink:"bg-pink-100 text-pink-600",rose:"bg-rose-100 text-rose-600"}}});function d({className:n,variant:i,color:e,render:a,...o}){const r=e?void 0:i??"default";return g.useRender({defaultTagName:"span",props:s.mergeProps({className:b.cn(t({variant:r,color:e}),n)},o),render:a,state:{slot:"tag",variant:r,color:e}})}exports.Tag=d;exports.tagVariants=t;