@yewdiel21/motion-kit 0.14.0 → 0.16.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 (156) hide show
  1. package/README.md +178 -155
  2. package/bin/motion-kit.mjs +3 -3
  3. package/dist/auto/index.d.ts +6 -3
  4. package/dist/auto/index.js +8 -2
  5. package/dist/auto/index.js.map +1 -1
  6. package/dist/{chunk-EY4BJKC4.js → chunk-NFZIX3IA.js} +2 -2
  7. package/dist/chunk-RBEKR5UZ.js +3660 -0
  8. package/dist/chunk-RBEKR5UZ.js.map +1 -0
  9. package/dist/{chunk-CU6SXW3E.js → chunk-SDQ776LG.js} +1596 -485
  10. package/dist/chunk-SDQ776LG.js.map +1 -0
  11. package/dist/css/components/add-to-cart.css +72 -0
  12. package/dist/css/components/bidirectional-slider.css +168 -0
  13. package/dist/css/components/chart.css +7 -0
  14. package/dist/css/components/data-table.css +121 -26
  15. package/dist/css/components/filter-builder.css +10 -15
  16. package/dist/css/components/heatmap-chart.css +398 -0
  17. package/dist/css/components/hover-card.css +8 -2
  18. package/dist/css/components/image-preview.css +90 -2
  19. package/dist/css/components/json-viewer.css +33 -1
  20. package/dist/css/components/nav.css +102 -102
  21. package/dist/css/components/orbit-menu.css +130 -0
  22. package/dist/css/components/pagination.css +10 -5
  23. package/dist/css/components/pie-chart.css +397 -0
  24. package/dist/css/components/pill-button.css +135 -0
  25. package/dist/css/components/radar-chart.css +377 -0
  26. package/dist/css/components/radial-chart.css +412 -0
  27. package/dist/css/components/sankey-chart.css +365 -0
  28. package/dist/css/components/scroll-island.css +114 -0
  29. package/dist/css/components/select.css +136 -0
  30. package/dist/css/components/toolbar.css +122 -0
  31. package/dist/css/components/tree-view.css +79 -0
  32. package/dist/css/components/voice-dots.css +70 -0
  33. package/dist/elements/index.d.ts +180 -7
  34. package/dist/elements/index.js +293 -7
  35. package/dist/elements/index.js.map +1 -1
  36. package/dist/{engine-Cn6IhE3z.d.ts → engine-5zRIssTO.d.ts} +11 -1
  37. package/dist/index.css +1849 -168
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +33 -3
  40. package/dist/index.js.map +1 -1
  41. package/dist/react/index.d.ts +117 -11
  42. package/dist/react/index.js +320 -13
  43. package/dist/react/index.js.map +1 -1
  44. package/dist/{reduced-BBUusld6.d.ts → reduced-DQwVXQYb.d.ts} +1 -1
  45. package/dist/{reveal-DEvp6U6T.d.ts → reveal-DRpNO4KP.d.ts} +109 -4
  46. package/dist/store-Da3zSh8Z.d.ts +457 -0
  47. package/package.json +9 -16
  48. package/registry.json +1096 -948
  49. package/src/auto/auto-init.ts +6 -0
  50. package/src/components/add-to-cart/README.md +49 -0
  51. package/src/components/add-to-cart/add-to-cart.css +71 -0
  52. package/src/components/add-to-cart/element.ts +20 -0
  53. package/src/components/add-to-cart/engine.ts +206 -0
  54. package/src/components/add-to-cart/react.tsx +33 -0
  55. package/src/components/bidirectional-slider/README.md +46 -0
  56. package/src/components/bidirectional-slider/bidirectional-slider.css +167 -0
  57. package/src/components/bidirectional-slider/element.ts +42 -0
  58. package/src/components/bidirectional-slider/engine.ts +289 -0
  59. package/src/components/bidirectional-slider/react.tsx +45 -0
  60. package/src/components/chart/README.md +49 -24
  61. package/src/components/chart/chart.css +7 -0
  62. package/src/components/chart/element.ts +4 -1
  63. package/src/components/chart/engine.ts +153 -34
  64. package/src/components/chart/parts.ts +237 -0
  65. package/src/components/chart/react.tsx +2 -2
  66. package/src/components/chart/use-chart.ts +55 -0
  67. package/src/components/data-table/README.md +3 -3
  68. package/src/components/data-table/data-table.css +121 -26
  69. package/src/components/data-table/engine.ts +81 -29
  70. package/src/components/editable-table/engine.ts +67 -11
  71. package/src/components/filter-builder/engine.ts +33 -2
  72. package/src/components/filter-builder/filter-builder.css +10 -15
  73. package/src/components/heatmap-chart/README.md +48 -0
  74. package/src/components/heatmap-chart/element.ts +21 -0
  75. package/src/components/heatmap-chart/engine.ts +281 -0
  76. package/src/components/heatmap-chart/heatmap-chart.css +93 -0
  77. package/src/components/heatmap-chart/react.tsx +14 -0
  78. package/src/components/hover-card/engine.ts +30 -1
  79. package/src/components/hover-card/hover-card.css +8 -2
  80. package/src/components/image-preview/element.ts +1 -1
  81. package/src/components/image-preview/engine.ts +95 -15
  82. package/src/components/image-preview/image-preview.css +90 -2
  83. package/src/components/image-preview/react.tsx +3 -3
  84. package/src/components/json-viewer/engine.ts +11 -2
  85. package/src/components/json-viewer/json-viewer.css +33 -1
  86. package/src/components/nav/README.md +12 -10
  87. package/src/components/nav/element.ts +5 -5
  88. package/src/components/nav/engine.ts +21 -14
  89. package/src/components/nav/nav.css +102 -102
  90. package/src/components/nav/react.tsx +4 -4
  91. package/src/components/orbit-menu/README.md +46 -0
  92. package/src/components/orbit-menu/element.ts +27 -0
  93. package/src/components/orbit-menu/engine.ts +179 -0
  94. package/src/components/orbit-menu/orbit-menu.css +129 -0
  95. package/src/components/orbit-menu/react.tsx +44 -0
  96. package/src/components/pagination/README.md +1 -1
  97. package/src/components/pagination/engine.ts +50 -4
  98. package/src/components/pagination/pagination.css +10 -5
  99. package/src/components/pie-chart/README.md +48 -0
  100. package/src/components/pie-chart/element.ts +30 -0
  101. package/src/components/pie-chart/engine.ts +283 -0
  102. package/src/components/pie-chart/pie-chart.css +92 -0
  103. package/src/components/pie-chart/react.tsx +14 -0
  104. package/src/components/pill-button/README.md +46 -0
  105. package/src/components/pill-button/element.ts +16 -0
  106. package/src/components/pill-button/engine.ts +77 -0
  107. package/src/components/pill-button/pill-button.css +134 -0
  108. package/src/components/pill-button/react.tsx +32 -0
  109. package/src/components/radar-chart/README.md +48 -0
  110. package/src/components/radar-chart/element.ts +30 -0
  111. package/src/components/radar-chart/engine.ts +327 -0
  112. package/src/components/radar-chart/radar-chart.css +72 -0
  113. package/src/components/radar-chart/react.tsx +14 -0
  114. package/src/components/radial-chart/README.md +58 -0
  115. package/src/components/radial-chart/element.ts +30 -0
  116. package/src/components/radial-chart/engine.ts +317 -0
  117. package/src/components/radial-chart/radial-chart.css +107 -0
  118. package/src/components/radial-chart/react.tsx +14 -0
  119. package/src/components/sankey-chart/README.md +48 -0
  120. package/src/components/sankey-chart/element.ts +31 -0
  121. package/src/components/sankey-chart/engine.ts +401 -0
  122. package/src/components/sankey-chart/react.tsx +14 -0
  123. package/src/components/sankey-chart/sankey-chart.css +60 -0
  124. package/src/components/scroll-island/README.md +44 -0
  125. package/src/components/scroll-island/element.ts +16 -0
  126. package/src/components/scroll-island/engine.ts +274 -0
  127. package/src/components/scroll-island/react.tsx +26 -0
  128. package/src/components/scroll-island/scroll-island.css +113 -0
  129. package/src/components/select/README.md +34 -0
  130. package/src/components/select/element.ts +26 -0
  131. package/src/components/select/engine.ts +267 -0
  132. package/src/components/select/react.tsx +33 -0
  133. package/src/components/select/select.css +135 -0
  134. package/src/components/toolbar/README.md +46 -0
  135. package/src/components/toolbar/element.ts +30 -0
  136. package/src/components/toolbar/engine.ts +230 -0
  137. package/src/components/toolbar/react.tsx +34 -0
  138. package/src/components/toolbar/toolbar.css +121 -0
  139. package/src/components/tree-view/element.ts +1 -1
  140. package/src/components/tree-view/engine.ts +174 -0
  141. package/src/components/tree-view/react.tsx +7 -3
  142. package/src/components/tree-view/tree-view.css +79 -0
  143. package/src/components/voice-dots/README.md +48 -0
  144. package/src/components/voice-dots/element.ts +45 -0
  145. package/src/components/voice-dots/engine.ts +243 -0
  146. package/src/components/voice-dots/react.tsx +52 -0
  147. package/src/components/voice-dots/voice-dots.css +69 -0
  148. package/src/elements/index.ts +39 -0
  149. package/src/index.ts +16 -0
  150. package/src/motion/liquid.ts +14 -4
  151. package/src/react/index.ts +14 -1
  152. package/dist/chunk-6P4P7NU6.js +0 -1401
  153. package/dist/chunk-6P4P7NU6.js.map +0 -1
  154. package/dist/chunk-CU6SXW3E.js.map +0 -1
  155. package/dist/store-DjkTBX7f.d.ts +0 -195
  156. /package/dist/{chunk-EY4BJKC4.js.map → chunk-NFZIX3IA.js.map} +0 -0
