@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,21 +1,21 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as m, useState as M, useMemo as $ } from "react";
3
- import { Button as f } from "../../../vendor/shadcn/button.js";
2
+ import { forwardRef as f, useState as A, useMemo as M } from "react";
3
+ import { Button as j } from "../../../vendor/shadcn/button.js";
4
4
  import { Badge as C } from "../../../vendor/shadcn/badge.js";
5
5
  import { Separator as p } from "../../../vendor/shadcn/separator.js";
6
- import { Checkbox as L } from "../../../vendor/shadcn/checkbox.js";
7
- import { RadioGroup as Q, RadioGroupItem as E } from "../../../vendor/shadcn/radio-group.js";
8
- import { cn as x } from "../../../lib/utils.js";
9
- import { Icon as v } from "../icon/icon.js";
6
+ import { Checkbox as E } from "../../../vendor/shadcn/checkbox.js";
7
+ import { RadioGroup as Q, RadioGroupItem as L } from "../../../vendor/shadcn/radio-group.js";
8
+ import { Icon as y } from "../icon/icon.js";
9
+ import { cn as g } from "../../../lib/utils.js";
10
10
  import { Field as k } from "../field/field.js";
11
- import { Tooltip as b } from "../tooltip/tooltip.js";
12
- const F = m(
11
+ import { Tooltip as v } from "../tooltip/tooltip.js";
12
+ const F = f(
13
13
  ({ label: s, onRemove: t, className: n, ...l }, i) => /* @__PURE__ */ e.jsxs(
14
14
  C,
15
15
  {
16
16
  ref: i,
17
17
  variant: "secondary",
18
- className: x("h-8 gap-2 px-3 py-2 shadow-xs", n),
18
+ className: g("h-8 gap-2 px-3 py-2 shadow-xs", n),
19
19
  ...l,
20
20
  children: [
21
21
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: s }),
@@ -25,7 +25,7 @@ const F = m(
25
25
  onClick: t,
26
26
  className: "inline-flex items-center justify-center",
27
27
  "aria-label": `Remove ${s} filter`,
28
- children: /* @__PURE__ */ e.jsx(v, { name: "X", className: "size-4" })
28
+ children: /* @__PURE__ */ e.jsx(y, { name: "X", className: "size-4" })
29
29
  }
30
30
  )
31
31
  ]
@@ -33,27 +33,27 @@ const F = m(
33
33
  )
34
34
  );
35
35
  F.displayName = "FilterTag";
