@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
package/dist/react/index.js
CHANGED
|
@@ -55,26 +55,40 @@ import {
|
|
|
55
55
|
pileLayers,
|
|
56
56
|
pileStyle,
|
|
57
57
|
reflowLayout
|
|
58
|
-
} from "../chunk-
|
|
58
|
+
} from "../chunk-NFZIX3IA.js";
|
|
59
59
|
import {
|
|
60
60
|
ICON_PATHS,
|
|
61
61
|
NAV_STYLES,
|
|
62
|
+
NAV_STYLE_ALIASES,
|
|
62
63
|
PENDING_ID,
|
|
64
|
+
PILL_ARROW,
|
|
63
65
|
capturePending,
|
|
64
66
|
clearToasts,
|
|
67
|
+
createBidirectionalSlider,
|
|
65
68
|
createChat,
|
|
66
69
|
createCursor,
|
|
70
|
+
createHeatmapChart,
|
|
67
71
|
createIsland,
|
|
72
|
+
createOrbitMenu,
|
|
73
|
+
createPieChart,
|
|
74
|
+
createPillButton,
|
|
75
|
+
createRadarChart,
|
|
76
|
+
createRadialChart,
|
|
77
|
+
createSankeyChart,
|
|
68
78
|
createThemePicker,
|
|
69
79
|
createToaster,
|
|
80
|
+
createToolbar,
|
|
81
|
+
createVoiceDots,
|
|
70
82
|
dismissToast,
|
|
71
83
|
morphPendingToReply,
|
|
72
84
|
revealShell,
|
|
85
|
+
toNavStyle,
|
|
73
86
|
toast
|
|
74
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-RBEKR5UZ.js";
|
|
75
88
|
import {
|
|
76
89
|
confetti,
|
|
77
90
|
createActivityFeed,
|
|
91
|
+
createAddToCart,
|
|
78
92
|
createAttachment,
|
|
79
93
|
createBreadcrumb,
|
|
80
94
|
createCalendar,
|
|
@@ -119,6 +133,8 @@ import {
|
|
|
119
133
|
createResizablePanel,
|
|
120
134
|
createRichTextEditor,
|
|
121
135
|
createScratchCard,
|
|
136
|
+
createScrollIsland,
|
|
137
|
+
createSelect,
|
|
122
138
|
createSkeleton,
|
|
123
139
|
createSlotPicker,
|
|
124
140
|
createSplitView,
|
|
@@ -149,7 +165,7 @@ import {
|
|
|
149
165
|
tokenLines,
|
|
150
166
|
tokenize,
|
|
151
167
|
tweenNumber
|
|
152
|
-
} from "../chunk-
|
|
168
|
+
} from "../chunk-SDQ776LG.js";
|
|
153
169
|
import {
|
|
154
170
|
DEFAULT_THEME,
|
|
155
171
|
MK_THEME_HEAD_SCRIPT,
|
|
@@ -787,7 +803,7 @@ function Nav({
|
|
|
787
803
|
items,
|
|
788
804
|
active,
|
|
789
805
|
onSelect,
|
|
790
|
-
navStyle = "
|
|
806
|
+
navStyle = "pills",
|
|
791
807
|
accent = false,
|
|
792
808
|
reveal = false,
|
|
793
809
|
first,
|
|
@@ -801,7 +817,7 @@ function Nav({
|
|
|
801
817
|
const handle = revealShell(ref.current);
|
|
802
818
|
return () => handle?.cancel();
|
|
803
819
|
}, []);
|
|
804
|
-
const classes = ["mk-nav", `mk-nav--${navStyle}`, accent && "mk-nav--accent", className].filter(Boolean).join(" ");
|
|
820
|
+
const classes = ["mk-nav", `mk-nav--${toNavStyle(navStyle) ?? "pills"}`, accent && "mk-nav--accent", className].filter(Boolean).join(" ");
|
|
805
821
|
return /* @__PURE__ */ jsxs3("nav", { ref, "aria-label": "Principal", ...props, className: classes, children: [
|
|
806
822
|
first,
|
|
807
823
|
/* @__PURE__ */ jsx11("div", { className: "mk-nav__buttons", children: items.map((item) => {
|
|
@@ -1698,13 +1714,13 @@ function RangeSlider({ min, max, step, value, defaultValue, disabled, name, labe
|
|
|
1698
1714
|
// src/components/chart/react.tsx
|
|
1699
1715
|
import { useRef as useRef30 } from "react";
|
|
1700
1716
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1701
|
-
function Chart({ type, labels, series, points, stacked, formatValue, label, height, emptyLabel, legend, tooltip, onSelect, instanceRef, className, ...props }) {
|
|
1717
|
+
function Chart({ type, labels, series, points, stacked, barStyle, barTrack, barFill, barWidth, curve, formatValue, label, height, emptyLabel, legend, tooltip, axis, endLabel, onSelect, instanceRef, className, ...props }) {
|
|
1702
1718
|
const ref = useRef30(null);
|
|
1703
1719
|
const instance = useRef30(null);
|
|
1704
1720
|
const format = useLatest(formatValue);
|
|
1705
1721
|
const select = useLatest(onSelect);
|
|
1706
1722
|
const formatted = formatValue !== void 0;
|
|
1707
|
-
const data = { type, labels, series, points, stacked, label, height, emptyLabel, legend, tooltip };
|
|
1723
|
+
const data = { type, labels, series, points, stacked, barStyle, barTrack, barFill, barWidth, curve, label, height, emptyLabel, legend, tooltip, axis, endLabel };
|
|
1708
1724
|
const key = JSON.stringify(data);
|
|
1709
1725
|
const latest = useLatest(data);
|
|
1710
1726
|
const options = () => ({
|
|
@@ -1812,19 +1828,19 @@ function HoldConfirm({ duration, resetAfter, holdingLabel, doneLabel, hint, disa
|
|
|
1812
1828
|
// src/components/image-preview/react.tsx
|
|
1813
1829
|
import { useRef as useRef34 } from "react";
|
|
1814
1830
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1815
|
-
function ImagePreview({ images, labels, loop, onChange, onOpenChange, instanceRef, className, ...props }) {
|
|
1831
|
+
function ImagePreview({ images, labels, loop, strip, onChange, onOpenChange, instanceRef, className, ...props }) {
|
|
1816
1832
|
const ref = useRef34(null);
|
|
1817
1833
|
const change = useLatest(onChange);
|
|
1818
1834
|
const openChange = useLatest(onOpenChange);
|
|
1819
1835
|
const key = JSON.stringify(labels ?? {});
|
|
1820
1836
|
useIsomorphicLayoutEffect(() => {
|
|
1821
|
-
const created = createImagePreview(ref.current, { labels, loop, onChange: (i) => change.current?.(i), onOpenChange: (open) => openChange.current?.(open) });
|
|
1837
|
+
const created = createImagePreview(ref.current, { labels, loop, strip, onChange: (i) => change.current?.(i), onOpenChange: (open) => openChange.current?.(open) });
|
|
1822
1838
|
if (instanceRef) instanceRef.current = created;
|
|
1823
1839
|
return () => {
|
|
1824
1840
|
created.destroy();
|
|
1825
1841
|
if (instanceRef) instanceRef.current = null;
|
|
1826
1842
|
};
|
|
1827
|
-
}, [key, loop]);
|
|
1843
|
+
}, [key, loop, strip]);
|
|
1828
1844
|
return /* @__PURE__ */ jsx37("div", { ...props, ref, className: ["mk-image-preview", className].filter(Boolean).join(" "), children: images.map((image, i) => /* @__PURE__ */ jsx37("button", { type: "button", "data-mk-image": "", "data-mk-src": image.src, "data-mk-caption": image.caption, "aria-label": `Ver ${image.alt}`, children: /* @__PURE__ */ jsx37("img", { src: image.thumb ?? image.src, alt: image.alt, loading: "lazy", decoding: "async" }) }, `${image.src}-${i}`)) });
|
|
1829
1845
|
}
|
|
1830
1846
|
|
|
@@ -2656,7 +2672,7 @@ var ActivityFeed = forwardRef2(function ActivityFeed2({ items, locale, label, em
|
|
|
2656
2672
|
// src/components/tree-view/react.tsx
|
|
2657
2673
|
import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle3, useRef as useRef61 } from "react";
|
|
2658
2674
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
2659
|
-
var TreeView = forwardRef3(function TreeView2({ nodes, checkable, checked, expanded, selected, search, label, loadChildren, renderLabel, searchText, onSelect, onCheck, onExpand, className, ...props }, handle) {
|
|
2675
|
+
var TreeView = forwardRef3(function TreeView2({ nodes, checkable, checked, expanded, selected, search, label, loadChildren, renderLabel, searchText, icons, draggable, onSelect, onCheck, onExpand, onMove, className, ...props }, handle) {
|
|
2660
2676
|
const ref = useRef61(null);
|
|
2661
2677
|
const instance = useRef61(null);
|
|
2662
2678
|
const select = useLatest(onSelect);
|
|
@@ -2665,6 +2681,7 @@ var TreeView = forwardRef3(function TreeView2({ nodes, checkable, checked, expan
|
|
|
2665
2681
|
const load = useLatest(loadChildren);
|
|
2666
2682
|
const draw = useLatest(renderLabel);
|
|
2667
2683
|
const text = useLatest(searchText);
|
|
2684
|
+
const moved = useLatest(onMove);
|
|
2668
2685
|
useImperativeHandle3(
|
|
2669
2686
|
handle,
|
|
2670
2687
|
() => ({
|
|
@@ -2692,14 +2709,17 @@ var TreeView = forwardRef3(function TreeView2({ nodes, checkable, checked, expan
|
|
|
2692
2709
|
searchText: searchText ? (node) => text.current?.(node) ?? node.label : void 0,
|
|
2693
2710
|
onSelect: (node) => select.current?.(node),
|
|
2694
2711
|
onCheck: (ids) => check.current?.(ids),
|
|
2695
|
-
onExpand: (node, open) => expand.current?.(node, open)
|
|
2712
|
+
onExpand: (node, open) => expand.current?.(node, open),
|
|
2713
|
+
icons,
|
|
2714
|
+
draggable,
|
|
2715
|
+
onMove: (node, into) => moved.current?.(node, into)
|
|
2696
2716
|
});
|
|
2697
2717
|
instance.current = created;
|
|
2698
2718
|
return () => {
|
|
2699
2719
|
created.destroy();
|
|
2700
2720
|
instance.current = null;
|
|
2701
2721
|
};
|
|
2702
|
-
}, [checkable, String(search), label, Boolean(loadChildren), Boolean(renderLabel), Boolean(searchText)]);
|
|
2722
|
+
}, [checkable, String(search), label, Boolean(loadChildren), Boolean(renderLabel), Boolean(searchText), icons, draggable]);
|
|
2703
2723
|
const first = useRef61(true);
|
|
2704
2724
|
useIsomorphicLayoutEffect(() => {
|
|
2705
2725
|
if (first.current) {
|
|
@@ -3199,11 +3219,285 @@ var RichTextEditor = forwardRef11(function RichTextEditor2({ value, placeholder,
|
|
|
3199
3219
|
}, [value]);
|
|
3200
3220
|
return /* @__PURE__ */ jsx71("div", { ...props, ref, className: ["mk-rich-text-editor", className].filter(Boolean).join(" ") });
|
|
3201
3221
|
});
|
|
3222
|
+
|
|
3223
|
+
// src/components/select/react.tsx
|
|
3224
|
+
import { useRef as useRef70 } from "react";
|
|
3225
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3226
|
+
function Select({ options, value, defaultValue, name, label, placeholder, disabled, onChange, className, ...props }) {
|
|
3227
|
+
const ref = useRef70(null);
|
|
3228
|
+
const instance = useRef70(null);
|
|
3229
|
+
const change = useLatest(onChange);
|
|
3230
|
+
const start = useRef70(value ?? defaultValue);
|
|
3231
|
+
const key = JSON.stringify(options ?? null);
|
|
3232
|
+
useIsomorphicLayoutEffect(() => {
|
|
3233
|
+
const created = createSelect(ref.current, { options, value: value ?? start.current, name, label, placeholder, disabled, onChange: (next) => change.current?.(next) });
|
|
3234
|
+
instance.current = created;
|
|
3235
|
+
return () => {
|
|
3236
|
+
start.current = created.value;
|
|
3237
|
+
created.destroy();
|
|
3238
|
+
instance.current = null;
|
|
3239
|
+
};
|
|
3240
|
+
}, [key, name, label, placeholder, disabled]);
|
|
3241
|
+
useIsomorphicLayoutEffect(() => {
|
|
3242
|
+
if (value !== void 0 && instance.current && instance.current.value !== value) instance.current.setValue(value, false);
|
|
3243
|
+
}, [value]);
|
|
3244
|
+
return /* @__PURE__ */ jsx72("div", { ...props, ref, className: ["mk-select", className].filter(Boolean).join(" ") });
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
// src/components/add-to-cart/react.tsx
|
|
3248
|
+
import { useRef as useRef71 } from "react";
|
|
3249
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3250
|
+
function AddToCart({ target, image, quantity, count, label, onAdd, onLand, instanceRef, className, children, ...props }) {
|
|
3251
|
+
const ref = useRef71(null);
|
|
3252
|
+
const add = useLatest(onAdd);
|
|
3253
|
+
const landed = useLatest(onLand);
|
|
3254
|
+
const instance = useRef71(null);
|
|
3255
|
+
useIsomorphicLayoutEffect(() => {
|
|
3256
|
+
const created = createAddToCart(ref.current, { target, image, quantity, count, label, onAdd: (n) => add.current?.(n), onLand: (n) => landed.current?.(n) });
|
|
3257
|
+
instance.current = created;
|
|
3258
|
+
if (instanceRef) instanceRef.current = created;
|
|
3259
|
+
return () => {
|
|
3260
|
+
created.destroy();
|
|
3261
|
+
instance.current = null;
|
|
3262
|
+
if (instanceRef) instanceRef.current = null;
|
|
3263
|
+
};
|
|
3264
|
+
}, [typeof target === "string" ? target : null, typeof image === "string" ? image : null, quantity, label]);
|
|
3265
|
+
useIsomorphicLayoutEffect(() => {
|
|
3266
|
+
if (count !== void 0) instance.current?.setCount(count);
|
|
3267
|
+
}, [count]);
|
|
3268
|
+
return /* @__PURE__ */ jsx73("div", { ...props, ref, className: ["mk-add-to-cart", className].filter(Boolean).join(" "), children });
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3271
|
+
// src/components/scroll-island/react.tsx
|
|
3272
|
+
import { useRef as useRef72 } from "react";
|
|
3273
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3274
|
+
function ScrollIsland({ sections, reach, idle, persistent, page, onSection, className, children, ...props }) {
|
|
3275
|
+
const ref = useRef72(null);
|
|
3276
|
+
const section = useLatest(onSection);
|
|
3277
|
+
useIsomorphicLayoutEffect(() => {
|
|
3278
|
+
const created = createScrollIsland(page ? document.documentElement : ref.current, { sections, reach, idle, persistent, page, onSection: (name) => section.current?.(name) });
|
|
3279
|
+
return () => created.destroy();
|
|
3280
|
+
}, [sections, reach, idle, persistent, page]);
|
|
3281
|
+
if (page) return null;
|
|
3282
|
+
return /* @__PURE__ */ jsx74("div", { ...props, ref, className: ["mk-scroll-island", className].filter(Boolean).join(" "), children });
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3285
|
+
// src/components/pill-button/react.tsx
|
|
3286
|
+
import { useRef as useRef73 } from "react";
|
|
3287
|
+
import { jsx as jsx75, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3288
|
+
function PillButton({ expand, icon, className, children, type = "button", ...props }) {
|
|
3289
|
+
const ref = useRef73(null);
|
|
3290
|
+
useIsomorphicLayoutEffect(() => {
|
|
3291
|
+
const instance = createPillButton(ref.current, { expand });
|
|
3292
|
+
return () => instance.destroy();
|
|
3293
|
+
}, [expand]);
|
|
3294
|
+
return /* @__PURE__ */ jsxs22("button", { ...props, type, ref, className: ["mk-pill-button", className].filter(Boolean).join(" "), children: [
|
|
3295
|
+
/* @__PURE__ */ jsx75("span", { "data-mk-pill-label": "", children }),
|
|
3296
|
+
icon ? /* @__PURE__ */ jsx75("span", { "data-mk-pill-icon": "", "aria-hidden": "true", children: icon }) : /* @__PURE__ */ jsx75("span", { "data-mk-pill-icon": "", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: PILL_ARROW } })
|
|
3297
|
+
] });
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
// src/components/toolbar/react.tsx
|
|
3301
|
+
import { useRef as useRef74 } from "react";
|
|
3302
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
3303
|
+
function Toolbar({ value, orientation, tips, onChange, instanceRef, className, children, ...props }) {
|
|
3304
|
+
const ref = useRef74(null);
|
|
3305
|
+
const changed = useLatest(onChange);
|
|
3306
|
+
const instance = useRef74(null);
|
|
3307
|
+
useIsomorphicLayoutEffect(() => {
|
|
3308
|
+
const created = createToolbar(ref.current, { value, orientation, tips, onChange: (next) => changed.current?.(next) });
|
|
3309
|
+
instance.current = created;
|
|
3310
|
+
if (instanceRef) instanceRef.current = created;
|
|
3311
|
+
return () => {
|
|
3312
|
+
created.destroy();
|
|
3313
|
+
instance.current = null;
|
|
3314
|
+
if (instanceRef) instanceRef.current = null;
|
|
3315
|
+
};
|
|
3316
|
+
}, [orientation, tips]);
|
|
3317
|
+
useIsomorphicLayoutEffect(() => {
|
|
3318
|
+
if (value !== void 0 && instance.current && instance.current.value !== value) instance.current.setValue(value);
|
|
3319
|
+
}, [value]);
|
|
3320
|
+
return /* @__PURE__ */ jsx76("div", { ...props, ref, className: ["mk-toolbar", className].filter(Boolean).join(" "), children });
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3323
|
+
// src/components/bidirectional-slider/react.tsx
|
|
3324
|
+
import { useRef as useRef75 } from "react";
|
|
3325
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
3326
|
+
function BidirectionalSlider({ min, max, origin, step, value, disabled, name, label, icons, formatValue, onInput, onChange, instanceRef, className, ...props }) {
|
|
3327
|
+
const ref = useRef75(null);
|
|
3328
|
+
const input = useLatest(onInput);
|
|
3329
|
+
const change = useLatest(onChange);
|
|
3330
|
+
const format = useLatest(formatValue);
|
|
3331
|
+
const instance = useRef75(null);
|
|
3332
|
+
useIsomorphicLayoutEffect(() => {
|
|
3333
|
+
const created = createBidirectionalSlider(ref.current, {
|
|
3334
|
+
min,
|
|
3335
|
+
max,
|
|
3336
|
+
origin,
|
|
3337
|
+
step,
|
|
3338
|
+
value,
|
|
3339
|
+
disabled,
|
|
3340
|
+
name,
|
|
3341
|
+
label,
|
|
3342
|
+
icons,
|
|
3343
|
+
formatValue: formatValue ? (n) => format.current(n) : void 0,
|
|
3344
|
+
onInput: (n) => input.current?.(n),
|
|
3345
|
+
onChange: (n) => change.current?.(n)
|
|
3346
|
+
});
|
|
3347
|
+
instance.current = created;
|
|
3348
|
+
if (instanceRef) instanceRef.current = created;
|
|
3349
|
+
return () => {
|
|
3350
|
+
created.destroy();
|
|
3351
|
+
instance.current = null;
|
|
3352
|
+
if (instanceRef) instanceRef.current = null;
|
|
3353
|
+
};
|
|
3354
|
+
}, [min, max, origin, step, disabled, name, label, icons]);
|
|
3355
|
+
useIsomorphicLayoutEffect(() => {
|
|
3356
|
+
if (value !== void 0 && instance.current && instance.current.value !== value) instance.current.setValue(value);
|
|
3357
|
+
}, [value]);
|
|
3358
|
+
return /* @__PURE__ */ jsx77("div", { ...props, ref, className: ["mk-bidirectional-slider", className].filter(Boolean).join(" ") });
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
// src/components/voice-dots/react.tsx
|
|
3362
|
+
import { useRef as useRef76 } from "react";
|
|
3363
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
3364
|
+
function VoiceDots({ state = "idle", count, colorful, size, labels, source, level, instanceRef, className, ...props }) {
|
|
3365
|
+
const ref = useRef76(null);
|
|
3366
|
+
const instance = useRef76(null);
|
|
3367
|
+
useIsomorphicLayoutEffect(() => {
|
|
3368
|
+
const created = createVoiceDots(ref.current, { state, count, colorful, size, labels });
|
|
3369
|
+
instance.current = created;
|
|
3370
|
+
if (instanceRef) instanceRef.current = created;
|
|
3371
|
+
return () => {
|
|
3372
|
+
created.destroy();
|
|
3373
|
+
instance.current = null;
|
|
3374
|
+
if (instanceRef) instanceRef.current = null;
|
|
3375
|
+
};
|
|
3376
|
+
}, [count, colorful, size]);
|
|
3377
|
+
useIsomorphicLayoutEffect(() => {
|
|
3378
|
+
if (instance.current && instance.current.state !== state) instance.current.setState(state);
|
|
3379
|
+
}, [state]);
|
|
3380
|
+
useIsomorphicLayoutEffect(() => {
|
|
3381
|
+
const dots = instance.current;
|
|
3382
|
+
if (!dots || !source) return;
|
|
3383
|
+
let stop = null;
|
|
3384
|
+
let gone = false;
|
|
3385
|
+
void dots.listen(source).then((done) => {
|
|
3386
|
+
if (gone) done();
|
|
3387
|
+
else stop = done;
|
|
3388
|
+
}).catch((error) => {
|
|
3389
|
+
if (!gone) ref.current?.dispatchEvent(new CustomEvent("mk:error", { bubbles: true, detail: { error } }));
|
|
3390
|
+
});
|
|
3391
|
+
return () => {
|
|
3392
|
+
gone = true;
|
|
3393
|
+
stop?.();
|
|
3394
|
+
};
|
|
3395
|
+
}, [source, count, colorful, size]);
|
|
3396
|
+
useIsomorphicLayoutEffect(() => {
|
|
3397
|
+
if (level !== void 0) instance.current?.setLevel(level);
|
|
3398
|
+
}, [level]);
|
|
3399
|
+
return /* @__PURE__ */ jsx78("div", { ...props, ref, className: ["mk-voice-dots", className].filter(Boolean).join(" ") });
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
// src/components/chart/use-chart.ts
|
|
3403
|
+
import { useRef as useRef77 } from "react";
|
|
3404
|
+
function useChart(create, data, callbacks, instanceRef) {
|
|
3405
|
+
const ref = useRef77(null);
|
|
3406
|
+
const instance = useRef77(null);
|
|
3407
|
+
const format = useLatest(callbacks.formatValue);
|
|
3408
|
+
const select = useLatest(callbacks.onSelect);
|
|
3409
|
+
const formatted = callbacks.formatValue !== void 0;
|
|
3410
|
+
const key = JSON.stringify(data);
|
|
3411
|
+
const latest = useLatest(data);
|
|
3412
|
+
const options = () => ({
|
|
3413
|
+
...latest.current,
|
|
3414
|
+
formatValue: formatted ? (value) => format.current?.(value) ?? String(value) : void 0,
|
|
3415
|
+
onSelect: (...args) => select.current?.(...args)
|
|
3416
|
+
});
|
|
3417
|
+
useIsomorphicLayoutEffect(() => {
|
|
3418
|
+
const created = create(ref.current, options());
|
|
3419
|
+
instance.current = created;
|
|
3420
|
+
if (instanceRef) instanceRef.current = created;
|
|
3421
|
+
return () => {
|
|
3422
|
+
created.destroy();
|
|
3423
|
+
instance.current = null;
|
|
3424
|
+
if (instanceRef) instanceRef.current = null;
|
|
3425
|
+
};
|
|
3426
|
+
}, []);
|
|
3427
|
+
const first = useRef77(true);
|
|
3428
|
+
useIsomorphicLayoutEffect(() => {
|
|
3429
|
+
if (first.current) {
|
|
3430
|
+
first.current = false;
|
|
3431
|
+
return;
|
|
3432
|
+
}
|
|
3433
|
+
instance.current?.update(options());
|
|
3434
|
+
}, [key, formatted]);
|
|
3435
|
+
return ref;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
// src/components/pie-chart/react.tsx
|
|
3439
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
3440
|
+
function PieChart({ data, donut, gap, size, label, totalLabel, legend, emptyLabel, formatValue, onSelect, instanceRef, className, ...props }) {
|
|
3441
|
+
const ref = useChart(createPieChart, { data, donut, gap, size, label, totalLabel, legend, emptyLabel }, { formatValue, onSelect }, instanceRef);
|
|
3442
|
+
return /* @__PURE__ */ jsx79("div", { ...props, ref, className: ["mk-chart mk-pie-chart", className].filter(Boolean).join(" ") });
|
|
3443
|
+
}
|
|
3444
|
+
|
|
3445
|
+
// src/components/radar-chart/react.tsx
|
|
3446
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
3447
|
+
function RadarChart({ axes, series, max, levels, grid, size, label, legend, emptyLabel, formatValue, onSelect, instanceRef, className, ...props }) {
|
|
3448
|
+
const ref = useChart(createRadarChart, { axes, series, max, levels, grid, size, label, legend, emptyLabel }, { formatValue, onSelect }, instanceRef);
|
|
3449
|
+
return /* @__PURE__ */ jsx80("div", { ...props, ref, className: ["mk-chart mk-radar-chart", className].filter(Boolean).join(" ") });
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3452
|
+
// src/components/radial-chart/react.tsx
|
|
3453
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
3454
|
+
function RadialChart({ data, max, sweep, size, thickness, segments, center, label, totalLabel, legend, emptyLabel, formatValue, onSelect, instanceRef, className, ...props }) {
|
|
3455
|
+
const ref = useChart(createRadialChart, { data, max, sweep, size, thickness, segments, center, label, totalLabel, legend, emptyLabel }, { formatValue, onSelect }, instanceRef);
|
|
3456
|
+
return /* @__PURE__ */ jsx81("div", { ...props, ref, className: ["mk-chart mk-radial-chart", className].filter(Boolean).join(" ") });
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
// src/components/sankey-chart/react.tsx
|
|
3460
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
3461
|
+
function SankeyChart({ nodes, links, height, nodeWidth, nodePadding, label, emptyLabel, formatValue, onSelect, instanceRef, className, ...props }) {
|
|
3462
|
+
const ref = useChart(createSankeyChart, { nodes, links, height, nodeWidth, nodePadding, label, emptyLabel }, { formatValue, onSelect }, instanceRef);
|
|
3463
|
+
return /* @__PURE__ */ jsx82("div", { ...props, ref, className: ["mk-chart mk-sankey-chart", className].filter(Boolean).join(" ") });
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
// src/components/heatmap-chart/react.tsx
|
|
3467
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
3468
|
+
function HeatmapChart({ data, end, weeks, firstDay, locale, levels, color, unit, label, legend, formatValue, emptyLabel, onSelect, instanceRef, className, ...props }) {
|
|
3469
|
+
const ref = useChart(createHeatmapChart, { data, end, weeks, firstDay, locale, levels, color, unit, label, legend, emptyLabel }, { formatValue, onSelect }, instanceRef);
|
|
3470
|
+
return /* @__PURE__ */ jsx83("div", { ...props, ref, className: ["mk-heatmap-chart", className].filter(Boolean).join(" ") });
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
// src/components/orbit-menu/react.tsx
|
|
3474
|
+
import { useRef as useRef78 } from "react";
|
|
3475
|
+
import { jsx as jsx84, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3476
|
+
function OrbitMenu({ items, label = "Men\xFA", radius, start, closeOnSelect, onToggle, onSelect, instanceRef, className, ...props }) {
|
|
3477
|
+
const ref = useRef78(null);
|
|
3478
|
+
const toggled = useLatest(onToggle);
|
|
3479
|
+
const selected = useLatest(onSelect);
|
|
3480
|
+
const keys = items.map((item) => item.value).join("\0");
|
|
3481
|
+
useIsomorphicLayoutEffect(() => {
|
|
3482
|
+
const created = createOrbitMenu(ref.current, { radius, start, closeOnSelect, onToggle: (open) => toggled.current?.(open), onSelect: (value) => selected.current?.(value) });
|
|
3483
|
+
if (instanceRef) instanceRef.current = created;
|
|
3484
|
+
return () => {
|
|
3485
|
+
created.destroy();
|
|
3486
|
+
if (instanceRef) instanceRef.current = null;
|
|
3487
|
+
};
|
|
3488
|
+
}, [keys, radius, start, closeOnSelect]);
|
|
3489
|
+
return /* @__PURE__ */ jsxs23("div", { ...props, ref, className: ["mk-orbit-menu", className].filter(Boolean).join(" "), children: [
|
|
3490
|
+
/* @__PURE__ */ jsx84("button", { type: "button", "data-mk-orbit-toggle": "", "aria-label": label }),
|
|
3491
|
+
items.map((item) => /* @__PURE__ */ jsx84("button", { type: "button", "data-mk-orbit-item": "", "data-mk-value": item.value, "aria-label": item.label, children: item.icon }, item.value))
|
|
3492
|
+
] });
|
|
3493
|
+
}
|
|
3202
3494
|
export {
|
|
3203
3495
|
ANIMATIONS,
|
|
3204
3496
|
ActivityFeed,
|
|
3497
|
+
AddToCart,
|
|
3205
3498
|
AnimatedNumber,
|
|
3206
3499
|
Attachment,
|
|
3500
|
+
BidirectionalSlider,
|
|
3207
3501
|
Breadcrumb,
|
|
3208
3502
|
Calendar,
|
|
3209
3503
|
Chart,
|
|
@@ -3230,6 +3524,7 @@ export {
|
|
|
3230
3524
|
FilterBuilder,
|
|
3231
3525
|
FlipGroup,
|
|
3232
3526
|
Frost,
|
|
3527
|
+
HeatmapChart,
|
|
3233
3528
|
HoldConfirm,
|
|
3234
3529
|
HoverCard,
|
|
3235
3530
|
ImagePreview,
|
|
@@ -3246,19 +3541,28 @@ export {
|
|
|
3246
3541
|
MkIcon,
|
|
3247
3542
|
MultiSelect,
|
|
3248
3543
|
NAV_STYLES,
|
|
3544
|
+
NAV_STYLE_ALIASES,
|
|
3249
3545
|
Nav,
|
|
3250
3546
|
NotificationBell,
|
|
3547
|
+
OrbitMenu,
|
|
3251
3548
|
Pagination,
|
|
3252
3549
|
PasswordStrength,
|
|
3550
|
+
PieChart,
|
|
3551
|
+
PillButton,
|
|
3253
3552
|
Popover,
|
|
3254
3553
|
Progress,
|
|
3255
3554
|
Quantity,
|
|
3256
3555
|
Questionnaire,
|
|
3556
|
+
RadarChart,
|
|
3557
|
+
RadialChart,
|
|
3257
3558
|
RangeCalendar,
|
|
3258
3559
|
RangeSlider,
|
|
3259
3560
|
ResizablePanel,
|
|
3260
3561
|
RichTextEditor,
|
|
3562
|
+
SankeyChart,
|
|
3261
3563
|
ScratchCard,
|
|
3564
|
+
ScrollIsland,
|
|
3565
|
+
Select,
|
|
3262
3566
|
Skeleton,
|
|
3263
3567
|
SlotPicker,
|
|
3264
3568
|
SlotText,
|
|
@@ -3274,10 +3578,12 @@ export {
|
|
|
3274
3578
|
TimeField,
|
|
3275
3579
|
Timeline,
|
|
3276
3580
|
Toaster,
|
|
3581
|
+
Toolbar,
|
|
3277
3582
|
Tooltip,
|
|
3278
3583
|
Trailer,
|
|
3279
3584
|
TreeView,
|
|
3280
3585
|
VirtualList,
|
|
3586
|
+
VoiceDots,
|
|
3281
3587
|
animate,
|
|
3282
3588
|
clearToasts,
|
|
3283
3589
|
confetti,
|
|
@@ -3287,6 +3593,7 @@ export {
|
|
|
3287
3593
|
pileLayers,
|
|
3288
3594
|
pileStyle,
|
|
3289
3595
|
themeHeadScript,
|
|
3596
|
+
toNavStyle,
|
|
3290
3597
|
toast,
|
|
3291
3598
|
useActionButton,
|
|
3292
3599
|
useCardDock,
|