@datum-cloud/datum-ui 0.6.1 → 0.8.0

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 (257) hide show
  1. package/README.md +10 -0
  2. package/dist/action-row-DnhBhMtt.mjs +22 -0
  3. package/dist/app-navigation/index.mjs +2 -2
  4. package/dist/{app-navigation-84ro28PU.mjs → app-navigation-rSOfo1KV.mjs} +169 -106
  5. package/dist/autocomplete/index.mjs +1 -1
  6. package/dist/autocomplete-DdbTQe6u.mjs +141 -0
  7. package/dist/autosearch/index.mjs +100 -92
  8. package/dist/avatar-stack/index.mjs +1 -1
  9. package/dist/{avatar-stack-oVr8tsU7.mjs → avatar-stack-CDhlA1Nm.mjs} +1 -1
  10. package/dist/calendar/index.mjs +1 -1
  11. package/dist/{calendar-DEkCw7I1.mjs → calendar-C-Hbf74r.mjs} +4 -4
  12. package/dist/{calendar-date-picker-CDT-8Ha8.mjs → calendar-date-picker-BaykEs6j.mjs} +324 -240
  13. package/dist/code-editor/index.mjs +1 -1
  14. package/dist/components/base/date-picker/index.d.ts +4 -0
  15. package/dist/components/base/date-picker/index.d.ts.map +1 -0
  16. package/dist/components/base/date-picker/types.d.ts +7 -0
  17. package/dist/components/base/date-picker/types.d.ts.map +1 -0
  18. package/dist/components/base/date-picker/use-date-constraints.d.ts +8 -0
  19. package/dist/components/base/date-picker/use-date-constraints.d.ts.map +1 -0
  20. package/dist/components/base/index.d.ts +3 -0
  21. package/dist/components/base/index.d.ts.map +1 -1
  22. package/dist/components/base/mobile-sheet/context.d.ts +13 -0
  23. package/dist/components/base/mobile-sheet/context.d.ts.map +1 -0
  24. package/dist/components/base/mobile-sheet/index.d.ts +3 -0
  25. package/dist/components/base/mobile-sheet/index.d.ts.map +1 -0
  26. package/dist/components/base/mobile-sheet/mobile-sheet.d.ts +14 -0
  27. package/dist/components/base/mobile-sheet/mobile-sheet.d.ts.map +1 -0
  28. package/dist/components/base/option-picker/index.d.ts +5 -0
  29. package/dist/components/base/option-picker/index.d.ts.map +1 -0
  30. package/dist/components/base/option-picker/option-list.d.ts +3 -0
  31. package/dist/components/base/option-picker/option-list.d.ts.map +1 -0
  32. package/dist/components/base/option-picker/types.d.ts +71 -0
  33. package/dist/components/base/option-picker/types.d.ts.map +1 -0
  34. package/dist/components/base/option-picker/use-option-picker.d.ts +4 -0
  35. package/dist/components/base/option-picker/use-option-picker.d.ts.map +1 -0
  36. package/dist/components/base/responsive-dropdown/index.d.ts +2 -0
  37. package/dist/components/base/responsive-dropdown/index.d.ts.map +1 -0
  38. package/dist/components/base/responsive-dropdown/responsive-dropdown.d.ts +25 -0
  39. package/dist/components/base/responsive-dropdown/responsive-dropdown.d.ts.map +1 -0
  40. package/dist/components/base/responsive-popover/index.d.ts +2 -0
  41. package/dist/components/base/responsive-popover/index.d.ts.map +1 -0
  42. package/dist/components/base/responsive-popover/responsive-popover.d.ts +46 -0
  43. package/dist/components/base/responsive-popover/responsive-popover.d.ts.map +1 -0
  44. package/dist/components/base/tooltip/tooltip.d.ts.map +1 -1
  45. package/dist/components/features/app-navigation/app-navigation.d.ts +5 -3
  46. package/dist/components/features/app-navigation/app-navigation.d.ts.map +1 -1
  47. package/dist/components/features/autocomplete/autocomplete.d.ts +2 -2
  48. package/dist/components/features/autocomplete/autocomplete.d.ts.map +1 -1
  49. package/dist/components/features/autocomplete/autocomplete.types.d.ts +7 -16
  50. package/dist/components/features/autocomplete/autocomplete.types.d.ts.map +1 -1
  51. package/dist/components/features/autocomplete/trigger.d.ts +20 -0
  52. package/dist/components/features/autocomplete/trigger.d.ts.map +1 -0
  53. package/dist/components/features/autosearch/autosearch.d.ts +1 -1
  54. package/dist/components/features/autosearch/autosearch.d.ts.map +1 -1
  55. package/dist/components/features/autosearch/autosearch.types.d.ts +4 -0
  56. package/dist/components/features/autosearch/autosearch.types.d.ts.map +1 -1
  57. package/dist/components/features/calendar-date-picker/calendar-date-picker.d.ts +3 -37
  58. package/dist/components/features/calendar-date-picker/calendar-date-picker.d.ts.map +1 -1
  59. package/dist/components/features/calendar-date-picker/calendar-header.d.ts +13 -0
  60. package/dist/components/features/calendar-date-picker/calendar-header.d.ts.map +1 -0
  61. package/dist/components/features/calendar-date-picker/calendar-presets.d.ts +9 -0
  62. package/dist/components/features/calendar-date-picker/calendar-presets.d.ts.map +1 -0
  63. package/dist/components/features/calendar-date-picker/date-trigger.d.ts +24 -0
  64. package/dist/components/features/calendar-date-picker/date-trigger.d.ts.map +1 -0
  65. package/dist/components/features/calendar-date-picker/index.d.ts +2 -1
  66. package/dist/components/features/calendar-date-picker/index.d.ts.map +1 -1
  67. package/dist/components/features/calendar-date-picker/types.d.ts +42 -0
  68. package/dist/components/features/calendar-date-picker/types.d.ts.map +1 -0
  69. package/dist/components/features/calendar-date-picker/use-calendar-date-picker.d.ts +48 -0
  70. package/dist/components/features/calendar-date-picker/use-calendar-date-picker.d.ts.map +1 -0
  71. package/dist/components/features/data-table/components/row-actions.d.ts +1 -1
  72. package/dist/components/features/data-table/components/row-actions.d.ts.map +1 -1
  73. package/dist/components/features/data-table/filters/checkbox-filter.d.ts +1 -1
  74. package/dist/components/features/data-table/filters/checkbox-filter.d.ts.map +1 -1
  75. package/dist/components/features/data-table/filters/select-filter.d.ts +1 -1
  76. package/dist/components/features/data-table/filters/select-filter.d.ts.map +1 -1
  77. package/dist/components/features/data-table/types.d.ts +11 -12
  78. package/dist/components/features/data-table/types.d.ts.map +1 -1
  79. package/dist/components/features/date-time-picker/date-time-picker.d.ts +1 -1
  80. package/dist/components/features/date-time-picker/date-time-picker.d.ts.map +1 -1
  81. package/dist/components/features/date-time-picker/types.d.ts +23 -0
  82. package/dist/components/features/date-time-picker/types.d.ts.map +1 -1
  83. package/dist/components/features/form/components/form-combobox.d.ts +7 -44
  84. package/dist/components/features/form/components/form-combobox.d.ts.map +1 -1
  85. package/dist/components/features/form/components/form-dialog.d.ts +2 -1
  86. package/dist/components/features/form/components/form-dialog.d.ts.map +1 -1
  87. package/dist/components/features/form/components/form-field.d.ts +1 -1
  88. package/dist/components/features/form/components/form-field.d.ts.map +1 -1
  89. package/dist/components/features/form/types/index.d.ts +4 -0
  90. package/dist/components/features/form/types/index.d.ts.map +1 -1
  91. package/dist/components/features/index.d.ts +2 -0
  92. package/dist/components/features/index.d.ts.map +1 -1
  93. package/dist/components/features/more-actions/action-row.d.ts +9 -0
  94. package/dist/components/features/more-actions/action-row.d.ts.map +1 -0
  95. package/dist/components/features/more-actions/index.d.ts +3 -1
  96. package/dist/components/features/more-actions/index.d.ts.map +1 -1
  97. package/dist/components/features/more-actions/more-actions.d.ts +8 -14
  98. package/dist/components/features/more-actions/more-actions.d.ts.map +1 -1
  99. package/dist/components/features/more-actions/types.d.ts +24 -0
  100. package/dist/components/features/more-actions/types.d.ts.map +1 -0
  101. package/dist/components/features/multi-select/index.d.ts +3 -0
  102. package/dist/components/features/multi-select/index.d.ts.map +1 -0
  103. package/dist/components/features/multi-select/multi-select.d.ts +147 -0
  104. package/dist/components/features/multi-select/multi-select.d.ts.map +1 -0
  105. package/dist/components/features/page-title/page-title.d.ts.map +1 -1
  106. package/dist/components/features/rich-text-editor/index.d.ts +4 -0
  107. package/dist/components/features/rich-text-editor/index.d.ts.map +1 -0
  108. package/dist/components/features/rich-text-editor/rich-text-content.d.ts +3 -0
  109. package/dist/components/features/rich-text-editor/rich-text-content.d.ts.map +1 -0
  110. package/dist/components/features/rich-text-editor/rich-text-editor.d.ts +28 -0
  111. package/dist/components/features/rich-text-editor/rich-text-editor.d.ts.map +1 -0
  112. package/dist/components/features/rich-text-editor/toolbar/bold-toolbar.d.ts +2 -0
  113. package/dist/components/features/rich-text-editor/toolbar/bold-toolbar.d.ts.map +1 -0
  114. package/dist/components/features/rich-text-editor/toolbar/italic-toolbar.d.ts +2 -0
  115. package/dist/components/features/rich-text-editor/toolbar/italic-toolbar.d.ts.map +1 -0
  116. package/dist/components/features/rich-text-editor/toolbar/link-toolbar.d.ts +2 -0
  117. package/dist/components/features/rich-text-editor/toolbar/link-toolbar.d.ts.map +1 -0
  118. package/dist/components/features/rich-text-editor/toolbar/strike-toolbar.d.ts +2 -0
  119. package/dist/components/features/rich-text-editor/toolbar/strike-toolbar.d.ts.map +1 -0
  120. package/dist/components/features/rich-text-editor/toolbar/toolbar-button.d.ts +17 -0
  121. package/dist/components/features/rich-text-editor/toolbar/toolbar-button.d.ts.map +1 -0
  122. package/dist/components/features/rich-text-editor/toolbar/toolbar.d.ts +6 -0
  123. package/dist/components/features/rich-text-editor/toolbar/toolbar.d.ts.map +1 -0
  124. package/dist/components/features/rich-text-editor/toolbar/underline-toolbar.d.ts +2 -0
  125. package/dist/components/features/rich-text-editor/toolbar/underline-toolbar.d.ts.map +1 -0
  126. package/dist/components/features/rich-text-editor/types.d.ts +20 -0
  127. package/dist/components/features/rich-text-editor/types.d.ts.map +1 -0
  128. package/dist/components/features/tag-input/tag-input.d.ts +12 -1
  129. package/dist/components/features/tag-input/tag-input.d.ts.map +1 -1
  130. package/dist/components/features/task-queue/core/task-queue-dropdown.d.ts.map +1 -1
  131. package/dist/components/features/time-picker/time-picker.d.ts +1 -17
  132. package/dist/components/features/time-picker/time-picker.d.ts.map +1 -1
  133. package/dist/components/features/time-picker/types.d.ts +20 -18
  134. package/dist/components/features/time-picker/types.d.ts.map +1 -1
  135. package/dist/components/features/time-picker/use-time-slots.d.ts +10 -0
  136. package/dist/components/features/time-picker/use-time-slots.d.ts.map +1 -0
  137. package/dist/components/features/time-range-picker/components/absolute-range-panel.d.ts.map +1 -1
  138. package/dist/components/features/time-range-picker/time-range-picker.d.ts.map +1 -1
  139. package/dist/data-table/index.mjs +60 -175
  140. package/dist/date-picker/index.mjs +2 -2
  141. package/dist/date-time-picker/index.mjs +1 -1
  142. package/dist/{date-time-picker-BomrW07W.mjs → date-time-picker-DKOxrhmc.mjs} +64 -49
  143. package/dist/dropdown/index.mjs +109 -1
  144. package/dist/dropzone/index.mjs +1 -1
  145. package/dist/empty-content/index.mjs +1 -1
  146. package/dist/form/adapters/conform/index.mjs +2 -2
  147. package/dist/form/adapters/rhf/index.mjs +2 -2
  148. package/dist/form/index.mjs +2 -2
  149. package/dist/form/stepper/index.mjs +3 -3
  150. package/dist/{form-B3rQ4CH9.mjs → form-CCNN9VtJ.mjs} +27 -30
  151. package/dist/grid/index.mjs +1 -1
  152. package/dist/hooks/index.d.ts +1 -0
  153. package/dist/hooks/index.d.ts.map +1 -1
  154. package/dist/hooks/index.mjs +4 -3
  155. package/dist/hooks/use-breakpoint.d.ts +9 -0
  156. package/dist/hooks/use-breakpoint.d.ts.map +1 -0
  157. package/dist/index.mjs +49 -42
  158. package/dist/input-number/index.mjs +1 -1
  159. package/dist/loader-overlay/index.mjs +1 -1
  160. package/dist/map/index.mjs +1 -1
  161. package/dist/{map-CWIQ-eql.mjs → map-qo7bY_g_.mjs} +83 -4
  162. package/dist/mobile-sheet/index.mjs +2 -0
  163. package/dist/mobile-sheet-BxMvkzAj.mjs +61 -0
  164. package/dist/more-actions/index.mjs +3 -2
  165. package/dist/more-actions-Ca5qqd0H.mjs +49 -0
  166. package/dist/multi-select/index.mjs +2 -0
  167. package/dist/multi-select-DM_dxnSV.mjs +235 -0
  168. package/dist/page-title/index.mjs +1 -1
  169. package/dist/{page-title-ChsnpBiH.mjs → page-title-ChLiv6gB.mjs} +3 -2
  170. package/dist/popover/index.mjs +1 -1
  171. package/dist/radio-group/index.mjs +1 -1
  172. package/dist/responsive-dropdown/index.mjs +2 -0
  173. package/dist/responsive-dropdown-IFroDgKn.mjs +53 -0
  174. package/dist/responsive-popover/index.mjs +2 -0
  175. package/dist/responsive-popover-D-t9bxSN.mjs +61 -0
  176. package/dist/rich-text-editor/index.mjs +2 -0
  177. package/dist/rich-text-editor-CQH_U4T5.mjs +293 -0
  178. package/dist/select/index.mjs +1 -1
  179. package/dist/sheet/index.mjs +2 -2
  180. package/dist/{sheet-BzXksqYY.mjs → sheet-LhUgozvg.mjs} +1 -1
  181. package/dist/sidebar/index.mjs +1 -1
  182. package/dist/{sidebar-BnhnjvfO.mjs → sidebar-B8LQJiNI.mjs} +3 -3
  183. package/dist/skeleton/index.mjs +1 -1
  184. package/dist/{skeleton-D1MUhAVo.mjs → skeleton-D4HOEiOZ.mjs} +1 -1
  185. package/dist/spinner/index.mjs +1 -1
  186. package/dist/stepper/index.mjs +1 -1
  187. package/dist/styles/canela.css +23 -0
  188. package/dist/styles/fonts/CanelaText-Regular.ttf +0 -0
  189. package/dist/styles/tokens/figma-tokens.css +4 -0
  190. package/dist/switch/index.mjs +1 -1
  191. package/dist/table/index.mjs +1 -1
  192. package/dist/tag-input/index.mjs +1 -1
  193. package/dist/{tag-input-T9cUX9-G.mjs → tag-input-Bf4GMptp.mjs} +29 -14
  194. package/dist/task-queue/index.mjs +1 -1
  195. package/dist/{task-queue-dropdown-Wcbj-f0V.mjs → task-queue-dropdown-D-LncEWm.mjs} +39 -39
  196. package/dist/textarea/index.mjs +1 -1
  197. package/dist/theme/index.mjs +1 -1
  198. package/dist/time-picker/index.mjs +1 -1
  199. package/dist/time-picker-BZF5jbF6.mjs +99 -0
  200. package/dist/{to-api-format-Bh3c01gr.mjs → to-api-format-CgKcC9SK.mjs} +144 -119
  201. package/dist/toast/index.mjs +2 -2
  202. package/dist/{toast-DpxlFNNx.mjs → toast-DDdLgY53.mjs} +1 -1
  203. package/dist/tooltip/index.mjs +1 -1
  204. package/dist/{tooltip-Cruvl5F6.mjs → tooltip-a7NTDCWw.mjs} +74 -17
  205. package/dist/transfer/index.mjs +1 -1
  206. package/dist/{types-BZNk3q65.mjs → types-CKIe2WlV.mjs} +2 -2
  207. package/dist/typography/index.mjs +1 -1
  208. package/dist/use-breakpoint-DGcVmB3c.mjs +36 -0
  209. package/dist/{use-copy-to-clipboard-uNeeVHC4.mjs → use-copy-to-clipboard-D7KyLIAt.mjs} +1 -1
  210. package/dist/use-date-constraints-R3H4lIoT.mjs +41 -0
  211. package/dist/use-option-picker-BXQOfyrK.mjs +215 -0
  212. package/dist/utils/index.d.ts +1 -0
  213. package/dist/utils/index.d.ts.map +1 -1
  214. package/dist/utils/index.mjs +2 -1
  215. package/dist/utils/timezone.d.ts +19 -0
  216. package/dist/utils/timezone.d.ts.map +1 -0
  217. package/dist/utils-BwB1mIdZ.mjs +35 -0
  218. package/dist/visually-hidden/index.mjs +1 -1
  219. package/package.json +61 -6
  220. package/dist/autocomplete-CkYJueBL.mjs +0 -293
  221. package/dist/combobox/index.mjs +0 -2
  222. package/dist/combobox-B-C9lJeD.mjs +0 -97
  223. package/dist/components/features/combobox/combobox.d.ts +0 -27
  224. package/dist/components/features/combobox/combobox.d.ts.map +0 -1
  225. package/dist/components/features/combobox/index.d.ts +0 -3
  226. package/dist/components/features/combobox/index.d.ts.map +0 -1
  227. package/dist/components/features/combobox/types.d.ts +0 -84
  228. package/dist/components/features/combobox/types.d.ts.map +0 -1
  229. package/dist/dropdown-DZiAt-jS.mjs +0 -110
  230. package/dist/dropdown-menu-lALvDnab.mjs +0 -85
  231. package/dist/more-actions-ILnEZq_E.mjs +0 -52
  232. package/dist/time-picker-BoF7pZZ2.mjs +0 -43
  233. /package/dist/{adapter-context-rWveHhDd.mjs → adapter-context-NyGTDZYq.mjs} +0 -0
  234. /package/dist/{col-1T0Q3SlH.mjs → col-DISdGlqY.mjs} +0 -0
  235. /package/dist/{dropzone-ogtpQ4fy.mjs → dropzone-Bt0plEuw.mjs} +0 -0
  236. /package/dist/{empty-content-C63GPJ5d.mjs → empty-content-CBh5bbtJ.mjs} +0 -0
  237. /package/dist/{form-context-Ccxm-wqL.mjs → form-context-CeKyvO-A.mjs} +0 -0
  238. /package/dist/{hooks-D8r2M2U6.mjs → hooks-DQXVwbrs.mjs} +0 -0
  239. /package/dist/{input-number-a7uydAsw.mjs → input-number-Diu-C6d5.mjs} +0 -0
  240. /package/dist/{loader-overlay-BTFdkp7W.mjs → loader-overlay-C2WDla6V.mjs} +0 -0
  241. /package/dist/{map-leaflet-imports-CRSKA79m.mjs → map-leaflet-imports-yWwH4CHB.mjs} +0 -0
  242. /package/dist/{popover-FJAcbYoH.mjs → popover-JOuXJOZ2.mjs} +0 -0
  243. /package/dist/{radio-group-CiITR0LO.mjs → radio-group-70UjJBb5.mjs} +0 -0
  244. /package/dist/{select-CiLR_DiQ.mjs → select-zxwykvQn.mjs} +0 -0
  245. /package/dist/{sheet-Di3b-oPu.mjs → sheet-DVEToCVY.mjs} +0 -0
  246. /package/dist/{skeleton-BKl4mfJt.mjs → skeleton-D2xuJdE1.mjs} +0 -0
  247. /package/dist/{spinner-OyOf9-Yu.mjs → spinner-CgPI3DDi.mjs} +0 -0
  248. /package/dist/{stepper-DvIOp0hh.mjs → stepper-Beb-zbdL.mjs} +0 -0
  249. /package/dist/{switch-DQJQhPIQ.mjs → switch-DcSF42Kc.mjs} +0 -0
  250. /package/dist/{table-Cdsh-39-.mjs → table-DWGT4cqh.mjs} +0 -0
  251. /package/dist/{textarea-BwD-MmTV.mjs → textarea-BoChBcFz.mjs} +0 -0
  252. /package/dist/{themes-DG1md8FI.mjs → themes-CAiN4b6G.mjs} +0 -0
  253. /package/dist/{toast-BWnN5fax.mjs → toast-D5XD7goD.mjs} +0 -0
  254. /package/dist/{transfer-46C-rFFW.mjs → transfer-CoGPwOc6.mjs} +0 -0
  255. /package/dist/{typography-ClB8k55E.mjs → typography-TRKP_CLT.mjs} +0 -0
  256. /package/dist/{use-display-touched-I39aXEBD.mjs → use-display-touched-C-afz17j.mjs} +0 -0
  257. /package/dist/{visuallyhidden-BLUsJpYH.mjs → visuallyhidden-BHOPczmW.mjs} +0 -0
