@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
package/README.md CHANGED
@@ -1,86 +1,113 @@
1
- # @knitify/vue
2
-
3
- Vue 3 components for [Knitify](https://www.npmjs.com/package/@knitify/core), the core UI library
4
- powering the Knitware ecosystem. Each component wraps Knitify's markup, classes, and interactive
5
- behaviour behind a typed Vue API.
6
-
7
- ## Installation
8
-
9
- ```bash
10
- pnpm add @knitify/vue @knitify/core
11
- ```
12
-
13
- `@knitify/core`, `vue`, and `vue-router` are peer dependencies — install them alongside this
14
- package.
15
-
16
- | Peer | Range |
17
- | --------------- | --------- |
18
- | `@knitify/core` | `^1.1.0` |
19
- | `vue` | `^3.5.12` |
20
- | `vue-router` | `^4.0.3` |
21
-
22
- ## Setup
23
-
24
- The components ship unstyled on their own — Knitify's stylesheet lives in `@knitify/core` and must
25
- be imported once by the consuming app:
26
-
27
- ```ts
28
- import '@knitify/core/main.css'
29
- ```
30
-
31
- ### Register every component
32
-
33
- The default export is a Vue plugin that registers all components globally:
34
-
35
- ```ts
36
- import { createApp } from 'vue'
37
- import Knitify from '@knitify/vue'
38
- import '@knitify/core/main.css'
39
- import App from './App.vue'
40
-
41
- createApp(App).use(Knitify).mount('#app')
42
- ```
43
-
44
- ### Or import individually
45
-
46
- Every component is also a named export, which keeps your bundle to what you actually use:
47
-
48
- ```vue
49
- <script setup lang="ts">
50
- import { ref } from 'vue'
51
- import { KButton, KModal } from '@knitify/vue'
52
-
53
- const modal = ref<InstanceType<typeof KModal>>()
54
- </script>
55
-
56
- <template>
57
- <KButton variant="info" @click="modal?.show()">Open</KButton>
58
- <KModal ref="modal" title="Hello" closable>Content</KModal>
59
- </template>
60
- ```
61
-
62
- `KModal` is opened through the instance it exposes (`show`, `hide`, `toggle`) rather than a
63
- `v-model`, which keeps it in step with core's own `data-kt-modal-toggle` attribute.
64
-
65
- Colour-carrying props take Knitify's semantic intents — `caution`, `warning`, `critical`, `info`,
66
- `discovery`, `affirm` — rather than generic names like `primary`.
67
-
68
- ## What's included
69
-
70
- 47 components covering layout (`KContainer`, `KGrid`, `KWorkspace`), navigation (`KNavbar`,
71
- `KBreadcrumb`, `KTabs`, `KMenuList`), forms (`KInput`, `KSelect`, `KCheckbox`, `KRadio`,
72
- `KToggle`, `KCalendar`), overlays (`KModal`, `KDrawer`, `KPopover`, `KTooltip`, `KDropdown`),
73
- feedback (`KAlert`, `KProgress`, `KNotificationList`), and data display (`KTable`,
74
- `KCard`, `KAvatar`, `KBadge`, `KAccordion`, `KCollapse`, `KFileTree`, `KChat`).
75
-
76
- Alongside the components:
77
-
78
- - `useToast()` — composable for pushing toasts imperatively
79
- - `accordionGroupKey`, `chatBusyKey` — injection keys for building on the accordion and chat
80
- primitives
81
- - Prop and emit types for every component, re-exported from the package root
82
-
83
- ## TypeScript
84
-
85
- The package is TypeScript-first and ships declarations at `dist/types/index.d.ts`. No
86
- `@types/*` package is needed.
1
+ # @knitify/vue
2
+
3
+ Vue 3 components for [Knitify](https://www.npmjs.com/package/@knitify/core), the core UI library
4
+ powering the Knitware ecosystem. Each component wraps Knitify's markup, classes, and interactive
5
+ behaviour behind a typed Vue API.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pnpm add @knitify/vue @knitify/core
11
+ ```
12
+
13
+ `@knitify/core`, `vue`, and `vue-router` are peer dependencies — install them alongside this
14
+ package.
15
+
16
+ | Peer | Range |
17
+ | --------------- | --------- |
18
+ | `@knitify/core` | `^1.1.0` |
19
+ | `vue` | `^3.5.12` |
20
+ | `vue-router` | `^4.0.3` |
21
+
22
+ ## Setup
23
+
24
+ The components ship unstyled on their own — Knitify's stylesheet lives in `@knitify/core` and must
25
+ be imported once by the consuming app:
26
+
27
+ ```ts
28
+ import '@knitify/core/main.css'
29
+ ```
30
+
31
+ ### Register every component
32
+
33
+ The default export is a Vue plugin that registers all components globally:
34
+
35
+ ```ts
36
+ import { createApp } from 'vue'
37
+ import Knitify from '@knitify/vue'
38
+ import '@knitify/core/main.css'
39
+ import App from './App.vue'
40
+
41
+ createApp(App).use(Knitify).mount('#app')
42
+ ```
43
+
44
+ ### Or import individually
45
+
46
+ Every component is also a named export, which keeps your bundle to what you actually use:
47
+
48
+ ```vue
49
+ <script setup lang="ts">
50
+ import { ref } from 'vue'
51
+ import { KButton, KModal } from '@knitify/vue'
52
+
53
+ const modal = ref<InstanceType<typeof KModal>>()
54
+ </script>
55
+
56
+ <template>
57
+ <KButton variant="info" @click="modal?.show()">Open</KButton>
58
+ <KModal ref="modal" title="Hello" closable>Content</KModal>
59
+ </template>
60
+ ```
61
+
62
+ `KModal` is opened through the instance it exposes (`show`, `hide`, `toggle`) rather than a
63
+ `v-model`, which keeps it in step with core's own `data-kt-modal-toggle` attribute.
64
+
65
+ Colour-carrying props take Knitify's semantic intents — `caution`, `warning`, `critical`, `info`,
66
+ `discovery`, `affirm` — rather than generic names like `primary`.
67
+
68
+ ## What's included
69
+
70
+ 47 components covering layout (`KContainer`, `KGrid`, `KWorkspace`), navigation (`KNavbar`,
71
+ `KBreadcrumb`, `KTabs`, `KMenuList`), forms (`KInput`, `KSelect`, `KCheckbox`, `KRadio`,
72
+ `KToggle`, `KCalendar`), overlays (`KModal`, `KDrawer`, `KPopover`, `KTooltip`, `KDropdown`),
73
+ feedback (`KAlert`, `KProgress`, `KNotificationList`), and data display (`KTable`,
74
+ `KCard`, `KAvatar`, `KBadge`, `KAccordion`, `KCollapse`, `KFileTree`, `KChat`).
75
+
76
+ Alongside the components:
77
+
78
+ - `useToast()` — composable for pushing toasts imperatively
79
+ - `v-tooltip` — directive form of `KTooltip` (`v-tooltip:bottom="'Save'"`), registered by the
80
+ plugin and exported as `vTooltip` for local use
81
+ - `accordionGroupKey`, `chatBusyKey` — injection keys for building on the accordion and chat
82
+ primitives
83
+ - Prop and emit types for every component, re-exported from the package root
84
+
85
+ ### Chat dock with a backend
86
+
87
+ `KMessenger` wires the chat dock to your API with loader functions; `useChatDock` is the same state without the rendering.
88
+
89
+ ```vue
90
+ <script setup lang="ts">
91
+ import type { ChatDockLoaders } from '@knitify/vue'
92
+
93
+ const loaders: ChatDockLoaders = {
94
+ loadConversations: () => api.conversations(),
95
+ loadMessages: (id, cursor) => api.messages(id, cursor),
96
+ sendMessage: (id, text) => api.send(id, text),
97
+ }
98
+ </script>
99
+
100
+ <template>
101
+ <KMessenger :loaders="loaders" />
102
+ </template>
103
+ ```
104
+
105
+ The loaders are read once, when the component mounts — so bind a stable object
106
+ rather than an inline literal, which a re-render would replace to no effect.
107
+
108
+ Note that Vue unwraps refs on an exposed object, so through a template ref `conversations`, `openIds` and `listLoading` read as plain values rather than refs; the store you create yourself with `useChatDock` keeps them as refs.
109
+
110
+ ## TypeScript
111
+
112
+ The package is TypeScript-first and ships declarations at `dist/types/index.d.ts`. No
113
+ `@types/*` package is needed.