@yuno-payments/dashboard-design-system 0.0.170 → 0.0.172

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 (161) hide show
  1. package/dist/components/atoms/access-denied-alert/access-denied-alert.d.ts +16 -0
  2. package/dist/components/atoms/accordion/accordion.d.ts +66 -0
  3. package/dist/components/atoms/alert/alert.d.ts +26 -1
  4. package/dist/components/atoms/alert/alert.js +9 -8
  5. package/dist/components/atoms/avatar/avatar-group.d.ts +28 -0
  6. package/dist/components/atoms/avatar/avatar.d.ts +25 -0
  7. package/dist/components/atoms/avatar/avatar.js +9 -9
  8. package/dist/components/atoms/badge/badge.d.ts +30 -2
  9. package/dist/components/atoms/badge/badge.js +27 -11
  10. package/dist/components/atoms/button/button.d.ts +44 -0
  11. package/dist/components/atoms/card/card.d.ts +137 -3
  12. package/dist/components/atoms/card/card.js +56 -28
  13. package/dist/components/atoms/checkbox/checkbox.d.ts +38 -2
  14. package/dist/components/atoms/checkbox/checkbox.js +61 -27
  15. package/dist/components/atoms/combobox/combobox.d.ts +18 -0
  16. package/dist/components/atoms/combobox/combobox.js +41 -41
  17. package/dist/components/atoms/combobox/types.d.ts +90 -1
  18. package/dist/components/atoms/currency-field/currency-field.d.ts +38 -0
  19. package/dist/components/atoms/currency-field/currency-field.js +22 -19
  20. package/dist/components/atoms/date-picker/date-picker.d.ts +15 -0
  21. package/dist/components/atoms/date-range-picker/date-range-picker.d.ts +15 -0
  22. package/dist/components/atoms/dots-menu/dots-menu.d.ts +16 -0
  23. package/dist/components/atoms/dots-menu/dots-menu.js +8 -8
  24. package/dist/components/atoms/dots-menu/dots-menu.types.d.ts +52 -0
  25. package/dist/components/atoms/dropdown-menu/dropdown-menu.d.ts +50 -0
  26. package/dist/components/atoms/field/field.d.ts +55 -0
  27. package/dist/components/atoms/field/field.js +53 -46
  28. package/dist/components/atoms/filter/filter-date-range.d.ts +12 -2
  29. package/dist/components/atoms/filter/filter-date-range.js +203 -168
  30. package/dist/components/atoms/filter/filter.d.ts +6 -0
  31. package/dist/components/atoms/filter/filter.js +91 -76
  32. package/dist/components/atoms/filter/index.d.ts +1 -1
  33. package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +208 -2
  34. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +214 -160
  35. package/dist/components/atoms/icon/aida-logo.d.ts +3 -0
  36. package/dist/components/atoms/icon/aida-logo.js +64 -0
  37. package/dist/components/atoms/icon/icon-list.d.ts +5 -0
  38. package/dist/components/atoms/icon/icon-list.js +394 -384
  39. package/dist/components/atoms/icon/icon.d.ts +29 -0
  40. package/dist/components/atoms/index.d.ts +3 -2
  41. package/dist/components/atoms/label/index.d.ts +1 -1
  42. package/dist/components/atoms/label/label.d.ts +11 -0
  43. package/dist/components/atoms/label/label.js +28 -0
  44. package/dist/components/atoms/link/link.d.ts +20 -0
  45. package/dist/components/atoms/loading/index.d.ts +1 -0
  46. package/dist/components/atoms/loading/loading.d.ts +39 -0
  47. package/dist/components/atoms/loading/loading.js +37 -0
  48. package/dist/components/atoms/multi-select/multi-select.d.ts +1 -1
  49. package/dist/components/atoms/multi-select/multi-select.js +6 -6
  50. package/dist/components/atoms/multi-values-field/multi-values-field.d.ts +16 -0
  51. package/dist/components/atoms/multi-values-field/multi-values-field.js +109 -87
  52. package/dist/components/atoms/multi-values-field/multi-values-field.types.d.ts +81 -0
  53. package/dist/components/atoms/otp-field/otp-field.d.ts +32 -0
  54. package/dist/components/atoms/password-field/password-field.d.ts +23 -0
  55. package/dist/components/atoms/password-field/password-field.js +1 -1
  56. package/dist/components/atoms/progress/progress.d.ts +15 -0
  57. package/dist/components/atoms/protected-field/protected-field.d.ts +10 -0
  58. package/dist/components/atoms/protected-field/protected-field.types.d.ts +14 -0
  59. package/dist/components/atoms/radio-group/radio-group-option.js +11 -11
  60. package/dist/components/atoms/radio-group/radio-group.d.ts +50 -1
  61. package/dist/components/atoms/radio-group/radio-group.js +13 -12
  62. package/dist/components/atoms/search-field/search-field.d.ts +14 -0
  63. package/dist/components/atoms/search-field/search-field.js +17 -17
  64. package/dist/components/atoms/search-field/search-field.types.d.ts +57 -0
  65. package/dist/components/atoms/select/index.d.ts +2 -0
  66. package/dist/components/atoms/select/search-select.d.ts +22 -0
  67. package/dist/components/atoms/select/search-select.js +201 -0
  68. package/dist/components/atoms/select/select.d.ts +83 -1
  69. package/dist/components/atoms/select/select.js +21 -21
  70. package/dist/components/atoms/separator/separator.d.ts +17 -0
  71. package/dist/components/atoms/skeleton/index.d.ts +9 -0
  72. package/dist/components/atoms/switch/switch.d.ts +56 -2
  73. package/dist/components/atoms/switch/switch.js +64 -32
  74. package/dist/components/atoms/tabs/index.d.ts +16 -0
  75. package/dist/components/atoms/textarea/textarea.d.ts +32 -0
  76. package/dist/components/atoms/textarea/textarea.js +1 -1
  77. package/dist/components/atoms/time-picker/time-picker.d.ts +73 -2
  78. package/dist/components/atoms/time-picker/time-picker.js +218 -3
  79. package/dist/components/atoms/toaster/index.d.ts +15 -0
  80. package/dist/components/atoms/toggle-group/toggle-group.d.ts +26 -1
  81. package/dist/components/atoms/toggle-group/toggle-group.js +15 -14
  82. package/dist/components/atoms/tooltip/tooltip.d.ts +53 -2
  83. package/dist/components/atoms/typography/typography.d.ts +18 -0
  84. package/dist/components/molecules/breadcrumb/breadcrumb.d.ts +50 -0
  85. package/dist/components/molecules/breadcrumb/breadcrumb.js +17 -17
  86. package/dist/components/molecules/dialog-content/dialog-content.d.ts +16 -0
  87. package/dist/components/molecules/dialog-footer/dialog-footer.d.ts +20 -0
  88. package/dist/components/molecules/dialog-header/dialog-header.d.ts +31 -0
  89. package/dist/components/molecules/empty/empty-icon.js +6 -6
  90. package/dist/components/molecules/empty/empty.d.ts +16 -1
  91. package/dist/components/molecules/empty/empty.js +37 -34
  92. package/dist/components/molecules/highlight-banner/highlight-banner.d.ts +17 -0
  93. package/dist/components/molecules/pagination/pagination.d.ts +49 -0
  94. package/dist/components/organisms/data-table/components/cells/data-table-list-cell.d.ts +41 -0
  95. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-content.js +1 -1
  96. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +18 -18
  97. package/dist/components/organisms/data-table/components/column-header/data-table-column-header.d.ts +18 -0
  98. package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +10 -10
  99. package/dist/components/organisms/data-table/components/data-table-body.d.ts +18 -0
  100. package/dist/components/organisms/data-table/components/data-table-header.d.ts +12 -0
  101. package/dist/components/organisms/data-table/components/data-table-header.js +7 -7
  102. package/dist/components/organisms/data-table/components/states/data-table-loading.d.ts +24 -0
  103. package/dist/components/organisms/data-table/components/states/data-table-loading.js +6 -6
  104. package/dist/components/organisms/data-table/data-table.d.ts +133 -4
  105. package/dist/components/organisms/data-table/data-table.js +132 -100
  106. package/dist/components/organisms/data-table/data-table.types.d.ts +35 -26
  107. package/dist/components/organisms/data-table/hooks/use-data-table-columns.js +57 -41
  108. package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +8 -2
  109. package/dist/components/organisms/data-table/hooks/use-data-table-state.js +82 -47
  110. package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +8 -2
  111. package/dist/components/organisms/data-table/utils/data-table-constants.js +16 -10
  112. package/dist/components/organisms/data-table/utils/data-table-styles.d.ts +1652 -0
  113. package/dist/components/organisms/data-table/utils/data-table-styles.js +29 -14
  114. package/dist/components/organisms/dialog/dialog.d.ts +67 -1
  115. package/dist/components/organisms/dialog/dialog.js +78 -61
  116. package/dist/components/organisms/index.d.ts +2 -0
  117. package/dist/components/organisms/sheet/sheet.d.ts +69 -0
  118. package/dist/components/organisms/sheet/sheet.js +34 -33
  119. package/dist/components/organisms/tutorial/index.d.ts +2 -0
  120. package/dist/components/organisms/tutorial/tutorial.d.ts +16 -0
  121. package/dist/components/organisms/tutorial/tutorial.js +114 -0
  122. package/dist/components/organisms/tutorial/tutorial.types.d.ts +15 -0
  123. package/dist/hooks/index.d.ts +3 -0
  124. package/dist/hooks/use-body-scroll-lock.d.ts +13 -0
  125. package/dist/hooks/use-escape-key.d.ts +14 -0
  126. package/dist/hooks/use-media-query.d.ts +20 -0
  127. package/dist/hooks/use-media-query.js +21 -0
  128. package/dist/index.css +1 -1
  129. package/dist/index.d.ts +2 -0
  130. package/dist/index.js +173 -162
  131. package/dist/lib/notification-alert.d.ts +42 -0
  132. package/dist/lib/notification-alert.js +75 -0
  133. package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +8 -0
  134. package/dist/node_modules/@phosphor-icons/react/dist/csr/Microphone.es.js +8 -0
  135. package/dist/node_modules/@phosphor-icons/react/dist/csr/Stop.es.js +8 -0
  136. package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +8 -0
  137. package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +30 -0
  138. package/dist/node_modules/@phosphor-icons/react/dist/defs/Microphone.es.js +36 -0
  139. package/dist/node_modules/@phosphor-icons/react/dist/defs/Stop.es.js +36 -0
  140. package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +30 -0
  141. package/dist/vendor/shadcn/avatar.js +19 -19
  142. package/dist/vendor/shadcn/badge.js +15 -15
  143. package/dist/vendor/shadcn/card.js +7 -7
  144. package/dist/vendor/shadcn/date-picker.d.ts +2 -2
  145. package/dist/vendor/shadcn/date-picker.js +1 -1
  146. package/dist/vendor/shadcn/date-range-picker.d.ts +2 -2
  147. package/dist/vendor/shadcn/date-range-picker.js +1 -1
  148. package/dist/vendor/shadcn/dialog.js +2 -2
  149. package/dist/vendor/shadcn/input-group.js +17 -17
  150. package/dist/vendor/shadcn/input.js +7 -7
  151. package/dist/vendor/shadcn/popover.js +1 -1
  152. package/dist/vendor/shadcn/select.js +2 -2
  153. package/dist/vendor/shadcn/sonner.d.ts +26 -1
  154. package/dist/vendor/shadcn/sonner.js +12 -8
  155. package/dist/vendor/shadcn/table.js +30 -30
  156. package/dist/vendor/shadcn/textarea.js +9 -9
  157. package/dist/vendor/shadcn/time-picker.d.ts +1 -2
  158. package/dist/vendor/shadcn/time-picker.js +17 -23
  159. package/dist/vendor/shadcn/toggle.js +13 -13
  160. package/dist/vendor/shadcn/tooltip.js +25 -15
  161. package/package.json +1 -1
