@knitify/vue 1.0.0 → 2.1.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 (97) hide show
  1. package/README.md +113 -86
  2. package/dist/index.es.js +5773 -1451
  3. package/dist/index.umd.js +1 -1
  4. package/dist/types/components/Alert/KAlert.vue.d.ts +22 -2
  5. package/dist/types/components/Alert/types.d.ts +11 -1
  6. package/dist/types/components/ArticleList/KArticleList.vue.d.ts +11 -0
  7. package/dist/types/components/ArticleList/KArticleListItem.vue.d.ts +15 -0
  8. package/dist/types/components/ArticleList/types.d.ts +40 -0
  9. package/dist/types/components/Avatar/KAvatar.vue.d.ts +5 -1
  10. package/dist/types/components/Avatar/types.d.ts +92 -4
  11. package/dist/types/components/Badge/types.d.ts +2 -0
  12. package/dist/types/components/Calendar/types.d.ts +2 -0
  13. package/dist/types/components/Chat/KChatDivider.vue.d.ts +11 -0
  14. package/dist/types/components/Chat/KChatMessageActions.vue.d.ts +18 -0
  15. package/dist/types/components/Chat/KChatNotice.vue.d.ts +11 -0
  16. package/dist/types/components/Chat/KChatPrompt.vue.d.ts +1 -1
  17. package/dist/types/components/Chat/keys.d.ts +1 -0
  18. package/dist/types/components/Chat/types.d.ts +109 -4
  19. package/dist/types/components/ChatDock/KChatDock.vue.d.ts +47 -0
  20. package/dist/types/components/ChatDock/KChatDockItem.vue.d.ts +11 -0
  21. package/dist/types/components/ChatDock/KChatDockPanel.vue.d.ts +11 -0
  22. package/dist/types/components/ChatDock/KChatNewWindow.vue.d.ts +28 -0
  23. package/dist/types/components/ChatDock/KChatWindow.vue.d.ts +27 -0
  24. package/dist/types/components/ChatDock/KMessenger.vue.d.ts +29 -0
  25. package/dist/types/components/ChatDock/keys.d.ts +98 -0
  26. package/dist/types/components/ChatDock/messenger-types.d.ts +335 -0
  27. package/dist/types/components/ChatDock/store-keys.d.ts +7 -0
  28. package/dist/types/components/ChatDock/types.d.ts +162 -0
  29. package/dist/types/components/ChatDock/useChatDock.d.ts +11 -0
  30. package/dist/types/components/Collapse/KCollapse.vue.d.ts +2 -2
  31. package/dist/types/components/Collapse/useCollapseSync.d.ts +7 -5
  32. package/dist/types/components/DateInput/KDateInput.vue.d.ts +26 -0
  33. package/dist/types/components/DateInput/KDateRangeInput.vue.d.ts +31 -0
  34. package/dist/types/components/DateInput/types.d.ts +69 -0
  35. package/dist/types/components/DateInput/useDateInput.d.ts +27 -0
  36. package/dist/types/components/Divider/KDivider.vue.d.ts +11 -0
  37. package/dist/types/components/Divider/types.d.ts +19 -0
  38. package/dist/types/components/Drawer/KDrawer.vue.d.ts +3 -3
  39. package/dist/types/components/Dropdown/KDropdown.vue.d.ts +2 -2
  40. package/dist/types/components/Field/FieldIsolate.d.ts +4 -0
  41. package/dist/types/components/Field/KField.vue.d.ts +11 -0
  42. package/dist/types/components/Field/keys.d.ts +21 -0
  43. package/dist/types/components/Field/types.d.ts +35 -0
  44. package/dist/types/components/Flex/KFlex.vue.d.ts +11 -0
  45. package/dist/types/components/Flex/types.d.ts +26 -0
  46. package/dist/types/components/Input/KInput.vue.d.ts +2 -0
  47. package/dist/types/components/Input/types.d.ts +11 -1
  48. package/dist/types/components/Modal/KModal.vue.d.ts +3 -3
  49. package/dist/types/components/Modal/types.d.ts +5 -1
  50. package/dist/types/components/Pagination/KPagination.vue.d.ts +13 -0
  51. package/dist/types/components/Pagination/range.d.ts +6 -0
  52. package/dist/types/components/Pagination/types.d.ts +20 -0
  53. package/dist/types/components/Popover/KPopover.vue.d.ts +2 -2
  54. package/dist/types/components/Popover/useOverlaySync.d.ts +15 -1
  55. package/dist/types/components/RadioCard/KRadioCard.vue.d.ts +20 -0
  56. package/dist/types/components/RadioCard/KRadioCardGroup.vue.d.ts +11 -0
  57. package/dist/types/components/RadioCard/types.d.ts +25 -0
  58. package/dist/types/components/SearchInput/KSearchInput.vue.d.ts +22 -0
  59. package/dist/types/components/SearchInput/types.d.ts +7 -0
  60. package/dist/types/components/SegmentedButtons/KSegmentedButton.vue.d.ts +20 -0
  61. package/dist/types/components/SegmentedButtons/KSegmentedButtons.vue.d.ts +11 -0
  62. package/dist/types/components/SegmentedButtons/types.d.ts +25 -0
  63. package/dist/types/components/Select/KSelect.vue.d.ts +2 -0
  64. package/dist/types/components/Select/types.d.ts +8 -0
  65. package/dist/types/components/Skeleton/KSkeleton.vue.d.ts +4 -0
  66. package/dist/types/components/Skeleton/types.d.ts +19 -0
  67. package/dist/types/components/Spinner/KSpinner.vue.d.ts +6 -0
  68. package/dist/types/components/Spinner/types.d.ts +13 -0
  69. package/dist/types/components/Table/KTable.vue.d.ts +8 -1
  70. package/dist/types/components/Table/KTableResizer.vue.d.ts +4 -0
  71. package/dist/types/components/Table/types.d.ts +27 -2
  72. package/dist/types/components/Tabs/types.d.ts +25 -3
  73. package/dist/types/components/TagsInput/KTagsInput.vue.d.ts +32 -0
  74. package/dist/types/components/TagsInput/types.d.ts +68 -0
  75. package/dist/types/components/TagsInput/useTagsInput.d.ts +27 -0
  76. package/dist/types/components/Time/KTime.vue.d.ts +18 -0
  77. package/dist/types/components/Time/types.d.ts +23 -0
  78. package/dist/types/components/TimeInput/KTimeInput.vue.d.ts +26 -0
  79. package/dist/types/components/TimeInput/types.d.ts +27 -0
  80. package/dist/types/components/TimeInput/useTimeInput.d.ts +22 -0
  81. package/dist/types/components/Toggle/types.d.ts +2 -0
  82. package/dist/types/components/Tooltip/triggerHandlers.d.ts +33 -0
  83. package/dist/types/components/Tooltip/types.d.ts +5 -0
  84. package/dist/types/components/Tooltip/vTooltip.d.ts +10 -0
  85. package/dist/types/components/Workspace/KWorkspace.vue.d.ts +13 -1
  86. package/dist/types/components/Workspace/types.d.ts +10 -0
  87. package/dist/types/components/index.d.ts +34 -0
  88. package/dist/types/components/types.d.ts +19 -0
  89. package/dist/types/index.d.ts +1 -0
  90. package/dist/types/utils/useCoreModule.d.ts +30 -0
  91. package/dist/types/utils/useDocumentEvent.d.ts +19 -0
  92. package/dist/types/utils/useExclusive.d.ts +13 -0
  93. package/dist/types/utils/useFieldControl.d.ts +25 -0
  94. package/dist/types/utils/useRootClasses.d.ts +15 -0
  95. package/dist/types/utils/useTopmost.d.ts +17 -0
  96. package/dist/web-types.json +7986 -0
  97. package/package.json +17 -5
