@inkeep/cxkit-primitives 0.5.38 → 0.5.40

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./providers/attachment-item-provider.cjs"),v=require("./providers/attachments-bar-provider.cjs"),l=require("./providers/base-events-provider.cjs"),t=require("./providers/chat-events-provider.cjs"),s=require("./providers/chat-form-provider.cjs"),n=require("./providers/config-provider.cjs"),i=require("./providers/conversation-provider.cjs"),P=require("./providers/feedback-item-provider.cjs"),h=require("./providers/feedback-provider.cjs"),I=require("./providers/form-field-provider.cjs"),a=require("./providers/help-menu-provider.cjs"),C=require("./providers/markdown-provider.cjs"),p=require("./providers/message-attachments-provider.cjs"),d=require("./providers/message-provider.cjs"),A=require("./providers/root-provider.cjs"),g=require("./providers/source-item-provider.cjs"),w=require("./providers/theme-provider.cjs"),S=require("./providers/user-provider.cjs"),q=require("./providers/widget-provider.cjs"),F=require("./components/factory.cjs"),R=require("./components/embedded-chat.cjs"),M=require("./components/embedded-chat/chat-provider.cjs"),E=require("./components/embedded-search.cjs"),u=require("./components/embedded-search/search-provider.cjs"),f=require("./components/modal.cjs"),b=require("./components/modal/modal-provider.cjs"),y=require("./components/intelligent-form.cjs"),c=require("./components/intelligent-form/intelligent-form-provider.cjs"),T=require("./components/chat-button.cjs"),W=require("./components/searchbar.cjs"),U=require("./hooks/use-boolean.cjs"),k=require("./hooks/use-browser-storage.cjs"),H=require("./hooks/use-component-classnames.cjs"),z=require("./hooks/use-container-size.cjs"),O=require("./hooks/use-copy-to-clipboard.cjs"),x=require("./hooks/use-instant-update.cjs"),Q=require("./hooks/use-is-mounted.cjs"),D=require("./hooks/use-media-query.cjs"),_=require("./hooks/use-resize-observer.cjs"),j=require("./hooks/use-scrolling-fades.cjs"),J=require("./hooks/use-settle-action.cjs"),K=require("./hooks/use-scroll-to-bottom.cjs"),r=require("./utils/misc.cjs"),e=require("./utils/component-ids.cjs"),B=require("./utils/compose-refs.cjs"),N=require("./atoms/portal.cjs"),Y=require("./atoms/icons/custom-icon.cjs"),G=require("./atoms/icons/built-in-icon-renderer.cjs"),L=require("./atoms/portal-with-theme.cjs"),o=require("./atoms/shadow/context.cjs");exports.AttachmentItemProvider=m.AttachmentItemProvider;exports.useAttachmentItem=m.useAttachmentItem;exports.AttachmentsBarProvider=v.AttachmentsBarProvider;exports.useAttachmentsBar=v.useAttachmentsBar;exports.BaseEventsProvider=l.BaseEventsProvider;exports.useBaseEvents=l.useBaseEvents;exports.ChatEventsProvider=t.ChatEventsProvider;exports.ChatEventsProviderWithBase=t.ChatEventsProviderWithBase;exports.useChatEvents=t.useChatEvents;exports.ChatFormProvider=s.ChatFormProvider;exports.useChatForm=s.useChatForm;exports.useChatFormState=s.useChatFormState;exports.InkeepConfigProvider=n.InkeepConfigProvider;exports.WebWidgetInteractionType=n.WebWidgetInteractionType;exports.useInkeepConfig=n.useInkeepConfig;exports.InkeepConversationProvider=i.InkeepConversationProvider;exports.SHARE_QUERY_PARAM=i.SHARE_QUERY_PARAM;exports.useInkeepConversation=i.useInkeepConversation;exports.FeedbackItemProvider=P.FeedbackItemProvider;exports.useFeedbackItem=P.useFeedbackItem;exports.FeedbackProvider=h.FeedbackProvider;exports.useMessageFeedback=h.useMessageFeedback;exports.FormFieldProvider=I.FormFieldProvider;exports.useFormField=I.useFormField;exports.HelpMenuProvider=a.HelpMenuProvider;exports.useHelpMenu=a.useHelpMenu;exports.useHelpMenuState=a.useHelpMenuState;exports.ChatMarkdownProvider=C.ChatMarkdownProvider;exports.useChatMarkdown=C.useChatMarkdown;exports.MessageAttachmentsProvider=p.MessageAttachmentsProvider;exports.useMessageAttachments=p.useMessageAttachments;exports.MessageProvider=d.MessageProvider;exports.useMessage=d.useMessage;exports.useOptionalMessage=d.useOptionalMessage;exports.RootProvider=A.RootProvider;exports.SourceItemProvider=g.SourceItemProvider;exports.useSourceItem=g.useSourceItem;exports.ThemeProvider=w.ThemeProvider;exports.UserProvider=S.UserProvider;exports.useUser=S.useUser;exports.WidgetProvider=q.WidgetProvider;exports.useWidget=q.useWidget;exports.ikp=F.ikp;exports.jsxFactory=F.jsxFactory;exports.EmbeddedChatPrimitive=R;exports.ChatProvider=M.ChatProvider;exports.useChat=M.useChat;exports.EmbeddedSearchPrimitive=E;exports.SearchProvider=u.SearchProvider;exports.SearchProviderImpl=u.SearchProviderImpl;exports.useSearch=u.useSearch;exports.ModalPrimitive=f;exports.ModalProvider=b.ModalProvider;exports.useModal=b.useModal;exports.IntelligentFormPrimitive=y;exports.IntelligentFormProvider=c.IntelligentFormProvider;exports.IntelligentFormProviderImpl=c.IntelligentFormProviderImpl;exports.useIntelligentForm=c.useIntelligentForm;exports.ChatButtonPrimitive=T;exports.SearchBarPrimitive=W;exports.useBoolean=U.useBoolean;exports.passesBrowserStorageChecks=k.passesBrowserStorageChecks;exports.useBrowserStorage=k.useBrowserStorage;exports.useComponentClassNames=H.useComponentClassNames;exports.useContainerSize=z.useContainerSize;exports.useCopyToClipboard=O.useCopyToClipboard;exports.useInstantUpdate=x.useInstantUpdate;exports.useIsMounted=Q.useIsMounted;exports.useMediaQuery=D.useMediaQuery;exports.useResizeObserver=_.useResizeObserver;exports.useScrollingFades=j.useScrollingFades;exports.useSettleAction=J.useSettleAction;exports.useScrollToBottom=K.useScrollToBottom;exports.callAll=r.callAll;exports.dataAttr=r.dataAttr;exports.getInitials=r.getInitials;exports.getMessageContent=r.getMessageContent;exports.isString=r.isString;exports.maybeRender=r.maybeRender;exports.parseIfJson=r.parseIfJson;exports.toKebabCase=r.toKebabCase;exports.SearchBarComponentIds=e.SearchBarComponentIds;exports.aiChatComponentIds=e.aiChatComponentIds;exports.aiSearchComponentIds=e.aiSearchComponentIds;exports.chatButtonComponentIds=e.chatButtonComponentIds;exports.componentIDs=e.componentIDs;exports.intelligentFormComponentIds=e.intelligentFormComponentIds;exports.markDownComponentIds=e.markDownComponentIds;exports.miscellanousComponentIds=e.miscellanousComponentIds;exports.modalComponentIds=e.modalComponentIds;exports.composeRefs=B.composeRefs;exports.useComposedRefs=B.useComposedRefs;exports.Portal=N.Portal;exports.CustomIcon=Y.CustomIcon;exports.BuiltInIconRenderer=G.BuiltInIconRenderer;exports.PortalWithTheme=L.PortalWithTheme;exports.InkeepShadow=o.InkeepShadow;exports.InkeepShadowProvider=o.InkeepShadowProvider;exports.ShadowContext=o.ShadowContext;exports.useShadow=o.useShadow;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./providers/attachment-item-provider.cjs"),v=require("./providers/attachments-bar-provider.cjs"),C=require("./providers/base-events-provider.cjs"),s=require("./providers/chat-events-provider.cjs"),n=require("./providers/chat-form-provider.cjs"),i=require("./providers/config-provider.cjs"),a=require("./providers/conversation-provider.cjs"),P=require("./providers/feedback-item-provider.cjs"),h=require("./providers/feedback-provider.cjs"),I=require("./providers/form-field-provider.cjs"),d=require("./providers/help-menu-provider.cjs"),p=require("./providers/markdown-provider.cjs"),g=require("./providers/message-attachments-provider.cjs"),u=require("./providers/message-provider.cjs"),R=require("./providers/root-provider.cjs"),S=require("./providers/source-item-provider.cjs"),w=require("./providers/theme-provider.cjs"),q=require("./providers/user-provider.cjs"),F=require("./providers/widget-provider.cjs"),M=require("./components/factory.cjs"),E=require("./components/embedded-chat.cjs"),b=require("./components/embedded-chat/chat-provider.cjs"),f=require("./components/embedded-search.cjs"),m=require("./components/embedded-search/search-provider.cjs"),y=require("./components/modal.cjs"),k=require("./components/modal/modal-provider.cjs"),T=require("./components/intelligent-form.cjs"),c=require("./components/intelligent-form/intelligent-form-provider.cjs"),W=require("./components/chat-button.cjs"),U=require("./components/searchbar.cjs"),H=require("./hooks/use-boolean.cjs"),B=require("./hooks/use-browser-storage.cjs"),x=require("./hooks/use-component-classnames.cjs"),z=require("./hooks/use-container-size.cjs"),D=require("./hooks/use-copy-to-clipboard.cjs"),O=require("./hooks/use-instant-update.cjs"),Q=require("./hooks/use-is-mounted.cjs"),L=require("./hooks/use-media-query.cjs"),_=require("./hooks/use-resize-observer.cjs"),j=require("./hooks/use-scrolling-fades.cjs"),J=require("./hooks/use-settle-action.cjs"),K=require("./hooks/use-scroll-to-bottom.cjs"),o=require("./utils/misc.cjs"),r=require("./utils/component-ids.cjs"),A=require("./utils/compose-refs.cjs"),N=require("./atoms/portal.cjs"),Y=require("./atoms/icons/custom-icon.cjs"),G=require("./atoms/icons/built-in-icon-renderer.cjs"),V=require("./atoms/portal-with-theme.cjs"),e=require("./atoms/cmdk/index.cjs"),t=require("./atoms/shadow/context.cjs");exports.AttachmentItemProvider=l.AttachmentItemProvider;exports.useAttachmentItem=l.useAttachmentItem;exports.AttachmentsBarProvider=v.AttachmentsBarProvider;exports.useAttachmentsBar=v.useAttachmentsBar;exports.BaseEventsProvider=C.BaseEventsProvider;exports.useBaseEvents=C.useBaseEvents;exports.ChatEventsProvider=s.ChatEventsProvider;exports.ChatEventsProviderWithBase=s.ChatEventsProviderWithBase;exports.useChatEvents=s.useChatEvents;exports.ChatFormProvider=n.ChatFormProvider;exports.useChatForm=n.useChatForm;exports.useChatFormState=n.useChatFormState;exports.InkeepConfigProvider=i.InkeepConfigProvider;exports.WebWidgetInteractionType=i.WebWidgetInteractionType;exports.useInkeepConfig=i.useInkeepConfig;exports.InkeepConversationProvider=a.InkeepConversationProvider;exports.SHARE_QUERY_PARAM=a.SHARE_QUERY_PARAM;exports.useInkeepConversation=a.useInkeepConversation;exports.FeedbackItemProvider=P.FeedbackItemProvider;exports.useFeedbackItem=P.useFeedbackItem;exports.FeedbackProvider=h.FeedbackProvider;exports.useMessageFeedback=h.useMessageFeedback;exports.FormFieldProvider=I.FormFieldProvider;exports.useFormField=I.useFormField;exports.HelpMenuProvider=d.HelpMenuProvider;exports.useHelpMenu=d.useHelpMenu;exports.useHelpMenuState=d.useHelpMenuState;exports.ChatMarkdownProvider=p.ChatMarkdownProvider;exports.useChatMarkdown=p.useChatMarkdown;exports.MessageAttachmentsProvider=g.MessageAttachmentsProvider;exports.useMessageAttachments=g.useMessageAttachments;exports.MessageProvider=u.MessageProvider;exports.useMessage=u.useMessage;exports.useOptionalMessage=u.useOptionalMessage;exports.RootProvider=R.RootProvider;exports.SourceItemProvider=S.SourceItemProvider;exports.useSourceItem=S.useSourceItem;exports.ThemeProvider=w.ThemeProvider;exports.UserProvider=q.UserProvider;exports.useUser=q.useUser;exports.WidgetProvider=F.WidgetProvider;exports.useWidget=F.useWidget;exports.ikp=M.ikp;exports.jsxFactory=M.jsxFactory;exports.EmbeddedChatPrimitive=E;exports.ChatProvider=b.ChatProvider;exports.useChat=b.useChat;exports.EmbeddedSearchPrimitive=f;exports.SearchProvider=m.SearchProvider;exports.SearchProviderImpl=m.SearchProviderImpl;exports.useSearch=m.useSearch;exports.ModalPrimitive=y;exports.ModalProvider=k.ModalProvider;exports.useModal=k.useModal;exports.IntelligentFormPrimitive=T;exports.IntelligentFormProvider=c.IntelligentFormProvider;exports.IntelligentFormProviderImpl=c.IntelligentFormProviderImpl;exports.useIntelligentForm=c.useIntelligentForm;exports.ChatButtonPrimitive=W;exports.SearchBarPrimitive=U;exports.useBoolean=H.useBoolean;exports.passesBrowserStorageChecks=B.passesBrowserStorageChecks;exports.useBrowserStorage=B.useBrowserStorage;exports.useComponentClassNames=x.useComponentClassNames;exports.useContainerSize=z.useContainerSize;exports.useCopyToClipboard=D.useCopyToClipboard;exports.useInstantUpdate=O.useInstantUpdate;exports.useIsMounted=Q.useIsMounted;exports.useMediaQuery=L.useMediaQuery;exports.useResizeObserver=_.useResizeObserver;exports.useScrollingFades=j.useScrollingFades;exports.useSettleAction=J.useSettleAction;exports.useScrollToBottom=K.useScrollToBottom;exports.callAll=o.callAll;exports.dataAttr=o.dataAttr;exports.getInitials=o.getInitials;exports.getMessageContent=o.getMessageContent;exports.isString=o.isString;exports.maybeRender=o.maybeRender;exports.parseIfJson=o.parseIfJson;exports.toKebabCase=o.toKebabCase;exports.SearchBarComponentIds=r.SearchBarComponentIds;exports.aiChatComponentIds=r.aiChatComponentIds;exports.aiSearchComponentIds=r.aiSearchComponentIds;exports.chatButtonComponentIds=r.chatButtonComponentIds;exports.componentIDs=r.componentIDs;exports.intelligentFormComponentIds=r.intelligentFormComponentIds;exports.markDownComponentIds=r.markDownComponentIds;exports.miscellanousComponentIds=r.miscellanousComponentIds;exports.modalComponentIds=r.modalComponentIds;exports.composeRefs=A.composeRefs;exports.useComposedRefs=A.useComposedRefs;exports.Portal=N.Portal;exports.CustomIcon=Y.CustomIcon;exports.BuiltInIconRenderer=G.BuiltInIconRenderer;exports.PortalWithTheme=V.PortalWithTheme;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandLoading=e.CommandLoading;exports.CommandRoot=e.CommandRoot;exports.CommandSeparator=e.CommandSeparator;exports.defaultFilter=e.defaultFilter;exports.useCommandState=e.useCommandState;exports.useCommandStore=e.useCommandStore;exports.InkeepShadow=t.InkeepShadow;exports.InkeepShadowProvider=t.InkeepShadowProvider;exports.ShadowContext=t.ShadowContext;exports.useShadow=t.useShadow;
package/dist/index.d.cts CHANGED
@@ -55,6 +55,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
55
55
  import { Portal as Portal_2 } from '@radix-ui/react-portal';
56
56
  import { Primitive } from '@radix-ui/react-primitive';
57
57
  import { PropsWithChildren } from 'react';
58
+ import * as RadixDialog from '@radix-ui/react-dialog';
58
59
  import * as React_2 from 'react';
59
60
  import { ReactElement } from 'react';
60
61
  import { ReactNode } from 'react';
@@ -429,6 +430,10 @@ export declare interface ChatProviderProps extends Pick<EmbeddedChatProviderProp
429
430
  children: React.ReactNode;
430
431
  }
431
432
 
433
+ declare type Children = {
434
+ children?: React_2.ReactNode;
435
+ };
436
+
432
437
  declare const Close: React_2.ForwardRefExoticComponent<DialogCloseProps & React_2.RefAttributes<HTMLButtonElement>>;
433
438
 
434
439
  declare interface CodeProps {
@@ -441,6 +446,438 @@ declare interface CodeProps {
441
446
  onCopy?: (language: string, code: string) => void;
442
447
  }
443
448
 
449
+ export declare const Command: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
450
+ asChild?: boolean;
451
+ }, "ref"> & {
452
+ /**
453
+ * Accessible label for this command menu. Not shown visibly.
454
+ */
455
+ label?: string;
456
+ /**
457
+ * Optionally set to `false` to turn off the automatic filtering and sorting.
458
+ * If `false`, you must conditionally render valid items based on the search query yourself.
459
+ */
460
+ shouldFilter?: boolean;
461
+ /**
462
+ * Custom filter function for whether each command menu item should matches the given search query.
463
+ * It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely.
464
+ * By default, uses the `command-score` library.
465
+ */
466
+ filter?: (value: string, search: string, keywords?: string[]) => number;
467
+ /**
468
+ * Optional default item value when it is initially rendered.
469
+ */
470
+ defaultValue?: string;
471
+ /**
472
+ * Optional default query when it is initially rendered.
473
+ */
474
+ defaultSearch?: string;
475
+ /**
476
+ * Optional controlled state of the selected command menu item.
477
+ */
478
+ value?: string;
479
+ /**
480
+ * Event handler called when the selected item of the menu changes.
481
+ */
482
+ onValueChange?: (value: string) => void;
483
+ /**
484
+ * Optionally set to `true` to turn on looping around when using the arrow keys.
485
+ */
486
+ loop?: boolean;
487
+ /**
488
+ * Optionally set to `true` to disable selection via pointer events.
489
+ */
490
+ disablePointerSelection?: boolean;
491
+ /**
492
+ * Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.
493
+ */
494
+ vimBindings?: boolean;
495
+ } & React_2.RefAttributes<HTMLDivElement>> & {
496
+ List: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
497
+ asChild?: boolean;
498
+ }, "ref"> & {
499
+ /**
500
+ * Accessible label for this List of suggestions. Not shown visibly.
501
+ */
502
+ label?: string;
503
+ } & React_2.RefAttributes<HTMLDivElement>>;
504
+ Item: React_2.ForwardRefExoticComponent<Children & Omit<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
505
+ asChild?: boolean;
506
+ }, "ref">, "value" | "disabled" | "onSelect"> & {
507
+ /** Whether this item is currently disabled. */
508
+ disabled?: boolean;
509
+ /** Event handler for when this item is selected, either via click or keyboard selection. */
510
+ onSelect?: (details: {
511
+ value: string;
512
+ trigger: "click" | "keyboard";
513
+ }) => void;
514
+ /**
515
+ * A unique value for this item.
516
+ * If no value is provided, it will be inferred from `children` or the rendered `textContent`. If your `textContent` changes between renders, you _must_ provide a stable, unique `value`.
517
+ */
518
+ value?: string;
519
+ /** Optional keywords to match against when filtering. */
520
+ keywords?: string[];
521
+ /** Whether this item is forcibly rendered regardless of filtering. */
522
+ forceMount?: boolean;
523
+ } & React_2.RefAttributes<HTMLDivElement>>;
524
+ Input: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.ClassAttributes<HTMLInputElement> & React_2.InputHTMLAttributes<HTMLInputElement> & {
525
+ asChild?: boolean;
526
+ }, "ref">, "value" | "type" | "onChange"> & {
527
+ /**
528
+ * Optional controlled state for the value of the search input.
529
+ */
530
+ value?: string;
531
+ /**
532
+ * Event handler called when the search value changes.
533
+ */
534
+ onValueChange?: (search: string) => void;
535
+ } & React_2.RefAttributes<HTMLInputElement>>;
536
+ Group: React_2.ForwardRefExoticComponent<Children & Omit<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
537
+ asChild?: boolean;
538
+ }, "ref">, "value" | "heading"> & {
539
+ /** Optional heading to render for this group. */
540
+ heading?: React_2.ReactNode;
541
+ /** If no heading is provided, you must provide a value that is unique for this group. */
542
+ value?: string;
543
+ /** Whether this group is forcibly rendered regardless of filtering. */
544
+ forceMount?: boolean;
545
+ } & React_2.RefAttributes<HTMLDivElement>>;
546
+ Separator: React_2.ForwardRefExoticComponent<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
547
+ asChild?: boolean;
548
+ }, "ref"> & {
549
+ /** Whether this separator should always be rendered. Useful if you disable automatic filtering. */
550
+ alwaysRender?: boolean;
551
+ } & React_2.RefAttributes<HTMLDivElement>>;
552
+ Dialog: React_2.ForwardRefExoticComponent<RadixDialog.DialogProps & Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
553
+ asChild?: boolean;
554
+ }, "ref"> & {
555
+ /**
556
+ * Accessible label for this command menu. Not shown visibly.
557
+ */
558
+ label?: string;
559
+ /**
560
+ * Optionally set to `false` to turn off the automatic filtering and sorting.
561
+ * If `false`, you must conditionally render valid items based on the search query yourself.
562
+ */
563
+ shouldFilter?: boolean;
564
+ /**
565
+ * Custom filter function for whether each command menu item should matches the given search query.
566
+ * It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely.
567
+ * By default, uses the `command-score` library.
568
+ */
569
+ filter?: (value: string, search: string, keywords?: string[]) => number;
570
+ /**
571
+ * Optional default item value when it is initially rendered.
572
+ */
573
+ defaultValue?: string;
574
+ /**
575
+ * Optional default query when it is initially rendered.
576
+ */
577
+ defaultSearch?: string;
578
+ /**
579
+ * Optional controlled state of the selected command menu item.
580
+ */
581
+ value?: string;
582
+ /**
583
+ * Event handler called when the selected item of the menu changes.
584
+ */
585
+ onValueChange?: (value: string) => void;
586
+ /**
587
+ * Optionally set to `true` to turn on looping around when using the arrow keys.
588
+ */
589
+ loop?: boolean;
590
+ /**
591
+ * Optionally set to `true` to disable selection via pointer events.
592
+ */
593
+ disablePointerSelection?: boolean;
594
+ /**
595
+ * Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.
596
+ */
597
+ vimBindings?: boolean;
598
+ } & {
599
+ /** Provide a className to the Dialog overlay. */
600
+ overlayClassName?: string;
601
+ /** Provide a className to the Dialog content. */
602
+ contentClassName?: string;
603
+ /** Provide a custom element the Dialog should portal into. */
604
+ container?: HTMLElement;
605
+ } & React_2.RefAttributes<HTMLDivElement>>;
606
+ Empty: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
607
+ asChild?: boolean;
608
+ }, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
609
+ Loading: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
610
+ asChild?: boolean;
611
+ }, "ref"> & {
612
+ /** Estimated progress of loading asynchronous options. */
613
+ progress?: number;
614
+ /**
615
+ * Accessible label for this loading progressbar. Not shown visibly.
616
+ */
617
+ label?: string;
618
+ } & React_2.RefAttributes<HTMLDivElement>>;
619
+ };
620
+
621
+ /**
622
+ * Renders the command menu in a Radix Dialog.
623
+ */
624
+ export declare const CommandDialog: React_2.ForwardRefExoticComponent<RadixDialog.DialogProps & Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
625
+ asChild?: boolean;
626
+ }, "ref"> & {
627
+ /**
628
+ * Accessible label for this command menu. Not shown visibly.
629
+ */
630
+ label?: string;
631
+ /**
632
+ * Optionally set to `false` to turn off the automatic filtering and sorting.
633
+ * If `false`, you must conditionally render valid items based on the search query yourself.
634
+ */
635
+ shouldFilter?: boolean;
636
+ /**
637
+ * Custom filter function for whether each command menu item should matches the given search query.
638
+ * It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely.
639
+ * By default, uses the `command-score` library.
640
+ */
641
+ filter?: (value: string, search: string, keywords?: string[]) => number;
642
+ /**
643
+ * Optional default item value when it is initially rendered.
644
+ */
645
+ defaultValue?: string;
646
+ /**
647
+ * Optional default query when it is initially rendered.
648
+ */
649
+ defaultSearch?: string;
650
+ /**
651
+ * Optional controlled state of the selected command menu item.
652
+ */
653
+ value?: string;
654
+ /**
655
+ * Event handler called when the selected item of the menu changes.
656
+ */
657
+ onValueChange?: (value: string) => void;
658
+ /**
659
+ * Optionally set to `true` to turn on looping around when using the arrow keys.
660
+ */
661
+ loop?: boolean;
662
+ /**
663
+ * Optionally set to `true` to disable selection via pointer events.
664
+ */
665
+ disablePointerSelection?: boolean;
666
+ /**
667
+ * Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.
668
+ */
669
+ vimBindings?: boolean;
670
+ } & {
671
+ /** Provide a className to the Dialog overlay. */
672
+ overlayClassName?: string;
673
+ /** Provide a className to the Dialog content. */
674
+ contentClassName?: string;
675
+ /** Provide a custom element the Dialog should portal into. */
676
+ container?: HTMLElement;
677
+ } & React_2.RefAttributes<HTMLDivElement>>;
678
+
679
+ /**
680
+ * Automatically renders when there are no results for the search query.
681
+ */
682
+ export declare const CommandEmpty: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
683
+ asChild?: boolean;
684
+ }, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
685
+
686
+ export declare type CommandGroup = {
687
+ id: string;
688
+ forceMount?: boolean;
689
+ };
690
+
691
+ /**
692
+ * Group command menu items together with a heading.
693
+ * Grouped items are always shown together.
694
+ */
695
+ export declare const CommandGroup: React_2.ForwardRefExoticComponent<Children & Omit<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
696
+ asChild?: boolean;
697
+ }, "ref">, "value" | "heading"> & {
698
+ /** Optional heading to render for this group. */
699
+ heading?: React_2.ReactNode;
700
+ /** If no heading is provided, you must provide a value that is unique for this group. */
701
+ value?: string;
702
+ /** Whether this group is forcibly rendered regardless of filtering. */
703
+ forceMount?: boolean;
704
+ } & React_2.RefAttributes<HTMLDivElement>>;
705
+
706
+ /**
707
+ * Command menu input.
708
+ * All props are forwarded to the underyling `input` element.
709
+ */
710
+ export declare const CommandInput: React_2.ForwardRefExoticComponent<Omit<Omit<React_2.ClassAttributes<HTMLInputElement> & React_2.InputHTMLAttributes<HTMLInputElement> & {
711
+ asChild?: boolean;
712
+ }, "ref">, "value" | "type" | "onChange"> & {
713
+ /**
714
+ * Optional controlled state for the value of the search input.
715
+ */
716
+ value?: string;
717
+ /**
718
+ * Event handler called when the search value changes.
719
+ */
720
+ onValueChange?: (search: string) => void;
721
+ } & React_2.RefAttributes<HTMLInputElement>>;
722
+
723
+ /**
724
+ * Command menu item. Becomes active on pointer enter or through keyboard navigation.
725
+ * Preferably pass a `value`, otherwise the value will be inferred from `children` or
726
+ * the rendered item's `textContent`.
727
+ */
728
+ export declare const CommandItem: React_2.ForwardRefExoticComponent<Children & Omit<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
729
+ asChild?: boolean;
730
+ }, "ref">, "value" | "disabled" | "onSelect"> & {
731
+ /** Whether this item is currently disabled. */
732
+ disabled?: boolean;
733
+ /** Event handler for when this item is selected, either via click or keyboard selection. */
734
+ onSelect?: (details: {
735
+ value: string;
736
+ trigger: "click" | "keyboard";
737
+ }) => void;
738
+ /**
739
+ * A unique value for this item.
740
+ * If no value is provided, it will be inferred from `children` or the rendered `textContent`. If your `textContent` changes between renders, you _must_ provide a stable, unique `value`.
741
+ */
742
+ value?: string;
743
+ /** Optional keywords to match against when filtering. */
744
+ keywords?: string[];
745
+ /** Whether this item is forcibly rendered regardless of filtering. */
746
+ forceMount?: boolean;
747
+ } & React_2.RefAttributes<HTMLDivElement>>;
748
+
749
+ /**
750
+ * Contains `Item`, `Group`, and `Separator`.
751
+ * Use the `--cmdk-list-height` CSS variable to animate height based on the number of results.
752
+ */
753
+ export declare const CommandList: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
754
+ asChild?: boolean;
755
+ }, "ref"> & {
756
+ /**
757
+ * Accessible label for this List of suggestions. Not shown visibly.
758
+ */
759
+ label?: string;
760
+ } & React_2.RefAttributes<HTMLDivElement>>;
761
+
762
+ /**
763
+ * You should conditionally render this with `progress` while loading asynchronous items.
764
+ */
765
+ export declare const CommandLoading: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
766
+ asChild?: boolean;
767
+ }, "ref"> & {
768
+ /** Estimated progress of loading asynchronous options. */
769
+ progress?: number;
770
+ /**
771
+ * Accessible label for this loading progressbar. Not shown visibly.
772
+ */
773
+ label?: string;
774
+ } & React_2.RefAttributes<HTMLDivElement>>;
775
+
776
+ declare type CommandProps = Children & DivProps & {
777
+ /**
778
+ * Accessible label for this command menu. Not shown visibly.
779
+ */
780
+ label?: string;
781
+ /**
782
+ * Optionally set to `false` to turn off the automatic filtering and sorting.
783
+ * If `false`, you must conditionally render valid items based on the search query yourself.
784
+ */
785
+ shouldFilter?: boolean;
786
+ /**
787
+ * Custom filter function for whether each command menu item should matches the given search query.
788
+ * It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely.
789
+ * By default, uses the `command-score` library.
790
+ */
791
+ filter?: (value: string, search: string, keywords?: string[]) => number;
792
+ /**
793
+ * Optional default item value when it is initially rendered.
794
+ */
795
+ defaultValue?: string;
796
+ /**
797
+ * Optional default query when it is initially rendered.
798
+ */
799
+ defaultSearch?: string;
800
+ /**
801
+ * Optional controlled state of the selected command menu item.
802
+ */
803
+ value?: string;
804
+ /**
805
+ * Event handler called when the selected item of the menu changes.
806
+ */
807
+ onValueChange?: (value: string) => void;
808
+ /**
809
+ * Optionally set to `true` to turn on looping around when using the arrow keys.
810
+ */
811
+ loop?: boolean;
812
+ /**
813
+ * Optionally set to `true` to disable selection via pointer events.
814
+ */
815
+ disablePointerSelection?: boolean;
816
+ /**
817
+ * Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.
818
+ */
819
+ vimBindings?: boolean;
820
+ };
821
+
822
+ export declare const CommandRoot: React_2.ForwardRefExoticComponent<Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
823
+ asChild?: boolean;
824
+ }, "ref"> & {
825
+ /**
826
+ * Accessible label for this command menu. Not shown visibly.
827
+ */
828
+ label?: string;
829
+ /**
830
+ * Optionally set to `false` to turn off the automatic filtering and sorting.
831
+ * If `false`, you must conditionally render valid items based on the search query yourself.
832
+ */
833
+ shouldFilter?: boolean;
834
+ /**
835
+ * Custom filter function for whether each command menu item should matches the given search query.
836
+ * It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely.
837
+ * By default, uses the `command-score` library.
838
+ */
839
+ filter?: (value: string, search: string, keywords?: string[]) => number;
840
+ /**
841
+ * Optional default item value when it is initially rendered.
842
+ */
843
+ defaultValue?: string;
844
+ /**
845
+ * Optional default query when it is initially rendered.
846
+ */
847
+ defaultSearch?: string;
848
+ /**
849
+ * Optional controlled state of the selected command menu item.
850
+ */
851
+ value?: string;
852
+ /**
853
+ * Event handler called when the selected item of the menu changes.
854
+ */
855
+ onValueChange?: (value: string) => void;
856
+ /**
857
+ * Optionally set to `true` to turn on looping around when using the arrow keys.
858
+ */
859
+ loop?: boolean;
860
+ /**
861
+ * Optionally set to `true` to disable selection via pointer events.
862
+ */
863
+ disablePointerSelection?: boolean;
864
+ /**
865
+ * Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.
866
+ */
867
+ vimBindings?: boolean;
868
+ } & React_2.RefAttributes<HTMLDivElement>>;
869
+
870
+ /**
871
+ * A visual and semantic separator between items or groups.
872
+ * Visible when the search query is empty or `alwaysRender` is true, hidden otherwise.
873
+ */
874
+ export declare const CommandSeparator: React_2.ForwardRefExoticComponent<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
875
+ asChild?: boolean;
876
+ }, "ref"> & {
877
+ /** Whether this separator should always be rendered. Useful if you disable automatic filtering. */
878
+ alwaysRender?: boolean;
879
+ } & React_2.RefAttributes<HTMLDivElement>>;
880
+
444
881
  export declare type ComponentID = keyof typeof componentIDs;