@@ -1,36 +1,64 @@
1
- import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as d } from "react";
3
- import { Card as n, CardHeader as i, CardTitle as m, CardDescription as c, CardContent as l, CardFooter as p } from "../../../vendor/shadcn/card.js";
4
- import { cn as o } from "../../../lib/utils.js";
5
- const N = d(
6
- ({ className: a, children: r, variant: e = "default", ...s }, C) => /* @__PURE__ */ t.jsx(n, { ref: C, className: o(a), variant: e, ...s, children: r })
1
+ import { j as d } from "../../../_virtual/jsx-runtime.js";
2
+ import { forwardRef as t } from "react";
3
+ import { CardHeader as D, CardTitle as F, CardDescription as T, CardContent as B, CardFooter as R, Card as w } from "../../../vendor/shadcn/card.js";
4
+ import { cn as n } from "../../../lib/utils.js";
5
+ const C = t(
6
+ ({ className: s, children: a, variant: r = "default", ...e }, o) => /* @__PURE__ */ d.jsx(w, { ref: o, className: n(s), variant: r, ...e, children: a })
7
7
  );
8
- N.displayName = "Card";
9
- const x = d(
10
- ({ className: a, children: r, ...e }, s) => /* @__PURE__ */ t.jsx(i, { ref: s, className: o(a), ...e, children: r })
8
+ C.displayName = "CardBase";
9
+ const c = t(
10
+ ({ className: s, children: a, ...r }, e) => /* @__PURE__ */ d.jsx(D, { ref: e, className: n(s), ...r, children: a })
11
11
  );
12
- x.displayName = "CardHeader";
13
- const j = d(
14
- ({ className: a, children: r, ...e }, s) => /* @__PURE__ */ t.jsx(m, { ref: s, className: o(a), ...e, children: r })
12
+ c.displayName = "CardHeader";
13
+ const l = t(
14
+ ({ className: s, children: a, ...r }, e) => /* @__PURE__ */ d.jsx(F, { ref: e, className: n(s), ...r, children: a })
15
15
  );
16
- j.displayName = "CardTitle";
17
- const u = d(
18
- ({ className: a, children: r, ...e }, s) => /* @__PURE__ */ t.jsx(c, { ref: s, className: o(a), ...e, children: r })
16
+ l.displayName = "CardTitle";
17
+ const m = t(
18
+ ({ className: s, children: a, ...r }, e) => /* @__PURE__ */ d.jsx(T, { ref: e, className: n(s), ...r, children: a })
19
19
  );
20
- u.displayName = "CardDescription";
21
- const f = d(
22
- ({ className: a, children: r, ...e }, s) => /* @__PURE__ */ t.jsx(l, { ref: s, className: o(a), ...e, children: r })
20
+ m.displayName = "CardDescription";
21
+ const i = t(
22
+ ({ className: s, children: a, ...r }, e) => /* @__PURE__ */ d.jsx(B, { ref: e, className: n(s), ...r, children: a })
23
23
  );
24
- f.displayName = "CardContent";
25
- const y = d(
26
- ({ className: a, children: r, ...e }, s) => /* @__PURE__ */ t.jsx(p, { ref: s, className: o(a), ...e, children: r })
24
+ i.displayName = "CardContent";
25
+ const N = t(
26
+ ({ className: s, children: a, ...r }, e) => /* @__PURE__ */ d.jsx(R, { ref: e, className: n(s), ...r, children: a })
27
27
  );
28
- y.displayName = "CardFooter";
28
+ N.displayName = "CardFooter";
29
+ const E = t(
30
+ ({
31
+ className: s,
32
+ title: a,
33
+ description: r,
34
+ children: e,
35
+ footer: o,
36
+ variant: p = "default",
37
+ headerClassName: x,
38
+ titleClassName: j,
39
+ descriptionClassName: u,
40
+ contentClassName: f,
41
+ footerClassName: y,
42
+ ...h
43
+ }, $) => {
44
+ const H = a || r;
45
+ return /* @__PURE__ */ d.jsxs(C, { ref: $, className: s, variant: p, ...h, children: [
46
+ H && /* @__PURE__ */ d.jsxs(c, { className: x, children: [
47
+ a && /* @__PURE__ */ d.jsx(l, { className: j, children: a }),
48
+ r && /* @__PURE__ */ d.jsx(m, { className: u, children: r })
49
+ ] }),
50
+ /* @__PURE__ */ d.jsx(i, { className: f, children: e }),
51
+ o && /* @__PURE__ */ d.jsx(N, { className: y, children: o })
52
+ ] });
53
+ }
54
+ );
55
+ E.displayName = "Card";
29
56
  export {
30
- N as Card,
31
- f as CardContent,
32
- u as CardDescription,
33
- y as CardFooter,
34
- x as CardHeader,
35
- j as CardTitle
57
+ E as Card,
58
+ C as CardBase,
59
+ i as CardContent,
60
+ m as CardDescription,
61
+ N as CardFooter,
62
+ c as CardHeader,
63
+ l as CardTitle
36
64
  };
@@ -1,8 +1,44 @@
1
- import { ComponentProps } from 'react';
1
+ import { ComponentProps, ChangeEvent } from 'react';
2
2
  import { Checkbox as ShadcnCheckbox } from '../../../vendor/shadcn/checkbox';
3
- export interface CheckboxProps extends Omit<ComponentProps<typeof ShadcnCheckbox>, "children"> {
3
+ /**
4
+ * Props for the Checkbox component
5
+ */
6
+ export interface CheckboxProps extends Omit<ComponentProps<typeof ShadcnCheckbox>, "children" | "onCheckedChange" | "onChange"> {
7
+ /**
8
+ * Label text displayed next to the checkbox
9
+ */
4
10
  label?: string;
11
+ /**
12
+ * Optional description text displayed below the label
13
+ */
5
14
  description?: string;
15
+ /**
16
+ * Callback fired when the checkbox state changes
17
+ * Provides a synthetic ChangeEvent compatible with react-hook-form
18
+ */
19
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
20
+ /**
21
+ * Additional CSS classes to apply to the label element
22
+ */
23
+ labelClassName?: string;
24
+ /**
25
+ * Optional info icon with tooltip
26
+ */
27
+ info?: string;
6
28
  }
29
+ /**
30
+ * Checkbox component with optional label and description.
31
+ * Compatible with react-hook-form through synthetic ChangeEvent.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <Checkbox
36
+ * label="Accept terms and conditions"
37
+ * description="You must agree to continue"
38
+ * checked={accepted}
39
+ * onChange={(e) => setAccepted(e.target.checked)}
40
+ * />
41
+ * ```
42
+ */
7
43
  declare const Checkbox: import('react').ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
8
44
  export { Checkbox };
@@ -1,49 +1,83 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as p, useId as f } from "react";
3
- import { Checkbox as d } from "../../../vendor/shadcn/checkbox.js";
4
- import { cn as m } from "../../../lib/utils.js";
5
- import { Label as h } from "../../../vendor/shadcn/label.js";
6
- const u = p(
7
- ({ label: o, description: t, id: x, name: a, disabled: r, ...n }, i) => {
8
- const l = f(), s = x || a || l, c = /* @__PURE__ */ e.jsx(
9
- d,
2
+ import { forwardRef as g, useId as C } from "react";
3
+ import { Checkbox as j } from "../../../vendor/shadcn/checkbox.js";
4
+ import { cn as x } from "../../../lib/utils.js";
5
+ import { Label as k } from "../label/label.js";
6
+ const v = g(
7
+ ({
8
+ label: n,
9
+ description: c,
10
+ id: i,
11
+ name: t,
12
+ disabled: s,
13
+ onChange: a,
14
+ labelClassName: f,
15
+ info: l,
16
+ ...p
17
+ }, h) => {
18
+ const u = C(), o = i || t || u, d = (r) => {
19
+ if (!a) return;
20
+ a({
21
+ target: {
22
+ name: t || o,
23
+ checked: r,
24
+ type: "checkbox",
25
+ value: r ? "on" : "off"
26
+ },
27
+ currentTarget: {
28
+ name: t || o,
29
+ checked: r,
30
+ type: "checkbox",
31
+ value: r ? "on" : "off"
32
+ },
33
+ preventDefault: () => {
34
+ },
35
+ stopPropagation: () => {
36
+ }
37
+ });
38
+ }, m = /* @__PURE__ */ e.jsx(
39
+ j,
10
40
  {
11
- ref: i,
12
- id: s,
13
- disabled: r,
14
- ...n,
41
+ ref: h,
42
+ id: o,
43
+ name: t,
44
+ disabled: s,
45
+ onCheckedChange: d,
46
+ ...p,
15
47
  className: "size-3.5 cursor-pointer"
16
48
  }
17
49
  );
18
- return o ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
19
- c,
50
+ return n ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
51
+ m,
20
52
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
21
53
  /* @__PURE__ */ e.jsx(
22
- h,
54
+ k,
23
55
  {
24
- htmlFor: s,
25
- className: m(
56
+ htmlFor: o,
57
+ info: l,
58
+ className: x(
26
59
  "text-sm leading-none cursor-pointer",
27
- r && "text-muted-foreground"
60
+ s && "text-muted-foreground",
61
+ f
28
62
  ),
29
- children: o
63
+ children: n
30
64
  }
31
65
  ),
32
- t && /* @__PURE__ */ e.jsx(
66
+ c && /* @__PURE__ */ e.jsx(
33
67
  "p",
34
68
  {
35
- className: m(
36
- "text-sm text-neutral-500",
37
- r && "opacity-50"
69
+ className: x(
70
+ "text-sm text-muted-foreground",
71
+ s && "opacity-50"
38
72
  ),
39
- children: t
73
+ children: c
40
74
  }
41
75
  )
42
76
  ] })
43
- ] }) : c;
77
+ ] }) : m;
44
78
  }
45
79
  );
46
- u.displayName = "Checkbox";
80
+ v.displayName = "Checkbox";
47
81
  export {
48
- u as Checkbox
82
+ v as Checkbox
49
83
  };
@@ -1,3 +1,21 @@
1
1
  import { ComboboxProps } from './types';
2
+ /**
3
+ * Multi-select combobox component with search and chips display.
4
+ * Features include searchable options, chip badges for selected items, and "delete all" functionality.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <Combobox
9
+ * label="Select Users"
10
+ * value={selectedIds}
11
+ * options={[
12
+ * { value: '1', label: 'John Doe' },
13
+ * { value: '2', label: 'Jane Smith' }
14
+ * ]}
15
+ * onChange={(newValues) => setSelectedIds(newValues)}
16
+ * onCloseChip={(id) => handleRemove(id)}
17
+ * />
18
+ * ```
19
+ */
2
20
  declare const ComboboxComponent: import('react').ForwardRefExoticComponent<ComboboxProps & import('react').RefAttributes<HTMLButtonElement>>;
3
21
  export { ComboboxComponent as Combobox };
@@ -1,11 +1,11 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
2
  import { forwardRef as Y, useState as y, useRef as Z, useEffect as I } from "react";
3
- import { cn as m } from "../../../lib/utils.js";
4
- import { Combobox as _, ComboboxTrigger as A, ComboboxContent as W } from "../../../vendor/shadcn/combobox.js";
5
- import { Label as P } from "../../../vendor/shadcn/label.js";
3
+ import { cn as f } from "../../../lib/utils.js";
4
+ import { Combobox as _, ComboboxTrigger as W, ComboboxContent as A } from "../../../vendor/shadcn/combobox.js";
5
+ import { Icon as $ } from "../icon/icon.js";
6
+ import { Label as P } from "../label/label.js";
6
7
  import { Typography as C } from "../typography/typography.js";
7
8
  import { Badge as N } from "../badge/badge.js";
8
- import { Icon as $ } from "../icon/icon.js";
9
9
  import { Checkbox as ee } from "../checkbox/checkbox.js";
10
10
  const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ t.jsx(C, { variant: "sm", className: "text-muted-foreground", children: n }) }), se = Y(
11
11
  ({
@@ -14,29 +14,29 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
14
14
  selectPlaceholder: z = "Select options...",
15
15
  searchPlaceholder: k = "Search...",
16
16
  onChange: w,
17
- onCloseChip: f,
17
+ onCloseChip: x,
18
18
  valueProp: r = "value",
19
19
  fullWidth: v = !1,
20
20
  disabled: o = !1,
21
- withSearch: x = !0,
21
+ withSearch: d = !0,
22
22
  limitTags: D = 10,
23
23
  maxHeightList: p = 320,
24
24
  emptyState: B = /* @__PURE__ */ t.jsx(te, {}),
25
25
  label: O,
26
26
  description: E,
27
- error: d,
28
- deleteAll: u,
27
+ error: u,
28
+ deleteAll: l,
29
29
  className: K,
30
- id: l
30
+ id: i
31
31
  }, G) => {
32
32
  const [c, R] = y(!1), [L, M] = y(""), [S, g] = y(a), h = Z(null);
33
33
  I(() => {
34
34
  g(a);
35
35
  }, [a]), I(() => {
36
- c && h.current && x && setTimeout(() => {
36
+ c && h.current && d && setTimeout(() => {
37
37
  h.current?.focus();
38
38
  }, 0);
39
- }, [c, x]);
39
+ }, [c, d]);
40
40
  const b = (e) => {
41
41
  const s = e.label || e[r];
42
42
  return String(s);
@@ -45,40 +45,40 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
45
45
  if (M(s), s === "")
46
46
  g(a);
47
47
  else {
48
- const i = a.filter(
48
+ const m = a.filter(
49
49
  (Q) => b(Q).toLowerCase().includes(s.toLowerCase())
50
50
  );
51
- g(i);
51
+ g(m);
52
52
  }
53
53
  }, j = (e) => {
54
54
  if (o) return;
55
- const s = n.includes(e) ? n.filter((i) => i !== e) : [...n, e];
55
+ const s = n.includes(e) ? n.filter((m) => m !== e) : [...n, e];
56
56
  w(s);
57
57
  }, V = (e) => {
58
58
  if (!o)
59
- if (f)
60
- f(e);
59
+ if (x)
60
+ x(e);
61
61
  else {
62
- const s = n.filter((i) => i !== e);
62
+ const s = n.filter((m) => m !== e);
63
63
  w(s);
64
64
  }
65
65
  }, X = () => {
66
- o || !u?.onClick || u.onClick();
67
- }, q = (e, s) => e?.length <= s ? e : e?.substring(0, s) + "...", T = n.map((e) => a.find((s) => s[r] === e)).filter(Boolean), H = u && !o && n.length >= u.length, J = T.slice(0, D), F = T.length - D;
68
- return /* @__PURE__ */ t.jsxs("div", { className: m("w-full", v && "w-full", K), children: [
66
+ o || !l?.onClick || l.onClick();
67
+ }, q = (e, s) => e?.length <= s ? e : e?.substring(0, s) + "...", T = n.map((e) => a.find((s) => s[r] === e)).filter(Boolean), H = l && !o && n.length >= l.length, J = T.slice(0, D), F = T.length - D;
68
+ return /* @__PURE__ */ t.jsxs("div", { className: f("w-full", v && "w-full", K), children: [
69
69
  O && /* @__PURE__ */ t.jsx(
70
70
  P,
71
71
  {
72
- htmlFor: l,
73
- className: m("mb-2 block", o && "opacity-50"),
72
+ htmlFor: i,
73
+ className: f("mb-2 block", o && "opacity-50"),
74
74
  children: O
75
75
  }
76
76
  ),
77
- E && !d && /* @__PURE__ */ t.jsx(
77
+ E && !u && /* @__PURE__ */ t.jsx(
78
78
  C,
79
79
  {
80
80
  variant: "sm",
81
- className: m(
81
+ className: f(
82
82
  "text-muted-foreground mb-2",
83
83
  o && "opacity-50"
84
84
  ),
@@ -86,20 +86,20 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
86
86
  }
87
87
  ),
88
88
  /* @__PURE__ */ t.jsxs(_, { open: c, onOpenChange: R, children: [
89
- /* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
89
+ /* @__PURE__ */ t.jsx(W, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
90
90
  "button",
91
91
  {
92
92
  ref: G,
93
- id: l,
93
+ id: i,
94
94
  type: "button",
95
95
  disabled: o,
96
96
  role: "combobox",
97
97
  "aria-expanded": c,
98
98
  "aria-haspopup": "listbox",
99
- "aria-controls": c ? `${l}-listbox` : void 0,
100
- className: m(
99
+ "aria-controls": c ? `${i}-listbox` : void 0,
100
+ className: f(
101
101
  "flex h-auto min-h-[36px] 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",
102
- d && "border-destructive",
102
+ u && "border-destructive",
103
103
  v && "w-full"
104
104
  ),
105
105
  children: [
@@ -114,8 +114,8 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
114
114
  N,
115
115
  {
116
116
  variant: "secondary",
117
- className: "gap-1 pr-1 cursor-pointer flex items-center",
118
- children: "Delete all"
117
+ className: "gap-1 cursor-pointer flex items-center",
118
+ children: l.label || "Delete all"
119
119
  }
120
120
  )
121
121
  }
@@ -124,14 +124,14 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
124
124
  "div",
125
125
  {
126
126
  onClick: (s) => {
127
- f && !o && (s.preventDefault(), s.stopPropagation(), V(e[r]));
127
+ x && !o && (s.preventDefault(), s.stopPropagation(), V(e[r]));
128
128
  },
129
129
  children: /* @__PURE__ */ t.jsx(
130
130
  N,
131
131
  {
132
132
  variant: "outline",
133
- className: "gap-1 pr-1 flex items-center",
134
- endIcon: f && !o ? "X" : void 0,
133
+ className: "gap-1 flex items-center",
134
+ endIcon: x && !o ? "X" : void 0,
135
135
  children: q(b(e), 8)
136
136
  }
137
137
  )
@@ -145,7 +145,7 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
145
145
  {
146
146
  name: "CaretUpDown",
147
147
  size: "sm",
148
- className: m(
148
+ className: f(
149
149
  "opacity-50 transition-transform",
150
150
  c && "transform rotate-180"
151
151
  )
@@ -155,15 +155,15 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
155
155
  }
156
156
  ) }),
157
157
  /* @__PURE__ */ t.jsx(
158
- W,
158
+ A,
159
159
  {
160
160
  className: "p-0",
161
161
  align: "start",
162
162
  style: { maxHeight: p },
163
- id: l ? `${l}-listbox` : void 0,
163
+ id: i ? `${i}-listbox` : void 0,
164
164
  role: "listbox",
165
165
  children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
166
- x && a.length > 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b", children: [
166
+ d && a.length > 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b", children: [
167
167
  /* @__PURE__ */ t.jsx(
168
168
  $,
169
169
  {
@@ -193,7 +193,7 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
193
193
  {
194
194
  className: "overflow-y-auto",
195
195
  style: {
196
- maxHeight: x ? p - 48 : p
196
+ maxHeight: d ? p - 48 : p
197
197
  },
198
198
  children: S.length > 0 ? S.map((e) => /* @__PURE__ */ t.jsxs(
199
199
  "div",
@@ -210,7 +210,7 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
210
210
  ee,
211
211
  {
212
212
  checked: n.includes(e[r]),
213
- onCheckedChange: () => j(e[r]),
213
+ onChange: () => j(e[r]),
214
214
  onClick: (s) => s.stopPropagation()
215
215
  }
216
216
  ),
@@ -225,7 +225,7 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
225
225
  }
226
226
  )
227
227
  ] }),
228
- d && /* @__PURE__ */ t.jsx(C, { variant: "sm", className: "text-destructive mt-2", children: d })
228
+ u && /* @__PURE__ */ t.jsx(C, { variant: "sm", className: "text-destructive mt-2", children: u })
229
229
  ] });
230
230
  }
231
231
  );
@@ -1,31 +1,120 @@
1
1
  import { ReactNode } from 'react';
2
+ /**
3
+ * Represents a single option in the combobox
4
+ */
2
5
  export interface ComboboxOption {
6
+ /**
7
+ * Unique value for the option
8
+ */
3
9
  value: string | number;
10
+ /**
11
+ * Display label for the option
12
+ */
4
13
  label: string;
14
+ /**
15
+ * Additional properties can be added
16
+ */
5
17
  [key: string]: string | number;
6
18
  }
19
+ /**
20
+ * Props for the Combobox component
21
+ */
7
22
  export interface ComboboxProps {
23
+ /**
24
+ * Array of selected option values
25
+ */
8
26
  value: Array<string | number>;
27
+ /**
28
+ * Array of available options
29
+ */
9
30
  options: ComboboxOption[];
31
+ /**
32
+ * Placeholder text when no options are selected
33
+ * @default "Select options..."
34
+ */
10
35
  selectPlaceholder?: string;
36
+ /**
37
+ * Placeholder text for the search input
38
+ * @default "Search..."
39
+ */
11
40
  searchPlaceholder?: string;
41
+ /**
42
+ * Callback fired when selection changes
43
+ */
12
44
  onChange: (values: Array<string | number>) => void;
45
+ /**
46
+ * Callback fired when a chip/tag is removed
47
+ */
13
48
  onCloseChip?: (value: string | number) => void;
49
+ /**
50
+ * Property name to use as the value identifier
51
+ * @default "value"
52
+ */
14
53
  valueProp?: string;
54
+ /**
55
+ * Whether the combobox should take full width
56
+ * @default false
57
+ */
15
58
  fullWidth?: boolean;
59
+ /**
60
+ * Whether the combobox is disabled
61
+ * @default false
62
+ */
16
63
  disabled?: boolean;
64
+ /**
65
+ * Whether to show the search input
66
+ * @default true
67
+ */
17
68
  withSearch?: boolean;
69
+ /**
70
+ * Maximum number of chips to display before showing "+N"
71
+ * @default 10
72
+ */
18
73
  limitTags?: number;
74
+ /**
75
+ * Maximum height of the options list in pixels
76
+ * @default 320
77
+ */
19
78
  maxHeightList?: number;
79
+ /**
80
+ * Custom empty state component when no options match search
81
+ */
20
82
  emptyState?: ReactNode;
83
+ /**
84
+ * Label text displayed above the combobox
85
+ */
21
86
  label?: string;
87
+ /**
88
+ * Helper text displayed below the combobox
89
+ */
22
90
  description?: string;
91
+ /**
92
+ * Error message displayed below the combobox
93
+ */
23
94
  error?: string;
95
+ /**
96
+ * Configuration for "Delete All" chip functionality
97
+ */
24
98
  deleteAll?: {
25
- label: string;
99
+ /**
100
+ * Label for the delete all chip
101
+ */
102
+ label?: string;
103
+ /**
104
+ * Minimum number of selected items to show delete all
105
+ */
26
106
  length: number;
107
+ /**
108
+ * Callback fired when delete all is clicked
109
+ */
27
110
  onClick: () => void;
28
111
  };
112
+ /**
113
+ * Additional CSS classes
114
+ */
29
115
  className?: string;
116
+ /**
117
+ * HTML id attribute
118
+ */
30
119
  id?: string;
31
120
  }
@@ -3,12 +3,50 @@ declare const currencyFieldVariants: (props?: ({
3
3
  size?: "base" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
4
4
  fontWeight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ /**
7
+ * Props for the CurrencyField component
8
+ */
6
9
  export interface CurrencyFieldProps extends VariantProps<typeof currencyFieldVariants> {
10
+ /**
11
+ * Numeric value to format as currency
12
+ */
7
13
  value: number;
14
+ /**
15
+ * ISO 4217 currency code
16
+ * @default "USD"
17
+ */
8
18
  currency?: string;
19
+ /**
20
+ * Locale(s) for number formatting
21
+ * @default "en"
22
+ */
9
23
  locales?: string | string[];
24
+ /**
25
+ * Additional CSS classes for the container
26
+ */
10
27
  className?: string;
28
+ /**
29
+ * Whether to display the currency code
30
+ * @default true
31
+ */
11
32
  showCurrencyCode?: boolean;
33
+ /**
34
+ * Additional CSS classes for the value
35
+ */
36
+ valueClassName?: string;
37
+ /**
38
+ * Additional CSS classes for the currency code
39
+ */
40
+ codeClassName?: string;
12
41
  }
42
+ /**
43
+ * Displays formatted currency values with optional currency code.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <CurrencyField value={1234.56} currency="USD" size="lg" />
48
+ * <CurrencyField value={999} currency="EUR" showCurrencyCode={false} />
49
+ * ```
50
+ */
13
51
  declare const CurrencyField: import('react').ForwardRefExoticComponent<CurrencyFieldProps & import('react').RefAttributes<HTMLDivElement>>;
14
52
  export { CurrencyField };