36
- const P = m(
36
+ const P = f(
37
37
  ({
38
38
  appliedFilters: s = [],
39
39
  onRemoveFilter: t,
40
40
  onClearAll: n,
41
41
  maxVisibleTags: l = 4,
42
42
  className: i,
43
- ...r
44
- }, h) => {
45
- const o = s.length > 0, N = s.slice(0, l), g = s.length - l;
43
+ ...c
44
+ }, r) => {
45
+ const o = s.length > 0, x = s.slice(0, l), u = s.length - l;
46
46
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
47
47
  /* @__PURE__ */ e.jsxs(
48
- f,
48
+ j,
49
49
  {
50
- ref: h,
50
+ ref: r,
51
51
  variant: "outline",
52
52
  size: "sm",
53
- className: x("h-8 gap-2 px-3 py-2", i),
54
- ...r,
53
+ className: g("h-8 gap-2 px-3 py-2", i),
54
+ ...c,
55
55
  children: [
56
- /* @__PURE__ */ e.jsx(v, { name: "FunnelSimple", className: "size-4" }),
56
+ /* @__PURE__ */ e.jsx(y, { name: "FunnelSimple", className: "size-4" }),
57
57
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium leading-none", children: "Add filter" })
58
58
  ]
59
59
  }
@@ -61,21 +61,21 @@ const P = m(
61
61
  o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
62
62
  /* @__PURE__ */ e.jsx(p, { orientation: "vertical", className: "h-5" }),
63
63
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
64
- N.map((u) => /* @__PURE__ */ e.jsx(
64
+ x.map((m) => /* @__PURE__ */ e.jsx(
65
65
  F,
66
66
  {
67
- label: u.label,
68
- onRemove: () => t?.(u.id)
67
+ label: m.label,
68
+ onRemove: () => t?.(m.id)
69
69
  },
70
- u.id
70
+ m.id
71
71
  )),
72
- g > 0 && /* @__PURE__ */ e.jsx(C, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-medium leading-none", children: [
72
+ u > 0 && /* @__PURE__ */ e.jsx(C, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-medium leading-none", children: [
73
73
  "+",
74
- g,
74
+ u,
75
75
  " more"
76
76
  ] }) }),
77
77
  n && /* @__PURE__ */ e.jsx(
78
- f,
78
+ j,
79
79
  {
80
80
  variant: "ghost",
81
81
  size: "sm",
@@ -94,44 +94,44 @@ const P = m(
94
94
  }
95
95
  );
96
96
  P.displayName = "FilterButton";
97
- const X = m(
97
+ const X = f(
98
98
  (s, t) => {
99
99
  const {
100
100
  title: n,
101
101
  items: l,
102
102
  className: i,
103
- searchable: r = !1,
104
- searchPlaceholder: h = "Search...",
103
+ searchable: c = !1,
104
+ searchPlaceholder: r = "Search...",
105
105
  showActions: o = !1,
106
- enableSelectAll: N = !0,
107
- enableInverse: g = !0,
108
- enableNone: u = !0
109
- } = s, c = s.type || "checkbox", w = c === "radio", z = c === "checkbox" || !s.type, [j, I] = M(""), y = $(() => j ? l.filter(
110
- (a) => a.label.toLowerCase().includes(j.toLowerCase())
111
- ) : l, [l, j]), R = () => {
112
- if (c === "checkbox" && "selectedValues" in s) {
113
- const a = l.map((d) => d.value);
106
+ enableSelectAll: x = !0,
107
+ enableInverse: u = !0,
108
+ enableNone: m = !0
109
+ } = s, d = s.type || "checkbox", w = d === "radio", z = d === "checkbox" || !s.type, [N, I] = A(""), b = M(() => N ? l.filter(
110
+ (a) => a.label.toLowerCase().includes(N.toLowerCase())
111
+ ) : l, [l, N]), R = () => {
112
+ if (d === "checkbox" && "selectedValues" in s) {
113
+ const a = l.map((h) => h.value);
114
114
  s.onChange(a);
115
115
  }
116
116
  }, T = () => {
117
- if (c === "checkbox" && "selectedValues" in s) {
118
- const a = l.filter((d) => !s.selectedValues.includes(d.value)).map((d) => d.value);
117
+ if (d === "checkbox" && "selectedValues" in s) {
118
+ const a = l.filter((h) => !s.selectedValues.includes(h.value)).map((h) => h.value);
119
119
  s.onChange(a);
120
120
  }
121
121
  }, B = () => {
122
- c === "checkbox" && "selectedValues" in s ? s.onChange([]) : c === "radio" && "selectedValue" in s && s.onChange("");
122
+ d === "checkbox" && "selectedValues" in s ? s.onChange([]) : d === "radio" && "selectedValue" in s && s.onChange("");
123
123
  }, G = (a) => {
124
- if (c === "checkbox" && "selectedValues" in s) {
125
- const O = s.selectedValues.includes(a) ? s.selectedValues.filter((A) => A !== a) : [...s.selectedValues, a];
124
+ if (d === "checkbox" && "selectedValues" in s) {
125
+ const O = s.selectedValues.includes(a) ? s.selectedValues.filter(($) => $ !== a) : [...s.selectedValues, a];
126
126
  s.onChange(O);
127
127
  }
128
128
  };
129
- return /* @__PURE__ */ e.jsxs("div", { ref: t, className: x("flex flex-col h-full", i), children: [
130
- r && /* @__PURE__ */ e.jsx(
129
+ return /* @__PURE__ */ e.jsxs("div", { ref: t, className: g("flex flex-col h-full", i), children: [
130
+ c && /* @__PURE__ */ e.jsx(
131
131
  k,
132
132
  {
133
- placeholder: h,
134
- value: j,
133
+ placeholder: r,
134
+ value: N,
135
135
  onChange: (a) => I(a.target.value),
136
136
  startIcon: "MagnifyingGlass",
137
137
  className: "mb-4"
@@ -139,9 +139,9 @@ const X = m(
139
139
  ),
140
140
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between mb-1", children: [
141
141
  /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal text-foreground", children: n }),
142
- o && c === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
143
- N && /* @__PURE__ */ e.jsx(
144
- f,
142
+ o && d === "checkbox" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
143
+ x && /* @__PURE__ */ e.jsx(
144
+ j,
145
145
  {
146
146
  variant: "link",
147
147
  size: "sm",
@@ -150,8 +150,8 @@ const X = m(
150
150
  children: "Select all"
151
151
  }
152
152
  ),
153
- g && /* @__PURE__ */ e.jsx(
154
- f,
153
+ u && /* @__PURE__ */ e.jsx(
154
+ j,
155
155
  {
156
156
  variant: "link",
157
157
  size: "sm",
@@ -160,8 +160,8 @@ const X = m(
160
160
  children: "Inverse"
161
161
  }
162
162
  ),
163
- u && /* @__PURE__ */ e.jsx(
164
- f,
163
+ m && /* @__PURE__ */ e.jsx(
164
+ j,
165
165
  {
166
166
  variant: "link",
167
167
  size: "sm",
@@ -178,8 +178,8 @@ const X = m(
178
178
  {
179
179
  value: s.selectedValue,
180
180
  onValueChange: s.onChange,
181
- className: "grid grid-cols-2 gap-4 overflow-y-auto",
182
- children: y.map((a) => /* @__PURE__ */ e.jsx(
181
+ className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto",
182
+ children: b.map((a) => /* @__PURE__ */ e.jsx(
183
183
  S,
184
184
  {
185
185
  label: a.label,
@@ -189,11 +189,12 @@ const X = m(
189
189
  a.value
190
190
  ))
191
191
  }
192
- ) : z && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-4 overflow-y-auto", children: y.map((a) => /* @__PURE__ */ e.jsx(
192
+ ) : z && "selectedValues" in s ? /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-5 overflow-y-auto", children: b.map((a) => /* @__PURE__ */ e.jsx(
193
193
  V,
194
194
  {
195
195
  label: a.label,
196
196
  description: a.description,
197
+ icon: a.icon,
197
198
  checked: s.selectedValues.includes(a.value),
198
199
  onCheckedChange: () => G(a.value)
199
200
  },
@@ -203,51 +204,65 @@ const X = m(
203
204
  }
204
205
  );
205
206
  X.displayName = "FilterSection";
206
- const V = m(({ label: s, checked: t, onCheckedChange: n, description: l, className: i }, r) => /* @__PURE__ */ e.jsxs("label", { className: x("flex items-start gap-2 cursor-pointer", i), children: [
207
- /* @__PURE__ */ e.jsx(L, { ref: r, checked: t, onCheckedChange: n }),
208
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
209
- /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none", children: s }),
210
- l && /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground", children: l })
211
- ] })
212
- ] }));
207
+ const V = f(({ label: s, checked: t, onCheckedChange: n, description: l, className: i, maxLabelLength: c = 14, icon: r }, o) => {
208
+ const x = s.length > c, u = x ? `${s.slice(0, c)}...` : s;
209
+ return /* @__PURE__ */ e.jsxs("label", { className: g("flex items-start gap-2 cursor-pointer", i), children: [
210
+ /* @__PURE__ */ e.jsx(E, { ref: o, checked: t, onCheckedChange: n }),
211
+ r && /* @__PURE__ */ e.jsx(
212
+ "img",
213
+ {
214
+ src: r,
215
+ alt: "",
216
+ className: "size-4 object-contain shrink-0",
217
+ onError: (m) => {
218
+ m.currentTarget.style.display = "none";
219
+ }
220
+ }
221
+ ),
222
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 min-w-0 flex-1", children: [
223
+ /* @__PURE__ */ e.jsx(v, { content: x ? s : "", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-4 truncate", children: u }) }),
224
+ l && /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground truncate", children: l })
225
+ ] })
226
+ ] });
227
+ });
213
228
  V.displayName = "FilterCheckboxOption";
214
- const S = m(
215
- ({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className: x("flex items-start gap-3", l), children: [
216
- /* @__PURE__ */ e.jsx(E, { ref: i, value: t, id: `radio-${t}` }),
229
+ const S = f(
230
+ ({ label: s, value: t, description: n, className: l }, i) => /* @__PURE__ */ e.jsxs("div", { className: g("flex items-start gap-3", l), children: [
231
+ /* @__PURE__ */ e.jsx(L, { ref: i, value: t, id: `radio-${t}` }),
217
232
  /* @__PURE__ */ e.jsxs(
218
233
  "label",
219
234
  {
220
235
  htmlFor: `radio-${t}`,
221
236
  className: "flex flex-col gap-1.5 cursor-pointer flex-1 truncate",
222
237
  children: [
223
- /* @__PURE__ */ e.jsx(b, { content: s, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none truncate", children: s }) }),
224
- n && /* @__PURE__ */ e.jsx(b, { content: n, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-5 text-muted-foreground truncate", children: n }) })
238
+ /* @__PURE__ */ e.jsx(v, { content: s, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-4 truncate", children: s }) }),
239
+ n && /* @__PURE__ */ e.jsx(v, { content: n, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm font-normal leading-4 text-muted-foreground truncate", children: n }) })
225
240
  ]
226
241
  }
227
242
  )
228
243
  ] })
229
244
  );
230
245
  S.displayName = "FilterRadioOption";
231
- const q = m(
246
+ const q = f(
232
247
  ({
233
248
  children: s,
234
249
  showSearch: t = !1,
235
250
  searchPlaceholder: n = "Search...",
236
251
  searchValue: l,
237
252
  onSearchChange: i,
238
- className: r
239
- }, h) => /* @__PURE__ */ e.jsxs(
253
+ className: c
254
+ }, r) => /* @__PURE__ */ e.jsxs(
240
255
  "div",
241
256
  {
242
- ref: h,
243
- className: x(
244
- "flex flex-col gap-6 bg-white rounded-md p-6 min-w-[448px]",
245
- r
257
+ ref: r,
258
+ className: g(
259
+ "flex flex-col gap-6 bg-background rounded-md p-6 min-w-[448px]",
260
+ c
246
261
  ),
247
262
  children: [
248
263
  t && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
249
264
  /* @__PURE__ */ e.jsx(
250
- v,
265
+ y,
251
266
  {
252
267
  name: "MagnifyingGlass",
253
268
  className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"
@@ -1,2 +1,2 @@
1
1
  export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, } from './filter';
2
- export { FilterDateRange, FilterDateRangeOption, type FilterDateRangeProps, type FilterDateRangeOptionProps, } from './filter-date-range';
2
+ export { FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, type FilterDateRangeProps, type FilterDateRangeOptionProps, } from './filter-date-range';
@@ -1,68 +1,274 @@
1
1
  import { ReactNode, ComponentProps } from 'react';
2
2
  import { IconName } from '../icon';
3
3
  import { FilterSectionItem } from '../filter/filter';
4
+ /**
5
+ * Props for the FilterMenuItem component
6
+ */
4
7
  interface FilterMenuItemProps extends ComponentProps<"button"> {
8
+ /**
9
+ * Optional icon to display at the start of the menu item
10
+ */
5
11
  icon?: IconName;
12
+ /**
13
+ * Label text to display in the menu item
14
+ */
6
15
  label: string;
16
+ /**
17
+ * Whether the menu item is currently active/selected
18
+ * @default false
19
+ */
7
20
  isActive?: boolean;
21
+ /**
22
+ * Whether to show a chevron icon at the end of the menu item
23
+ * @default false
24
+ */
8
25
  showChevron?: boolean;
9
26
  }
27
+ /**
28
+ * A single menu item in the filter sidebar
29
+ */
10
30
  declare const FilterMenuItem: import('react').ForwardRefExoticComponent<Omit<FilterMenuItemProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
31
+ /**
32
+ * Props for the FilterMenu component (Sidebar)
33
+ */
11
34
  interface FilterMenuProps {
35
+ /**
36
+ * Array of menu items to display in the sidebar
37
+ */
12
38
  items: Array<{
39
+ /**
40
+ * Unique identifier for the menu item
41
+ */
13
42
  id: string;
43
+ /**
44
+ * Optional icon to display in the menu item
45
+ */
14
46
  icon?: IconName;
47
+ /**
48
+ * Label text for the menu item
49
+ */
15
50
  label: string;
51
+ /**
52
+ * Whether to show a chevron icon
53
+ */
16
54
  showChevron?: boolean;
17
55
  }>;
56
+ /**
57
+ * ID of the currently active/selected menu item
58
+ */
18
59
  activeItemId?: string;
60
+ /**
61
+ * Callback fired when a menu item is clicked
62
+ */
19
63
  onItemClick?: (itemId: string) => void;
64
+ /**
65
+ * Optional CSS class name
66
+ */
20
67
  className?: string;
21
68
  }
69
+ /**
70
+ * Sidebar menu displaying available filter options
71
+ */
22
72
  declare const FilterMenu: import('react').ForwardRefExoticComponent<FilterMenuProps & import('react').RefAttributes<HTMLDivElement>>;
73
+ /**
74
+ * Configuration for a single filter in the FilterDropdown
75
+ */
23
76
  interface FilterConfig {
77
+ /**
78
+ * Unique identifier for the filter
79
+ */
24
80
  id: string;
81
+ /**
82
+ * Optional icon to display in the filter menu
83
+ */
25
84
  icon?: IconName;
85
+ /**
86
+ * Label text for the filter
87
+ */
26
88
  label: string;
27
- type: 'checkbox' | 'radio' | 'custom' | 'date';
89
+ /**
90
+ * Type of filter to render
91
+ */
92
+ type: "checkbox" | "radio" | "custom" | "date";
93
+ /**
94
+ * Items for checkbox/radio type filters
95
+ */
28
96
  items?: FilterSectionItem[];
97
+ /**
98
+ * Selected values for checkbox type filters
99
+ */
29
100
  selectedValues?: string[];
101
+ /**
102
+ * Callback fired when checkbox selections change
103
+ */
30
104
  onChange?: (values: string[]) => void;
105
+ /**
106
+ * Selected value for radio type filters
107
+ */
31
108
  selectedValue?: string;
109
+ /**
110
+ * Callback fired when radio selection changes
111
+ */
32
112
  onValueChange?: (value: string) => void;
113
+ /**
114
+ * Current date range selection value (e.g., "last-7-days", "custom")
115
+ */
33
116
  dateValue?: string;
117
+ /**
118
+ * Start date for date type filters
119
+ */
34
120
  dateInit?: Date;
121
+ /**
122
+ * End date for date type filters
123
+ */
35
124
  dateEnd?: Date;
125
+ /**
126
+ * Start time in HH:mm:ss format
127
+ */
36
128
  startTime?: string;
129
+ /**
130
+ * End time in HH:mm:ss format
131
+ */
37
132
  endTime?: string;
38
- dateMode?: 'range' | 'single';
133
+ /**
134
+ * Date picker mode: 'range' shows two date pickers, 'single' shows one
135
+ * @default 'range'
136
+ */
137
+ dateMode?: "range" | "single";
138
+ /**
139
+ * Label for single day picker when dateMode is 'single'
140
+ */
39
141
  singleDayLabel?: string;
142
+ /**
143
+ * Whether to show "All time" option in date filter
144
+ * @default false
145
+ */
40
146
  showAllTime?: boolean;
147
+ /**
148
+ * Callback fired when date range selection changes
149
+ */
41
150
  onDateValueChange?: (value: string) => void;
151
+ /**
152
+ * Callback fired when start date changes
153
+ */
42
154
  onDateInitChange?: (date: Date | undefined) => void;
155
+ /**
156
+ * Callback fired when end date changes
157
+ */
43
158
  onDateEndChange?: (date: Date | undefined) => void;
159
+ /**
160
+ * Callback fired when start time changes
161
+ */
44
162
  onStartTimeChange?: (time: string) => void;
163
+ /**
164
+ * Callback fired when end time changes
165
+ */
45
166
  onEndTimeChange?: (time: string) => void;
167
+ /**
168
+ * Whether the filter items are searchable
169
+ */
46
170
  searchable?: boolean;
171
+ /**
172
+ * Placeholder text for the search input
173
+ */
47
174
  searchPlaceholder?: string;
175
+ /**
176
+ * Whether to show action buttons (Select All, Inverse, None)
177
+ */
48
178
  showActions?: boolean;
179
+ /**
180
+ * Whether to enable "Select All" action
181
+ */
49
182
  enableSelectAll?: boolean;
183
+ /**
184
+ * Whether to enable "Inverse" action
185
+ */
50
186
  enableInverse?: boolean;
187
+ /**
188
+ * Whether to enable "None" action
189
+ */
51
190
  enableNone?: boolean;
191
+ /**
192
+ * Whether this filter can be cleared from applied filters
193
+ * @default true
194
+ */
52
195
  clearable?: boolean;
196
+ /**
197
+ * Custom render function for 'custom' type filters
198
+ */
53
199
  renderContent?: () => ReactNode;
54
200
  }
201
+ /**
202
+ * Props for the FilterDropdown component
203
+ */
55
204
  interface FilterDropdownProps {
205
+ /**
206
+ * Array of filter configurations to display
207
+ */
56
208
  filters: FilterConfig[];
209
+ /**
210
+ * Array of currently applied filters to display as badges
211
+ */
57
212
  appliedFilters?: Array<{
213
+ /**
214
+ * ID of the applied filter (should match a FilterConfig id)
215
+ */
58
216
  id: string;
217
+ /**
218
+ * Label to display in the badge
219
+ */
59
220
  label: string;
60
221
  }>;
222
+ /**
223
+ * Callback fired when a filter badge is removed
224
+ */
61
225
  onRemoveFilter?: (filterId: string) => void;
226
+ /**
227
+ * Callback fired when "Clear filters" button is clicked
228
+ */
62
229
  onClearAllFilters?: () => void;
230
+ /**
231
+ * Text to display in the trigger button
232
+ * @default "Add filter"
233
+ */
63
234
  buttonText?: string;
235
+ /**
236
+ * Maximum number of filter badges to show before displaying "+X more"
237
+ * @default 4
238
+ */
64
239
  maxVisibleTags?: number;
240
+ /**
241
+ * Optional CSS class name for the root element
242
+ */
65
243
  className?: string;
244
+ /**
245
+ * Whether the filter dropdown is disabled
246
+ * @default false
247
+ */
248
+ disabled?: boolean;
66
249
  }
250
+ /**
251
+ * Advanced filter dropdown component with sidebar navigation and multiple filter types.
252
+ * Supports checkbox, radio, date range, and custom filters with applied filter badges.
253
+ *
254
+ * @example
255
+ * ```tsx
256
+ * <FilterDropdown
257
+ * filters={[
258
+ * {
259
+ * id: 'status',
260
+ * label: 'Status',
261
+ * type: 'checkbox',
262
+ * items: [{ value: 'active', label: 'Active' }],
263
+ * selectedValues: ['active'],
264
+ * onChange: (values) => console.log(values)
265
+ * }
266
+ * ]}
267
+ * appliedFilters={[{ id: 'status', label: 'Status: Active' }]}
268
+ * onRemoveFilter={(id) => console.log('Remove', id)}
269
+ * onClearAllFilters={() => console.log('Clear all')}
270
+ * />
271
+ * ```
272
+ */
67
273
  declare const FilterDropdown: import('react').ForwardRefExoticComponent<FilterDropdownProps & import('react').RefAttributes<HTMLDivElement>>;
68
274
  export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, };