@knitify/vue 0.0.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +111 -0
  2. package/dist/index.es.js +4490 -221
  3. package/dist/index.umd.js +1 -1
  4. package/dist/types/components/Accordion/KAccordion.vue.d.ts +11 -0
  5. package/dist/types/components/Accordion/KAccordionItem.vue.d.ts +22 -0
  6. package/dist/types/components/Accordion/keys.d.ts +2 -0
  7. package/dist/types/components/Accordion/types.d.ts +37 -0
  8. package/dist/types/components/Alert/KAlert.vue.d.ts +11 -0
  9. package/dist/types/components/Alert/types.d.ts +18 -0
  10. package/dist/types/components/Avatar/KAvatar.vue.d.ts +15 -0
  11. package/dist/types/components/Avatar/KAvatarGroup.vue.d.ts +11 -0
  12. package/dist/types/components/Avatar/types.d.ts +130 -0
  13. package/dist/types/components/Badge/types.d.ts +2 -0
  14. package/dist/types/components/Breadcrumb/KBreadcrumb.vue.d.ts +11 -0
  15. package/dist/types/components/Breadcrumb/KBreadcrumbItem.vue.d.ts +11 -0
  16. package/dist/types/components/Breadcrumb/types.d.ts +23 -0
  17. package/dist/types/components/Button/types.d.ts +15 -4
  18. package/dist/types/components/Calendar/KCalendar.vue.d.ts +34 -0
  19. package/dist/types/components/Calendar/types.d.ts +26 -0
  20. package/dist/types/components/Card/KCard.vue.d.ts +11 -0
  21. package/dist/types/components/Card/types.d.ts +26 -0
  22. package/dist/types/components/Chat/KChat.vue.d.ts +14 -0
  23. package/dist/types/components/Chat/KChatDivider.vue.d.ts +11 -0
  24. package/dist/types/components/Chat/KChatMessage.vue.d.ts +11 -0
  25. package/dist/types/components/Chat/KChatMessageActions.vue.d.ts +18 -0
  26. package/dist/types/components/Chat/KChatMessages.vue.d.ts +11 -0
  27. package/dist/types/components/Chat/KChatNotice.vue.d.ts +11 -0
  28. package/dist/types/components/Chat/KChatPrompt.vue.d.ts +30 -0
  29. package/dist/types/components/Chat/KChatShimmer.vue.d.ts +11 -0
  30. package/dist/types/components/Chat/keys.d.ts +2 -0
  31. package/dist/types/components/Chat/types.d.ts +140 -0
  32. package/dist/types/components/ChatDock/KChatDock.vue.d.ts +45 -0
  33. package/dist/types/components/ChatDock/KChatDockItem.vue.d.ts +11 -0
  34. package/dist/types/components/ChatDock/KChatDockPanel.vue.d.ts +11 -0
  35. package/dist/types/components/ChatDock/KChatWindow.vue.d.ts +27 -0
  36. package/dist/types/components/ChatDock/KMessenger.vue.d.ts +23 -0
  37. package/dist/types/components/ChatDock/keys.d.ts +98 -0
  38. package/dist/types/components/ChatDock/messenger-types.d.ts +280 -0
  39. package/dist/types/components/ChatDock/store-keys.d.ts +7 -0
  40. package/dist/types/components/ChatDock/types.d.ts +134 -0
  41. package/dist/types/components/ChatDock/useChatDock.d.ts +11 -0
  42. package/dist/types/components/Checkbox/KCheckbox.vue.d.ts +20 -0
  43. package/dist/types/components/Checkbox/types.d.ts +23 -0
  44. package/dist/types/components/Collapse/KCollapse.vue.d.ts +32 -0
  45. package/dist/types/components/Collapse/types.d.ts +32 -0
  46. package/dist/types/components/Collapse/useCollapseSync.d.ts +31 -0
  47. package/dist/types/components/Drawer/KDrawer.vue.d.ts +34 -0
  48. package/dist/types/components/Drawer/types.d.ts +54 -0
  49. package/dist/types/components/Dropdown/KDropdown.vue.d.ts +28 -0
  50. package/dist/types/components/Dropdown/KDropdownItem.vue.d.ts +13 -0
  51. package/dist/types/components/Dropdown/KDropdownMenu.vue.d.ts +13 -0
  52. package/dist/types/components/Dropdown/types.d.ts +34 -0
  53. package/dist/types/components/FileTree/KFileTree.vue.d.ts +34 -0
  54. package/dist/types/components/FileTree/KFileTreeNode.vue.d.ts +20 -0
  55. package/dist/types/components/FileTree/types.d.ts +39 -0
  56. package/dist/types/components/Grid/KGrid.vue.d.ts +11 -0
  57. package/dist/types/components/Grid/KGridColumn.vue.d.ts +11 -0
  58. package/dist/types/components/Grid/KGridRow.vue.d.ts +19 -0
  59. package/dist/types/components/Grid/types.d.ts +41 -0
  60. package/dist/types/components/Grid/useGrid.d.ts +8 -0
  61. package/dist/types/components/Icon/types.d.ts +1 -1
  62. package/dist/types/components/Input/KInput.vue.d.ts +3 -1
  63. package/dist/types/components/Input/types.d.ts +8 -0
  64. package/dist/types/components/MenuList/KMenuList.vue.d.ts +11 -0
  65. package/dist/types/components/MenuList/KMenuListItem.vue.d.ts +11 -0
  66. package/dist/types/components/MenuList/types.d.ts +20 -0
  67. package/dist/types/components/Modal/KModal.vue.d.ts +36 -0
  68. package/dist/types/components/Modal/types.d.ts +57 -0
  69. package/dist/types/components/NotificationList/KNotificationList.vue.d.ts +11 -0
  70. package/dist/types/components/NotificationList/KNotificationListItem.vue.d.ts +11 -0
  71. package/dist/types/components/NotificationList/types.d.ts +36 -0
  72. package/dist/types/components/Popover/KPopover.vue.d.ts +28 -0
  73. package/dist/types/components/Popover/types.d.ts +24 -0
  74. package/dist/types/components/Popover/useOverlaySync.d.ts +49 -0
  75. package/dist/types/components/Progress/KProgress.vue.d.ts +11 -0
  76. package/dist/types/components/Progress/types.d.ts +19 -0
  77. package/dist/types/components/Radio/KRadio.vue.d.ts +20 -0
  78. package/dist/types/components/Radio/types.d.ts +20 -0
  79. package/dist/types/components/Select/KSelect.vue.d.ts +22 -0
  80. package/dist/types/components/Select/types.d.ts +30 -0
  81. package/dist/types/components/Spinner/KSpinner.vue.d.ts +6 -0
  82. package/dist/types/components/Spinner/types.d.ts +13 -0
  83. package/dist/types/components/Table/KTable.vue.d.ts +11 -0
  84. package/dist/types/components/Table/types.d.ts +16 -0
  85. package/dist/types/components/Tabs/KTab.vue.d.ts +13 -0
  86. package/dist/types/components/Tabs/KTabPanel.vue.d.ts +13 -0
  87. package/dist/types/components/Tabs/KTabs.vue.d.ts +25 -0
  88. package/dist/types/components/Tabs/types.d.ts +35 -0
  89. package/dist/types/components/Toast/types.d.ts +20 -0
  90. package/dist/types/components/Toast/useToast.d.ts +20 -0
  91. package/dist/types/components/Toggle/KToggle.vue.d.ts +20 -0
  92. package/dist/types/components/Toggle/types.d.ts +8 -0
  93. package/dist/types/components/Tooltip/KTooltip.vue.d.ts +45 -0
  94. package/dist/types/components/Tooltip/types.d.ts +18 -0
  95. package/dist/types/components/Workspace/KWorkspace.vue.d.ts +30 -0
  96. package/dist/types/components/Workspace/types.d.ts +29 -0
  97. package/dist/types/components/index.d.ts +56 -0
  98. package/dist/types/components/types.d.ts +31 -0
  99. package/dist/types/index.d.ts +1 -0
  100. package/dist/types/types.d.ts +1 -0
  101. package/dist/types/utils/useDocumentEvent.d.ts +19 -0
  102. package/dist/types/utils/useExclusive.d.ts +13 -0
  103. package/dist/types/utils/useTopmost.d.ts +17 -0
  104. package/dist/web-types.json +5107 -0
  105. package/package.json +22 -6
  106. package/dist/types/stories/KBadge.stories.d.ts +0 -104
  107. package/dist/types/stories/KButton.stories.d.ts +0 -117
  108. package/dist/types/stories/KContainer.stories.d.ts +0 -84
  109. package/dist/types/stories/KInput.stories.d.ts +0 -172
  110. package/dist/types/stories/KNavbar.stories.d.ts +0 -67
  111. package/dist/types/stories/KNavbarMenu.stories.d.ts +0 -99