@@ -1,195 +0,0 @@
1
- import { I as Instance } from './types-BkS_raL8.js';
2
- import { Flip } from 'gsap/Flip';
3
- import { a0 as RevealHandle } from './reveal-DEvp6U6T.js';
4
-
5
- interface ThemePickerOptions {
6
- /** Theme ids to show, in order. Default: visible presets, or all with showHidden. */
7
- themes?: string[];
8
- showHidden?: boolean;
9
- labels?: {
10
- group?: string;
11
- };
12
- onChange?: (id: string) => void;
13
- }
14
- interface ThemePickerInstance extends Instance {
15
- select(id: string): void;
16
- }
17
- declare function createThemePicker(root: HTMLElement | null, options?: ThemePickerOptions): ThemePickerInstance;
18
-
19
- interface ToasterLabels {
20
- dismiss?: string;
21
- }
22
- interface ToasterOptions {
23
- labels?: ToasterLabels;
24
- }
25
- type ToasterInstance = Instance;
26
- /** Render the toast list into `host` (a fixed layer at the top of the screen). */
27
- declare function createToaster(host: HTMLElement | null, options?: ToasterOptions): ToasterInstance;
28
-
29
- type ChatRole = 'user' | 'assistant' | 'system';
30
- interface ChatLabels {
31
- thinking?: string;
32
- }
33
- interface ChatOptions {
34
- /** Animate the messages already there when the chat starts (default: no, history stays still). */
35
- animateExisting?: boolean;
36
- /** Clear the input after sending (default). */
37
- clearOnSend?: boolean;
38
- labels?: ChatLabels;
39
- onSend?: (text: string) => void;
40
- }
41
- interface ChatInstance extends Instance {
42
- /** Append a plain-text message (vanilla convenience); it enters on its own. */
43
- add(role: ChatRole, text: string): HTMLElement;
44
- /** Show the thinking placeholder after 500 ms (a fast answer never shows it). */
45
- pending(): void;
46
- /** Add the answer: it morphs out of the placeholder if that was showing, else it enters. */
47
- reply(message: HTMLElement | string): HTMLElement;
48
- /** A confirmation bar flows in and its words rise. */
49
- confirm(bar: HTMLElement): void;
50
- setRecording(on: boolean): void;
51
- scrollToLatest(): void;
52
- /** Mark a message as already shown (a framework animates it itself). */
53
- adopt(message: Element): void;
54
- readonly messages: HTMLElement;
55
- }
56
- /** data-flip-id of the thinking placeholder; a framework's own placeholder must carry it. */
57
- declare const PENDING_ID = "mk-chat-pending";
58
- /** The thinking placeholder's geometry, taken before the DOM changes (for frameworks). */
59
- declare const capturePending: (placeholder: Element | null) => Flip.FlipState | null;
60
- /** Morph a captured placeholder into the reply (after the DOM shows the reply). */
61
- declare function morphPendingToReply(state: ReturnType<typeof Flip.getState> | null, reply: HTMLElement, scroller?: HTMLElement | null): gsap.core.Timeline | null;
62
- /** A message bubble element (plain text). */
63
- declare function chatMessage(role: ChatRole, text: string): HTMLDivElement;
64
- declare function createChat(root: HTMLElement | null, options?: ChatOptions): ChatInstance;
65
-
66
- declare const NAV_STYLES: readonly ["clasica", "bonita", "dock", "guapa", "tasks", "melon", "tunnel"];
67
- type NavStyle = (typeof NAV_STYLES)[number];
68
- interface NavOptions {
69
- /** Default: the saved one (storageKey), else the mk-nav--<style> class in the markup, else 'bonita' (Money's default). */
70
- style?: NavStyle;
71
- /** The accent variant: the current page in primary-container. */
72
- accent?: boolean;
73
- /** Reveal the shell from the first button when the nav starts (off by default). */
74
- reveal?: boolean;
75
- /** Remember the chosen style in localStorage under this key. */
76
- storageKey?: string;
77
- labels?: {
78
- nav?: string;
79
- };
80
- onSelect?: (index: number, value: string | undefined, item: HTMLElement) => void;
81
- }
82
- interface NavInstance extends Instance {
83
- /** Mark a page as current, by index or value (silent: no event). */
84
- select(target: number | string): void;
85
- setStyle(style: NavStyle): void;
86
- setAccent(on: boolean): void;
87
- readonly index: number;
88
- readonly style: NavStyle;
89
- readonly items: HTMLElement[];
90
- }
91
- interface NavigateDetail {
92
- index: number;
93
- value: string | undefined;
94
- item: HTMLElement;
95
- /** The click: call its preventDefault() to stop a link (single-page apps). */
96
- originalEvent: MouseEvent;
97
- }
98
- /** nav entrance: the app shell is uncovered from the nav's first button. */
99
- declare function revealShell(nav: HTMLElement): RevealHandle | null;
100
- declare function createNav(root: HTMLElement | null, options?: NavOptions): NavInstance;
101
-
102
- type CursorVariant = 'chip' | 'dot';
103
- interface CursorOptions {
104
- variant?: CursorVariant;
105
- /** Where it works. chip: the document; dot: the host's parent. */
106
- zone?: Element | null;
107
- /** dot: the word when nothing under the pointer gives one. */
108
- text?: string;
109
- /** dot: arrows shown while pressed. */
110
- arrows?: 'x' | 'y' | 'none';
111
- }
112
- interface CursorInstance extends Instance {
113
- readonly visible: boolean;
114
- readonly label: string;
115
- readonly position: {
116
- x: number;
117
- y: number;
118
- };
119
- readonly tone: 'light' | 'dark';
120
- /** One frame (dt = 1 at 60 Hz); the shared ticker calls it. */
121
- update(dt?: number): void;
122
- }
123
- declare function createCursor(host: HTMLElement | null, options?: CursorOptions): CursorInstance;
124
-
125
- interface IslandOptions {
126
- /** Drop in from above on load (true), wait for ready() ('manual') or not at all. */
127
- entrance?: boolean | 'manual';
128
- /** Close when the page scrolls after a wheel or touch. */
129
- closeOnScroll?: boolean;
130
- /** Close when a link inside a panel is followed. */
131
- closeOnNavigate?: boolean;
132
- /** Focus the first control of the panel that opens. */
133
- focusOnOpen?: boolean;
134
- /** The open panel's name, or null when it closes. */
135
- onChange?: (active: string | null) => void;
136
- }
137
- interface IslandInstance extends Instance {
138
- open(name?: string): void;
139
- close(returnFocus?: boolean): void;
140
- toggle(name?: string): void;
141
- /** Play the entrance (entrance: 'manual'). */
142
- ready(): void;
143
- readonly active: string | null;
144
- }
145
- declare function createIsland(root: HTMLElement | null, options?: IslandOptions): IslandInstance;
146
-
147
- type ToastTone = 'success' | 'error' | 'info' | 'neutral';
148
- interface ToastAction {
149
- label: string;
150
- onClick: () => void;
151
- }
152
- interface ToastOptions {
153
- /** The control the toast grows out of. */
154
- origin?: HTMLElement | null;
155
- /** ms on screen; 0 keeps it until dismissed. */
156
- duration?: number;
157
- tone?: ToastTone;
158
- action?: ToastAction;
159
- /** Show the tone's icon (default). */
160
- icon?: boolean;
161
- }
162
- interface ToastItem {
163
- id: number;
164
- message: string;
165
- origin: HTMLElement | null;
166
- duration: number;
167
- tone: ToastTone;
168
- action: ToastAction | null;
169
- icon: boolean;
170
- closing: boolean;
171
- }
172
- /** At most this many live toasts; older ones leave to make room. */
173
- declare const TOAST_LIMIT = 5;
174
- declare const getToasts: () => ToastItem[];
175
- declare function subscribeToasts(listener: () => void): () => void;
176
- declare function show(message: string, { origin, duration, tone, action, icon }?: ToastOptions): number;
177
- /** Start the closing animation of a toast. */
178
- declare function dismissToast(id: number): void;
179
- /** Take a toast out of the list (after its exit animation). */
180
- declare function removeToast(id: number): void;
181
- /** Remove every toast at once (no animation). */
182
- declare function clearToasts(): void;
183
- /** Show a toast: `toast('Copiado', { origin: button })`. Returns its id. */
184
- declare const toast: typeof show & {
185
- dismiss: typeof dismissToast;
186
- clear: typeof clearToasts;
187
- };
188
- declare const toastTimers: {
189
- start(id: number, duration: number): void;
190
- pause(id: number): void;
191
- resume(id: number): void;
192
- clear(id: number): void;
193
- };
194
-
195
- export { createNav as A, createThemePicker as B, type ChatInstance as C, createToaster as D, dismissToast as E, getToasts as F, morphPendingToReply as G, removeToast as H, type IslandInstance as I, revealShell as J, subscribeToasts as K, toast as L, toastTimers as M, NAV_STYLES as N, PENDING_ID as P, TOAST_LIMIT as T, type ChatLabels as a, type ChatOptions as b, type ChatRole as c, type CursorInstance as d, type CursorOptions as e, type CursorVariant as f, type IslandOptions as g, type NavInstance as h, type NavOptions as i, type NavStyle as j, type NavigateDetail as k, type ThemePickerInstance as l, type ThemePickerOptions as m, type ToastAction as n, type ToastItem as o, type ToastOptions as p, type ToastTone as q, type ToasterInstance as r, type ToasterLabels as s, type ToasterOptions as t, capturePending as u, chatMessage as v, clearToasts as w, createChat as x, createCursor as y, createIsland as z };