@@ -1,25 +1,12 @@
1
1
  import { t as cn } from "../cn-D2KYQ917.mjs";
2
2
  import { t as Button } from "../button-BllvE9Lm.mjs";
3
- import { i as CommandGroup, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "../command-DqHWukGK.mjs";
4
3
  import { t as Input } from "../input-FKGqZypx.mjs";
5
- import { i as PopoverTrigger, r as PopoverContent, t as Popover } from "../popover-FJAcbYoH.mjs";
6
- import { t as Tooltip } from "../tooltip-Cruvl5F6.mjs";
7
- import { AlertCircle, Check, Loader2, X } from "lucide-react";
4
+ import { t as ResponsivePopover } from "../responsive-popover-D-t9bxSN.mjs";
5
+ import { t as Tooltip } from "../tooltip-a7NTDCWw.mjs";
6
+ import { n as OptionList, t as useOptionPicker } from "../use-option-picker-BXQOfyrK.mjs";
7
+ import { AlertCircle, Loader2, X } from "lucide-react";
8
8
  import * as React$1 from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
- //#region src/components/features/autosearch/autosearch.types.ts
11
- /**
12
- * Default function to extract searchable text from an option.
13
- * Combines label, description, and value for comprehensive searching.
14
- */
15
- function defaultAutosearchValue(option) {
16
- return [
17
- option.label,
18
- option.description,
19
- option.value
20
- ].filter(Boolean).join(" ");
21
- }
22
- //#endregion
23
10
  //#region src/components/features/autosearch/autosearch.tsx
24
11
  /**
25
12
  * Autosearch - Search-first input with dropdown results
@@ -50,32 +37,28 @@ function defaultAutosearchValue(option) {
50
37
  * />
51
38
  * ```
52
39
  */
53
- function Autosearch({ options = [], value, onValueChange, onSearch, searchDebounceMs = 300, getValue = defaultAutosearchValue, placeholder = "Search for an option", emptyMessage = "No results found.", emptyContent, loading = false, modal = false, disabled = false, name, id, className, inputClassName, contentClassName, selectedClassName }) {
54
- const [searchQuery, setSearchQuery] = React$1.useState("");
40
+ function Autosearch({ options = [], value, onValueChange, onSearch, searchDebounceMs = 300, placeholder = "Search for an option", emptyMessage = "No results found.", emptyContent, loading = false, modal = false, responsive = true, sheetTitle, disabled = false, name, id, className, inputClassName, contentClassName, selectedClassName }) {
55
41
  const [open, setOpen] = React$1.useState(false);
56
42
  const [persistedOption, setPersistedOption] = React$1.useState(null);
57
43
  const [searchExecuted, setSearchExecuted] = React$1.useState(false);
58
44
  const searchDebounceRef = React$1.useRef(null);
59
- const handleSearchChange = (inputValue) => {
60
- setSearchQuery(inputValue);
61
- const normalized = inputValue.trim();
45
+ const onSearchChangeForEngine = React$1.useCallback((query) => {
46
+ const normalized = query.trim();
62
47
  if (searchDebounceRef.current) {
63
48
  clearTimeout(searchDebounceRef.current);
64
49
  searchDebounceRef.current = null;
65
50
  }
66
51
  if (!normalized) {
67
52
  onSearch?.("");
68
- setOpen(false);
69
53
  setSearchExecuted(false);
70
54
  return;
71
55
  }
72
- setOpen(true);
73
56
  searchDebounceRef.current = setTimeout(() => {
74
57
  setSearchExecuted(true);
75
58
  onSearch?.(normalized);
76
59
  searchDebounceRef.current = null;
77
60
  }, searchDebounceMs);
78
- };
61
+ }, [onSearch, searchDebounceMs]);
79
62
  React$1.useEffect(() => {
80
63
  return () => {
81
64
  if (searchDebounceRef.current) {
@@ -84,39 +67,60 @@ function Autosearch({ options = [], value, onValueChange, onSearch, searchDeboun
84
67
  }
85
68
  };
86
69
  }, []);
87
- const handleSelect = React$1.useCallback((option) => {
88
- setPersistedOption(option);
89
- onValueChange?.(option.value);
90
- setSearchQuery("");
91
- onSearch?.("");
92
- setOpen(false);
93
- setSearchExecuted(false);
94
- }, [onValueChange, onSearch]);
70
+ const picker = useOptionPicker({
71
+ multiple: false,
72
+ options,
73
+ value,
74
+ onValueChange: (selected) => {
75
+ setPersistedOption(options.find((o) => o.value === selected) ?? null);
76
+ onValueChange?.(selected);
77
+ picker.setSearch("");
78
+ onSearch?.("");
79
+ setSearchExecuted(false);
80
+ },
81
+ onSearchChange: onSearchChangeForEngine,
82
+ closeOnSelect: true,
83
+ open,
84
+ onOpenChange: setOpen
85
+ });
86
+ const hasSearch = Boolean(picker.search.trim());
87
+ const showResults = hasSearch && !value && options.length > 1;
88
+ const showNoResults = hasSearch && !loading && options.length === 0 && searchExecuted;
89
+ React$1.useEffect(() => {
90
+ if (hasSearch && !value) setOpen(true);
91
+ else if (!hasSearch) setOpen(false);
92
+ }, [hasSearch, value]);
93
+ React$1.useEffect(() => {
94
+ if (value || !hasSearch) return;
95
+ if (options.length === 1 && !options[0].disabled) {
96
+ const option = options[0];
97
+ setPersistedOption(option);
98
+ onValueChange?.(option.value);
99
+ picker.setSearch("");
100
+ onSearch?.("");
101
+ setSearchExecuted(false);
102
+ setOpen(false);
103
+ }
104
+ }, [
105
+ options,
106
+ value,
107
+ hasSearch
108
+ ]);
95
109
  const handleClear = React$1.useCallback(() => {
96
110
  setPersistedOption(null);
97
- setSearchQuery("");
111
+ picker.setSearch("");
98
112
  onSearch?.("");
99
113
  setOpen(false);
100
114
  setSearchExecuted(false);
101
115
  onValueChange?.("");
102
- }, [onValueChange, onSearch]);
103
- React$1.useEffect(() => {
104
- const normalized = searchQuery.trim();
105
- if (value || !normalized) return;
106
- if (options.length === 1 && !options[0].disabled) handleSelect(options[0]);
107
116
  }, [
108
- searchQuery,
109
- options,
110
- value,
111
- handleSelect
117
+ onValueChange,
118
+ onSearch,
119
+ picker
112
120
  ]);
113
- const normalizedQuery = searchQuery.trim();
114
- const hasSearch = Boolean(normalizedQuery);
115
- const showResults = hasSearch && !value && options.length > 1;
116
121
  const selectedOption = options.find((opt) => opt.value === value) ?? persistedOption;
117
122
  const selectedLabel = selectedOption?.label ?? "";
118
123
  const selectedDescription = selectedOption?.description ?? "";
119
- const showNoResults = hasSearch && !loading && options.length === 0 && searchExecuted;
120
124
  return /* @__PURE__ */ jsxs("div", {
121
125
  className: cn("relative", className),
122
126
  children: [name && /* @__PURE__ */ jsx("input", {
@@ -142,58 +146,62 @@ function Autosearch({ options = [], value, onValueChange, onSearch, searchDeboun
142
146
  disabled,
143
147
  children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
144
148
  })]
145
- }) : /* @__PURE__ */ jsxs(Popover, {
149
+ }) : /* @__PURE__ */ jsx(ResponsivePopover, {
146
150
  open: open && showResults,
147
151
  onOpenChange: setOpen,
152
+ responsive,
148
153
  modal,
149
- children: [/* @__PURE__ */ jsx(PopoverTrigger, {
150
- asChild: true,
151
- children: /* @__PURE__ */ jsxs("div", {
152
- className: "relative",
153
- children: [
154
- /* @__PURE__ */ jsx(Input, {
155
- id,
156
- placeholder,
157
- value: searchQuery,
158
- onChange: (e) => handleSearchChange(e.target.value),
159
- disabled,
160
- autoComplete: "off",
161
- className: cn("w-full pr-10", inputClassName)
162
- }),
163
- loading && /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground pointer-events-none absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2 animate-spin" }),
164
- showNoResults && /* @__PURE__ */ jsx(Tooltip, {
165
- message: emptyMessage,
166
- children: /* @__PURE__ */ jsx("span", {
167
- className: "absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2",
168
- children: /* @__PURE__ */ jsx(AlertCircle, { className: "text-destructive h-4 w-4" })
169
- })
154
+ sheetTitle: sheetTitle ?? placeholder ?? "Search",
155
+ align: "start",
156
+ side: "bottom",
157
+ contentClassName: cn("popover-content-width-full", contentClassName),
158
+ onOpenAutoFocus: (event) => event.preventDefault(),
159
+ trigger: /* @__PURE__ */ jsxs("div", {
160
+ className: "relative",
161
+ children: [
162
+ /* @__PURE__ */ jsx(Input, {
163
+ id,
164
+ placeholder,
165
+ value: picker.search,
166
+ onChange: (e) => {
167
+ picker.setSearch(e.target.value);
168
+ },
169
+ disabled,
170
+ autoComplete: "off",
171
+ className: cn("w-full pr-10", inputClassName)
172
+ }),
173
+ loading && /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground pointer-events-none absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2 animate-spin" }),
174
+ showNoResults && /* @__PURE__ */ jsx(Tooltip, {
175
+ message: emptyMessage,
176
+ children: /* @__PURE__ */ jsx("span", {
177
+ className: "absolute top-1/2 right-3 h-4 w-4 -translate-y-1/2",
178
+ children: /* @__PURE__ */ jsx(AlertCircle, { className: "text-destructive h-4 w-4" })
170
179
  })
171
- ]
172
- })
173
- }), /* @__PURE__ */ jsx(PopoverContent, {
174
- className: cn("popover-content-width-full p-0", contentClassName),
175
- side: "bottom",
176
- align: "start",
177
- onOpenAutoFocus: (event) => event.preventDefault(),
178
- children: /* @__PURE__ */ jsx(Command, { children: /* @__PURE__ */ jsx(CommandList, { children: loading ? /* @__PURE__ */ jsx(CommandEmpty, { children: "Searching..." }) : options.length === 0 ? /* @__PURE__ */ jsx(CommandEmpty, { children: emptyContent ?? emptyMessage }) : /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(CommandItem, {
179
- value: getValue(option),
180
- onSelect: () => handleSelect(option),
181
- disabled: option.disabled,
182
- children: [/* @__PURE__ */ jsxs("div", {
183
- className: "flex flex-col",
184
- children: [/* @__PURE__ */ jsx("span", {
185
- className: "font-medium",
186
- children: option.label
187
- }), option.description && /* @__PURE__ */ jsx("span", {
188
- className: "text-muted-foreground text-xs",
189
- children: option.description
190
- })]
191
- }), /* @__PURE__ */ jsx(Check, { className: cn("ml-auto h-4 w-4", value === option.value ? "opacity-100" : "opacity-0") })]
192
- }, option.value)) }) }) })
193
- })]
180
+ })
181
+ ]
182
+ }),
183
+ children: /* @__PURE__ */ jsx(OptionList, {
184
+ picker,
185
+ disableSearch: true,
186
+ emptyContent: emptyContent ?? emptyMessage,
187
+ loading
188
+ })
194
189
  })]
195
190
  });
196
191
  }
197
192
  Autosearch.displayName = "Autosearch";
198
193
  //#endregion
194
+ //#region src/components/features/autosearch/autosearch.types.ts
195
+ /**
196
+ * Default function to extract searchable text from an option.
197
+ * Combines label, description, and value for comprehensive searching.
198
+ */
199
+ function defaultAutosearchValue(option) {
200
+ return [
201
+ option.label,
202
+ option.description,
203
+ option.value
204
+ ].filter(Boolean).join(" ");
205
+ }
206
+ //#endregion
199
207
  export { Autosearch, defaultAutosearchValue };
@@ -1,2 +1,2 @@
1
- import { n as avatarStackVariants, t as AvatarStack } from "../avatar-stack-oVr8tsU7.mjs";
1
+ import { n as avatarStackVariants, t as AvatarStack } from "../avatar-stack-CDhlA1Nm.mjs";
2
2
  export { AvatarStack, avatarStackVariants };
@@ -1,6 +1,6 @@
1
1
  import { t as cn } from "./cn-D2KYQ917.mjs";
2
2
  import { n as AvatarFallback, r as AvatarImage, t as Avatar } from "./avatar-BtKVcvO4.mjs";
3
- import { t as Tooltip } from "./tooltip-Cruvl5F6.mjs";
3
+ import { t as Tooltip } from "./tooltip-a7NTDCWw.mjs";
4
4
  import { cva } from "class-variance-authority";
5
5
  import "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- import { n as CalendarDayButton, t as Calendar } from "../calendar-DEkCw7I1.mjs";
1
+ import { n as CalendarDayButton, t as Calendar } from "../calendar-C-Hbf74r.mjs";
2
2
  export { Calendar, CalendarDayButton };
@@ -69,9 +69,9 @@ function Calendar$1({ className, classNames, showOutsideDays = true, captionLayo
69
69
  week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
70
70
  week_number: cn("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
71
71
  day: cn("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", defaultClassNames.day),
72
- range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
73
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
74
- range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
72
+ range_start: cn("rounded-l-md bg-primary/10", defaultClassNames.range_start),
73
+ range_middle: cn("rounded-none bg-primary/10", defaultClassNames.range_middle),
74
+ range_end: cn("rounded-r-md bg-primary/10", defaultClassNames.range_end),
75
75
  today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
76
76
  outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
77
77
  disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
@@ -103,7 +103,7 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
103
103
  "data-range-start": modifiers.range_start,
104
104
  "data-range-end": modifiers.range_end,
105
105
  "data-range-middle": modifiers.range_middle,
106
- className: cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
106
+ className: cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-transparent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
107
107
  ...props
108
108
  });
109
109
  }