@datum-cloud/datum-ui 0.5.0 → 0.6.0-alpha.a9a8815

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 (154) hide show
  1. package/README.md +78 -40
  2. package/dist/adapter-context-rWveHhDd.mjs +25 -0
  3. package/dist/combobox/index.mjs +2 -0
  4. package/dist/combobox-cKTFK4uN.mjs +96 -0
  5. package/dist/components/features/combobox/combobox.d.ts +27 -0
  6. package/dist/components/features/combobox/combobox.d.ts.map +1 -0
  7. package/dist/components/features/combobox/index.d.ts +3 -0
  8. package/dist/components/features/combobox/index.d.ts.map +1 -0
  9. package/dist/components/features/combobox/types.d.ts +78 -0
  10. package/dist/components/features/combobox/types.d.ts.map +1 -0
  11. package/dist/components/features/date-time-picker/date-time-picker.d.ts +9 -0
  12. package/dist/components/features/date-time-picker/date-time-picker.d.ts.map +1 -0
  13. package/dist/components/features/date-time-picker/index.d.ts +3 -0
  14. package/dist/components/features/date-time-picker/index.d.ts.map +1 -0
  15. package/dist/components/features/date-time-picker/types.d.ts +53 -0
  16. package/dist/components/features/date-time-picker/types.d.ts.map +1 -0
  17. package/dist/components/features/date-time-picker/utils/format.d.ts +13 -0
  18. package/dist/components/features/date-time-picker/utils/format.d.ts.map +1 -0
  19. package/dist/components/features/date-time-picker/utils/index.d.ts +3 -0
  20. package/dist/components/features/date-time-picker/utils/index.d.ts.map +1 -0
  21. package/dist/components/features/date-time-picker/utils/timezone.d.ts +23 -0
  22. package/dist/components/features/date-time-picker/utils/timezone.d.ts.map +1 -0
  23. package/dist/components/features/form/adapter-context.d.ts +17 -0
  24. package/dist/components/features/form/adapter-context.d.ts.map +1 -0
  25. package/dist/components/features/form/adapter-types.d.ts +120 -0
  26. package/dist/components/features/form/adapter-types.d.ts.map +1 -0
  27. package/dist/components/features/form/adapters/conform/conform-adapter.d.ts +9 -0
  28. package/dist/components/features/form/adapters/conform/conform-adapter.d.ts.map +1 -0
  29. package/dist/components/features/form/adapters/conform/conform-provider.d.ts +22 -0
  30. package/dist/components/features/form/adapters/conform/conform-provider.d.ts.map +1 -0
  31. package/dist/components/features/form/adapters/conform/index.d.ts +3 -0
  32. package/dist/components/features/form/adapters/conform/index.d.ts.map +1 -0
  33. package/dist/components/features/form/adapters/rhf/index.d.ts +3 -0
  34. package/dist/components/features/form/adapters/rhf/index.d.ts.map +1 -0
  35. package/dist/components/features/form/adapters/rhf/rhf-adapter.d.ts +10 -0
  36. package/dist/components/features/form/adapters/rhf/rhf-adapter.d.ts.map +1 -0
  37. package/dist/components/features/form/adapters/rhf/rhf-provider.d.ts +22 -0
  38. package/dist/components/features/form/adapters/rhf/rhf-provider.d.ts.map +1 -0
  39. package/dist/components/features/form/components/form-autocomplete.d.ts.map +1 -1
  40. package/dist/components/features/form/components/form-autosearch.d.ts +25 -0
  41. package/dist/components/features/form/components/form-autosearch.d.ts.map +1 -0
  42. package/dist/components/features/form/components/form-checkbox.d.ts.map +1 -1
  43. package/dist/components/features/form/components/form-combobox.d.ts +76 -0
  44. package/dist/components/features/form/components/form-combobox.d.ts.map +1 -0
  45. package/dist/components/features/form/components/form-copy-box.d.ts.map +1 -1
  46. package/dist/components/features/form/components/form-custom.d.ts.map +1 -1
  47. package/dist/components/features/form/components/form-date-picker.d.ts +38 -0
  48. package/dist/components/features/form/components/form-date-picker.d.ts.map +1 -0
  49. package/dist/components/features/form/components/form-date-time-picker.d.ts +37 -0
  50. package/dist/components/features/form/components/form-date-time-picker.d.ts.map +1 -0
  51. package/dist/components/features/form/components/form-field-array.d.ts +5 -17
  52. package/dist/components/features/form/components/form-field-array.d.ts.map +1 -1
  53. package/dist/components/features/form/components/form-field.d.ts +7 -21
  54. package/dist/components/features/form/components/form-field.d.ts.map +1 -1
  55. package/dist/components/features/form/components/form-input-group.d.ts +4 -4
  56. package/dist/components/features/form/components/form-input-group.d.ts.map +1 -1
  57. package/dist/components/features/form/components/form-input.d.ts.map +1 -1
  58. package/dist/components/features/form/components/form-radio-group.d.ts.map +1 -1
  59. package/dist/components/features/form/components/form-root.d.ts +5 -25
  60. package/dist/components/features/form/components/form-root.d.ts.map +1 -1
  61. package/dist/components/features/form/components/form-select.d.ts.map +1 -1
  62. package/dist/components/features/form/components/form-switch.d.ts.map +1 -1
  63. package/dist/components/features/form/components/form-textarea.d.ts.map +1 -1
  64. package/dist/components/features/form/components/form-time-picker.d.ts +21 -0
  65. package/dist/components/features/form/components/form-time-picker.d.ts.map +1 -0
  66. package/dist/components/features/form/components/form-transfer.d.ts +37 -0
  67. package/dist/components/features/form/components/form-transfer.d.ts.map +1 -0
  68. package/dist/components/features/form/components/index.d.ts +6 -1
  69. package/dist/components/features/form/components/index.d.ts.map +1 -1
  70. package/dist/components/features/form/components/stepper/form-stepper.d.ts.map +1 -1
  71. package/dist/components/features/form/context/form-context.d.ts +2 -2
  72. package/dist/components/features/form/context/form-context.d.ts.map +1 -1
  73. package/dist/components/features/form/hooks/index.d.ts +1 -1
  74. package/dist/components/features/form/hooks/index.d.ts.map +1 -1
  75. package/dist/components/features/form/hooks/use-field.d.ts +12 -18
  76. package/dist/components/features/form/hooks/use-field.d.ts.map +1 -1
  77. package/dist/components/features/form/hooks/use-form-state.d.ts +36 -0
  78. package/dist/components/features/form/hooks/use-form-state.d.ts.map +1 -0
  79. package/dist/components/features/form/hooks/use-watch.d.ts +9 -20
  80. package/dist/components/features/form/hooks/use-watch.d.ts.map +1 -1
  81. package/dist/components/features/form/index.d.ts +69 -44
  82. package/dist/components/features/form/index.d.ts.map +1 -1
  83. package/dist/components/features/form/stepper/index.d.ts +17 -0
  84. package/dist/components/features/form/stepper/index.d.ts.map +1 -0
  85. package/dist/components/features/form/types/index.d.ts +68 -32
  86. package/dist/components/features/form/types/index.d.ts.map +1 -1
  87. package/dist/components/features/form/utils/get-field-constraints.d.ts +43 -0
  88. package/dist/components/features/form/utils/get-field-constraints.d.ts.map +1 -0
  89. package/dist/components/features/form/utils/get-schema-defaults.d.ts +24 -0
  90. package/dist/components/features/form/utils/get-schema-defaults.d.ts.map +1 -0
  91. package/dist/components/features/time-picker/index.d.ts +3 -0
  92. package/dist/components/features/time-picker/index.d.ts.map +1 -0
  93. package/dist/components/features/time-picker/time-picker.d.ts +22 -0
  94. package/dist/components/features/time-picker/time-picker.d.ts.map +1 -0
  95. package/dist/components/features/time-picker/types.d.ts +31 -0
  96. package/dist/components/features/time-picker/types.d.ts.map +1 -0
  97. package/dist/components/features/transfer/components/index.d.ts +9 -0
  98. package/dist/components/features/transfer/components/index.d.ts.map +1 -0
  99. package/dist/components/features/transfer/components/transfer-group.d.ts +7 -0
  100. package/dist/components/features/transfer/components/transfer-group.d.ts.map +1 -0
  101. package/dist/components/features/transfer/components/transfer-item.d.ts +10 -0
  102. package/dist/components/features/transfer/components/transfer-item.d.ts.map +1 -0
  103. package/dist/components/features/transfer/components/transfer-panel.d.ts +18 -0
  104. package/dist/components/features/transfer/components/transfer-panel.d.ts.map +1 -0
  105. package/dist/components/features/transfer/components/transfer-search.d.ts +9 -0
  106. package/dist/components/features/transfer/components/transfer-search.d.ts.map +1 -0
  107. package/dist/components/features/transfer/hooks/use-transfer-dnd.d.ts +26 -0
  108. package/dist/components/features/transfer/hooks/use-transfer-dnd.d.ts.map +1 -0
  109. package/dist/components/features/transfer/hooks/use-transfer-state.d.ts +20 -0
  110. package/dist/components/features/transfer/hooks/use-transfer-state.d.ts.map +1 -0
  111. package/dist/components/features/transfer/index.d.ts +3 -0
  112. package/dist/components/features/transfer/index.d.ts.map +1 -0
  113. package/dist/components/features/transfer/transfer.d.ts +6 -0
  114. package/dist/components/features/transfer/transfer.d.ts.map +1 -0
  115. package/dist/components/features/transfer/types.d.ts +69 -0
  116. package/dist/components/features/transfer/types.d.ts.map +1 -0
  117. package/dist/date-picker/index.mjs +1 -1
  118. package/dist/date-time-picker/index.mjs +2 -0
  119. package/dist/date-time-picker-Bx_n4nEJ.mjs +177 -0
  120. package/dist/form/adapters/conform/index.mjs +326 -0
  121. package/dist/form/adapters/rhf/index.mjs +275 -0
  122. package/dist/form/index.mjs +3 -2
  123. package/dist/form/stepper/index.mjs +542 -0
  124. package/dist/form-context-Ccxm-wqL.mjs +17 -0
  125. package/dist/form-zf5QOnAk.mjs +1611 -0
  126. package/dist/get-field-constraints-CxfZ753o.mjs +49 -0
  127. package/dist/grid/index.mjs +1 -1
  128. package/dist/hooks/index.mjs +2 -2
  129. package/dist/index.mjs +14 -13
  130. package/dist/input-number/index.mjs +1 -1
  131. package/dist/map/index.mjs +1 -1
  132. package/dist/{map-ClxB41Hg.mjs → map-CWIQ-eql.mjs} +1 -1
  133. package/dist/more-actions/index.mjs +1 -1
  134. package/dist/page-title/index.mjs +1 -1
  135. package/dist/stepper/index.mjs +1 -320
  136. package/dist/stepper-DvIOp0hh.mjs +321 -0
  137. package/dist/tag-input/index.mjs +1 -1
  138. package/dist/task-queue/index.mjs +1 -1
  139. package/dist/time-picker/index.mjs +2 -0
  140. package/dist/time-picker-BoF7pZZ2.mjs +43 -0
  141. package/dist/transfer/index.mjs +2 -0
  142. package/dist/transfer-C55XfEXy.mjs +243 -0
  143. package/package.json +58 -2
  144. package/dist/form-Co3fM4B7.mjs +0 -2114
  145. /package/dist/{col-q-J99UHe.mjs → col-1T0Q3SlH.mjs} +0 -0
  146. /package/dist/{hooks-Cb7YlxN4.mjs → hooks-D8r2M2U6.mjs} +0 -0
  147. /package/dist/{input-number-mDB-5M5C.mjs → input-number-a7uydAsw.mjs} +0 -0
  148. /package/dist/{map-leaflet-imports-CaMm_rdF.mjs → map-leaflet-imports-CRSKA79m.mjs} +0 -0
  149. /package/dist/{more-actions-CGagbIDT.mjs → more-actions-ILnEZq_E.mjs} +0 -0
  150. /package/dist/{page-title-R7QbfbWp.mjs → page-title-ChsnpBiH.mjs} +0 -0
  151. /package/dist/{tag-input-BVSwNcRd.mjs → tag-input-T9cUX9-G.mjs} +0 -0
  152. /package/dist/{task-queue-dropdown-DyM5R8KF.mjs → task-queue-dropdown-Wcbj-f0V.mjs} +0 -0
  153. /package/dist/{to-api-format-BnbRFYQI.mjs → to-api-format-Bh3c01gr.mjs} +0 -0
  154. /package/dist/{use-copy-to-clipboard-BGdTmkFV.mjs → use-copy-to-clipboard-uNeeVHC4.mjs} +0 -0