445
882
 
446
883
  export declare const componentIDs: {
@@ -796,6 +1233,8 @@ export declare interface CustomIconProps {
796
1233
 
797
1234
  export declare const dataAttr: (guard: boolean | undefined) => Booleanish;
798
1235
 
1236
+ export declare const defaultFilter: CommandProps['filter'];
1237
+
799
1238
  declare type DefaultInkeepAIChatSettings = typeof defaultInkeepAIChatSettings;
800
1239
 
801
1240
  declare const defaultInkeepAIChatSettings: {
@@ -1112,6 +1551,8 @@ declare interface DialogTriggerProps extends PrimitiveButtonProps {
1112
1551
 
1113
1552
  declare type DismissableLayerProps = React_2.ComponentPropsWithoutRef<typeof DismissableLayer>;
1114
1553
 
1554
+ declare type DivProps = React_2.ComponentPropsWithoutRef<typeof Primitive.div>;
1555
+
1115
1556
  export declare namespace EmbeddedChatPrimitive {
1116
1557
  export {
1117
1558
  EmbeddedChatPrimitiveWrapper,
@@ -3426,6 +3867,24 @@ export declare const SourceItemProvider: React.FC<{
3426
3867
  source: TransformedSourceItem;
3427
3868
  }>;
3428
3869
 
3870
+ declare type State = {
3871
+ search: string;
3872
+ value: string;
3873
+ selectedItemId?: string;
3874
+ filtered: {
3875
+ count: number;
3876
+ items: Map<string, number>;
3877
+ groups: Set<string>;
3878
+ };
3879
+ };
3880
+
3881
+ declare type Store = {
3882
+ subscribe: (callback: () => void) => () => void;
3883
+ snapshot: () => State;
3884
+ setState: <K extends keyof State>(key: K, value: State[K], opts?: any) => void;
3885
+ emit: () => void;
3886
+ };
3887
+
3429
3888
  export declare const ThemeProvider: React.FC<{
3430
3889
  children: React.ReactNode;
3431
3890
  }>;
@@ -3513,6 +3972,11 @@ export declare function useChatFormState(): {
3513
3972
 
3514
3973
  export declare const useChatMarkdown: () => ChatMarkdownContextValue | undefined;
3515
3974
 
3975
+ /** Run a selector against the store state. */
3976
+ export declare function useCommandState<T = any>(selector: (state: State) => T): T;
3977
+
3978
+ export declare const useCommandStore: () => Store;
3979
+
3516
3980
  /**
3517
3981
  * Hook to compute class names for a component based on its ID, user-provided classes,
3518
3982
  * global configuration, and prefixing rules.