@datum-cloud/datum-ui 0.6.0 → 0.7.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/LICENSE +21 -0
- 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-D0EBWUwJ.mjs} +48 -3
- 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 +48 -41
- 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-DRzZDNtB.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/visually-hidden/index.mjs +1 -1
- package/package.json +63 -8
- 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-BkUrNU37.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-8VGszCqj.mjs} +0 -0
- /package/dist/{visuallyhidden-BLUsJpYH.mjs → visuallyhidden-BHOPczmW.mjs} +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Datum Technology, Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -462,3 +462,13 @@ See the [Form README](./src/components/features/form/README.md) for detailed doc
|
|
|
462
462
|
## License
|
|
463
463
|
|
|
464
464
|
MIT
|
|
465
|
+
|
|
466
|
+
## Optional: Canela font
|
|
467
|
+
|
|
468
|
+
Datum-branded surfaces can opt into Canela Text for the `font-title` Tailwind utility:
|
|
469
|
+
|
|
470
|
+
```ts
|
|
471
|
+
import '@datum-cloud/datum-ui/styles/canela'
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Consumers who do not import this file use the default system font stack declared in tokens — no visual degradation.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as cn } from "./cn-D2KYQ917.mjs";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/features/more-actions/action-row.tsx
|
|
4
|
+
function ActionRow({ action, data, onSelect }) {
|
|
5
|
+
const isDisabled = typeof action.disabled === "function" ? action.disabled(data) : action.disabled ?? false;
|
|
6
|
+
const IconComponent = typeof action.icon === "function" ? action.icon : null;
|
|
7
|
+
const iconNode = IconComponent ? /* @__PURE__ */ jsx(IconComponent, { className: "size-4" }) : action.icon;
|
|
8
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
9
|
+
type: "button",
|
|
10
|
+
onClick: (e) => {
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
e.stopPropagation();
|
|
13
|
+
action.onClick(data);
|
|
14
|
+
onSelect();
|
|
15
|
+
},
|
|
16
|
+
disabled: isDisabled,
|
|
17
|
+
className: cn("hover:bg-accent hover:text-accent-foreground flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-left text-xs disabled:pointer-events-none disabled:opacity-50", "[&_svg]:size-4 [&_svg]:shrink-0", action.variant === "destructive" && "text-destructive [&_svg]:!text-destructive hover:!text-destructive hover:[&_svg]:!text-destructive", action.className),
|
|
18
|
+
children: [iconNode, /* @__PURE__ */ jsx("span", { children: action.label })]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ActionRow as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "../sidebar-
|
|
1
|
+
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "../sidebar-B8LQJiNI.mjs";
|
|
2
2
|
import "../sidebar/index.mjs";
|
|
3
|
-
import { n as NavMenu, t as AppNavigation } from "../app-navigation-
|
|
3
|
+
import { n as NavMenu, t as AppNavigation } from "../app-navigation-D0EBWUwJ.mjs";
|
|
4
4
|
export { AppNavigation, NavMenu, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cn } from "./cn-D2KYQ917.mjs";
|
|
2
2
|
import { t as Icon } from "./icon-wrapper-DuLp3RM1.mjs";
|
|
3
3
|
import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "./collapsible-CUphkSBt.mjs";
|
|
4
|
-
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, c as SidebarHeader, d as SidebarMenu, h as SidebarMenuItem, i as SidebarGroup, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, w as useSidebar } from "./sidebar-
|
|
4
|
+
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, c as SidebarHeader, d as SidebarMenu, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, w as useSidebar } from "./sidebar-B8LQJiNI.mjs";
|
|
5
5
|
import { ChevronRight, ExternalLinkIcon } from "lucide-react";
|
|
6
6
|
import { Fragment, useCallback, useEffect, useRef, useState } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -379,7 +379,46 @@ function NavMenu({ ref, className, items, currentPath, linkComponent: LinkComp =
|
|
|
379
379
|
NavMenu.displayName = "NavMenu";
|
|
380
380
|
//#endregion
|
|
381
381
|
//#region src/components/features/app-navigation/app-navigation.tsx
|
|
382
|
-
|
|
382
|
+
/** Skeleton that mirrors the project nav layout: Home, separator, 6 items, separator, Project Settings */
|
|
383
|
+
function NavSkeleton() {
|
|
384
|
+
return /* @__PURE__ */ jsxs("ul", {
|
|
385
|
+
className: "flex h-full w-full min-w-0 flex-col gap-0.5 py-2",
|
|
386
|
+
"data-sidebar": "menu",
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ jsx(SidebarMenu, {
|
|
389
|
+
className: "px-2",
|
|
390
|
+
children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuSkeleton, {
|
|
391
|
+
showIcon: true,
|
|
392
|
+
className: "bg-sidebar-accent/60 h-8 rounded-xl **:data-[sidebar=menu-skeleton-text]:max-w-12"
|
|
393
|
+
}) })
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ jsx(SidebarSeparator, { className: "my-2" }),
|
|
396
|
+
[
|
|
397
|
+
1,
|
|
398
|
+
2,
|
|
399
|
+
3,
|
|
400
|
+
4,
|
|
401
|
+
5,
|
|
402
|
+
6
|
|
403
|
+
].map((i) => /* @__PURE__ */ jsx(SidebarMenu, {
|
|
404
|
+
className: "px-2",
|
|
405
|
+
children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuSkeleton, {
|
|
406
|
+
showIcon: true,
|
|
407
|
+
className: "h-8 rounded-xl"
|
|
408
|
+
}) })
|
|
409
|
+
}, i)),
|
|
410
|
+
/* @__PURE__ */ jsx(SidebarSeparator, { className: "my-2" }),
|
|
411
|
+
/* @__PURE__ */ jsx(SidebarMenu, {
|
|
412
|
+
className: "px-2",
|
|
413
|
+
children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuSkeleton, {
|
|
414
|
+
showIcon: true,
|
|
415
|
+
className: "h-8 rounded-xl [&_[data-sidebar=menu-skeleton-text]]:max-w-28"
|
|
416
|
+
}) })
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function AppNavigation({ navItems, title, closeOnNavigation, defaultOpen, currentPath, linkComponent, loading = false, ...props }) {
|
|
383
422
|
const { setOpen } = useSidebar();
|
|
384
423
|
useEffect(() => {
|
|
385
424
|
if (defaultOpen === false) setOpen(false);
|
|
@@ -394,7 +433,13 @@ function AppNavigation({ navItems, title, closeOnNavigation, defaultOpen, curren
|
|
|
394
433
|
className: "px-4 pt-4 pb-0",
|
|
395
434
|
children: title
|
|
396
435
|
}),
|
|
397
|
-
|
|
436
|
+
loading ? /* @__PURE__ */ jsx(SidebarGroup, {
|
|
437
|
+
className: "mb-2 p-0! px-0",
|
|
438
|
+
children: /* @__PURE__ */ jsx(SidebarGroupContent, {
|
|
439
|
+
className: "flex flex-col gap-0 py-0",
|
|
440
|
+
children: /* @__PURE__ */ jsx(NavSkeleton, {})
|
|
441
|
+
})
|
|
442
|
+
}) : navItems.length > 0 && /* @__PURE__ */ jsx(NavMenu, {
|
|
398
443
|
className: "h-fit py-2",
|
|
399
444
|
items: navItems,
|
|
400
445
|
currentPath,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Autocomplete } from "../autocomplete-
|
|
1
|
+
import { t as Autocomplete } from "../autocomplete-DdbTQe6u.mjs";
|
|
2
2
|
export { Autocomplete };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { t as cn } from "./cn-D2KYQ917.mjs";
|
|
2
|
+
import { t as ResponsivePopover } from "./responsive-popover-D-t9bxSN.mjs";
|
|
3
|
+
import { t as LoaderOverlay } from "./loader-overlay-C2WDla6V.mjs";
|
|
4
|
+
import { n as OptionList, t as useOptionPicker } from "./use-option-picker-BXQOfyrK.mjs";
|
|
5
|
+
import { ChevronDown } from "lucide-react";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/features/autocomplete/trigger.tsx
|
|
9
|
+
function Trigger({ ref, selectedOption, renderValue, placeholder, loading, disabled, open, id, className, ...rest }) {
|
|
10
|
+
let displayContent;
|
|
11
|
+
if (!selectedOption) displayContent = /* @__PURE__ */ jsx("span", {
|
|
12
|
+
className: "text-muted-foreground",
|
|
13
|
+
children: placeholder
|
|
14
|
+
});
|
|
15
|
+
else if (renderValue) displayContent = renderValue(selectedOption);
|
|
16
|
+
else displayContent = /* @__PURE__ */ jsx("span", {
|
|
17
|
+
className: "truncate",
|
|
18
|
+
children: selectedOption.label
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
21
|
+
ref,
|
|
22
|
+
type: "button",
|
|
23
|
+
id,
|
|
24
|
+
role: "combobox",
|
|
25
|
+
"aria-expanded": open,
|
|
26
|
+
disabled: disabled || loading,
|
|
27
|
+
className: cn("text-input-foreground placeholder:text-input-placeholder", "border-input-border bg-input-background/50 relative flex h-10 w-full items-center justify-between rounded-lg border px-3 py-2 text-left text-sm transition-all", "focus-visible:border-input-focus-border focus-visible:shadow-(--input-focus-shadow)", "focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-hidden", "aria-invalid:border-destructive", (disabled || loading) && "cursor-not-allowed opacity-50", className),
|
|
28
|
+
...rest,
|
|
29
|
+
children: [
|
|
30
|
+
loading && /* @__PURE__ */ jsx(LoaderOverlay, {}),
|
|
31
|
+
/* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: "min-w-0 flex-1",
|
|
33
|
+
children: displayContent
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "text-muted-foreground ml-2 size-4 shrink-0" })
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
Trigger.displayName = "AutocompleteTrigger";
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/features/autocomplete/autocomplete.tsx
|
|
42
|
+
/**
|
|
43
|
+
* Autocomplete - A searchable select component
|
|
44
|
+
*
|
|
45
|
+
* Standalone, form-agnostic combobox built on ResponsivePopover + OptionList engine.
|
|
46
|
+
* Supports flat/grouped options, virtualization, custom rendering, and async search.
|
|
47
|
+
*
|
|
48
|
+
* @example Basic usage
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Autocomplete
|
|
51
|
+
* value={country}
|
|
52
|
+
* onValueChange={setCountry}
|
|
53
|
+
* options={countries}
|
|
54
|
+
* placeholder="Select country..."
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example Async search
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <Autocomplete
|
|
61
|
+
* value={userId}
|
|
62
|
+
* onValueChange={setUserId}
|
|
63
|
+
* options={users ?? []}
|
|
64
|
+
* onSearchChange={setSearch}
|
|
65
|
+
* loading={isLoading}
|
|
66
|
+
* placeholder="Search users..."
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
function Autocomplete({ options, value, onValueChange, onSearchChange, searchPlaceholder = "Search...", disableSearch = false, renderOption, renderValue, placeholder = "Select...", emptyContent = "No results found", footer, creatable = false, creatableLabel, virtualize = false, itemSize = 36, loading = false, modal = false, responsive = true, sheetTitle, disabled = false, name, id, className, triggerClassName, contentClassName, listClassName }) {
|
|
71
|
+
const [open, setOpen] = React$1.useState(false);
|
|
72
|
+
const picker = useOptionPicker({
|
|
73
|
+
multiple: false,
|
|
74
|
+
options,
|
|
75
|
+
value,
|
|
76
|
+
onValueChange,
|
|
77
|
+
onSearchChange,
|
|
78
|
+
creatable,
|
|
79
|
+
creatableLabel,
|
|
80
|
+
closeOnSelect: true,
|
|
81
|
+
open,
|
|
82
|
+
onOpenChange: setOpen
|
|
83
|
+
});
|
|
84
|
+
const flatOptions = React$1.useMemo(() => {
|
|
85
|
+
if (Array.isArray(options) && options.length > 0 && "options" in options[0]) return options.flatMap((g) => g.options);
|
|
86
|
+
return options;
|
|
87
|
+
}, [options]);
|
|
88
|
+
const displayOption = React$1.useMemo(() => {
|
|
89
|
+
const found = flatOptions.find((o) => o.value === value);
|
|
90
|
+
if (found) return found;
|
|
91
|
+
if (creatable && value) return {
|
|
92
|
+
value,
|
|
93
|
+
label: value
|
|
94
|
+
};
|
|
95
|
+
}, [
|
|
96
|
+
flatOptions,
|
|
97
|
+
value,
|
|
98
|
+
creatable
|
|
99
|
+
]);
|
|
100
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
101
|
+
className: cn("relative", className),
|
|
102
|
+
children: [/* @__PURE__ */ jsx(ResponsivePopover, {
|
|
103
|
+
open,
|
|
104
|
+
onOpenChange: setOpen,
|
|
105
|
+
modal,
|
|
106
|
+
responsive,
|
|
107
|
+
sheetTitle: sheetTitle ?? placeholder ?? "Search",
|
|
108
|
+
contentClassName: cn("popover-content-width-full", contentClassName),
|
|
109
|
+
align: "start",
|
|
110
|
+
trigger: /* @__PURE__ */ jsx(Trigger, {
|
|
111
|
+
selectedOption: displayOption,
|
|
112
|
+
renderValue,
|
|
113
|
+
placeholder,
|
|
114
|
+
loading,
|
|
115
|
+
disabled,
|
|
116
|
+
open,
|
|
117
|
+
id,
|
|
118
|
+
className: triggerClassName
|
|
119
|
+
}),
|
|
120
|
+
children: /* @__PURE__ */ jsx(OptionList, {
|
|
121
|
+
picker,
|
|
122
|
+
searchPlaceholder,
|
|
123
|
+
disableSearch,
|
|
124
|
+
emptyContent,
|
|
125
|
+
renderOption,
|
|
126
|
+
footer,
|
|
127
|
+
loading,
|
|
128
|
+
virtualize,
|
|
129
|
+
itemSize,
|
|
130
|
+
listClassName
|
|
131
|
+
})
|
|
132
|
+
}), name && /* @__PURE__ */ jsx("input", {
|
|
133
|
+
type: "hidden",
|
|
134
|
+
name,
|
|
135
|
+
value: value ?? ""
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
Autocomplete.displayName = "Autocomplete";
|
|
140
|
+
//#endregion
|
|
141
|
+
export { Autocomplete as t };
|
|
@@ -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
|
}
|