@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.
- package/README.md +178 -155
- package/bin/motion-kit.mjs +3 -3
- package/dist/auto/index.d.ts +6 -3
- package/dist/auto/index.js +8 -2
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-EY4BJKC4.js → chunk-NFZIX3IA.js} +2 -2
- package/dist/chunk-RBEKR5UZ.js +3660 -0
- package/dist/chunk-RBEKR5UZ.js.map +1 -0
- package/dist/{chunk-CU6SXW3E.js → chunk-SDQ776LG.js} +1596 -485
- package/dist/chunk-SDQ776LG.js.map +1 -0
- package/dist/css/components/add-to-cart.css +72 -0
- package/dist/css/components/bidirectional-slider.css +168 -0
- package/dist/css/components/chart.css +7 -0
- package/dist/css/components/data-table.css +121 -26
- package/dist/css/components/filter-builder.css +10 -15
- package/dist/css/components/heatmap-chart.css +398 -0
- package/dist/css/components/hover-card.css +8 -2
- package/dist/css/components/image-preview.css +90 -2
- package/dist/css/components/json-viewer.css +33 -1
- package/dist/css/components/nav.css +102 -102
- package/dist/css/components/orbit-menu.css +130 -0
- package/dist/css/components/pagination.css +10 -5
- package/dist/css/components/pie-chart.css +397 -0
- package/dist/css/components/pill-button.css +135 -0
- package/dist/css/components/radar-chart.css +377 -0
- package/dist/css/components/radial-chart.css +412 -0
- package/dist/css/components/sankey-chart.css +365 -0
- package/dist/css/components/scroll-island.css +114 -0
- package/dist/css/components/select.css +136 -0
- package/dist/css/components/toolbar.css +122 -0
- package/dist/css/components/tree-view.css +79 -0
- package/dist/css/components/voice-dots.css +70 -0
- package/dist/elements/index.d.ts +180 -7
- package/dist/elements/index.js +293 -7
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-Cn6IhE3z.d.ts → engine-5zRIssTO.d.ts} +11 -1
- package/dist/index.css +1849 -168
- package/dist/index.d.ts +4 -4
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +117 -11
- package/dist/react/index.js +320 -13
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BBUusld6.d.ts → reduced-DQwVXQYb.d.ts} +1 -1
- package/dist/{reveal-DEvp6U6T.d.ts → reveal-DRpNO4KP.d.ts} +109 -4
- package/dist/store-Da3zSh8Z.d.ts +457 -0
- package/package.json +9 -16
- package/registry.json +1096 -948
- package/src/auto/auto-init.ts +6 -0
- package/src/components/add-to-cart/README.md +49 -0
- package/src/components/add-to-cart/add-to-cart.css +71 -0
- package/src/components/add-to-cart/element.ts +20 -0
- package/src/components/add-to-cart/engine.ts +206 -0
- package/src/components/add-to-cart/react.tsx +33 -0
- package/src/components/bidirectional-slider/README.md +46 -0
- package/src/components/bidirectional-slider/bidirectional-slider.css +167 -0
- package/src/components/bidirectional-slider/element.ts +42 -0
- package/src/components/bidirectional-slider/engine.ts +289 -0
- package/src/components/bidirectional-slider/react.tsx +45 -0
- package/src/components/chart/README.md +49 -24
- package/src/components/chart/chart.css +7 -0
- package/src/components/chart/element.ts +4 -1
- package/src/components/chart/engine.ts +153 -34
- package/src/components/chart/parts.ts +237 -0
- package/src/components/chart/react.tsx +2 -2
- package/src/components/chart/use-chart.ts +55 -0
- package/src/components/data-table/README.md +3 -3
- package/src/components/data-table/data-table.css +121 -26
- package/src/components/data-table/engine.ts +81 -29
- package/src/components/editable-table/engine.ts +67 -11
- package/src/components/filter-builder/engine.ts +33 -2
- package/src/components/filter-builder/filter-builder.css +10 -15
- package/src/components/heatmap-chart/README.md +48 -0
- package/src/components/heatmap-chart/element.ts +21 -0
- package/src/components/heatmap-chart/engine.ts +281 -0
- package/src/components/heatmap-chart/heatmap-chart.css +93 -0
- package/src/components/heatmap-chart/react.tsx +14 -0
- package/src/components/hover-card/engine.ts +30 -1
- package/src/components/hover-card/hover-card.css +8 -2
- package/src/components/image-preview/element.ts +1 -1
- package/src/components/image-preview/engine.ts +95 -15
- package/src/components/image-preview/image-preview.css +90 -2
- package/src/components/image-preview/react.tsx +3 -3
- package/src/components/json-viewer/engine.ts +11 -2
- package/src/components/json-viewer/json-viewer.css +33 -1
- package/src/components/nav/README.md +12 -10
- package/src/components/nav/element.ts +5 -5
- package/src/components/nav/engine.ts +21 -14
- package/src/components/nav/nav.css +102 -102
- package/src/components/nav/react.tsx +4 -4
- package/src/components/orbit-menu/README.md +46 -0
- package/src/components/orbit-menu/element.ts +27 -0
- package/src/components/orbit-menu/engine.ts +179 -0
- package/src/components/orbit-menu/orbit-menu.css +129 -0
- package/src/components/orbit-menu/react.tsx +44 -0
- package/src/components/pagination/README.md +1 -1
- package/src/components/pagination/engine.ts +50 -4
- package/src/components/pagination/pagination.css +10 -5
- package/src/components/pie-chart/README.md +48 -0
- package/src/components/pie-chart/element.ts +30 -0
- package/src/components/pie-chart/engine.ts +283 -0
- package/src/components/pie-chart/pie-chart.css +92 -0
- package/src/components/pie-chart/react.tsx +14 -0
- package/src/components/pill-button/README.md +46 -0
- package/src/components/pill-button/element.ts +16 -0
- package/src/components/pill-button/engine.ts +77 -0
- package/src/components/pill-button/pill-button.css +134 -0
- package/src/components/pill-button/react.tsx +32 -0
- package/src/components/radar-chart/README.md +48 -0
- package/src/components/radar-chart/element.ts +30 -0
- package/src/components/radar-chart/engine.ts +327 -0
- package/src/components/radar-chart/radar-chart.css +72 -0
- package/src/components/radar-chart/react.tsx +14 -0
- package/src/components/radial-chart/README.md +58 -0
- package/src/components/radial-chart/element.ts +30 -0
- package/src/components/radial-chart/engine.ts +317 -0
- package/src/components/radial-chart/radial-chart.css +107 -0
- package/src/components/radial-chart/react.tsx +14 -0
- package/src/components/sankey-chart/README.md +48 -0
- package/src/components/sankey-chart/element.ts +31 -0
- package/src/components/sankey-chart/engine.ts +401 -0
- package/src/components/sankey-chart/react.tsx +14 -0
- package/src/components/sankey-chart/sankey-chart.css +60 -0
- package/src/components/scroll-island/README.md +44 -0
- package/src/components/scroll-island/element.ts +16 -0
- package/src/components/scroll-island/engine.ts +274 -0
- package/src/components/scroll-island/react.tsx +26 -0
- package/src/components/scroll-island/scroll-island.css +113 -0
- package/src/components/select/README.md +34 -0
- package/src/components/select/element.ts +26 -0
- package/src/components/select/engine.ts +267 -0
- package/src/components/select/react.tsx +33 -0
- package/src/components/select/select.css +135 -0
- package/src/components/toolbar/README.md +46 -0
- package/src/components/toolbar/element.ts +30 -0
- package/src/components/toolbar/engine.ts +230 -0
- package/src/components/toolbar/react.tsx +34 -0
- package/src/components/toolbar/toolbar.css +121 -0
- package/src/components/tree-view/element.ts +1 -1
- package/src/components/tree-view/engine.ts +174 -0
- package/src/components/tree-view/react.tsx +7 -3
- package/src/components/tree-view/tree-view.css +79 -0
- package/src/components/voice-dots/README.md +48 -0
- package/src/components/voice-dots/element.ts +45 -0
- package/src/components/voice-dots/engine.ts +243 -0
- package/src/components/voice-dots/react.tsx +52 -0
- package/src/components/voice-dots/voice-dots.css +69 -0
- package/src/elements/index.ts +39 -0
- package/src/index.ts +16 -0
- package/src/motion/liquid.ts +14 -4
- package/src/react/index.ts +14 -1
- package/dist/chunk-6P4P7NU6.js +0 -1401
- package/dist/chunk-6P4P7NU6.js.map +0 -1
- package/dist/chunk-CU6SXW3E.js.map +0 -1
- package/dist/store-DjkTBX7f.d.ts +0 -195
- /package/dist/{chunk-EY4BJKC4.js.map → chunk-NFZIX3IA.js.map} +0 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import { I as Instance } from './types-BkS_raL8.js';
|
|
2
|
+
import { Flip } from 'gsap/Flip';
|
|
3
|
+
import { a3 as RevealHandle, a4 as DateInput } from './reveal-DRpNO4KP.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 ["sidebar", "pills", "dock", "card", "rail", "wash", "magnify"];
|
|
67
|
+
type NavStyle = (typeof NAV_STYLES)[number];
|
|
68
|
+
/** The names before 0.15, still accepted: each turns into the style it always was. */
|
|
69
|
+
declare const NAV_STYLE_ALIASES: {
|
|
70
|
+
readonly clasica: "sidebar";
|
|
71
|
+
readonly bonita: "pills";
|
|
72
|
+
readonly guapa: "card";
|
|
73
|
+
readonly tasks: "rail";
|
|
74
|
+
readonly melon: "wash";
|
|
75
|
+
readonly tunnel: "magnify";
|
|
76
|
+
};
|
|
77
|
+
type NavStyleAlias = keyof typeof NAV_STYLE_ALIASES;
|
|
78
|
+
/** A style name (new or old) as one of NAV_STYLES, or undefined. */
|
|
79
|
+
declare const toNavStyle: (value: unknown) => NavStyle | undefined;
|
|
80
|
+
interface NavOptions {
|
|
81
|
+
/** Default: the saved one (storageKey), else the mk-nav--<style> class in the markup, else 'pills'. Old names (clasica…) work too. */
|
|
82
|
+
style?: NavStyle | NavStyleAlias;
|
|
83
|
+
/** The accent variant: the current page in primary-container. */
|
|
84
|
+
accent?: boolean;
|
|
85
|
+
/** Reveal the shell from the first button when the nav starts (off by default). */
|
|
86
|
+
reveal?: boolean;
|
|
87
|
+
/** Remember the chosen style in localStorage under this key. */
|
|
88
|
+
storageKey?: string;
|
|
89
|
+
labels?: {
|
|
90
|
+
nav?: string;
|
|
91
|
+
};
|
|
92
|
+
onSelect?: (index: number, value: string | undefined, item: HTMLElement) => void;
|
|
93
|
+
}
|
|
94
|
+
interface NavInstance extends Instance {
|
|
95
|
+
/** Mark a page as current, by index or value (silent: no event). */
|
|
96
|
+
select(target: number | string): void;
|
|
97
|
+
setStyle(style: NavStyle | NavStyleAlias): void;
|
|
98
|
+
setAccent(on: boolean): void;
|
|
99
|
+
readonly index: number;
|
|
100
|
+
readonly style: NavStyle;
|
|
101
|
+
readonly items: HTMLElement[];
|
|
102
|
+
}
|
|
103
|
+
interface NavigateDetail {
|
|
104
|
+
index: number;
|
|
105
|
+
value: string | undefined;
|
|
106
|
+
item: HTMLElement;
|
|
107
|
+
/** The click: call its preventDefault() to stop a link (single-page apps). */
|
|
108
|
+
originalEvent: MouseEvent;
|
|
109
|
+
}
|
|
110
|
+
/** nav entrance: the app shell is uncovered from the nav's first button. */
|
|
111
|
+
declare function revealShell(nav: HTMLElement): RevealHandle | null;
|
|
112
|
+
declare function createNav(root: HTMLElement | null, options?: NavOptions): NavInstance;
|
|
113
|
+
|
|
114
|
+
type CursorVariant = 'chip' | 'dot';
|
|
115
|
+
interface CursorOptions {
|
|
116
|
+
variant?: CursorVariant;
|
|
117
|
+
/** Where it works. chip: the document; dot: the host's parent. */
|
|
118
|
+
zone?: Element | null;
|
|
119
|
+
/** dot: the word when nothing under the pointer gives one. */
|
|
120
|
+
text?: string;
|
|
121
|
+
/** dot: arrows shown while pressed. */
|
|
122
|
+
arrows?: 'x' | 'y' | 'none';
|
|
123
|
+
}
|
|
124
|
+
interface CursorInstance extends Instance {
|
|
125
|
+
readonly visible: boolean;
|
|
126
|
+
readonly label: string;
|
|
127
|
+
readonly position: {
|
|
128
|
+
x: number;
|
|
129
|
+
y: number;
|
|
130
|
+
};
|
|
131
|
+
readonly tone: 'light' | 'dark';
|
|
132
|
+
/** One frame (dt = 1 at 60 Hz); the shared ticker calls it. */
|
|
133
|
+
update(dt?: number): void;
|
|
134
|
+
}
|
|
135
|
+
declare function createCursor(host: HTMLElement | null, options?: CursorOptions): CursorInstance;
|
|
136
|
+
|
|
137
|
+
interface IslandOptions {
|
|
138
|
+
/** Drop in from above on load (true), wait for ready() ('manual') or not at all. */
|
|
139
|
+
entrance?: boolean | 'manual';
|
|
140
|
+
/** Close when the page scrolls after a wheel or touch. */
|
|
141
|
+
closeOnScroll?: boolean;
|
|
142
|
+
/** Close when a link inside a panel is followed. */
|
|
143
|
+
closeOnNavigate?: boolean;
|
|
144
|
+
/** Focus the first control of the panel that opens. */
|
|
145
|
+
focusOnOpen?: boolean;
|
|
146
|
+
/** The open panel's name, or null when it closes. */
|
|
147
|
+
onChange?: (active: string | null) => void;
|
|
148
|
+
}
|
|
149
|
+
interface IslandInstance extends Instance {
|
|
150
|
+
open(name?: string): void;
|
|
151
|
+
close(returnFocus?: boolean): void;
|
|
152
|
+
toggle(name?: string): void;
|
|
153
|
+
/** Play the entrance (entrance: 'manual'). */
|
|
154
|
+
ready(): void;
|
|
155
|
+
readonly active: string | null;
|
|
156
|
+
}
|
|
157
|
+
declare function createIsland(root: HTMLElement | null, options?: IslandOptions): IslandInstance;
|
|
158
|
+
|
|
159
|
+
interface ToolbarOptions {
|
|
160
|
+
/** The chosen tool (its data-mk-tool, else its position); default: the first one. */
|
|
161
|
+
value?: string;
|
|
162
|
+
/** Default 'vertical'. */
|
|
163
|
+
orientation?: 'vertical' | 'horizontal';
|
|
164
|
+
/** The label beside the tool under the pointer or focus (default true). */
|
|
165
|
+
tips?: boolean;
|
|
166
|
+
onChange?: (value: string) => void;
|
|
167
|
+
}
|
|
168
|
+
interface ToolbarInstance extends Instance {
|
|
169
|
+
setValue(value: string, notify?: boolean): void;
|
|
170
|
+
readonly value: string;
|
|
171
|
+
}
|
|
172
|
+
declare function createToolbar(root: HTMLElement | null, options?: ToolbarOptions): ToolbarInstance;
|
|
173
|
+
|
|
174
|
+
interface BidirectionalSliderOptions {
|
|
175
|
+
/** Default −100. */
|
|
176
|
+
min?: number;
|
|
177
|
+
/** Default 100. */
|
|
178
|
+
max?: number;
|
|
179
|
+
/** Where the fill starts (default 0, kept inside min…max). */
|
|
180
|
+
origin?: number;
|
|
181
|
+
step?: number;
|
|
182
|
+
value?: number;
|
|
183
|
+
disabled?: boolean;
|
|
184
|
+
name?: string;
|
|
185
|
+
/** Accessible name of the input. */
|
|
186
|
+
label?: string;
|
|
187
|
+
/** The end icons: − and + (default), the speaker, or none. */
|
|
188
|
+
icons?: 'signs' | 'volume' | false;
|
|
189
|
+
/** Text for the bubble and aria-valuetext (default: signed, "+24", "−12"). */
|
|
190
|
+
formatValue?: (value: number) => string;
|
|
191
|
+
onInput?: (value: number) => void;
|
|
192
|
+
onChange?: (value: number) => void;
|
|
193
|
+
}
|
|
194
|
+
interface BidirectionalSliderInstance extends Instance {
|
|
195
|
+
setValue(value: number, notify?: boolean): void;
|
|
196
|
+
/** Back to the origin. */
|
|
197
|
+
reset(notify?: boolean): void;
|
|
198
|
+
readonly value: number;
|
|
199
|
+
}
|
|
200
|
+
declare function createBidirectionalSlider(root: HTMLElement | null, options?: BidirectionalSliderOptions): BidirectionalSliderInstance;
|
|
201
|
+
|
|
202
|
+
type VoiceState = 'idle' | 'listening' | 'thinking' | 'speaking';
|
|
203
|
+
interface VoiceDotsOptions {
|
|
204
|
+
/** Default 'idle'. */
|
|
205
|
+
state?: VoiceState;
|
|
206
|
+
/** Dots (default 4, 3…6). */
|
|
207
|
+
count?: number;
|
|
208
|
+
/** The chart colours instead of the text colour. */
|
|
209
|
+
colorful?: boolean;
|
|
210
|
+
/** Dot size in px (default 12). */
|
|
211
|
+
size?: number;
|
|
212
|
+
/** The status text for each state. */
|
|
213
|
+
labels?: Partial<Record<VoiceState, string>>;
|
|
214
|
+
}
|
|
215
|
+
interface VoiceDotsInstance extends Instance {
|
|
216
|
+
setState(state: VoiceState): void;
|
|
217
|
+
readonly state: VoiceState;
|
|
218
|
+
/** The voice's level, 0…1: one for all dots or one per dot (from your own analysis). */
|
|
219
|
+
setLevel(level: number | number[]): void;
|
|
220
|
+
/** Follow a microphone stream or a playing <audio>/<video>; resolves to a function that stops following. */
|
|
221
|
+
listen(source: MediaStream | HTMLMediaElement): Promise<() => void>;
|
|
222
|
+
/** Stop following the audio (the state stays). */
|
|
223
|
+
stop(): void;
|
|
224
|
+
}
|
|
225
|
+
declare function createVoiceDots(root: HTMLElement | null, options?: VoiceDotsOptions): VoiceDotsInstance;
|
|
226
|
+
|
|
227
|
+
interface PieSlice {
|
|
228
|
+
label: string;
|
|
229
|
+
value: number;
|
|
230
|
+
color?: string;
|
|
231
|
+
}
|
|
232
|
+
interface PieChartOptions {
|
|
233
|
+
data?: PieSlice[];
|
|
234
|
+
/** Hole size as a share of the radius: 0 is a pie (default 0.62). */
|
|
235
|
+
donut?: number;
|
|
236
|
+
/** Degrees of surface between slices (default 1.5). */
|
|
237
|
+
gap?: number;
|
|
238
|
+
/** Diameter in px (default 240; it shrinks with its container). */
|
|
239
|
+
size?: number;
|
|
240
|
+
/** Accessible name (and table caption). */
|
|
241
|
+
label?: string;
|
|
242
|
+
/** The donut's middle when nothing is chosen (default 'Total'). */
|
|
243
|
+
totalLabel?: string;
|
|
244
|
+
legend?: boolean;
|
|
245
|
+
formatValue?: (value: number) => string;
|
|
246
|
+
emptyLabel?: string;
|
|
247
|
+
onSelect?: (index: number | null) => void;
|
|
248
|
+
}
|
|
249
|
+
interface PieChartInstance extends Instance {
|
|
250
|
+
update(options: PieChartOptions): void;
|
|
251
|
+
select(index: number | null): void;
|
|
252
|
+
readonly selected: number | null;
|
|
253
|
+
}
|
|
254
|
+
declare function createPieChart(root: HTMLElement | null, initial?: PieChartOptions): PieChartInstance;
|
|
255
|
+
|
|
256
|
+
interface RadarSeries {
|
|
257
|
+
name: string;
|
|
258
|
+
values: Array<number | null>;
|
|
259
|
+
color?: string;
|
|
260
|
+
}
|
|
261
|
+
interface RadarChartOptions {
|
|
262
|
+
/** The measures, clockwise from the top. */
|
|
263
|
+
axes?: string[];
|
|
264
|
+
series?: RadarSeries[];
|
|
265
|
+
/** The outer ring's value (default: the largest value, rounded up). */
|
|
266
|
+
max?: number;
|
|
267
|
+
/** Rings (default 4). */
|
|
268
|
+
levels?: number;
|
|
269
|
+
/** Ring shape (default 'polygon'). */
|
|
270
|
+
grid?: 'polygon' | 'circle';
|
|
271
|
+
/** Diameter in px (default 300; it shrinks with its container). */
|
|
272
|
+
size?: number;
|
|
273
|
+
label?: string;
|
|
274
|
+
legend?: boolean;
|
|
275
|
+
formatValue?: (value: number) => string;
|
|
276
|
+
emptyLabel?: string;
|
|
277
|
+
onSelect?: (axis: number | null) => void;
|
|
278
|
+
}
|
|
279
|
+
interface RadarChartInstance extends Instance {
|
|
280
|
+
update(options: RadarChartOptions): void;
|
|
281
|
+
select(axis: number | null): void;
|
|
282
|
+
readonly selected: number | null;
|
|
283
|
+
}
|
|
284
|
+
declare function createRadarChart(root: HTMLElement | null, initial?: RadarChartOptions): RadarChartInstance;
|
|
285
|
+
|
|
286
|
+
interface RadialDatum {
|
|
287
|
+
label: string;
|
|
288
|
+
value: number;
|
|
289
|
+
/** This ring's goal (default: the chart's max). */
|
|
290
|
+
max?: number;
|
|
291
|
+
color?: string;
|
|
292
|
+
}
|
|
293
|
+
interface RadialChartOptions {
|
|
294
|
+
/** Rings from the outside in. */
|
|
295
|
+
data?: RadialDatum[];
|
|
296
|
+
/** What a full ring is worth (default: the largest value). */
|
|
297
|
+
max?: number;
|
|
298
|
+
/** Degrees a full ring covers (default 360; 270 makes a gauge). */
|
|
299
|
+
sweep?: number;
|
|
300
|
+
/** Diameter in px (default 240). */
|
|
301
|
+
size?: number;
|
|
302
|
+
/** Ring thickness in px (default: what fits, up to 16). */
|
|
303
|
+
thickness?: number;
|
|
304
|
+
/** Discrete sectors per ring (0: continuous, default). */
|
|
305
|
+
segments?: number;
|
|
306
|
+
/** Show values (default) or progress toward the goals in the middle. */
|
|
307
|
+
center?: 'value' | 'percent';
|
|
308
|
+
label?: string;
|
|
309
|
+
/** The middle when nothing is chosen (default 'Total'). */
|
|
310
|
+
totalLabel?: string;
|
|
311
|
+
legend?: boolean;
|
|
312
|
+
formatValue?: (value: number) => string;
|
|
313
|
+
emptyLabel?: string;
|
|
314
|
+
onSelect?: (index: number | null) => void;
|
|
315
|
+
}
|
|
316
|
+
interface RadialChartInstance extends Instance {
|
|
317
|
+
update(options: RadialChartOptions): void;
|
|
318
|
+
select(index: number | null): void;
|
|
319
|
+
readonly selected: number | null;
|
|
320
|
+
}
|
|
321
|
+
declare function createRadialChart(root: HTMLElement | null, initial?: RadialChartOptions): RadialChartInstance;
|
|
322
|
+
|
|
323
|
+
interface SankeyNode {
|
|
324
|
+
id: string;
|
|
325
|
+
label?: string;
|
|
326
|
+
color?: string;
|
|
327
|
+
}
|
|
328
|
+
interface SankeyLink {
|
|
329
|
+
source: string;
|
|
330
|
+
target: string;
|
|
331
|
+
value: number;
|
|
332
|
+
}
|
|
333
|
+
interface SankeyChartOptions {
|
|
334
|
+
nodes?: SankeyNode[];
|
|
335
|
+
links?: SankeyLink[];
|
|
336
|
+
/** Plot height in px (default 320). */
|
|
337
|
+
height?: number;
|
|
338
|
+
/** Node width in px (default 12). */
|
|
339
|
+
nodeWidth?: number;
|
|
340
|
+
/** Space between nodes in a column, px (default 14). */
|
|
341
|
+
nodePadding?: number;
|
|
342
|
+
label?: string;
|
|
343
|
+
formatValue?: (value: number) => string;
|
|
344
|
+
emptyLabel?: string;
|
|
345
|
+
/** A flow was chosen (its index in `links`), or none. */
|
|
346
|
+
onSelect?: (index: number | null) => void;
|
|
347
|
+
}
|
|
348
|
+
interface SankeyChartInstance extends Instance {
|
|
349
|
+
update(options: SankeyChartOptions): void;
|
|
350
|
+
select(index: number | null): void;
|
|
351
|
+
readonly selected: number | null;
|
|
352
|
+
}
|
|
353
|
+
declare function createSankeyChart(root: HTMLElement | null, initial?: SankeyChartOptions): SankeyChartInstance;
|
|
354
|
+
|
|
355
|
+
interface HeatmapDatum {
|
|
356
|
+
date: DateInput;
|
|
357
|
+
value: number;
|
|
358
|
+
}
|
|
359
|
+
interface HeatmapChartOptions {
|
|
360
|
+
/** Values by day: a list or a { 'YYYY-MM-DD': value } map. */
|
|
361
|
+
data?: HeatmapDatum[] | Record<string, number>;
|
|
362
|
+
/** The last day shown (default: today). */
|
|
363
|
+
end?: DateInput;
|
|
364
|
+
/** Weeks shown (default 53). */
|
|
365
|
+
weeks?: number;
|
|
366
|
+
/** First day of the week, 0 Sunday … 6 Saturday (default 1, Monday). */
|
|
367
|
+
firstDay?: number;
|
|
368
|
+
locale?: string;
|
|
369
|
+
/** Coloured steps above zero (default 4). */
|
|
370
|
+
levels?: number;
|
|
371
|
+
/** The deepest step's colour (default the accent). */
|
|
372
|
+
color?: string;
|
|
373
|
+
/** What a value counts, for the tooltip (default 'actividades'). */
|
|
374
|
+
unit?: string;
|
|
375
|
+
label?: string;
|
|
376
|
+
/** The "less … more" scale (default true). */
|
|
377
|
+
legend?: boolean;
|
|
378
|
+
formatValue?: (value: number) => string;
|
|
379
|
+
emptyLabel?: string;
|
|
380
|
+
onSelect?: (date: string | null, value: number | null) => void;
|
|
381
|
+
}
|
|
382
|
+
interface HeatmapChartInstance extends Instance {
|
|
383
|
+
update(options: HeatmapChartOptions): void;
|
|
384
|
+
/** Choose a day ('YYYY-MM-DD') or none. */
|
|
385
|
+
select(date: string | null): void;
|
|
386
|
+
readonly selected: string | null;
|
|
387
|
+
}
|
|
388
|
+
declare function createHeatmapChart(root: HTMLElement | null, initial?: HeatmapChartOptions): HeatmapChartInstance;
|
|
389
|
+
|
|
390
|
+
interface OrbitMenuOptions {
|
|
391
|
+
/** Distance of the options from the middle, px (default 96). */
|
|
392
|
+
radius?: number;
|
|
393
|
+
/** Where the first option sits, degrees clockwise from the top (default 0). */
|
|
394
|
+
start?: number;
|
|
395
|
+
/** Close after an option is chosen (default true). */
|
|
396
|
+
closeOnSelect?: boolean;
|
|
397
|
+
onToggle?: (open: boolean) => void;
|
|
398
|
+
/** An option was chosen: its data-mk-value, else its position. */
|
|
399
|
+
onSelect?: (value: string) => void;
|
|
400
|
+
}
|
|
401
|
+
interface OrbitMenuInstance extends Instance {
|
|
402
|
+
open(): void;
|
|
403
|
+
close(): void;
|
|
404
|
+
toggle(): void;
|
|
405
|
+
readonly isOpen: boolean;
|
|
406
|
+
}
|
|
407
|
+
declare function createOrbitMenu(root: HTMLElement | null, options?: OrbitMenuOptions): OrbitMenuInstance;
|
|
408
|
+
|
|
409
|
+
type ToastTone = 'success' | 'error' | 'info' | 'neutral';
|
|
410
|
+
interface ToastAction {
|
|
411
|
+
label: string;
|
|
412
|
+
onClick: () => void;
|
|
413
|
+
}
|
|
414
|
+
interface ToastOptions {
|
|
415
|
+
/** The control the toast grows out of. */
|
|
416
|
+
origin?: HTMLElement | null;
|
|
417
|
+
/** ms on screen; 0 keeps it until dismissed. */
|
|
418
|
+
duration?: number;
|
|
419
|
+
tone?: ToastTone;
|
|
420
|
+
action?: ToastAction;
|
|
421
|
+
/** Show the tone's icon (default). */
|
|
422
|
+
icon?: boolean;
|
|
423
|
+
}
|
|
424
|
+
interface ToastItem {
|
|
425
|
+
id: number;
|
|
426
|
+
message: string;
|
|
427
|
+
origin: HTMLElement | null;
|
|
428
|
+
duration: number;
|
|
429
|
+
tone: ToastTone;
|
|
430
|
+
action: ToastAction | null;
|
|
431
|
+
icon: boolean;
|
|
432
|
+
closing: boolean;
|
|
433
|
+
}
|
|
434
|
+
/** At most this many live toasts; older ones leave to make room. */
|
|
435
|
+
declare const TOAST_LIMIT = 5;
|
|
436
|
+
declare const getToasts: () => ToastItem[];
|
|
437
|
+
declare function subscribeToasts(listener: () => void): () => void;
|
|
438
|
+
declare function show(message: string, { origin, duration, tone, action, icon }?: ToastOptions): number;
|
|
439
|
+
/** Start the closing animation of a toast. */
|
|
440
|
+
declare function dismissToast(id: number): void;
|
|
441
|
+
/** Take a toast out of the list (after its exit animation). */
|
|
442
|
+
declare function removeToast(id: number): void;
|
|
443
|
+
/** Remove every toast at once (no animation). */
|
|
444
|
+
declare function clearToasts(): void;
|
|
445
|
+
/** Show a toast: `toast('Copiado', { origin: button })`. Returns its id. */
|
|
446
|
+
declare const toast: typeof show & {
|
|
447
|
+
dismiss: typeof dismissToast;
|
|
448
|
+
clear: typeof clearToasts;
|
|
449
|
+
};
|
|
450
|
+
declare const toastTimers: {
|
|
451
|
+
start(id: number, duration: number): void;
|
|
452
|
+
pause(id: number): void;
|
|
453
|
+
resume(id: number): void;
|
|
454
|
+
clear(id: number): void;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export { chatMessage as $, type SankeyLink as A, type BidirectionalSliderInstance as B, type ChatInstance as C, type SankeyNode as D, type ThemePickerInstance as E, type ThemePickerOptions as F, type ToastAction as G, type HeatmapChartInstance as H, type IslandInstance as I, type ToastItem as J, type ToastOptions as K, type ToastTone as L, type ToasterInstance as M, NAV_STYLES as N, type OrbitMenuInstance as O, PENDING_ID as P, type ToasterLabels as Q, type RadarChartInstance as R, type SankeyChartInstance as S, TOAST_LIMIT as T, type ToasterOptions as U, type ToolbarInstance as V, type ToolbarOptions as W, type VoiceDotsInstance as X, type VoiceDotsOptions as Y, type VoiceState as Z, capturePending as _, type BidirectionalSliderOptions as a, clearToasts as a0, createBidirectionalSlider as a1, createChat as a2, createCursor as a3, createHeatmapChart as a4, createIsland as a5, createNav as a6, createOrbitMenu as a7, createPieChart as a8, createRadarChart as a9, createRadialChart as aa, createSankeyChart as ab, createThemePicker as ac, createToaster as ad, createToolbar as ae, createVoiceDots as af, dismissToast as ag, getToasts as ah, morphPendingToReply as ai, removeToast as aj, revealShell as ak, subscribeToasts as al, toNavStyle as am, toast as an, toastTimers as ao, type ChatLabels as b, type ChatOptions as c, type ChatRole as d, type CursorInstance as e, type CursorOptions as f, type CursorVariant as g, type HeatmapChartOptions as h, type HeatmapDatum as i, type IslandOptions as j, NAV_STYLE_ALIASES as k, type NavInstance as l, type NavOptions as m, type NavStyle as n, type NavStyleAlias as o, type NavigateDetail as p, type OrbitMenuOptions as q, type PieChartInstance as r, type PieChartOptions as s, type PieSlice as t, type RadarChartOptions as u, type RadarSeries as v, type RadialChartInstance as w, type RadialChartOptions as x, type RadialDatum as y, type SankeyChartOptions as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yewdiel21/motion-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Motion toolkit for vanilla, Astro and React: GSAP recipes, accessible components, 19 themes, CSS controls and optional WebGL effects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -8,15 +8,7 @@
|
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/YewdielMartinez/motion-kit/issues"
|
|
10
10
|
},
|
|
11
|
-
"keywords": [
|
|
12
|
-
"animation",
|
|
13
|
-
"gsap",
|
|
14
|
-
"react",
|
|
15
|
-
"astro",
|
|
16
|
-
"webgl",
|
|
17
|
-
"motion",
|
|
18
|
-
"ui"
|
|
19
|
-
],
|
|
11
|
+
"keywords": ["animation", "gsap", "react", "astro", "webgl", "motion", "ui"],
|
|
20
12
|
"repository": {
|
|
21
13
|
"type": "git",
|
|
22
14
|
"url": "git+https://github.com/YewdielMartinez/motion-kit.git",
|
|
@@ -77,6 +69,12 @@
|
|
|
77
69
|
"NOTICE",
|
|
78
70
|
"css.d.ts"
|
|
79
71
|
],
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "tsup && node scripts/build-css.mjs",
|
|
74
|
+
"prepack": "pnpm run build",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"typecheck": "tsc --noEmit"
|
|
77
|
+
},
|
|
80
78
|
"peerDependencies": {
|
|
81
79
|
"gsap": ">=3.13.0",
|
|
82
80
|
"react": ">=18",
|
|
@@ -108,10 +106,5 @@
|
|
|
108
106
|
"tsup": "^8.5.1",
|
|
109
107
|
"typescript": "5.9.3",
|
|
110
108
|
"vitest": "4.1.11"
|
|
111
|
-
},
|
|
112
|
-
"scripts": {
|
|
113
|
-
"build": "tsup && node scripts/build-css.mjs",
|
|
114
|
-
"test": "vitest run",
|
|
115
|
-
"typecheck": "tsc --noEmit"
|
|
116
109
|
}
|
|
117
|
-
}
|
|
110
|
+
}
|