@@ -0,0 +1,23 @@
1
+ import type { RouteLocationRaw } from 'vue-router';
2
+ export type KBreadcrumbProps = {
3
+ /** Names the navigation landmark. */
4
+ ariaLabel?: string;
5
+ /** Separator between crumbs. Core's default is a double angle quote. */
6
+ divider?: string;
7
+ };
8
+ export type KBreadcrumbItemProps = {
9
+ /**
10
+ * The current page. Renders as plain text rather than a link, and carries
11
+ * `aria-current="page"`.
12
+ *
13
+ * Note this maps to core's `KBreadcrumb-is-active`, not the `is-active`
14
+ * state class every other module uses.
15
+ */
16
+ active?: boolean;
17
+ href?: string;
18
+ /** Router destination. Takes precedence over `href`. */
19
+ to?: RouteLocationRaw;
20
+ };
21
+ export type KBreadcrumbSlots = {
22
+ default?(): any;
23
+ };
@@ -1,16 +1,27 @@
1
1
  import type { RouteLocationRaw } from 'vue-router';
2
- import type { Variant } from '../../types';
2
+ import type { Intent } from '../../types';
3
3
  export type KButtonType = 'button' | 'submit' | 'reset';
4
+ export type KButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
5
  export type KButtonProps = {
5
6
  disabled?: boolean;
6
7
  expanded?: boolean;
7
- ghost?: boolean;
8
8
  href?: string;
9
- outline?: boolean;
9
+ icon?: boolean;
10
+ iconCircular?: boolean;
11
+ minimal?: boolean;
10
12
  rounded?: boolean;
13
+ secondary?: boolean;
14
+ selected?: boolean;
15
+ size?: KButtonSize;
11
16
  to?: RouteLocationRaw;
12
17
  type?: KButtonType;
13
- variant?: Variant;
18
+ utility?: boolean;
19
+ /**
20
+ * Semantic color. Core ships no `utilityWarning`, `minimalWarning` or
21
+ * `minimalAffirm` modifier, so those combinations render as the solid
22
+ * fill for that intent.
23
+ */
24
+ variant?: Intent;
14
25
  };