@@ -1,6 +1,26 @@
1
- import type { KAlertProps, KAlertSlots } from './types';
1
+ import type { KAlertSlots } from './types';
2
2
  type __VLS_Slots = KAlertSlots;
3
- declare const __VLS_base: import("vue").DefineComponent<KAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KAlertProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const __VLS_base: import("vue").DefineComponent<({
4
+ title?: string;
5
+ } & {
6
+ banner?: false;
7
+ variant?: import("../..").Intent;
8
+ }) | ({
9
+ title?: string;
10
+ } & {
11
+ banner: true;
12
+ variant?: import("./types").KAlertBannerIntent;
13
+ }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<({
14
+ title?: string;
15
+ } & {
16
+ banner?: false;
17
+ variant?: import("../..").Intent;
18
+ }) | ({
19
+ title?: string;
20
+ } & {
21
+ banner: true;
22
+ variant?: import("./types").KAlertBannerIntent;
23
+ })> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
25
  declare const _default: typeof __VLS_export;
6
26
  export default _default;
@@ -1,4 +1,6 @@
1
1
  import { Intent } from '../../types';
2
+ /** The intents core gives a banner colour to. */
3
+ export type KAlertBannerIntent = Extract<Intent, 'caution' | 'critical' | 'info'>;
2
4
  /**
3
5
  * Core ships no `--edged` modifier — the one in its docs helper does not exist
4
6
  * in the stylesheet — so there is deliberately no `edged` prop here.
@@ -6,12 +8,20 @@ import { Intent } from '../../types';
6
8
  * Anchors inside the message need `class="KAlert-link"` to pick up the alert's
7
9
  * text colour. That stays the consumer's job: the slot content is arbitrary,
8
10
  * so the wrapper has nothing to attach it to.
11
+ *
12
+ * `banner` narrows `variant` to the intents that have a banner colour.
9
13
  */
10
14
  export type KAlertProps = {
11
15
  /** Bold label above the message. The `title` slot overrides it. */
12
16
  title?: string;
17
+ } & ({
18
+ banner?: false;
13
19
  variant?: Intent;
14
- };
20
+ } | {
21
+ /** Full-width page banner: no border or radius, centered text. */
22
+ banner: true;
23
+ variant?: KAlertBannerIntent;
24
+ });
15
25
  export type KAlertSlots = {
16
26
  default?(): any;
17
27
  title?(): any;
@@ -0,0 +1,11 @@
1
+ import type { KArticleListProps, KArticleListSlots } from './types';
2
+ type __VLS_Slots = KArticleListSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KArticleListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KArticleListProps> & 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,15 @@
1
+ import type { KArticleListItemProps, KArticleListItemSlots } from './types';
2
+ type __VLS_Slots = KArticleListItemSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KArticleListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ click: (event: MouseEvent) => any;
5
+ }, string, import("vue").PublicProps, Readonly<KArticleListItemProps> & Readonly<{
6
+ onClick?: ((event: MouseEvent) => any) | undefined;
7
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,40 @@
1
+ import type { RouteLocationRaw } from 'vue-router';
2
+ export type KArticleListProps = {
3
+ /** Names the list for a screen reader. */
4
+ ariaLabel?: string;
5
+ };
6
+ export type KArticleListItemProps = {
7
+ /**
8
+ * Marks the article currently open. Maps to core's `is-active` plus
9
+ * `aria-current`, since the fill alone conveys nothing to a screen reader.
10
+ */
11
+ active?: boolean;
12
+ /** Publication date. The `date` slot overrides it. */
13
+ date?: string;
14
+ /** Native `disabled` on a button; `is-disabled` + `aria-disabled` on a link. */
15
+ disabled?: boolean;
16
+ /** Excerpt, clamped to three lines by core. The default slot overrides it. */
17
+ excerpt?: string;
18
+ /** Forces the hover fill, for previews. */
19
+ hovered?: boolean;
20
+ href?: string;
21
+ /** Sprite id of the trailing icon. */
22
+ icon?: string;
23
+ /** Article title. The `title` slot overrides it. */
24
+ title?: string;
25
+ /** Router destination. Takes precedence over `href`. */
26
+ to?: RouteLocationRaw;
27
+ };
28
+ export type KArticleListItemEmits = {
29
+ click: [event: MouseEvent];
30
+ };
31
+ export type KArticleListSlots = {
32
+ default?(): any;
33
+ };
34
+ export type KArticleListItemSlots = {
35
+ date?(): any;
36
+ /** The excerpt. */
37
+ default?(): any;
38
+ icon?(): any;
39
+ title?(): any;
40
+ };
@@ -1,6 +1,10 @@
1
1
  import type { KAvatarProps, KAvatarSlots } from './types';
2
2
  type __VLS_Slots = KAvatarSlots;
3
- declare const __VLS_base: import("vue").DefineComponent<KAvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KAvatarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const __VLS_base: import("vue").DefineComponent<KAvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ remove: () => any;
5
+ }, string, import("vue").PublicProps, Readonly<KAvatarProps> & Readonly<{
6
+ onRemove?: (() => any) | undefined;
7
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
8
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
9
  declare const _default: typeof __VLS_export;
6
10
  export default _default;
@@ -1,15 +1,40 @@
1
+ import type { AvatarColor, AvatarHue, AvatarShade } from '@knitify/core';
1
2
  import { Intent } from '../../types';
2
- export type KAvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
+ export type KAvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ export type KAvatarTextPosition = 'right' | 'left' | 'stacked';
5
+ export type KAvatarHue = AvatarHue;
6
+ export type KAvatarShade = AvatarShade;
7
+ export type KAvatarColor = AvatarColor;
3
8
  export type KAvatarProps = {
4
9
  /** Alt text for `src`. Empty by default, which hides a decorative photo. */
5
10
  alt?: string;
6
11
  /**
7
- * Placeholder glyph, used when there is no `src`. `true` is core's `#user`;
12
+ * A count or short label on the circle's top-right, such as `3` or `9+`.
13
+ * The `badge` slot replaces it with richer content.
14
+ */
15
+ badge?: number | string;
16
+ /**
17
+ * Picks a stable hue color from this key, usually a user ID, via core's
18
+ * `avatarColor()`. Ignored when `variant` is set.
19
+ */
20
+ colorKey?: string;
21
+ /**
22
+ * Placeholder glyph, used when there is no `src`. `true` is core's `#kt-user`;
8
23
  * a string is any other sprite href.
9
24
  */
10
25
  icon?: boolean | string;
11
26
  /** The muted "+3" tile that closes a truncated group. */
12
27
  overflow?: boolean;
28
+ /**
29
+ * A remove button on the circle's top-right, emitting `remove`. It shows on
30
+ * hover and on keyboard focus, and always on touch screens.
31
+ */
32
+ removable?: boolean;
33
+ /**
34
+ * Accessible name for the remove button, such as "Remove Jerome". The
35
+ * button is an icon alone, so give it one whenever `removable` is set.
36
+ */
37
+ removeLabel?: string;
13
38
  size?: KAvatarSize;
14
39
  src?: string;
15
40
  /**
@@ -22,10 +47,42 @@ export type KAvatarProps = {
22
47
  * uses, so give it one wherever the state carries meaning.
23
48
  */
24
49
  statusLabel?: string;
25
- variant?: Intent;
50
+ /**
51
+ * Secondary label line, under `text`. Either line on its own is enough to
52
+ * give the avatar a label.
53
+ */
54
+ subtext?: string;
55
+ /**
56
+ * Primary label line beside the avatar. With neither `text` nor `subtext`,
57
+ * `.KAvatar` holds the circle alone and measures exactly as wide as it.
58
+ */
59
+ text?: string;
60
+ /** Which side the label sits on. `right` by default. */
61
+ textPosition?: KAvatarTextPosition;
62
+ /**
63
+ * An intent for a semantic avatar, or a hue color such as `cyan400` to tell
64
+ * participants apart. `colorKey` picks a stable hue instead.
65
+ */
66
+ variant?: Intent | KAvatarColor;
67
+ };
68
+ export type KAvatarEmits = {
69
+ /** The remove button was clicked. The click does not reach the avatar. */
70
+ remove: [];
26
71
  };
27
72
  export type KAvatarSlots = {
73
+ /**
74
+ * Replaces the remove button with a button of your own. Give it the
75
+ * `KAvatar-action` class, which positions it and hides it until hover.
76
+ */
77
+ action?(): any;
78
+ /** Rich replacement for the `badge` prop. */
79
+ badge?(): any;
80
+ /** The initials inside the circle. */
28
81
  default?(): any;
82
+ /** Rich replacement for the `subtext` prop. */
83
+ subtext?(): any;
84
+ /** Rich replacement for the `text` prop. */
85
+ text?(): any;
29
86
  };
30
87
  export type KAvatarGroupProps = {
31
88
  /**
@@ -34,8 +91,39 @@ export type KAvatarGroupProps = {
34
91
  * overflow tile instead.
35
92
  */
36
93
  diagonal?: boolean;
37
- /** On a diagonal group the size belongs here, not on the children. */
94
+ /**
95
+ * Lifts the avatar under the pointer and brings it to the front. Row groups
96
+ * only; it has no effect with `diagonal`.
97
+ */
98
+ hoverable?: boolean;
99
+ /**
100
+ * Accessible name for the group as a whole, such as "Design team, 6
101
+ * people". With it, the group reads as one image rather than as each
102
+ * avatar's initials in turn. Give it one on a `pie` group.
103
+ */
104
+ label?: string;
105
+ /**
106
+ * One circle cut into a slice per avatar, as in Teams: up to four. For a
107
+ * bigger group, pass three avatars and an `overflow` tile such as "+3".
108
+ * Not combined with `diagonal`.
109
+ */
110
+ pie?: boolean;
111
+ /**
112
+ * On a diagonal group the size belongs here, not on the children. It also
113
+ * sizes `status`, so a row of larger avatars wants it set too.
114
+ */
38
115
  size?: KAvatarSize;
116
+ /**
117
+ * One presence dot for the group as a whole, in place of a dot per avatar.
118
+ * Absent or `false` renders none, `true` the grey offline dot, and an intent
119
+ * colours it.
120
+ */
121
+ status?: boolean | Intent;
122
+ /**
123
+ * Accessible name for the status dot. Colour is the only channel the dot
124
+ * uses, so give it one wherever the state carries meaning.
125
+ */
126
+ statusLabel?: string;
39
127
  };
40
128
  export type KAvatarGroupSlots = {
41
129
  default?(): any;
@@ -1,5 +1,7 @@
1
1
  import { Size, Variant } from '../../types';
2
2
  export type KBadgeProps = {
3
+ /** Tighter padding for a badge sitting on an avatar or in a dense list. */
4
+ compact?: boolean;
3
5
  pill?: boolean;
4
6
  size?: Size;
5
7
  subtle?: boolean;
@@ -13,6 +13,8 @@ export type KCalendarProps = {
13
13
  maxDate?: Date;
14
14
  minDate?: Date;
15
15
  mode?: KCalendarMode;
16
+ /** Months shown side by side. Two suits range selection; defaults to `1`. */
17
+ months?: 1 | 2;
16
18
  };
17
19
  export type KCalendarEmits = {
18
20
  clear: [];
@@ -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,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 { 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
+ };
@@ -16,8 +16,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
16
16
  }>, {
17
17
  disabled: boolean;
18
18
  busy: boolean;
19
- maxRows: number;
20
19
  placeholder: string;
20
+ maxRows: number;
21
21
  newlineOnEnter: boolean;
22
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
23
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,2 +1,3 @@
1
1
  import type { InjectionKey, Ref } from 'vue';
2
2
  export declare const chatBusyKey: InjectionKey<Ref<boolean>>;
3
+ export declare const chatAiKey: InjectionKey<Ref<boolean>>;
@@ -1,4 +1,7 @@
1
+ import type { Intent } from '../../types';
1
2
  export type KChatProps = {
3
+ /** Stacks every message's actions under its bubble instead of beside it. */
4
+ actionsBottom?: boolean;
2
5
  ai?: boolean;
3
6
  autoscroll?: boolean;
4
7
  busy?: boolean;
@@ -18,6 +21,93 @@ export type KChatMessageProps = {
18
21
  export type KChatMessageSlots = {
19
22
  default?(): any;
20
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;
21
111
  };
22
112
  export type KChatPromptProps = {
23
113
  busy?: boolean;
@@ -34,11 +124,25 @@ export type KChatPromptEmits = {
34
124
  stop: [];
35
125
  submit: [value: string];
36
126
  };
127
+ /**
128
+ * `busy` is the chat's busy state; `disabled` is whether the send button is
129
+ * disabled (no draft, or the prompt itself disabled), for controls that
130
+ * should follow it.
131
+ */
132
+ type KChatPromptSlotProps = {
133
+ busy: boolean;
134
+ disabled: boolean;
135
+ };
37
136
  export type KChatPromptSlots = {
38
- send?(props: {
39
- busy: boolean;
40
- disabled: boolean;
41
- }): any;
137
+ send?(props: KChatPromptSlotProps): any;
138
+ /** Inside the field border, before the text (a `KInput` addon). */
139
+ prefix?(props: KChatPromptSlotProps): any;
140
+ /** Inside the field border, after the text (a `KInput` addon). */
141
+ suffix?(props: KChatPromptSlotProps): any;
142
+ /** Outside the field, before it. */
143
+ start?(props: KChatPromptSlotProps): any;
144
+ /** Outside the field, between it and the send button. */
145
+ end?(props: KChatPromptSlotProps): any;
42
146
  };
43
147
  export type KChatShimmerProps = {
44
148
  interval?: number;
@@ -48,3 +152,4 @@ export type KChatShimmerProps = {
48
152
  export type KChatShimmerSlots = {
49
153
  default?(): any;
50
154
  };
155
+ export {};
@@ -0,0 +1,47 @@
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
+ compose: () => any;
29
+ panel: (open: boolean) => any;
30
+ activate: (id: string) => any;
31
+ }, string, import("vue").PublicProps, Readonly<KChatDockProps> & Readonly<{
32
+ onSelect?: ((id: string, opened: boolean) => any) | undefined;
33
+ onSearch?: ((query: string) => any) | undefined;
34
+ onReflow?: (() => any) | undefined;
35
+ onLauncher?: (() => any) | undefined;
36
+ onCompose?: (() => any) | undefined;
37
+ onPanel?: ((open: boolean) => any) | undefined;
38
+ onActivate?: ((id: string) => any) | undefined;
39
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
41
+ declare const _default: typeof __VLS_export;
42
+ export default _default;
43
+ type __VLS_WithSlots<T, S> = T & {
44
+ new (): {
45
+ $slots: S;
46
+ };
47
+ };
@@ -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,28 @@
1
+ import type { KChatNewWindowProps, KChatNewWindowSlots, KChatWindowState } from './types';
2
+ type __VLS_Props = KChatNewWindowProps;
3
+ type __VLS_Slots = KChatNewWindowSlots;
4
+ type __VLS_ModelProps = {
5
+ 'state'?: KChatWindowState;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
9
+ expand: () => void | undefined;
10
+ rail: () => void | undefined;
11
+ focus: () => void | undefined;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ close: () => any;
14
+ search: (query: string) => any;
15
+ "update:state": (value: KChatWindowState) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ onClose?: (() => any) | undefined;
18
+ onSearch?: ((query: string) => any) | undefined;
19
+ "onUpdate:state"?: ((value: KChatWindowState) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -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,29 @@
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
+ compose: () => any;
10
+ "new-chat-search": (query: string) => any;
11
+ "new-chat-close": () => any;
12
+ }, string, import("vue").PublicProps, Readonly<KMessengerProps> & Readonly<{
13
+ onError?: ((kind: import("./messenger-types").ChatDockErrorKind, id: string | undefined, error: unknown) => any) | undefined;
14
+ onSend?: ((message: import("./messenger-types").ChatMessage) => any) | undefined;
15
+ onOpen?: ((id: string) => any) | undefined;
16
+ onClose?: ((id: string) => any) | undefined;
17
+ onReceive?: ((message: import("./messenger-types").ChatMessage) => any) | undefined;
18
+ onCompose?: (() => any) | undefined;
19
+ "onNew-chat-search"?: ((query: string) => any) | undefined;
20
+ "onNew-chat-close"?: (() => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };