@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.
- package/README.md +10 -0
- package/dist/action-row-DnhBhMtt.mjs +22 -0
- package/dist/app-navigation/index.mjs +2 -2
- package/dist/{app-navigation-84ro28PU.mjs → app-navigation-rSOfo1KV.mjs} +169 -106
- package/dist/autocomplete/index.mjs +1 -1
- package/dist/autocomplete-DdbTQe6u.mjs +141 -0
- package/dist/autosearch/index.mjs +100 -92
- package/dist/avatar-stack/index.mjs +1 -1
- package/dist/{avatar-stack-oVr8tsU7.mjs → avatar-stack-CDhlA1Nm.mjs} +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/{calendar-DEkCw7I1.mjs → calendar-C-Hbf74r.mjs} +4 -4
- package/dist/{calendar-date-picker-CDT-8Ha8.mjs → calendar-date-picker-BaykEs6j.mjs} +324 -240
- package/dist/code-editor/index.mjs +1 -1
- package/dist/components/base/date-picker/index.d.ts +4 -0
- package/dist/components/base/date-picker/index.d.ts.map +1 -0
- package/dist/components/base/date-picker/types.d.ts +7 -0
- package/dist/components/base/date-picker/types.d.ts.map +1 -0
- package/dist/components/base/date-picker/use-date-constraints.d.ts +8 -0
- package/dist/components/base/date-picker/use-date-constraints.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +3 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/base/mobile-sheet/context.d.ts +13 -0
- package/dist/components/base/mobile-sheet/context.d.ts.map +1 -0
- package/dist/components/base/mobile-sheet/index.d.ts +3 -0
- package/dist/components/base/mobile-sheet/index.d.ts.map +1 -0
- package/dist/components/base/mobile-sheet/mobile-sheet.d.ts +14 -0
- package/dist/components/base/mobile-sheet/mobile-sheet.d.ts.map +1 -0
- package/dist/components/base/option-picker/index.d.ts +5 -0
- package/dist/components/base/option-picker/index.d.ts.map +1 -0
- package/dist/components/base/option-picker/option-list.d.ts +3 -0
- package/dist/components/base/option-picker/option-list.d.ts.map +1 -0
- package/dist/components/base/option-picker/types.d.ts +71 -0
- package/dist/components/base/option-picker/types.d.ts.map +1 -0
- package/dist/components/base/option-picker/use-option-picker.d.ts +4 -0
- package/dist/components/base/option-picker/use-option-picker.d.ts.map +1 -0
- package/dist/components/base/responsive-dropdown/index.d.ts +2 -0
- package/dist/components/base/responsive-dropdown/index.d.ts.map +1 -0
- package/dist/components/base/responsive-dropdown/responsive-dropdown.d.ts +25 -0
- package/dist/components/base/responsive-dropdown/responsive-dropdown.d.ts.map +1 -0
- package/dist/components/base/responsive-popover/index.d.ts +2 -0
- package/dist/components/base/responsive-popover/index.d.ts.map +1 -0
- package/dist/components/base/responsive-popover/responsive-popover.d.ts +46 -0
- package/dist/components/base/responsive-popover/responsive-popover.d.ts.map +1 -0
- package/dist/components/base/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/features/app-navigation/app-navigation.d.ts +5 -3
- package/dist/components/features/app-navigation/app-navigation.d.ts.map +1 -1
- package/dist/components/features/autocomplete/autocomplete.d.ts +2 -2
- package/dist/components/features/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/features/autocomplete/autocomplete.types.d.ts +7 -16
- package/dist/components/features/autocomplete/autocomplete.types.d.ts.map +1 -1
- package/dist/components/features/autocomplete/trigger.d.ts +20 -0
- package/dist/components/features/autocomplete/trigger.d.ts.map +1 -0
- package/dist/components/features/autosearch/autosearch.d.ts +1 -1
- package/dist/components/features/autosearch/autosearch.d.ts.map +1 -1
- package/dist/components/features/autosearch/autosearch.types.d.ts +4 -0
- package/dist/components/features/autosearch/autosearch.types.d.ts.map +1 -1
- package/dist/components/features/calendar-date-picker/calendar-date-picker.d.ts +3 -37
- package/dist/components/features/calendar-date-picker/calendar-date-picker.d.ts.map +1 -1
- package/dist/components/features/calendar-date-picker/calendar-header.d.ts +13 -0
- package/dist/components/features/calendar-date-picker/calendar-header.d.ts.map +1 -0
- package/dist/components/features/calendar-date-picker/calendar-presets.d.ts +9 -0
- package/dist/components/features/calendar-date-picker/calendar-presets.d.ts.map +1 -0
- package/dist/components/features/calendar-date-picker/date-trigger.d.ts +24 -0
- package/dist/components/features/calendar-date-picker/date-trigger.d.ts.map +1 -0
- package/dist/components/features/calendar-date-picker/index.d.ts +2 -1
- package/dist/components/features/calendar-date-picker/index.d.ts.map +1 -1
- package/dist/components/features/calendar-date-picker/types.d.ts +42 -0
- package/dist/components/features/calendar-date-picker/types.d.ts.map +1 -0
- package/dist/components/features/calendar-date-picker/use-calendar-date-picker.d.ts +48 -0
- package/dist/components/features/calendar-date-picker/use-calendar-date-picker.d.ts.map +1 -0
- package/dist/components/features/data-table/components/row-actions.d.ts +1 -1
- package/dist/components/features/data-table/components/row-actions.d.ts.map +1 -1
- package/dist/components/features/data-table/filters/checkbox-filter.d.ts +1 -1
- package/dist/components/features/data-table/filters/checkbox-filter.d.ts.map +1 -1
- package/dist/components/features/data-table/filters/select-filter.d.ts +1 -1
- package/dist/components/features/data-table/filters/select-filter.d.ts.map +1 -1
- package/dist/components/features/data-table/types.d.ts +11 -12
- package/dist/components/features/data-table/types.d.ts.map +1 -1
- package/dist/components/features/date-time-picker/date-time-picker.d.ts +1 -1
- package/dist/components/features/date-time-picker/date-time-picker.d.ts.map +1 -1
- package/dist/components/features/date-time-picker/types.d.ts +23 -0
- package/dist/components/features/date-time-picker/types.d.ts.map +1 -1
- package/dist/components/features/form/components/form-combobox.d.ts +7 -44
- package/dist/components/features/form/components/form-combobox.d.ts.map +1 -1
- package/dist/components/features/form/components/form-dialog.d.ts +2 -1
- package/dist/components/features/form/components/form-dialog.d.ts.map +1 -1
- package/dist/components/features/form/components/form-field.d.ts +1 -1
- package/dist/components/features/form/components/form-field.d.ts.map +1 -1
- package/dist/components/features/form/types/index.d.ts +4 -0
- package/dist/components/features/form/types/index.d.ts.map +1 -1
- package/dist/components/features/index.d.ts +2 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/more-actions/action-row.d.ts +9 -0
- package/dist/components/features/more-actions/action-row.d.ts.map +1 -0
- package/dist/components/features/more-actions/index.d.ts +3 -1
- package/dist/components/features/more-actions/index.d.ts.map +1 -1
- package/dist/components/features/more-actions/more-actions.d.ts +8 -14
- package/dist/components/features/more-actions/more-actions.d.ts.map +1 -1
- package/dist/components/features/more-actions/types.d.ts +24 -0
- package/dist/components/features/more-actions/types.d.ts.map +1 -0
- package/dist/components/features/multi-select/index.d.ts +3 -0
- package/dist/components/features/multi-select/index.d.ts.map +1 -0
- package/dist/components/features/multi-select/multi-select.d.ts +147 -0
- package/dist/components/features/multi-select/multi-select.d.ts.map +1 -0
- package/dist/components/features/page-title/page-title.d.ts.map +1 -1
- package/dist/components/features/rich-text-editor/index.d.ts +4 -0
- package/dist/components/features/rich-text-editor/index.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/rich-text-content.d.ts +3 -0
- package/dist/components/features/rich-text-editor/rich-text-content.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.d.ts +28 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/bold-toolbar.d.ts +2 -0
- package/dist/components/features/rich-text-editor/toolbar/bold-toolbar.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/italic-toolbar.d.ts +2 -0
- package/dist/components/features/rich-text-editor/toolbar/italic-toolbar.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/link-toolbar.d.ts +2 -0
- package/dist/components/features/rich-text-editor/toolbar/link-toolbar.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/strike-toolbar.d.ts +2 -0
- package/dist/components/features/rich-text-editor/toolbar/strike-toolbar.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/toolbar-button.d.ts +17 -0
- package/dist/components/features/rich-text-editor/toolbar/toolbar-button.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/toolbar.d.ts +6 -0
- package/dist/components/features/rich-text-editor/toolbar/toolbar.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/toolbar/underline-toolbar.d.ts +2 -0
- package/dist/components/features/rich-text-editor/toolbar/underline-toolbar.d.ts.map +1 -0
- package/dist/components/features/rich-text-editor/types.d.ts +20 -0
- package/dist/components/features/rich-text-editor/types.d.ts.map +1 -0
- package/dist/components/features/tag-input/tag-input.d.ts +12 -1
- package/dist/components/features/tag-input/tag-input.d.ts.map +1 -1
- package/dist/components/features/task-queue/core/task-queue-dropdown.d.ts.map +1 -1
- package/dist/components/features/time-picker/time-picker.d.ts +1 -17
- package/dist/components/features/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/features/time-picker/types.d.ts +20 -18
- package/dist/components/features/time-picker/types.d.ts.map +1 -1
- package/dist/components/features/time-picker/use-time-slots.d.ts +10 -0
- package/dist/components/features/time-picker/use-time-slots.d.ts.map +1 -0
- package/dist/components/features/time-range-picker/components/absolute-range-panel.d.ts.map +1 -1
- package/dist/components/features/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/data-table/index.mjs +60 -175
- package/dist/date-picker/index.mjs +2 -2
- package/dist/date-time-picker/index.mjs +1 -1
- package/dist/{date-time-picker-BomrW07W.mjs → date-time-picker-DKOxrhmc.mjs} +64 -49
- package/dist/dropdown/index.mjs +109 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/empty-content/index.mjs +1 -1
- package/dist/form/adapters/conform/index.mjs +2 -2
- package/dist/form/adapters/rhf/index.mjs +2 -2
- package/dist/form/index.mjs +2 -2
- package/dist/form/stepper/index.mjs +3 -3
- package/dist/{form-B3rQ4CH9.mjs → form-CCNN9VtJ.mjs} +27 -30
- package/dist/grid/index.mjs +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +4 -3
- package/dist/hooks/use-breakpoint.d.ts +9 -0
- package/dist/hooks/use-breakpoint.d.ts.map +1 -0
- package/dist/index.mjs +49 -42
- package/dist/input-number/index.mjs +1 -1
- package/dist/loader-overlay/index.mjs +1 -1
- package/dist/map/index.mjs +1 -1
- package/dist/{map-CWIQ-eql.mjs → map-qo7bY_g_.mjs} +83 -4
- package/dist/mobile-sheet/index.mjs +2 -0
- package/dist/mobile-sheet-BxMvkzAj.mjs +61 -0
- package/dist/more-actions/index.mjs +3 -2
- package/dist/more-actions-Ca5qqd0H.mjs +49 -0
- package/dist/multi-select/index.mjs +2 -0
- package/dist/multi-select-DM_dxnSV.mjs +235 -0
- package/dist/page-title/index.mjs +1 -1
- package/dist/{page-title-ChsnpBiH.mjs → page-title-ChLiv6gB.mjs} +3 -2
- package/dist/popover/index.mjs +1 -1
- package/dist/radio-group/index.mjs +1 -1
- package/dist/responsive-dropdown/index.mjs +2 -0
- package/dist/responsive-dropdown-IFroDgKn.mjs +53 -0
- package/dist/responsive-popover/index.mjs +2 -0
- package/dist/responsive-popover-D-t9bxSN.mjs +61 -0
- package/dist/rich-text-editor/index.mjs +2 -0
- package/dist/rich-text-editor-CQH_U4T5.mjs +293 -0
- package/dist/select/index.mjs +1 -1
- package/dist/sheet/index.mjs +2 -2
- package/dist/{sheet-BzXksqYY.mjs → sheet-LhUgozvg.mjs} +1 -1
- package/dist/sidebar/index.mjs +1 -1
- package/dist/{sidebar-BnhnjvfO.mjs → sidebar-B8LQJiNI.mjs} +3 -3
- package/dist/skeleton/index.mjs +1 -1
- package/dist/{skeleton-D1MUhAVo.mjs → skeleton-D4HOEiOZ.mjs} +1 -1
- package/dist/spinner/index.mjs +1 -1
- package/dist/stepper/index.mjs +1 -1
- package/dist/styles/canela.css +23 -0
- package/dist/styles/fonts/CanelaText-Regular.ttf +0 -0
- package/dist/styles/tokens/figma-tokens.css +4 -0
- package/dist/switch/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tag-input/index.mjs +1 -1
- package/dist/{tag-input-T9cUX9-G.mjs → tag-input-Bf4GMptp.mjs} +29 -14
- package/dist/task-queue/index.mjs +1 -1
- package/dist/{task-queue-dropdown-Wcbj-f0V.mjs → task-queue-dropdown-D-LncEWm.mjs} +39 -39
- package/dist/textarea/index.mjs +1 -1
- package/dist/theme/index.mjs +1 -1
- package/dist/time-picker/index.mjs +1 -1
- package/dist/time-picker-BZF5jbF6.mjs +99 -0
- package/dist/{to-api-format-Bh3c01gr.mjs → to-api-format-CgKcC9SK.mjs} +144 -119
- package/dist/toast/index.mjs +2 -2
- package/dist/{toast-DpxlFNNx.mjs → toast-DDdLgY53.mjs} +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/dist/{tooltip-Cruvl5F6.mjs → tooltip-a7NTDCWw.mjs} +74 -17
- package/dist/transfer/index.mjs +1 -1
- package/dist/{types-BZNk3q65.mjs → types-CKIe2WlV.mjs} +2 -2
- package/dist/typography/index.mjs +1 -1
- package/dist/use-breakpoint-DGcVmB3c.mjs +36 -0
- package/dist/{use-copy-to-clipboard-uNeeVHC4.mjs → use-copy-to-clipboard-D7KyLIAt.mjs} +1 -1
- package/dist/use-date-constraints-R3H4lIoT.mjs +41 -0
- package/dist/use-option-picker-BXQOfyrK.mjs +215 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.mjs +2 -1
- package/dist/utils/timezone.d.ts +19 -0
- package/dist/utils/timezone.d.ts.map +1 -0
- package/dist/utils-BwB1mIdZ.mjs +35 -0
- package/dist/visually-hidden/index.mjs +1 -1
- package/package.json +61 -6
- package/dist/autocomplete-CkYJueBL.mjs +0 -293
- package/dist/combobox/index.mjs +0 -2
- package/dist/combobox-B-C9lJeD.mjs +0 -97
- package/dist/components/features/combobox/combobox.d.ts +0 -27
- package/dist/components/features/combobox/combobox.d.ts.map +0 -1
- package/dist/components/features/combobox/index.d.ts +0 -3
- package/dist/components/features/combobox/index.d.ts.map +0 -1
- package/dist/components/features/combobox/types.d.ts +0 -84
- package/dist/components/features/combobox/types.d.ts.map +0 -1
- package/dist/dropdown-DZiAt-jS.mjs +0 -110
- package/dist/dropdown-menu-lALvDnab.mjs +0 -85
- package/dist/more-actions-ILnEZq_E.mjs +0 -52
- package/dist/time-picker-BoF7pZZ2.mjs +0 -43
- /package/dist/{adapter-context-rWveHhDd.mjs → adapter-context-NyGTDZYq.mjs} +0 -0
- /package/dist/{col-1T0Q3SlH.mjs → col-DISdGlqY.mjs} +0 -0
- /package/dist/{dropzone-ogtpQ4fy.mjs → dropzone-Bt0plEuw.mjs} +0 -0
- /package/dist/{empty-content-C63GPJ5d.mjs → empty-content-CBh5bbtJ.mjs} +0 -0
- /package/dist/{form-context-Ccxm-wqL.mjs → form-context-CeKyvO-A.mjs} +0 -0
- /package/dist/{hooks-D8r2M2U6.mjs → hooks-DQXVwbrs.mjs} +0 -0
- /package/dist/{input-number-a7uydAsw.mjs → input-number-Diu-C6d5.mjs} +0 -0
- /package/dist/{loader-overlay-BTFdkp7W.mjs → loader-overlay-C2WDla6V.mjs} +0 -0
- /package/dist/{map-leaflet-imports-CRSKA79m.mjs → map-leaflet-imports-yWwH4CHB.mjs} +0 -0
- /package/dist/{popover-FJAcbYoH.mjs → popover-JOuXJOZ2.mjs} +0 -0
- /package/dist/{radio-group-CiITR0LO.mjs → radio-group-70UjJBb5.mjs} +0 -0
- /package/dist/{select-CiLR_DiQ.mjs → select-zxwykvQn.mjs} +0 -0
- /package/dist/{sheet-Di3b-oPu.mjs → sheet-DVEToCVY.mjs} +0 -0
- /package/dist/{skeleton-BKl4mfJt.mjs → skeleton-D2xuJdE1.mjs} +0 -0
- /package/dist/{spinner-OyOf9-Yu.mjs → spinner-CgPI3DDi.mjs} +0 -0
- /package/dist/{stepper-DvIOp0hh.mjs → stepper-Beb-zbdL.mjs} +0 -0
- /package/dist/{switch-DQJQhPIQ.mjs → switch-DcSF42Kc.mjs} +0 -0
- /package/dist/{table-Cdsh-39-.mjs → table-DWGT4cqh.mjs} +0 -0
- /package/dist/{textarea-BwD-MmTV.mjs → textarea-BoChBcFz.mjs} +0 -0
- /package/dist/{themes-DG1md8FI.mjs → themes-CAiN4b6G.mjs} +0 -0
- /package/dist/{toast-BWnN5fax.mjs → toast-D5XD7goD.mjs} +0 -0
- /package/dist/{transfer-46C-rFFW.mjs → transfer-CoGPwOc6.mjs} +0 -0
- /package/dist/{typography-ClB8k55E.mjs → typography-TRKP_CLT.mjs} +0 -0
- /package/dist/{use-display-touched-I39aXEBD.mjs → use-display-touched-C-afz17j.mjs} +0 -0
- /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 {
|
|
6
|
-
import { t as Tooltip } from "../tooltip-
|
|
7
|
-
import {
|
|
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,
|
|
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
|
|
60
|
-
|
|
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
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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__ */
|
|
149
|
+
}) : /* @__PURE__ */ jsx(ResponsivePopover, {
|
|
146
150
|
open: open && showResults,
|
|
147
151
|
onOpenChange: setOpen,
|
|
152
|
+
responsive,
|
|
148
153
|
modal,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
}),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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-
|
|
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-
|
|
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";
|
package/dist/calendar/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CalendarDayButton, t as Calendar } from "../calendar-
|
|
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-
|
|
73
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
74
|
-
range_end: cn("rounded-r-md bg-
|
|
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-
|
|
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
|
}
|