15
26
  export type KButtonSlots = {
16
27
  default?(): any;
@@ -0,0 +1,34 @@
1
+ import type { KCalendarProps, KCalendarRange, KCalendarSlots } from './types';
2
+ type __VLS_Props = KCalendarProps;
3
+ type __VLS_Slots = KCalendarSlots;
4
+ type __VLS_ModelProps = {
5
+ modelValue?: Date | null;
6
+ 'range'?: KCalendarRange | null;
7
+ };
8
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
10
+ clear: () => void | undefined;
11
+ navigateTo: (year: number, month: number) => void | undefined;
12
+ next: () => void | undefined;
13
+ prev: () => void | undefined;
14
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ navigate: (year: number, month: number) => any;
16
+ clear: () => any;
17
+ rangestart: (date: Date) => any;
18
+ "update:modelValue": (value: Date | null) => any;
19
+ "update:range": (value: KCalendarRange | null) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
+ onNavigate?: ((year: number, month: number) => any) | undefined;
22
+ onClear?: (() => any) | undefined;
23
+ onRangestart?: ((date: Date) => any) | undefined;
24
+ "onUpdate:modelValue"?: ((value: Date | null) => any) | undefined;
25
+ "onUpdate:range"?: ((value: KCalendarRange | null) => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,26 @@
1
+ export type KCalendarMode = 'single' | 'range';
2
+ export type KCalendarRange = {
3
+ end: Date;
4
+ start: Date;
5
+ };
6
+ export type KCalendarProps = {
7
+ /** Dates that cannot be picked. */
8
+ disabledDates?: Date[];
9
+ /** `0` is Sunday, `1` is Monday. */
10
+ firstDay?: 0 | 1;
11
+ /** BCP 47 tag driving the month and weekday names. */
12
+ locale?: string;
13
+ maxDate?: Date;
14
+ minDate?: Date;
15
+ mode?: KCalendarMode;
16
+ };
17
+ export type KCalendarEmits = {
18
+ clear: [];
19
+ navigate: [year: number, month: number];
20
+ rangestart: [date: Date];
21
+ };
22
+ /**
23
+ * No slots: core renders the whole calendar into its container with
24
+ * `innerHTML`, so anything Vue put inside would be wiped on the first paint.
25
+ */
26
+ export type KCalendarSlots = Record<string, never>;
@@ -0,0 +1,11 @@
1
+ import type { KCardProps, KCardSlots } from './types';
2
+ type __VLS_Slots = KCardSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KCardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,26 @@
1
+ import { ClassValue } from 'vue';
2
+ export type KCardProps = {
3
+ /** Adds the accent bar. */
4
+ accented?: boolean;
5
+ bodyClass?: ClassValue;
6
+ /** Drops the border and the header and footer rules. */
7
+ borderless?: boolean;
8
+ footerClass?: ClassValue;
9
+ /** Removes the header and footer padding, so their content sits flush. */
10
+ flush?: boolean;
11
+ headerClass?: ClassValue;
12
+ /** Raises the card on hover. */
13
+ hoverable?: boolean;
14
+ /** Sits the card on a shadow rather than a border. */
15
+ lifted?: boolean;
16
+ /** Recesses the card into the surface behind it. */
17
+ sunken?: boolean;
18
+ /** Heading inside the header. The `title` slot overrides it. */
19
+ title?: string;
20
+ };
21
+ export type KCardSlots = {
22
+ default?(): any;
23
+ footer?(): any;
24
+ header?(): any;
25
+ title?(): any;
26
+ };
@@ -0,0 +1,14 @@
1
+ import type { KChatProps, KChatSlots } from './types';
2
+ type __VLS_Slots = KChatSlots;
3
+ declare function scrollToBottom(): void;
4
+ declare const __VLS_base: import("vue").DefineComponent<KChatProps, {
5
+ scrollToBottom: typeof scrollToBottom;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatDividerProps, KChatDividerSlots } from './types';
2
+ type __VLS_Slots = KChatDividerSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatDividerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatDividerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatMessageProps, KChatMessageSlots } from './types';
2
+ type __VLS_Slots = KChatMessageSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatMessageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,18 @@
1
+ import type { KChatMessageActionsProps, KChatMessageActionsSlots } from './types';
2
+ type __VLS_Slots = KChatMessageActionsSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatMessageActionsProps, {
4
+ hold: () => void;
5
+ release: () => void;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ action: (key: string, item?: string | undefined) => any;
8
+ }, string, import("vue").PublicProps, Readonly<KChatMessageActionsProps> & Readonly<{
9
+ onAction?: ((key: string, item?: string | undefined) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatMessagesSlots } from './types';
2
+ type __VLS_Slots = KChatMessagesSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatNoticeProps, KChatNoticeSlots } from './types';
2
+ type __VLS_Slots = KChatNoticeSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatNoticeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatNoticeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,30 @@
1
+ import type { KChatPromptProps, KChatPromptSlots } from './types';
2
+ type __VLS_Props = KChatPromptProps;
3
+ type __VLS_Slots = KChatPromptSlots;
4
+ type __VLS_ModelProps = {
5
+ modelValue?: string;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ stop: () => any;
10
+ submit: (value: string) => any;
11
+ "update:modelValue": (value: string) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ onStop?: (() => any) | undefined;
14
+ onSubmit?: ((value: string) => any) | undefined;
15
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
16
+ }>, {
17
+ disabled: boolean;
18
+ busy: boolean;
19
+ placeholder: string;
20
+ maxRows: number;
21
+ newlineOnEnter: boolean;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
26
+ type __VLS_WithSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatShimmerProps, KChatShimmerSlots } from './types';
2
+ type __VLS_Slots = KChatShimmerSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatShimmerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatShimmerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,2 @@
1
+ import type { InjectionKey, Ref } from 'vue';
2
+ export declare const chatBusyKey: InjectionKey<Ref<boolean>>;
@@ -0,0 +1,140 @@
1
+ import type { Intent } from '../../types';
2
+ export type KChatProps = {
3
+ /** Stacks every message's actions under its bubble instead of beside it. */
4
+ actionsBottom?: boolean;
5
+ ai?: boolean;
6
+ autoscroll?: boolean;
7
+ busy?: boolean;
8
+ height?: string;
9
+ };
10
+ export type KChatSlots = {
11
+ default?(): any;
12
+ footer?(): any;
13
+ };
14
+ export type KChatMessagesSlots = {
15
+ default?(): any;
16
+ };
17
+ export type KChatMessageProps = {
18
+ sender?: boolean;
19
+ time?: string;
20
+ };
21
+ export type KChatMessageSlots = {
22
+ default?(): any;
23
+ time?(): any;
24
+ /** The hover row beside or below the bubble. Put a `KChatMessageActions` here. */
25
+ actions?(): any;
26
+ };
27
+ /**
28
+ * One entry in a `KChatMessageActions` set. A consuming project computes these
29
+ * per message, which is where sender, status and permission logic belongs —
30
+ * the component only renders what it is handed.
31
+ */
32
+ export type KChatAction = {
33
+ /** Identifies the action in the `action` event. Unique within its level. */
34
+ key: string;
35
+ /** Sprite id, e.g. `reply`. Omitted for a text-only dropdown row. */
36
+ icon?: string;
37
+ /** Tooltip and accessible name. */
38
+ label: string;
39
+ disabled?: boolean;
40
+ /**
41
+ * Semantic color, for destructive rows. Applies to top-level actions only
42
+ * — a row nested under `items` renders as a plain `KDropdownItem`, which
43
+ * has no intent prop, so `intent` is silently ignored there.
44
+ */
45
+ intent?: Intent;
46
+ /** Defaults to `true`. A hidden action renders nothing at all. */
47
+ visible?: boolean;
48
+ /** Presence turns the action into a dropdown of these rows. */
49
+ items?: KChatAction[];
50
+ /** A rule between rows. Only meaningful inside `items`. */
51
+ divider?: boolean;
52
+ };
53
+ export type KChatMessageActionsProps = {
54
+ /**
55
+ * The action set. Defaults to react, reply and more; passing an array
56
+ * replaces it outright rather than adding to it.
57
+ */
58
+ actions?: KChatAction[];
59
+ };
60
+ export type KChatMessageActionsEmits = {
61
+ /**
62
+ * A top-level action's key, plus the nested key when the choice came from a
63
+ * dropdown row. Switch on `key` rather than binding a handler per button.
64
+ */
65
+ action: [key: string, item?: string];
66
+ };
67
+ export type KChatMessageActionsSlots = {
68
+ /**
69
+ * Replaces the whole row, keeping the reveal behaviour and the latch. `hold`
70
+ * and `release` are the same pair the built-in dropdown binds, so a custom
71
+ * overlay can keep the row up while it is open.
72
+ */
73
+ default?(props: {
74
+ hold: () => void;
75
+ release: () => void;
76
+ }): any;
77
+ /**
78
+ * Fills the `react` action, which exists precisely because a panel-shaped
79
+ * overlay — an emoji picker — cannot be described by a `KChatAction`.
80
+ */
81
+ react?(props: {
82
+ hold: () => void;
83
+ release: () => void;
84
+ }): any;
85
+ /**
86
+ * Dropdown rows for the `more` action, replacing its `items`. Rows you
87
+ * supply here are your own markup — only the rows generated from `items`
88
+ * emit the `action` event, so a row rendered through this slot must wire
89
+ * up its own click handling.
90
+ */
91
+ more?(): any;
92
+ };
93
+ export type KChatDividerProps = {
94
+ /** Centred label. Omit for an unbroken rule. */
95
+ label?: string;
96
+ };
97
+ /**
98
+ * An event in the conversation — "Call ended at 01:48 PM", "You ended the
99
+ * meeting". Distinct from `KChatDivider`, which marks a boundary between
100
+ * messages rather than being content itself.
101
+ */
102
+ export type KChatNoticeProps = {
103
+ /** The notice text. The default slot overrides it, for markup or a link. */
104
+ label?: string;
105
+ };
106
+ export type KChatNoticeSlots = {
107
+ default?(): any;
108
+ };
109
+ export type KChatDividerSlots = {
110
+ default?(): any;
111
+ };
112
+ export type KChatPromptProps = {
113
+ busy?: boolean;
114
+ disabled?: boolean;
115
+ maxRows?: number;
116
+ /**
117
+ * Enter inserts a newline instead of sending. The button becomes the only
118
+ * send path, which is how core's plain-HTML prompt behaves.
119
+ */
120
+ newlineOnEnter?: boolean;
121
+ placeholder?: string;
122
+ };
123
+ export type KChatPromptEmits = {
124
+ stop: [];
125
+ submit: [value: string];
126
+ };
127
+ export type KChatPromptSlots = {
128
+ send?(props: {
129
+ busy: boolean;
130
+ disabled: boolean;
131
+ }): any;
132
+ };
133
+ export type KChatShimmerProps = {
134
+ interval?: number;
135
+ text?: string;
136
+ texts?: string[];
137
+ };
138
+ export type KChatShimmerSlots = {
139
+ default?(): any;
140
+ };
@@ -0,0 +1,45 @@
1
+ import type { KChatDockProps, KChatDockSlots } from './types';
2
+ type __VLS_Slots = KChatDockSlots;
3
+ declare function openPanel(): void;
4
+ declare function closePanel(): void;
5
+ declare function togglePanel(): void;
6
+ /**
7
+ * Re-runs core's filter against whatever the search field currently holds.
8
+ *
9
+ * `filter()` is one-shot: it stamps `is-hidden` on the items present when it
10
+ * runs and recomputes the empty element only then. Rows a framework renders
11
+ * later — an async list resolving, a refresh adding rows while a query is
12
+ * active — are therefore unfiltered, and the empty element keeps whatever the
13
+ * last call decided (`closePanel()` filters on an empty list, so it un-hides
14
+ * it). A caller that renders the panel's items itself calls this after the
15
+ * rows change.
16
+ */
17
+ declare function refilter(): void;
18
+ declare const __VLS_base: import("vue").DefineComponent<KChatDockProps, {
19
+ openPanel: typeof openPanel;
20
+ closePanel: typeof closePanel;
21
+ togglePanel: typeof togglePanel;
22
+ refilter: typeof refilter;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ select: (id: string, opened: boolean) => any;
25
+ search: (query: string) => any;
26
+ reflow: () => any;
27
+ launcher: () => any;
28
+ panel: (open: boolean) => any;
29
+ activate: (id: string) => any;
30
+ }, string, import("vue").PublicProps, Readonly<KChatDockProps> & Readonly<{
31
+ onSelect?: ((id: string, opened: boolean) => any) | undefined;
32
+ onSearch?: ((query: string) => any) | undefined;
33
+ onReflow?: (() => any) | undefined;
34
+ onLauncher?: (() => any) | undefined;
35
+ onPanel?: ((open: boolean) => any) | undefined;
36
+ onActivate?: ((id: string) => any) | undefined;
37
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
41
+ type __VLS_WithSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatDockItemProps, KChatDockItemSlots } from './types';
2
+ type __VLS_Slots = KChatDockItemSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatDockItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatDockItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,11 @@
1
+ import type { KChatDockPanelProps, KChatDockPanelSlots } from './types';
2
+ type __VLS_Slots = KChatDockPanelSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KChatDockPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KChatDockPanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ type __VLS_WithSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
@@ -0,0 +1,27 @@
1
+ import type { KChatWindowProps, KChatWindowSlots, KChatWindowState } from './types';
2
+ type __VLS_Props = KChatWindowProps;
3
+ type __VLS_Slots = KChatWindowSlots;
4
+ declare function expand(): void;
5
+ declare function rail(): void;
6
+ type __VLS_ModelProps = {
7
+ 'state'?: KChatWindowState;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
11
+ expand: typeof expand;
12
+ rail: typeof rail;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ close: () => any;
15
+ "update:state": (value: KChatWindowState) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ onClose?: (() => any) | undefined;
18
+ "onUpdate:state"?: ((value: KChatWindowState) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,23 @@
1
+ import type { ChatDockStore, KMessengerProps, KMessengerSlots } from './messenger-types';
2
+ type __VLS_Slots = KMessengerSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KMessengerProps, ChatDockStore, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ error: (kind: import("./messenger-types").ChatDockErrorKind, id: string | undefined, error: unknown) => any;
5
+ send: (message: import("./messenger-types").ChatMessage) => any;
6
+ open: (id: string) => any;
7
+ close: (id: string) => any;
8
+ receive: (message: import("./messenger-types").ChatMessage) => any;
9
+ }, string, import("vue").PublicProps, Readonly<KMessengerProps> & Readonly<{
10
+ onError?: ((kind: import("./messenger-types").ChatDockErrorKind, id: string | undefined, error: unknown) => any) | undefined;
11
+ onSend?: ((message: import("./messenger-types").ChatMessage) => any) | undefined;
12
+ onOpen?: ((id: string) => any) | undefined;
13
+ onClose?: ((id: string) => any) | undefined;
14
+ onReceive?: ((message: import("./messenger-types").ChatMessage) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,98 @@
1
+ import type { InjectionKey, ShallowRef } from 'vue';
2
+ import type Knitify from '@knitify/core';
3
+ export type ChatDockInstance = InstanceType<typeof Knitify.modules.ChatDock>;
4
+ /**
5
+ * What `withModule` did, so a caller can react to each outcome distinctly:
6
+ *
7
+ * - `'called'` — the callback ran against a live module. Anything the caller
8
+ * wanted to tell core has been told.
9
+ * - `'deferred'` — a dock is present but its first `init()` has not run yet,
10
+ * so nothing may reach core (see `withModule`). The callback did **not**
11
+ * run; the caller must record its intent through `declare` instead, and the
12
+ * dock replays it the moment calling core becomes safe.
13
+ * - `'unavailable'` — there is no module to call at all: no `KChatDock`
14
+ * ancestor, or the dock's own root is gone. The callback did **not** run and
15
+ * nothing was or will be recorded, so a caller must not update bookkeeping
16
+ * that claims core was told something.
17
+ */
18
+ export type ChatDockCallResult = 'called' | 'deferred' | 'unavailable';
19
+ export type ChatDockContext = {
20
+ /**
21
+ * **The only way to reach core from anywhere in this component pair.** The
22
+ * module instance is deliberately not exposed: a call site that cannot get
23
+ * hold of it cannot skip the gate below by accident, which is what four
24
+ * successive rounds of path-specific patching kept failing to prevent.
25
+ *
26
+ * The gate: no core call may happen before the dock's own first deferred
27
+ * `init()` has run. Every core method reflows synchronously before it
28
+ * returns, and a reflow dispatches `kt.chatdock.rail`/`.unrail` to whichever
29
+ * windows changed — but a child window attaches those listeners from a
30
+ * template-ref watcher, which lands a flush *after* its parent's
31
+ * `onMounted`, and Vue orders pre-flush jobs by component creation order, so
32
+ * the dock's own watchers and an earlier sibling's watchers all run while a
33
+ * later sibling is still deaf. An event dropped that way is lost for good:
34
+ * Vue never re-patches a `class` binding whose rendered string is unchanged,
35
+ * so core's directly-set `is-railed` survives on the element while
36
+ * `v-model:state` (and `aria-expanded`) stay wrong forever, and every later
37
+ * reflow is a no-op diff that never repairs it.
38
+ *
39
+ * Skipping a pre-init call costs nothing, which is what makes the gate safe
40
+ * rather than merely cautious: the deferred `init()` applies every pending
41
+ * declaration and reflows anyway, so it subsumes whatever was skipped.
42
+ *
43
+ * Also flushes any pending declarations through core immediately before
44
+ * running the callback, so a `reflow()` never computes capacity against a
45
+ * window core has not yet been told is railed.
46
+ */
47
+ withModule: (run: (module: ChatDockInstance) => void) => ChatDockCallResult;
48
+ /**
49
+ * Records whether a window should be railed once the dock next applies its
50
+ * declarations — no class, no attribute, no method call yet. `KChatDock`
51
+ * plays every recorded declaration through core itself, from its deferred
52
+ * first `init()` and again before every later core call (see `withModule`),
53
+ * which are the only points every window is guaranteed to have already
54
+ * attached its own `kt.chatdock.*` listeners.
55
+ *
56
+ * This is where state intent goes whenever `withModule` reports
57
+ * `'deferred'`, and where a window's own initial non-expanded state goes at
58
+ * mount.
59
+ *
60
+ * With only two states left, this only ever records `railed` — an
61
+ * `'expanded'` window needs nothing (that's what a freshly-seeded window
62
+ * already is), and `railed` needs a core call because only core's `rail()`
63
+ * sets the `data-kt-chat-window-minimized` marker `reflow()` reads to tell
64
+ * an explicit minimize apart from a window merely ranked below capacity.
65
+ *
66
+ * Idempotent both ways: declaring the same element `railed` repeatedly, or
67
+ * un-declaring it (passing `false`) before it's ever applied, just leaves
68
+ * one net entry (or none) — whichever a window's most recent write before
69
+ * the dock's next apply says is true.
70
+ */
71
+ declare: (element: HTMLElement, railed: boolean) => void;
72
+ /**
73
+ * The rail element, as a ref, so a window can teleport its head into it.
74
+ *
75
+ * A ref rather than the element itself because the rail is rendered by the
76
+ * dock and a window may set up before it resolves; `<Teleport defer>`
77
+ * handles a target that appears later in the same tree, and the ref is what
78
+ * lets the window react when it does.
79
+ *
80
+ * This is not a way around the gate: teleporting renders markup, it does
81
+ * not call core. Every core call still goes through `withModule`.
82
+ */
83
+ rail: Readonly<ShallowRef<HTMLElement | null>>;
84
+ /**
85
+ * The popover list element, as a ref, so a window can teleport its row into
86
+ * it. Same shape and reasoning as `rail`: the dock renders it, a window may
87
+ * set up before it resolves, and `<Teleport defer>` handles a target that
88
+ * appears later in the same tree.
89
+ */
90
+ list: Readonly<ShallowRef<HTMLElement | null>>;
91
+ /**
92
+ * The row zone element, as a ref, so `KChatDockPanel` can teleport into it.
93
+ * Same shape and reasoning as `rail` and `list`. The panel's `order: -1`
94
+ * places it beside the rail regardless of where the teleport appends it.
95
+ */
96
+ panel: Readonly<ShallowRef<HTMLElement | null>>;
97
+ };
98
+ export declare const chatDockKey: InjectionKey<ChatDockContext>;