@yuno-payments/dashboard-design-system 0.0.78 → 0.0.80

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.
@@ -1,111 +1,111 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import * as a from "react";
3
- import { cn as l } from "../../../lib/utils.js";
4
- import { Combobox as B, ComboboxTrigger as H, ComboboxContent as J } from "../../../vendor/shadcn/combobox.js";
5
- import { Command as K, CommandInput as M, CommandList as P, CommandEmpty as Q, CommandGroup as U, CommandItem as k } from "../../../vendor/shadcn/command.js";
6
- import { Label as W } from "../../../vendor/shadcn/label.js";
2
+ import * as l from "react";
3
+ import { cn as a } from "../../../lib/utils.js";
4
+ import { FieldLabel as B } from "../../../vendor/shadcn/field.js";
5
+ import { Combobox as H, ComboboxTrigger as J, ComboboxContent as K } from "../../../vendor/shadcn/combobox.js";
6
+ import { Command as M, CommandInput as P, CommandList as Q, CommandEmpty as U, CommandGroup as W, CommandItem as k } from "../../../vendor/shadcn/command.js";
7
7
  import { Typography as x } from "../typography/typography.js";
8
8
  import { Icon as b } from "../icon/icon.js";
9
- const X = a.forwardRef(
9
+ const X = l.forwardRef(
10
10
  ({
11
11
  label: j,
12
12
  description: N,
13
- error: f,
13
+ error: u,
14
14
  optional: G = !1,
15
15
  placeholder: L = "Select an option",
16
- value: n,
16
+ value: r,
17
17
  defaultValue: p,
18
18
  onValueChange: h,
19
- disabled: u = !1,
19
+ disabled: f = !1,
20
20
  options: c = [],
21
21
  groups: o = [],
22
22
  className: E,
23
23
  id: g,
24
24
  searchPlaceholder: z = "Search...",
25
- maxHeight: I = 300
26
- }, F) => {
27
- const [i, C] = a.useState(!1), [v, y] = a.useState(""), d = o.length > 0, S = c.length > 0, R = a.useCallback(() => {
28
- if (!n) return null;
25
+ maxHeight: F = 300
26
+ }, I) => {
27
+ const [i, C] = l.useState(!1), [v, S] = l.useState(""), d = o.length > 0, w = c.length > 0, R = l.useCallback(() => {
28
+ if (!r) return null;
29
29
  if (d)
30
30
  for (const s of o) {
31
- const r = s.options.find((t) => t.value === n);
32
- if (r) return r.label;
31
+ const n = s.options.find((t) => t.value === r);
32
+ if (n) return n.label;
33
33
  }
34
- else if (S) {
35
- const s = c.find((r) => r.value === n);
34
+ else if (w) {
35
+ const s = c.find((n) => n.value === r);
36
36
  if (s) return s.label;
37
37
  }
38
38
  return null;
39
- }, [n, o, c, d, S]), T = a.useCallback(
39
+ }, [r, o, c, d, w]), T = l.useCallback(
40
40
  (s) => {
41
41
  if (!s)
42
42
  return { filteredOptions: c, filteredGroups: o };
43
- const r = s.toLowerCase();
43
+ const n = s.toLowerCase();
44
44
  if (d) {
45
45
  const t = o.map((m) => ({
46
46
  ...m,
47
47
  options: m.options.filter(
48
- (A) => A.label.toLowerCase().includes(r)
48
+ (A) => A.label.toLowerCase().includes(n)
49
49
  )
50
50
  })).filter((m) => m.options.length > 0);
51
51
  return { filteredOptions: [], filteredGroups: t };
52
52
  } else
53
53
  return { filteredOptions: c.filter(
54
- (m) => m.label.toLowerCase().includes(r)
54
+ (m) => m.label.toLowerCase().includes(n)
55
55
  ), filteredGroups: [] };
56
56
  },
57
57
  [c, o, d]
58
58
  ), { filteredOptions: q, filteredGroups: D } = T(v);
59
- a.useEffect(() => {
59
+ l.useEffect(() => {
60
60
  i && setTimeout(() => {
61
61
  document.querySelector(
62
62
  '[data-slot="command-input"]'
63
63
  )?.focus();
64
64
  }, 0);
65
- }, [i]), a.useEffect(() => {
66
- i || y("");
67
- }, [i]), a.useEffect(() => {
68
- p && !n && h?.(p);
69
- }, [p, n, h]);
70
- const w = (s) => {
71
- u || (h?.(s), C(!1));
65
+ }, [i]), l.useEffect(() => {
66
+ i || S("");
67
+ }, [i]), l.useEffect(() => {
68
+ p && !r && h?.(p);
69
+ }, [p, r, h]);
70
+ const y = (s) => {
71
+ f || (h?.(s), C(!1));
72
72
  }, O = R();
73
- return /* @__PURE__ */ e.jsxs("div", { className: l("w-full", E), children: [
73
+ return /* @__PURE__ */ e.jsxs("div", { className: a("w-full", E), children: [
74
74
  j && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 mb-2", children: [
75
- /* @__PURE__ */ e.jsx(W, { htmlFor: g, className: l(u && "opacity-50"), children: j }),
75
+ /* @__PURE__ */ e.jsx(B, { htmlFor: g, className: a(f && "text-muted-foreground"), children: j }),
76
76
  G && /* @__PURE__ */ e.jsx(x, { variant: "sm", className: "text-muted-foreground", children: "(Optional)" })
77
77
  ] }),
78
- N && !f && /* @__PURE__ */ e.jsx(
78
+ N && !u && /* @__PURE__ */ e.jsx(
79
79
  x,
80
80
  {
81
81
  variant: "sm",
82
- className: l(
82
+ className: a(
83
83
  "text-muted-foreground mb-2",
84
- u && "opacity-50"
84
+ f && "text-muted-"
85
85
  ),
86
86
  children: N
87
87
  }
88
88
  ),
89
- /* @__PURE__ */ e.jsxs(B, { open: i, onOpenChange: C, children: [
90
- /* @__PURE__ */ e.jsx(H, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
89
+ /* @__PURE__ */ e.jsxs(H, { open: i, onOpenChange: C, children: [
90
+ /* @__PURE__ */ e.jsx(J, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
91
91
  "button",
92
92
  {
93
- ref: F,
93
+ ref: I,
94
94
  id: g,
95
95
  type: "button",
96
- disabled: u,
96
+ disabled: f,
97
97
  role: "combobox",
98
98
  "aria-expanded": i,
99
99
  "aria-haspopup": "listbox",
100
- className: l(
101
- "flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 shadow-xs [&>span]:min-w-0 [&>span]:truncate",
102
- f && "border-destructive"
100
+ className: a(
101
+ "flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:text-muted- shadow-xs [&>span]:min-w-0 [&>span]:truncate",
102
+ u && "border-destructive"
103
103
  ),
104
104
  children: [
105
105
  /* @__PURE__ */ e.jsx(
106
106
  "span",
107
107
  {
108
- className: l(
108
+ className: a(
109
109
  "truncate",
110
110
  !O && "text-muted-foreground"
111
111
  ),
@@ -117,23 +117,23 @@ const X = a.forwardRef(
117
117
  {
118
118
  name: "CaretDown",
119
119
  size: "sm",
120
- className: "opacity-50 shrink-0"
120
+ className: "text-muted- shrink-0"
121
121
  }
122
122
  )
123
123
  ]
124
124
  }
125
125
  ) }),
126
- /* @__PURE__ */ e.jsx(J, { className: "p-0", align: "start", children: /* @__PURE__ */ e.jsxs(K, { shouldFilter: !1, children: [
126
+ /* @__PURE__ */ e.jsx(K, { className: "p-0", align: "start", children: /* @__PURE__ */ e.jsxs(M, { shouldFilter: !1, children: [
127
127
  /* @__PURE__ */ e.jsx(
128
- M,
128
+ P,
129
129
  {
130
130
  placeholder: z,
131
131
  value: v,
132
- onValueChange: y
132
+ onValueChange: S
133
133
  }
134
134
  ),
135
- /* @__PURE__ */ e.jsxs(P, { style: { maxHeight: I }, children: [
136
- /* @__PURE__ */ e.jsx(Q, { children: /* @__PURE__ */ e.jsx(
135
+ /* @__PURE__ */ e.jsxs(Q, { style: { maxHeight: F }, children: [
136
+ /* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(
137
137
  x,
138
138
  {
139
139
  variant: "sm",
@@ -141,23 +141,23 @@ const X = a.forwardRef(
141
141
  children: "No results found."
142
142
  }
143
143
  ) }),
144
- d ? D.map((s, r) => /* @__PURE__ */ e.jsxs(U, { children: [
144
+ d ? D.map((s, n) => /* @__PURE__ */ e.jsxs(W, { children: [
145
145
  s.label && /* @__PURE__ */ e.jsx("div", { className: "px-2 py-1.5 text-xs font-medium text-muted-foreground", children: s.label }),
146
146
  s.options.map((t) => /* @__PURE__ */ e.jsxs(
147
147
  k,
148
148
  {
149
149
  value: t.value,
150
- onSelect: () => w(t.value),
151
- className: l(
150
+ onSelect: () => y(t.value),
151
+ className: a(
152
152
  "cursor-pointer",
153
- n === t.value && "bg-accent"
153
+ r === t.value && "bg-accent"
154
154
  ),
155
155
  children: [
156
156
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
157
157
  t.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: t.icon }),
158
158
  t.label
159
159
  ] }),
160
- n === t.value && /* @__PURE__ */ e.jsx(
160
+ r === t.value && /* @__PURE__ */ e.jsx(
161
161
  b,
162
162
  {
163
163
  name: "Check",
@@ -169,21 +169,21 @@ const X = a.forwardRef(
169
169
  },
170
170
  t.value
171
171
  ))
172
- ] }, r)) : q.map((s) => /* @__PURE__ */ e.jsxs(
172
+ ] }, n)) : q.map((s) => /* @__PURE__ */ e.jsxs(
173
173
  k,
174
174
  {
175
175
  value: s.value,
176
- onSelect: () => w(s.value),
177
- className: l(
176
+ onSelect: () => y(s.value),
177
+ className: a(
178
178
  "cursor-pointer",
179
- n === s.value && "bg-accent"
179
+ r === s.value && "bg-accent"
180
180
  ),
181
181
  children: [
182
182
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
183
183
  s.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: s.icon }),
184
184
  s.label
185
185
  ] }),
186
- n === s.value && /* @__PURE__ */ e.jsx(b, { name: "Check", size: "sm", className: "ml-auto" })
186
+ r === s.value && /* @__PURE__ */ e.jsx(b, { name: "Check", size: "sm", className: "ml-auto" })
187
187
  ]
188
188
  },
189
189
  s.value
@@ -191,7 +191,7 @@ const X = a.forwardRef(
191
191
  ] })
192
192
  ] }) })
193
193
  ] }),
194
- f && /* @__PURE__ */ e.jsx(x, { variant: "sm", className: "text-destructive mt-2", children: f })
194
+ u && /* @__PURE__ */ e.jsx(x, { variant: "sm", className: "text-destructive mt-2", children: u })
195
195
  ] });
196
196
  }
197
197
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/dashboard-design-system",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",