@oneplatformdev/ui 0.0.1-beta.81 → 0.0.1-beta.85

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.
@@ -9,7 +9,7 @@ import "../Command/Command.mjs";
9
9
  import "@oneplatformdev/utils";
10
10
  import "@oneplatformdev/hooks";
11
11
  import "lucide-react";
12
- import { C as c } from "../Combobox-DpcCpN3b.js";
12
+ import { C as c } from "../Combobox-B0sHDL7X.js";
13
13
  export {
14
14
  c as Combobox
15
15
  };
@@ -20,7 +20,7 @@ import "../Card/Card.mjs";
20
20
  import "../Carousel/Carousel.mjs";
21
21
  import "../Checkbox/Checkbox.mjs";
22
22
  import "@radix-ui/react-collapsible";
23
- import { a as no } from "../Combobox-DpcCpN3b.js";
23
+ import { a as no } from "../Combobox-B0sHDL7X.js";
24
24
  import "../Command/Command.mjs";
25
25
  import "../DropdownMenu/DropdownMenu.mjs";
26
26
  import "../Table/Table.mjs";
@@ -3,7 +3,7 @@ import "../Button/Button.mjs";
3
3
  import "../Button/buttonVariants.mjs";
4
4
  import "react";
5
5
  import "../Collapsible/Collapsible.mjs";
6
- import { c as a, b as e } from "../Combobox-DpcCpN3b.js";
6
+ import { c as a, b as e } from "../Combobox-B0sHDL7X.js";
7
7
  import "lucide-react";
8
8
  import "@oneplatformdev/utils";
9
9
  export {
@@ -1,4 +1,4 @@
1
- import { C as m } from "../Combobox-DpcCpN3b.js";
1
+ import { C as m } from "../Combobox-B0sHDL7X.js";
2
2
  export {
3
3
  m as Combobox
4
4
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as m, jsx as e, Fragment as A } from "react/jsx-runtime";
2
- import g, { forwardRef as w, useState as V, useRef as W, useEffect as X, useCallback as v, useLayoutEffect as H } from "react";
1
+ import { jsxs as s, jsx as e, Fragment as A } from "react/jsx-runtime";
2
+ import f, { forwardRef as y, useState as V, useRef as W, useEffect as X, useCallback as b, useLayoutEffect as H } from "react";
3
3
  import { LoadingMask as J } from "./LoadingMask/LoadingMask.mjs";
4
4
  import "./LoadingMask/RenderLoadingMask.mjs";
5
5
  import { Popover as K, PopoverTrigger as Q, PopoverContent as Y } from "./Popover/Popover.mjs";
6
6
  import { Button as _ } from "./Button/Button.mjs";
7
7
  import "./Button/buttonVariants.mjs";
8
8
  import { CommandItem as Z, Command as $, CommandInput as ee, CommandList as te, CommandGroup as oe, CommandEmpty as F } from "./Command/Command.mjs";
9
- import { cn as c } from "@oneplatformdev/utils";
9
+ import { cn as p } from "@oneplatformdev/utils";
10
10
  import { useDebounceCallback as re } from "@oneplatformdev/hooks";
11
11
  import { Check as ae, ChevronDownIcon as ie, X as ne, ChevronsUpDown as le } from "lucide-react";
12
12
  import { Collapsible as se, CollapsibleTrigger as pe, CollapsibleContent as me } from "./Collapsible/Collapsible.mjs";
@@ -63,73 +63,73 @@ import "./Toggle/Toggle.mjs";
63
63
  import "./ToggleGroup/ToggleGroup.mjs";
64
64
  import "./Tooltip/TooltipRoot.mjs";
65
65
  import "./Dropzone/Dropzone.mjs";
66
- const ce = 8, I = w((i, l) => {
67
- const { children: t, setOpen: d, option: r, onChangeOption: n, value: s = "", deep: u = 0 } = i;
68
- return /* @__PURE__ */ m(
66
+ const ce = 8, I = y((n, l) => {
67
+ const { children: t, setOpen: m, option: o, onChangeOption: i, value: c = "", deep: a = 0 } = n;
68
+ return /* @__PURE__ */ s(
69
69
  Z,
70
70
  {
71
71
  ref: l,
72
- value: r.value,
72
+ value: o.value,
73
73
  onSelect: () => {
74
- s === r.value ? n == null || n({ value: "", label: "" }) : n == null || n(r), d(!1);
74
+ c === o.value ? i == null || i({ value: "", label: "" }) : i == null || i(o), m(!1);
75
75
  },
76
76
  style: {
77
- paddingLeft: (u + 1) * ce
77
+ paddingLeft: (a + 1) * ce
78
78
  },
79
79
  children: [
80
80
  t,
81
81
  /* @__PURE__ */ e(
82
82
  "span",
83
83
  {
84
- className: c(
84
+ className: p(
85
85
  "overflow-hidden whitespace-wrap text-ellipsis line-clamp-2"
86
86
  ),
87
- children: r.label
87
+ children: o.label
88
88
  }
89
89
  ),
90
90
  /* @__PURE__ */ e(
91
91
  ae,
92
92
  {
93
- className: c(
93
+ className: p(
94
94
  "ml-auto",
95
- s === r.value ? "opacity-100" : "opacity-0"
95
+ c === o.value ? "opacity-100" : "opacity-0"
96
96
  )
97
97
  }
98
98
  )
99
99
  ]
100
100
  },
101
- r.value
101
+ o.value
102
102
  );
103
- }), M = w((i, l) => {
104
- var p;
105
- const { option: t, onChangeOption: d, value: r = "", deep: n = 0 } = i, [s, u] = V(!0);
106
- return (p = t == null ? void 0 : t.items) != null && p.length ? /* @__PURE__ */ m(
103
+ }), M = y((n, l) => {
104
+ var c;
105
+ const { option: t, deep: m = 0 } = n, [o, i] = V(!0);
106
+ return (c = t == null ? void 0 : t.items) != null && c.length ? /* @__PURE__ */ s(
107
107
  se,
108
108
  {
109
109
  ref: l,
110
- open: s,
111
- onOpenChange: u,
112
- "data-opened": s,
113
- className: c("group/collapsible"),
110
+ open: o,
111
+ onOpenChange: i,
112
+ "data-opened": o,
113
+ className: p("group/collapsible"),
114
114
  children: [
115
- /* @__PURE__ */ e(I, { ...i, children: /* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ m(
115
+ /* @__PURE__ */ e(I, { ...n, children: /* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ s(
116
116
  _,
117
117
  {
118
118
  onClick: (a) => {
119
- a == null || a.preventDefault(), a == null || a.stopPropagation(), u((h) => !h);
119
+ a == null || a.preventDefault(), a == null || a.stopPropagation(), i((d) => !d);
120
120
  },
121
121
  type: "button",
122
122
  variant: "ghost",
123
123
  size: "sm",
124
- className: c("aspect-square size-6", "transition-transform"),
124
+ className: p("aspect-square size-6", "transition-transform"),
125
125
  children: [
126
126
  /* @__PURE__ */ e(
127
127
  ie,
128
128
  {
129
- className: c(
129
+ className: p(
130
130
  "!size-5",
131
131
  "transition-transform",
132
- s && "rotate-180"
132
+ o && "rotate-180"
133
133
  )
134
134
  }
135
135
  ),
@@ -140,103 +140,103 @@ const ce = 8, I = w((i, l) => {
140
140
  /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-0", children: t == null ? void 0 : t.items.map((a) => /* @__PURE__ */ e(
141
141
  M,
142
142
  {
143
- ...i,
144
- deep: n + 1,
143
+ ...n,
144
+ deep: m + 1,
145
145
  option: a
146
146
  },
147
147
  a.value
148
148
  )) }) })
149
149
  ]
150
150
  }
151
- ) : /* @__PURE__ */ e(I, { ...i, ref: l });
152
- }), de = w((i, l) => {
153
- const { options: t = [], ...d } = i;
154
- return /* @__PURE__ */ e("div", { ref: l, className: "flex flex-col gap-0", children: t.map((r) => /* @__PURE__ */ e(M, { ...d, option: r }, r.value)) });
155
- }), St = w(
156
- (i, l) => {
151
+ ) : /* @__PURE__ */ e(I, { ...n, ref: l });
152
+ }), de = y((n, l) => {
153
+ const { options: t = [], ...m } = n;
154
+ return /* @__PURE__ */ e("div", { ref: l, className: "flex flex-col gap-0", children: t.map((o) => /* @__PURE__ */ e(M, { ...m, option: o }, o.value)) });
155
+ }), St = y(
156
+ (n, l) => {
157
157
  var j;
158
158
  const {
159
159
  value: t,
160
- onChange: d,
161
- placeholder: r,
162
- disabled: n,
163
- searchLabel: s = "Type to search...",
164
- fetchOptions: u,
165
- options: p,
166
- emptyLabel: a = "No options",
167
- emptyAction: h,
160
+ onChange: m,
161
+ placeholder: o,
162
+ disabled: i,
163
+ searchLabel: c = "Type to search...",
164
+ fetchOptions: a,
165
+ options: d,
166
+ emptyLabel: L = "No options",
167
+ emptyAction: g,
168
168
  onMount: P
169
- } = i, N = W(!1), [f, C] = g.useState(!1), [x, T] = g.useState(""), [S, y] = g.useState([]), [O, k] = g.useState(), [D, b] = g.useState(!1);
169
+ } = n, w = W(!1), [u, v] = f.useState(!1), [C, T] = f.useState(""), [N, x] = f.useState([]), [S, k] = f.useState(), [O, h] = f.useState(!1);
170
170
  X(() => {
171
- p != null && p.length && y(p);
172
- }, [p]);
171
+ d != null && d.length && x(d);
172
+ }, [d]);
173
173
  const R = async () => {
174
- f || (E(), T(""));
175
- }, E = v(async (o) => {
176
- b(!0);
174
+ u || (E(), T(""));
175
+ }, E = b(async (r) => {
176
+ h(!0);
177
177
  try {
178
- const L = await u(o);
179
- y(L);
180
- } catch (L) {
181
- console.error("Unexpected error while get option:", L);
178
+ const D = await a(r);
179
+ x(D);
180
+ } catch (D) {
181
+ console.error("Unexpected error while get option:", D);
182
182
  } finally {
183
- b(!1);
183
+ h(!1);
184
184
  }
185
185
  }, []), q = re(E, 1e3, {
186
186
  leading: !1,
187
187
  trailing: !0
188
- }), B = v((o) => {
189
- b(!0), T(o), q(o);
190
- }, []), z = v((o) => {
191
- d(o.value), k(o), b(!1);
192
- }, []), G = v(() => {
193
- z({ value: "", label: "" }), k(void 0), b(!1);
194
- }, []), U = v(() => {
188
+ }), B = b((r) => {
189
+ h(!0), T(r), q(r);
190
+ }, []), z = b((r) => {
191
+ m(r.value), k(r), h(!1);
192
+ }, []), G = b(() => {
193
+ z({ value: "", label: "" }), k(void 0), h(!1);
194
+ }, []), U = b(() => {
195
195
  if (!P) {
196
- N.current = !0;
196
+ w.current = !0;
197
197
  return;
198
198
  }
199
- P({ setOptions: y, search: x || "", open: f, setOpen: C }).finally(
199
+ P({ setOptions: x, search: C || "", open: u, setOpen: v }).finally(
200
200
  () => {
201
- N.current = !0;
201
+ w.current = !0;
202
202
  }
203
203
  );
204
204
  }, []);
205
205
  return H(() => (U(), () => {
206
- N.current = !1;
207
- }), []), /* @__PURE__ */ e("div", { className: "w-full", ref: l, children: /* @__PURE__ */ m(
206
+ w.current = !1;
207
+ }), []), /* @__PURE__ */ e("div", { className: "w-full", ref: l, children: /* @__PURE__ */ s(
208
208
  K,
209
209
  {
210
- open: f,
211
- onOpenChange: (o) => {
212
- C(o), o && R();
210
+ open: u,
211
+ onOpenChange: (r) => {
212
+ v(r), r && R();
213
213
  },
214
214
  children: [
215
- /* @__PURE__ */ e(Q, { asChild: !0, className: "border-input", children: /* @__PURE__ */ m(
215
+ /* @__PURE__ */ e(Q, { asChild: !0, className: "border-input", children: /* @__PURE__ */ s(
216
216
  _,
217
217
  {
218
218
  variant: "outline",
219
219
  role: "combobox",
220
220
  size: "lg",
221
- "aria-expanded": f,
222
- className: c(
221
+ "aria-expanded": u,
222
+ className: p(
223
223
  "w-full justify-between font-normal text-sm border bg-transparent relative p-3",
224
- f ? "border-2 border-sidebar-accent" : "border-border"
224
+ u ? "border-2 border-sidebar-accent" : "border-border"
225
225
  ),
226
- disabled: n,
226
+ disabled: i,
227
227
  children: [
228
- /* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: t ? ((j = S.find((o) => o.value === t)) == null ? void 0 : j.label) || (O == null ? void 0 : O.label) : /* @__PURE__ */ e("span", { className: "text-gray-400", children: r }) }),
228
+ /* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: t ? ((j = N.find((r) => r.value === t)) == null ? void 0 : j.label) || (S == null ? void 0 : S.label) : /* @__PURE__ */ e("span", { className: "text-gray-400", children: o }) }),
229
229
  t ? /* @__PURE__ */ e(
230
230
  "div",
231
231
  {
232
- className: c(
232
+ className: p(
233
233
  "absolute top-0 right-1",
234
234
  "flex items-center justify-center",
235
235
  "w-9 aspect-square [&_svg]:size-5",
236
236
  "opacity-50 cursor-pointer hover:opacity-100"
237
237
  ),
238
- onClick: (o) => {
239
- o.stopPropagation(), G();
238
+ onClick: (r) => {
239
+ r.stopPropagation(), G();
240
240
  },
241
241
  children: /* @__PURE__ */ e(ne, {})
242
242
  }
@@ -249,37 +249,37 @@ const ce = 8, I = w((i, l) => {
249
249
  {
250
250
  className: "w-[var(--radix-popper-anchor-width)] max-w-none p-0",
251
251
  align: "start",
252
- children: /* @__PURE__ */ m($, { shouldFilter: !1, children: [
252
+ children: /* @__PURE__ */ s($, { shouldFilter: !1, children: [
253
253
  /* @__PURE__ */ e(
254
254
  ee,
255
255
  {
256
- placeholder: s,
257
- value: x,
256
+ placeholder: c,
257
+ value: C,
258
258
  onValueChange: B
259
259
  }
260
260
  ),
261
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ m(
261
+ /* @__PURE__ */ e(te, { children: /* @__PURE__ */ s(
262
262
  oe,
263
263
  {
264
- className: c(!S.length && "p-0 shadow-none"),
264
+ className: p(!N.length && "p-0 shadow-none"),
265
265
  children: [
266
- D && /* @__PURE__ */ e(J, { fullWidth: !0 }),
267
- !D && !!x && /* @__PURE__ */ e(A, { children: h ? /* @__PURE__ */ m(F, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
268
- /* @__PURE__ */ e("span", { children: a }),
269
- typeof h == "function" ? h({
270
- setOptions: y,
271
- search: x || "",
272
- open: f,
273
- setOpen: C
274
- }) : h
275
- ] }) : /* @__PURE__ */ e(F, { children: a }) }),
276
- !D && /* @__PURE__ */ e(
266
+ O && /* @__PURE__ */ e(J, { fullWidth: !0 }),
267
+ !O && !!C && /* @__PURE__ */ e(A, { children: g ? /* @__PURE__ */ s(F, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
268
+ /* @__PURE__ */ e("span", { children: L }),
269
+ typeof g == "function" ? g({
270
+ setOptions: x,
271
+ search: C || "",
272
+ open: u,
273
+ setOpen: v
274
+ }) : g
275
+ ] }) : /* @__PURE__ */ e(F, { children: L }) }),
276
+ !O && /* @__PURE__ */ e(
277
277
  de,
278
278
  {
279
279
  value: t,
280
- options: S,
280
+ options: N,
281
281
  onChangeOption: z,
282
- setOpen: C
282
+ setOpen: v
283
283
  }
284
284
  )
285
285
  ]
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { FormControl as a } from "../Form/Form.mjs";
3
3
  import { FormRenderControl as b } from "../Form/FormRenderControl.mjs";
4
- import { C as p } from "../Combobox-DpcCpN3b.js";
4
+ import { C as p } from "../Combobox-B0sHDL7X.js";
5
5
  const x = (m) => {
6
6
  const { form: n, label: e, name: t, ...C } = m;
7
7
  return /* @__PURE__ */ o(
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as PopoverPrimitive from "@radix-ui/react-popover";
1
+ import * as React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
3
  declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
4
  declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,24 +1,28 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import * as n from "react";
2
+ import * as s from "react";
3
3
  import * as o from "@radix-ui/react-popover";
4
- import { cn as s } from "@oneplatformdev/utils";
5
- const l = o.Root, c = o.Trigger, g = o.Anchor, m = n.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...d }, i) => /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
4
+ import { cn as m } from "@oneplatformdev/utils";
5
+ const c = o.Root, v = o.Trigger, g = o.Anchor, p = s.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, style: d, ...n }, i) => /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
6
6
  o.Content,
7
7
  {
8
8
  ref: i,
9
9
  align: a,
10
10
  sideOffset: r,
11
- className: s(
11
+ className: m(
12
12
  "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
13
13
  e
14
14
  ),
15
- ...d
15
+ style: {
16
+ pointerEvents: "auto",
17
+ ...d
18
+ },
19
+ ...n
16
20
  }
17
21
  ) }));
18
- m.displayName = o.Content.displayName;
22
+ p.displayName = o.Content.displayName;
19
23
  export {
20
- l as Popover,
24
+ c as Popover,
21
25
  g as PopoverAnchor,
22
- m as PopoverContent,
23
- c as PopoverTrigger
26
+ p as PopoverContent,
27
+ v as PopoverTrigger
24
28
  };
package/index.mjs CHANGED
@@ -20,7 +20,7 @@ import { Carousel as go, CarouselContent as xo, CarouselItem as fo, CarouselNext
20
20
  import { ChartContainer as To, ChartLegend as Do, ChartLegendContent as co, ChartStyle as Mo, ChartTooltip as Po, ChartTooltipContent as Ao } from "./Chart/Chart.mjs";
21
21
  import { Checkbox as wo, CheckboxLabel as ho } from "./Checkbox/Checkbox.mjs";
22
22
  import { Collapsible as Fo, CollapsibleContent as Lo, CollapsibleTrigger as Ro } from "./Collapsible/Collapsible.mjs";
23
- import { C as Go } from "./Combobox-DpcCpN3b.js";
23
+ import { C as Go } from "./Combobox-B0sHDL7X.js";
24
24
  import { Command as Ho, CommandDialog as No, CommandEmpty as Vo, CommandGroup as yo, CommandInput as Eo, CommandItem as Oo, CommandList as zo, CommandSeparator as _o, CommandShortcut as Uo } from "./Command/Command.mjs";
25
25
  import { DataTable as jo } from "./DataTable/DataTable.mjs";
26
26
  import { DatePicker as Jo } from "./DatePicker/DatePicker.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.81",
3
+ "version": "0.0.1-beta.85",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [