@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,8 +1,15 @@
1
1
  export { accordionGroupKey } from './Accordion/keys';
2
2
  export { chatBusyKey } from './Chat/keys';
3
+ export { chatDockKey } from './ChatDock/keys';
4
+ export { chatDockStoreKey, injectChatDock, provideChatDock, } from './ChatDock/store-keys';
5
+ export { useChatDock } from './ChatDock/useChatDock';
6
+ export { fieldKey } from './Field/keys';
7
+ export { useFieldControl } from '../utils/useFieldControl';
3
8
  export { default as KAccordion } from './Accordion/KAccordion.vue';
4
9
  export { default as KAccordionItem } from './Accordion/KAccordionItem.vue';
5
10
  export { default as KAlert } from './Alert/KAlert.vue';
11
+ export { default as KArticleList } from './ArticleList/KArticleList.vue';
12
+ export { default as KArticleListItem } from './ArticleList/KArticleListItem.vue';
6
13
  export { default as KAvatar } from './Avatar/KAvatar.vue';
7
14
  export { default as KAvatarGroup } from './Avatar/KAvatarGroup.vue';
8
15
  export { default as KBadge } from './Badge/KBadge.vue';
@@ -12,18 +19,32 @@ export { default as KButton } from './Button/KButton.vue';
12
19
  export { default as KCalendar } from './Calendar/KCalendar.vue';
13
20
  export { default as KCard } from './Card/KCard.vue';
14
21
  export { default as KChat } from './Chat/KChat.vue';
22
+ export { default as KChatDock } from './ChatDock/KChatDock.vue';
23
+ export { default as KChatDockItem } from './ChatDock/KChatDockItem.vue';
24
+ export { default as KChatDockPanel } from './ChatDock/KChatDockPanel.vue';
25
+ export { default as KChatDivider } from './Chat/KChatDivider.vue';
26
+ export { default as KMessenger } from './ChatDock/KMessenger.vue';
15
27
  export { default as KChatMessage } from './Chat/KChatMessage.vue';
28
+ export { default as KChatMessageActions } from './Chat/KChatMessageActions.vue';
16
29
  export { default as KChatMessages } from './Chat/KChatMessages.vue';
30
+ export { default as KChatNotice } from './Chat/KChatNotice.vue';
17
31
  export { default as KChatPrompt } from './Chat/KChatPrompt.vue';
18
32
  export { default as KChatShimmer } from './Chat/KChatShimmer.vue';
33
+ export { default as KChatWindow } from './ChatDock/KChatWindow.vue';
34
+ export { default as KChatNewWindow } from './ChatDock/KChatNewWindow.vue';
19
35
  export { default as KCheckbox } from './Checkbox/KCheckbox.vue';
20
36
  export { default as KCollapse } from './Collapse/KCollapse.vue';
21
37
  export { default as KContainer } from './Container/KContainer.vue';
38
+ export { default as KDateInput } from './DateInput/KDateInput.vue';
39
+ export { default as KDateRangeInput } from './DateInput/KDateRangeInput.vue';
40
+ export { default as KDivider } from './Divider/KDivider.vue';
22
41
  export { default as KDrawer } from './Drawer/KDrawer.vue';
23
42
  export { default as KDropdown } from './Dropdown/KDropdown.vue';
24
43
  export { default as KDropdownItem } from './Dropdown/KDropdownItem.vue';
25
44
  export { default as KDropdownMenu } from './Dropdown/KDropdownMenu.vue';
45
+ export { default as KField } from './Field/KField.vue';
26
46
  export { default as KFileTree } from './FileTree/KFileTree.vue';
47
+ export { default as KFlex } from './Flex/KFlex.vue';
27
48
  export { default as KGrid } from './Grid/KGrid.vue';
28
49
  export { default as KGridColumn } from './Grid/KGridColumn.vue';
29
50
  export { default as KGridRow } from './Grid/KGridRow.vue';
@@ -36,15 +57,28 @@ export { default as KNavbar } from './Navbar/KNavbar.vue';
36
57
  export { default as KNavbarMenu } from './Navbar/KNavbarMenu.vue';
37
58
  export { default as KNotificationList } from './NotificationList/KNotificationList.vue';
38
59
  export { default as KNotificationListItem } from './NotificationList/KNotificationListItem.vue';
60
+ export { default as KPagination } from './Pagination/KPagination.vue';
39
61
  export { default as KPopover } from './Popover/KPopover.vue';
40
62
  export { default as KProgress } from './Progress/KProgress.vue';
41
63
  export { default as KRadio } from './Radio/KRadio.vue';
64
+ export { default as KRadioCard } from './RadioCard/KRadioCard.vue';
65
+ export { default as KRadioCardGroup } from './RadioCard/KRadioCardGroup.vue';
66
+ export { default as KSearchInput } from './SearchInput/KSearchInput.vue';
67
+ export { default as KSegmentedButton } from './SegmentedButtons/KSegmentedButton.vue';
68
+ export { default as KSegmentedButtons } from './SegmentedButtons/KSegmentedButtons.vue';
42
69
  export { default as KSelect } from './Select/KSelect.vue';
70
+ export { default as KSkeleton } from './Skeleton/KSkeleton.vue';
71
+ export { default as KSpinner } from './Spinner/KSpinner.vue';
43
72
  export { default as KTab } from './Tabs/KTab.vue';
44
73
  export { default as KTable } from './Table/KTable.vue';
74
+ export { default as KTableResizer } from './Table/KTableResizer.vue';
45
75
  export { default as KTabPanel } from './Tabs/KTabPanel.vue';
46
76
  export { default as KTabs } from './Tabs/KTabs.vue';
77
+ export { default as KTagsInput } from './TagsInput/KTagsInput.vue';
78
+ export { default as KTime } from './Time/KTime.vue';
79
+ export { default as KTimeInput } from './TimeInput/KTimeInput.vue';
47
80
  export { default as KToggle } from './Toggle/KToggle.vue';
48
81
  export { default as KTooltip } from './Tooltip/KTooltip.vue';
82
+ export { vTooltip } from './Tooltip/vTooltip';
49
83
  export { default as KWorkspace } from './Workspace/KWorkspace.vue';
50
84
  export { useToast } from './Toast/useToast';
@@ -1,18 +1,28 @@
1
1
  export * from './Accordion/types';
2
2
  export * from './Alert/types';
3
+ export * from './ArticleList/types';
3
4
  export * from './Avatar/types';
4
5
  export * from './Badge/types';
5
6
  export * from './Breadcrumb/types';
6
7
  export * from './Button/types';
7
8
  export * from './Calendar/types';
9
+ export * from './DateInput/types';
8
10
  export * from './Card/types';
9
11
  export * from './Chat/types';
12
+ export type { ChatDockCallResult, ChatDockContext, ChatDockInstance, } from './ChatDock/keys';
13
+ export * from './ChatDock/types';
14
+ export * from './ChatDock/messenger-types';
10
15
  export * from './Checkbox/types';
11
16
  export * from './Collapse/types';
12
17
  export * from './Container/types';
18
+ export * from './Divider/types';
13
19
  export * from './Drawer/types';
20
+ export * from './Field/types';
21
+ export type { FieldContext } from './Field/keys';
22
+ export type { UseFieldControlOptions } from '../utils/useFieldControl';
14
23
  export * from './Dropdown/types';
15
24
  export * from './FileTree/types';
25
+ export * from './Flex/types';
16
26
  export * from './Grid/types';
17
27
  export * from './Icon/types';
18
28
  export * from './Input/types';
@@ -20,12 +30,21 @@ export * from './MenuList/types';
20
30
  export * from './Modal/types';
21
31
  export * from './Navbar/types';
22
32
  export * from './NotificationList/types';
33
+ export * from './Pagination/types';
23
34
  export * from './Popover/types';
24
35
  export * from './Progress/types';
25
36
  export * from './Radio/types';
37
+ export * from './RadioCard/types';
38
+ export * from './SearchInput/types';
39
+ export * from './SegmentedButtons/types';
26
40
  export * from './Select/types';
41
+ export * from './Skeleton/types';
42
+ export * from './Spinner/types';
27
43
  export * from './Table/types';
28
44
  export * from './Tabs/types';
45
+ export * from './TagsInput/types';
46
+ export * from './Time/types';
47
+ export * from './TimeInput/types';
29
48
  export * from './Toast/types';
30
49
  export * from './Toggle/types';
31
50
  export * from './Tooltip/types';
@@ -1,4 +1,5 @@
1
1
  import { App } from 'vue';
2
+ export * from './types';
2
3
  export * from './components/types';
3
4
  export * from './components';
4
5
  declare const _default: {
@@ -0,0 +1,30 @@
1
+ import type { ShallowRef } from 'vue';
2
+ type Destroyable = {
3
+ destroy(): void;
4
+ };
5
+ type Options<Config, Controls> = {
6
+ root: Readonly<ShallowRef<HTMLElement | null>>;
7
+ /** Builds the core module on the root. */
8
+ create: (node: HTMLElement, config: Config) => Controls & Destroyable;
9
+ /** Read inside a watcher, so every prop it touches triggers a rebuild. */
10
+ config: () => Config;
11
+ /** Pushes the current model into a freshly built module. */
12
+ apply: (instance: Controls) => void;
13
+ listeners: Record<string, (event: CustomEvent) => void>;
14
+ };
15
+ /**
16
+ * The lifecycle the form-field wrappers share. Core reads its config once, in
17
+ * the constructor, so a config change means a rebuild rather than an update.
18
+ * Vue owns the root; core owns everything it renders inside.
19
+ */
20
+ export declare function useCoreModule<Config, Controls>({ root, create, config, apply, listeners, }: Options<Config, Controls>): {
21
+ getInstance: () => Controls | undefined;
22
+ };
23
+ /**
24
+ * Core disables a field's × while it is empty, but only when it paints. One
25
+ * the template inserts later takes its state from the root's `is-empty`,
26
+ * which core keeps current, so it never sits enabled with nothing to clear.
27
+ * Bound as a function ref: Vue calls it each time the button renders.
28
+ */
29
+ export declare function syncClearButtonFor(rootSelector: string): (element: unknown) => void;
30
+ export {};
@@ -0,0 +1,19 @@
1
+ import { type Ref } from 'vue';
2
+ export type DocumentEventOptions = {
3
+ capture?: boolean;
4
+ };
5
+ /**
6
+ * A `document` listener that exists only while `active` is true.
7
+ *
8
+ * Outside-click and Escape cannot be bound to the component's own element —
9
+ * they are about events that happen elsewhere. Core solves this with a
10
+ * permanent delegated listener that runs on every click on the page and then
11
+ * queries the DOM for anything open. Scoping the listener to the open state
12
+ * instead means a closed component costs nothing, and the handler never has to
13
+ * ask whether it should be running.
14
+ *
15
+ * Registered on the next tick after `active` turns true, so the very click or
16
+ * keypress that opened the component cannot immediately close it again by
17
+ * reaching this listener as it bubbles.
18
+ */
19
+ export declare function useDocumentEvent(active: Ref<boolean>, type: string, handler: (event: any) => void, options?: DocumentEventOptions): void;
@@ -0,0 +1,13 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * Opening this overlay closes every other mounted member of `group`.
4
+ *
5
+ * Core got this from its delegated toggles, which swept the page — Popover
6
+ * hiding every other `[data-kt-popover].is-active`, Dropdown and Select calling
7
+ * `destroyAll`. Once each component binds its own toggle there is no sweep, so
8
+ * the group replaces it.
9
+ *
10
+ * Dropdowns and selects share one group, as they did in core: `Select` extends
11
+ * `Dropdown`, and opening either closed the other.
12
+ */
13
+ export declare function useExclusive(group: string, open: Ref<boolean>, close: () => void): void;
@@ -0,0 +1,25 @@
1
+ type Attrs = Record<string, unknown>;
2
+ export type UseFieldControlOptions = {
3
+ /** The control's own `disabled` prop. */
4
+ disabled: () => boolean;
5
+ /**
6
+ * The control is a button (KSelect's toggle). A button's name comes from its
7
+ * content, so it is labelled by the field label plus itself. It takes no
8
+ * `aria-required`, which ARIA does not allow on a button, so a required
9
+ * field's hidden "required" text joins its `aria-labelledby` instead.
10
+ */
11
+ button?: boolean;
12
+ };
13
+ /**
14
+ * Merges the enclosing KField's ids and state onto a control's native element.
15
+ * Outside a KField it hands `baseAttrs` back untouched. Inside a group field
16
+ * the ARIA lives on the fieldset, so only `disabled` is inherited.
17
+ *
18
+ * A non-group field wires exactly one control: two would share its id.
19
+ */
20
+ export declare function useFieldControl(baseAttrs: () => Attrs, options: UseFieldControlOptions): {
21
+ controlAttrs: import("vue").ComputedRef<Attrs>;
22
+ isDisabled: import("vue").ComputedRef<boolean>;
23
+ field: import("..").FieldContext | undefined;
24
+ };
25
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type ClassValue, type Ref } from 'vue';
2
+ /**
3
+ * Applies `classes` to `element` with `classList`, for a root whose classes
4
+ * core also writes.
5
+ *
6
+ * Core adds and removes its state classes (`is-active`, `is-shown`, …) on the
7
+ * root itself. A `:class` binding cannot share the element with it: whenever
8
+ * the bound value changes, Vue assigns `className` outright, wiping every class
9
+ * core added — so changing a modifier while the component was open hid it.
10
+ * Adding and removing only the classes this owns leaves core's alone.
11
+ *
12
+ * The root keeps its base class as a static `class` in the template. Vue
13
+ * writes that once, when the element is created, and never patches it.
14
+ */
15
+ export declare function useRootClasses(element: Readonly<Ref<HTMLElement | null>>, classes: () => ClassValue): void;
@@ -0,0 +1,17 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * Tracks whether this overlay is the innermost open one of its kind.
4
+ *
5
+ * Core answered the same question with a single delegated Escape handler that
6
+ * closed the first `.is-active` overlay it found. Once each component binds its
7
+ * own Escape, they would all close together, so the stack keeps that to one.
8
+ *
9
+ * Modals and drawers keep separate stacks, matching core's independent
10
+ * handlers: Escape in a drawer opened over a modal closes the drawer only.
11
+ *
12
+ * `priority` breaks the ordering where recency is the wrong answer. Core's
13
+ * drawer handler preferred a drawer with a backdrop over a `noBackdrop` one
14
+ * regardless of which opened last, since the latter is a persistent panel
15
+ * rather than something Escape should dismiss.
16
+ */
17
+ export declare function useTopmost(name: string, active: Ref<boolean>, priority?: () => number): () => boolean;