package/README.md CHANGED
@@ -88,7 +88,7 @@ Some components with shared heavy dependencies are grouped under a single subpat
88
88
  | `@datum-cloud/datum-ui/map` | `Map`, `PlaceAutocomplete`, + map controls | `leaflet`, `react-leaflet`, + leaflet plugins |
89
89
  | `@datum-cloud/datum-ui/dropzone` | `Dropzone`, `FileInputButton` | `react-dropzone` |
90
90
  | `@datum-cloud/datum-ui/chart` | `ChartContainer`, `ChartTooltip`, etc. | `recharts` |
91
- | `@datum-cloud/datum-ui/form` | `Form`, `FormField`, `FormInput`, etc. | `@conform-to/react`, `@conform-to/zod`, `zod` |
91
+ | `@datum-cloud/datum-ui/form` | `Form`, `FormField`, `FormInput`, etc. | See [Form Adapters](#form-adapters) below |
92
92
 
93
93
  ## Components
94
94
 
@@ -136,31 +136,34 @@ Thin wrappers around shadcn/Radix primitives with Datum styling. **Radix UI depe
136
136
 
137
137
  Complex, fully-customized components with significant business logic.
138
138
 
139
- | Component | Additional Dependencies | Description |
140
- | -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------------------------------ |
141
- | `Autocomplete` | — | Search autocomplete input |
142
- | `AvatarStack` | — | Stacked avatar display |
143
- | `CalendarDatePicker` | `react-day-picker`, `date-fns` | Date/range picker with presets |
144
- | `CodeEditor`, `CodeEditorTabs` | `@monaco-editor/react`, `monaco-editor` | Monaco-based code editor with VS Code UX |
145
- | `DataTable`, `DataTableColumnHeader`, `DataTablePagination`, `DataTableToolbar`, `DataTableViewOptions` | `@tanstack/react-table` | Advanced data table with sorting/filtering |
146
- | `Dropdown`, `DropdownHeader`, `DropdownItem`, `DropdownSection` | | Dropdown menu |
147
- | `Dropzone` | `react-dropzone` | File drag-and-drop upload area |
148
- | `EmptyContent` | — | Empty state placeholder |
149
- | `FileInputButton` | | File upload button |
150
- | `Form`, `FormField`, `FormInput`, `FormTextarea`, `FormSelect`, `FormCheckbox`, `FormSwitch`, `FormRadioGroup`, `FormFieldArray` | `@conform-to/react`, `@conform-to/zod`, `zod` | Form system with validation |
151
- | `Grid` | `@tanstack/react-virtual` | Virtualized data grid |
152
- | `InputNumber` | `react-number-format` | Numeric input with formatting |
153
- | `InputWithAddons` | | Input with prefix/suffix addons |
154
- | `LoaderOverlay` | | Full-screen loading overlay |
155
- | `MoreActions` | — | Three-dot actions menu |
156
- | `NProgress` | `nprogress` | Page navigation progress bar |
157
- | `PageTitle` | — | Page header with breadcrumbs |
158
- | `Sidebar`, `SidebarHeader`, `SidebarContent`, `SidebarFooter`, `SidebarMenu`, `SidebarMenuItem`, `SidebarMenuButton` | — | App sidebar navigation |
159
- | `Stepper` | `@stepperize/react` | Multi-step wizard |
160
- | `TagInput` | — | Tag/chip input |
161
- | `TaskQueue`, `TaskQueueProvider`, `TaskQueueDropdown`, `TaskPanelHeader`, `TaskSummaryDialog` | — | Background task queue with progress UI |
162
- | `TimeRangePicker` | `date-fns`, `date-fns-tz` | Time range selector with timezone support |
163
- | `Toast`, `Toaster`, `useToast` | `sonner` | Toast notifications |
139
+ | Component | Additional Dependencies | Description |
140
+ | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | ------------------------------------------ |
141
+ | `Autocomplete` | — | Search autocomplete input |
142
+ | `AvatarStack` | — | Stacked avatar display |
143
+ | `CalendarDatePicker` | `react-day-picker`, `date-fns` | Date/range picker with presets |
144
+ | `Combobox` | | Searchable single-select dropdown |
145
+ | `CodeEditor`, `CodeEditorTabs` | `@monaco-editor/react`, `monaco-editor` | Monaco-based code editor with VS Code UX |
146
+ | `DataTable`, `DataTableColumnHeader`, `DataTablePagination`, `DataTableToolbar`, `DataTableViewOptions` | `@tanstack/react-table` | Advanced data table with sorting/filtering |
147
+ | `DateTimePicker`, `TimePicker` | `date-fns`, `date-fns-tz` | Date/time picker with timezone support |
148
+ | `Dropdown`, `DropdownHeader`, `DropdownItem`, `DropdownSection` | — | Dropdown menu |
149
+ | `Dropzone` | `react-dropzone` | File drag-and-drop upload area |
150
+ | `EmptyContent` | | Empty state placeholder |
151
+ | `FileInputButton` | | File upload button |
152
+ | `Form`, `FormField`, `FormInput`, `FormTextarea`, `FormSelect`, `FormCheckbox`, `FormSwitch`, `FormRadioGroup`, `FormFieldArray` | See [Form Adapters](#form-adapters) below | Form system with pluggable adapter support |
153
+ | `Grid` | `@tanstack/react-virtual` | Virtualized data grid |
154
+ | `InputNumber` | `react-number-format` | Numeric input with formatting |
155
+ | `InputWithAddons` | — | Input with prefix/suffix addons |
156
+ | `LoaderOverlay` | | Full-screen loading overlay |
157
+ | `MoreActions` | — | Three-dot actions menu |
158
+ | `NProgress` | `nprogress` | Page navigation progress bar |
159
+ | `PageTitle` | | Page header with breadcrumbs |
160
+ | `Sidebar`, `SidebarHeader`, `SidebarContent`, `SidebarFooter`, `SidebarMenu`, `SidebarMenuItem`, `SidebarMenuButton` | — | App sidebar navigation |
161
+ | `Stepper` | `@stepperize/react` | Multi-step wizard |
162
+ | `TagInput` | | Tag/chip input |
163
+ | `TaskQueue`, `TaskQueueProvider`, `TaskQueueDropdown`, `TaskPanelHeader`, `TaskSummaryDialog` | — | Background task queue with progress UI |
164
+ | `TimeRangePicker` | `date-fns`, `date-fns-tz` | Time range selector with timezone support |
165
+ | `Transfer` | — | Dual-panel item selector with search |
166
+ | `Toast`, `Toaster`, `useToast` | `sonner` | Toast notifications |
164
167
 
165
168
  ## Usage Examples
166
169
 
@@ -212,26 +215,45 @@ import { Title, Text, Paragraph, Code } from '@datum-cloud/datum-ui/typography'
212
215
 
213
216
  ### Form with Validation
214
217
 
218
+ The form system uses a pluggable adapter pattern. Wrap your app with an adapter, then use `Form.*` components as usual:
219
+
215
220
  ```tsx
216
- import { Form, FormField, FormInput, FormSelect } from '@datum-cloud/datum-ui/form'
221
+ import { Form } from '@datum-cloud/datum-ui/form'
222
+ import { ConformAdapter } from '@datum-cloud/datum-ui/form/adapters/conform'
223
+ // or: import { RHFAdapter } from '@datum-cloud/datum-ui/form/adapters/rhf'
217
224
  import { z } from 'zod'
218
225
 
219
226
  const schema = z.object({
220
- name: z.string().min(1),
227
+ name: z.string().min(1, 'Name is required'),
221
228
  role: z.enum(['admin', 'user']),
222
229
  })
223
230
 
224
- <Form schema={schema} onSubmit={handleSubmit}>
225
- <FormField name="name">
226
- <FormInput label="Name" />
227
- </FormField>
228
- <FormField name="role">
229
- <FormSelect label="Role" options={[
230
- { label: 'Admin', value: 'admin' },
231
- { label: 'User', value: 'user' },
232
- ]} />
233
- </FormField>
234
- </Form>
231
+ // Wrap your app once with an adapter
232
+ function App() {
233
+ return (
234
+ <ConformAdapter>
235
+ <MyForm />
236
+ </ConformAdapter>
237
+ )
238
+ }
239
+
240
+ // Form code is identical regardless of adapter
241
+ function MyForm() {
242
+ return (
243
+ <Form.Root schema={schema} onSubmit={handleSubmit}>
244
+ <Form.Field name="name" label="Name" required>
245
+ <Form.Input />
246
+ </Form.Field>
247
+ <Form.Field name="role" label="Role" required>
248
+ <Form.Select placeholder="Select a role">
249
+ <Form.SelectItem value="admin">Admin</Form.SelectItem>
250
+ <Form.SelectItem value="user">User</Form.SelectItem>
251
+ </Form.Select>
252
+ </Form.Field>
253
+ <Form.Submit>Save</Form.Submit>
254
+ </Form.Root>
255
+ )
256
+ }
235
257
  ```
236
258
 
237
259
  ### Map
@@ -364,9 +386,12 @@ Many components require additional packages. Install only what you use:
364
386
  > Replace `npm install` with `yarn add`, `pnpm add`, or `bun add` for your package manager.
365
387
 
366
388
  ```bash
367
- # Forms (Form, FormField, FormInput, etc.)
389
+ # Forms Conform adapter
368
390
  npm install @conform-to/react @conform-to/zod zod
369
391
 
392
+ # Forms — React Hook Form adapter (alternative)
393
+ npm install react-hook-form @hookform/resolvers zod
394
+
370
395
  # Maps (Map, MapMarker, MapPopup, etc.)
371
396
  npm install leaflet react-leaflet leaflet-draw leaflet.fullscreen leaflet.markercluster react-leaflet-markercluster
372
397
 
@@ -407,6 +432,19 @@ npm install nuqs
407
432
  npm install motion
408
433
  ```
409
434
 
435
+ ## Form Adapters
436
+
437
+ The form system supports pluggable adapters. Choose one and wrap your app:
438
+
439
+ | Adapter | Import Path | Dependencies |
440
+ | ------------------- | --------------------------------------------- | -------------------------------------------------------------------- |
441
+ | **Conform.js** | `@datum-cloud/datum-ui/form/adapters/conform` | `@conform-to/react`, `@conform-to/zod`, `zod` (>=4) |
442
+ | **React Hook Form** | `@datum-cloud/datum-ui/form/adapters/rhf` | `react-hook-form` (>=7.55), `@hookform/resolvers` (>=5), `zod` (>=4) |
443
+
444
+ The `Form.*` component API is identical with either adapter. Switch adapters by changing only the root provider -- no form code changes needed.
445
+
446
+ See the [Form README](./src/components/features/form/README.md) for detailed documentation.
447
+
410
448
  ## Tech Stack
411
449
 
412
450
  - **React 19** with server component support
@@ -0,0 +1,25 @@
1
+ import * as React$1 from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/features/form/adapter-context.tsx
4
+ const AdapterContext = React$1.createContext(null);
5
+ /**
6
+ * Read the current form adapter from context.
7
+ * Throws with a helpful error if no adapter is found.
8
+ */
9
+ function useAdapter() {
10
+ const adapter = React$1.use(AdapterContext);
11
+ if (!adapter) throw new Error("No form adapter found. Wrap your application with an adapter provider:\n\n import { ConformAdapter } from '@datum-cloud/datum-ui/form/adapters/conform'\n // or\n import { RHFAdapter } from '@datum-cloud/datum-ui/form/adapters/rhf'\n\n <ConformAdapter>\n <App />\n </ConformAdapter>");
12
+ return adapter;
13
+ }
14
+ /**
15
+ * Internal provider used by adapter packages (ConformAdapter, RHFAdapter).
16
+ * Consumers don't use this directly.
17
+ */
18
+ function FormAdapterProvider({ adapter, children }) {
19
+ return /* @__PURE__ */ jsx(AdapterContext, {
20
+ value: adapter,
21
+ children
22
+ });
23
+ }
24
+ //#endregion
25
+ export { useAdapter as n, FormAdapterProvider as t };
@@ -0,0 +1,2 @@
1
+ import { t as Combobox } from "../combobox-cKTFK4uN.mjs";
2
+ export { Combobox };
@@ -0,0 +1,96 @@
1
+ import { t as cn } from "./cn-D2KYQ917.mjs";
2
+ import { a as CommandInput, i as CommandGroup, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "./command-DqHWukGK.mjs";
3
+ import { i as PopoverTrigger, r as PopoverContent, t as Popover } from "./popover-FJAcbYoH.mjs";
4
+ import { CheckIcon, ChevronDown, X } from "lucide-react";
5
+ import * as React$1 from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/features/combobox/combobox.tsx
8
+ /**
9
+ * Combobox - Single-select dropdown with search
10
+ *
11
+ * A simpler alternative to Autocomplete for basic select scenarios.
12
+ * Supports grouped options and search filtering.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const options = [
17
+ * { value: '1', label: 'Option 1' },
18
+ * { value: '2', label: 'Option 2' },
19
+ * ]
20
+ *
21
+ * <Combobox
22
+ * options={options}
23
+ * value={value}
24
+ * onChange={setValue}
25
+ * placeholder="Select an option"
26
+ * />
27
+ * ```
28
+ */
29
+ function Combobox({ options, value, onChange, placeholder = "Select option...", searchPlaceholder = "Search...", emptyMessage = "No options found.", disabled = false, className, triggerClassName, contentClassName, searchable = true, showDropdownArrow = true, clearable = false, id, "data-testid": testId }) {
30
+ const [open, setOpen] = React$1.useState(false);
31
+ const isGrouped = options.length > 0 && "options" in options[0];
32
+ const selectedOption = React$1.useMemo(() => {
33
+ if (isGrouped) return options.flatMap((group) => group.options);
34
+ return options;
35
+ }, [options, isGrouped]).find((opt) => opt.value === value);
36
+ const handleSelect = React$1.useCallback((selectedValue) => {
37
+ onChange?.(selectedValue === value ? void 0 : selectedValue);
38
+ setOpen(false);
39
+ }, [value, onChange]);
40
+ const handleClear = React$1.useCallback((e) => {
41
+ e.stopPropagation();
42
+ onChange?.(void 0);
43
+ }, [onChange]);
44
+ return /* @__PURE__ */ jsxs(Popover, {
45
+ open,
46
+ onOpenChange: setOpen,
47
+ children: [/* @__PURE__ */ jsx(PopoverTrigger, {
48
+ asChild: true,
49
+ children: /* @__PURE__ */ jsxs("button", {
50
+ type: "button",
51
+ role: "combobox",
52
+ "aria-expanded": open,
53
+ disabled,
54
+ id,
55
+ "data-testid": testId,
56
+ className: cn("flex h-10 w-full items-center justify-between rounded-lg 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", triggerClassName, className),
57
+ children: [/* @__PURE__ */ jsx("span", {
58
+ className: "truncate",
59
+ children: selectedOption ? selectedOption.label : placeholder
60
+ }), /* @__PURE__ */ jsxs("div", {
61
+ className: "ml-2 flex shrink-0 items-center gap-1",
62
+ children: [clearable && selectedOption && !disabled && /* @__PURE__ */ jsx(X, {
63
+ className: "size-4 opacity-50 hover:opacity-100",
64
+ onClick: handleClear
65
+ }), showDropdownArrow && /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 opacity-50" })]
66
+ })]
67
+ })
68
+ }), /* @__PURE__ */ jsx(PopoverContent, {
69
+ className: cn("w-[--radix-popover-trigger-width] p-0", contentClassName),
70
+ align: "start",
71
+ children: /* @__PURE__ */ jsxs(Command, { children: [searchable && /* @__PURE__ */ jsx(CommandInput, {
72
+ placeholder: searchPlaceholder,
73
+ className: "h-9"
74
+ }), /* @__PURE__ */ jsxs(CommandList, {
75
+ className: "max-h-[300px]",
76
+ children: [/* @__PURE__ */ jsx(CommandEmpty, { children: emptyMessage }), isGrouped ? options.map((group) => /* @__PURE__ */ jsx(CommandGroup, {
77
+ heading: group.label,
78
+ children: group.options.map((option) => /* @__PURE__ */ jsxs(CommandItem, {
79
+ value: option.value,
80
+ disabled: option.disabled,
81
+ onSelect: handleSelect,
82
+ children: [option.label, /* @__PURE__ */ jsx(CheckIcon, { className: cn("ml-auto size-4", value === option.value ? "opacity-100" : "opacity-0") })]
83
+ }, option.value))
84
+ }, group.label)) : /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(CommandItem, {
85
+ value: option.value,
86
+ disabled: option.disabled,
87
+ onSelect: handleSelect,
88
+ children: [option.label, /* @__PURE__ */ jsx(CheckIcon, { className: cn("ml-auto size-4", value === option.value ? "opacity-100" : "opacity-0") })]
89
+ }, option.value)) })]
90
+ })] })
91
+ })]
92
+ });
93
+ }
94
+ Combobox.displayName = "Combobox";
95
+ //#endregion
96
+ export { Combobox as t };
@@ -0,0 +1,27 @@
1
+ import type { ComboboxProps } from './types';
2
+ /**
3
+ * Combobox - Single-select dropdown with search
4
+ *
5
+ * A simpler alternative to Autocomplete for basic select scenarios.
6
+ * Supports grouped options and search filtering.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * const options = [
11
+ * { value: '1', label: 'Option 1' },
12
+ * { value: '2', label: 'Option 2' },
13
+ * ]
14
+ *
15
+ * <Combobox
16
+ * options={options}
17
+ * value={value}
18
+ * onChange={setValue}
19
+ * placeholder="Select an option"
20
+ * />
21
+ * ```
22
+ */
23
+ export declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, emptyMessage, disabled, className, triggerClassName, contentClassName, searchable, showDropdownArrow, clearable, id, 'data-testid': testId, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare namespace Combobox {
25
+ var displayName: string;
26
+ }
27
+ //# sourceMappingURL=combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/features/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiC,aAAa,EAAE,MAAM,SAAS,CAAA;AAc3E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAgC,EAChC,iBAA+B,EAC/B,YAAkC,EAClC,QAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,UAAiB,EACjB,iBAAwB,EACxB,SAAiB,EACjB,EAAE,EACF,aAAa,EAAE,MAAM,GACtB,EAAE,aAAa,2CAgIf;yBAhJe,QAAQ"}
@@ -0,0 +1,3 @@
1
+ export { Combobox } from './combobox';
2
+ export type { ComboboxGroup, ComboboxOption, ComboboxProps } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,78 @@
1
+ export interface ComboboxOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ }
6
+ export interface ComboboxGroup {
7
+ label: string;
8
+ options: ComboboxOption[];
9
+ }
10
+ export interface ComboboxProps {
11
+ /**
12
+ * Available options (flat or grouped)
13
+ */
14
+ 'options': ComboboxOption[] | ComboboxGroup[];
15
+ /**
16
+ * Selected value
17
+ */
18
+ 'value'?: string;
19
+ /**
20
+ * Called when selection changes
21
+ */
22
+ 'onChange'?: (value: string | undefined) => void;
23
+ /**
24
+ * Placeholder for trigger button
25
+ * @default "Select option..."
26
+ */
27
+ 'placeholder'?: string;
28
+ /**
29
+ * Placeholder for search input
30
+ * @default "Search..."
31
+ */
32
+ 'searchPlaceholder'?: string;
33
+ /**
34
+ * Message shown when no options match
35
+ * @default "No options found."
36
+ */
37
+ 'emptyMessage'?: string;
38
+ /**
39
+ * Disable the combobox
40
+ */
41
+ 'disabled'?: boolean;
42
+ /**
43
+ * Additional CSS classes for container
44
+ */
45
+ 'className'?: string;
46
+ /**
47
+ * Additional CSS classes for trigger button
48
+ */
49
+ 'triggerClassName'?: string;
50
+ /**
51
+ * Additional CSS classes for popover content
52
+ */
53
+ 'contentClassName'?: string;
54
+ /**
55
+ * Enable search functionality
56
+ * @default true
57
+ */
58
+ 'searchable'?: boolean;
59
+ /**
60
+ * Show dropdown arrow icon
61
+ * @default true
62
+ */
63
+ 'showDropdownArrow'?: boolean;
64
+ /**
65
+ * Allow clearing the selection
66
+ * @default false
67
+ */
68
+ 'clearable'?: boolean;
69
+ /**
70
+ * ID for the combobox
71
+ */
72
+ 'id'?: string;
73
+ /**
74
+ * Test ID
75
+ */
76
+ 'data-testid'?: string;
77
+ }
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/features/combobox/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE,CAAA;IAE7C;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAA;IAEhD;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,9 @@
1
+ import type { DateTimePickerProps } from './types';
2
+ import * as React from 'react';
3
+ export declare function DateTimePicker({ ref, value, onChange, minDate, maxDate, disabledDates, timezone, showTimezoneIndicator, placeholder, disabled, className }: DateTimePickerProps & {
4
+ ref?: React.RefObject<HTMLDivElement | null>;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare namespace DateTimePicker {
7
+ var displayName: string;
8
+ }
9
+ //# sourceMappingURL=date-time-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/features/date-time-picker/date-time-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,SAAS,CAAA;AAIjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAA2B,EAAE,qBAA6B,EAAE,WAAoC,EAAE,QAAgB,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAAE,2CAkH9R;yBAlHe,cAAc"}
@@ -0,0 +1,3 @@
1
+ export { DateTimePicker } from './date-time-picker';
2
+ export type { DateTimePickerProps, DateTimeState } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/date-time-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,53 @@
1
+ export interface DateTimePickerProps {
2
+ /**
3
+ * Current value (UTC ISO string)
4
+ * @example "2024-01-15T14:30:00Z"
5
+ */
6
+ value?: string;
7
+ /**
8
+ * Called when value changes
9
+ */
10
+ onChange?: (value: string) => void;
11
+ /**
12
+ * Minimum selectable date
13
+ */
14
+ minDate?: Date;
15
+ /**
16
+ * Maximum selectable date
17
+ */
18
+ maxDate?: Date;
19
+ /**
20
+ * Dates that should be disabled
21
+ */
22
+ disabledDates?: Date[] | ((date: Date) => boolean);
23
+ /**
24
+ * Timezone for display (defaults to browser timezone)
25
+ * @example "America/New_York"
26
+ */
27
+ timezone?: string;
28
+ /**
29
+ * Show timezone indicator below input
30
+ * @default false
31
+ */
32
+ showTimezoneIndicator?: boolean;
33
+ /**
34
+ * Input placeholder text
35
+ */
36
+ placeholder?: string;
37
+ /**
38
+ * Disable the input
39
+ */
40
+ disabled?: boolean;
41
+ /**
42
+ * Additional CSS class
43
+ */
44
+ className?: string;
45
+ }
46
+ /**
47
+ * Internal state for date + time selection
48
+ */
49
+ export interface DateTimeState {
50
+ date: Date | undefined;
51
+ time: string;
52
+ }
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/features/date-time-picker/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAElC;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAA;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAA;IAEd;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAA;IAElD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAE/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACb"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Format date for display
3
+ */
4
+ export declare function formatDate(date: Date | undefined): string;
5
+ /**
6
+ * Format time for display
7
+ */
8
+ export declare function formatTime(time: string): string;
9
+ /**
10
+ * Format full date-time for display
11
+ */
12
+ export declare function formatDateTime(date: Date | undefined, time: string): string;
13
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/date-time-picker/utils/format.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,CAIzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI3E"}
@@ -0,0 +1,3 @@
1
+ export * from './format';
2
+ export * from './timezone';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/date-time-picker/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Get the browser's timezone
3
+ */
4
+ export declare function getBrowserTimezone(): string;
5
+ /**
6
+ * Convert local date + time to UTC ISO string
7
+ * @param date - Date object (date part)
8
+ * @param time - Time string in HH:mm format
9
+ * @param timezone - IANA timezone (e.g., "America/New_York")
10
+ * @returns UTC ISO string
11
+ */
12
+ export declare function localDateTimeToUtc(date: Date, time: string, timezone: string): string;
13
+ /**
14
+ * Convert UTC ISO string to local date + time
15
+ * @param utcString - UTC ISO string
16
+ * @param timezone - IANA timezone
17
+ * @returns Object with date and time (HH:mm)
18
+ */
19
+ export declare function utcToLocalDateTime(utcString: string, timezone: string): {
20
+ date: Date;
21
+ time: string;
22
+ };
23
+ //# sourceMappingURL=timezone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timezone.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/date-time-picker/utils/timezone.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAwBR;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA4B9B"}
@@ -0,0 +1,17 @@
1
+ import type { FormAdapter } from './adapter-types';
2
+ import * as React from 'react';
3
+ /**
4
+ * Read the current form adapter from context.
5
+ * Throws with a helpful error if no adapter is found.
6
+ */
7
+ export declare function useAdapter(): FormAdapter;
8
+ export interface FormAdapterProviderProps {
9
+ adapter: FormAdapter;
10
+ children: React.ReactNode;
11
+ }
12
+ /**
13
+ * Internal provider used by adapter packages (ConformAdapter, RHFAdapter).
14
+ * Consumers don't use this directly.
15
+ */
16
+ export declare function FormAdapterProvider({ adapter, children }: FormAdapterProviderProps): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=adapter-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-context.d.ts","sourceRoot":"","sources":["../../../../src/components/features/form/adapter-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;GAGG;AACH,wBAAgB,UAAU,IAAI,WAAW,CAgBxC;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CAElF"}