@bearmenu/ui 0.8.3 → 0.8.4
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/dist/chunk-2WDJR6K7.js +76 -0
- package/dist/components/icon.d.ts +18 -0
- package/dist/components/icon.js +31 -0
- package/dist/components/motion-icon-controls.d.ts +26 -0
- package/dist/components/motion-icon-controls.js +380 -0
- package/dist/components/motion-icon-set.d.ts +27 -0
- package/dist/components/motion-icon-set.js +139 -0
- package/dist/components/motion-icon.d.ts +44 -0
- package/dist/components/motion-icon.js +3 -0
- package/dist/lib/icon-registry.d.ts +58 -0
- package/dist/lib/icon-registry.js +39 -0
- package/package.json +2 -1
- package/src/components/accordion.stories.tsx +1 -1
- package/src/components/combobox.stories.tsx +1 -1
- package/src/components/currency-input.stories.tsx +3 -3
- package/src/components/empty-state.stories.tsx +3 -3
- package/src/components/form.stories.tsx +1 -1
- package/src/components/icon.tsx +57 -0
- package/src/components/input-otp.stories.tsx +1 -1
- package/src/components/markdown-renderer.stories.tsx +1 -1
- package/src/components/motion-icon-controls.test.tsx +78 -0
- package/src/components/motion-icon-controls.tsx +552 -0
- package/src/components/motion-icon-set.stories.tsx +185 -0
- package/src/components/motion-icon-set.tsx +219 -0
- package/src/components/motion-icon.test.tsx +159 -0
- package/src/components/motion-icon.tsx +163 -0
- package/src/components/multi-select-combobox.stories.tsx +1 -1
- package/src/components/phone-frame.stories.tsx +1 -1
- package/src/components/rating.stories.tsx +3 -3
- package/src/components/searchable-select.stories.tsx +1 -1
- package/src/components/selection-bar.stories.tsx +1 -1
- package/src/components/skeleton-card.stories.tsx +3 -3
- package/src/components/sliding-panels.stories.tsx +1 -1
- package/src/components/stepper.stories.tsx +1 -1
- package/src/components/sticky-container.stories.tsx +3 -3
- package/src/components/toggle-group.stories.tsx +1 -1
- package/src/components/tooltip.stories.tsx +2 -2
- package/src/lib/icon-registry.ts +139 -0
- package/src/test/setup.ts +5 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { cn } from './chunk-FEK5XGZW.js';
|
|
2
|
+
import { __spreadProps, __spreadValues } from './chunk-3GWWZKX7.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useAnimationControls, motion } from 'framer-motion';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function beats(times, duration = 0.62) {
|
|
8
|
+
return { duration, times, ease: "easeInOut" };
|
|
9
|
+
}
|
|
10
|
+
var returnTransition = { type: "spring", stiffness: 320, damping: 26 };
|
|
11
|
+
function poses(rest, active, play, transition) {
|
|
12
|
+
return {
|
|
13
|
+
rest: __spreadProps(__spreadValues({}, rest), { transition: returnTransition }),
|
|
14
|
+
active: __spreadProps(__spreadValues({}, active), { transition: returnTransition }),
|
|
15
|
+
play: __spreadProps(__spreadValues({}, play), { transition })
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var rootVariants = {
|
|
19
|
+
rest: { strokeWidth: 1.75, transition: { duration: 0.18 } },
|
|
20
|
+
active: { strokeWidth: 2.25, transition: { duration: 0.18 } },
|
|
21
|
+
play: { strokeWidth: 2.25, transition: { duration: 0.12 } }
|
|
22
|
+
};
|
|
23
|
+
function useIconGesture(active, replayToken) {
|
|
24
|
+
const controls = useAnimationControls();
|
|
25
|
+
const lastPlayAt = React.useRef(0);
|
|
26
|
+
const seenToken = React.useRef(0);
|
|
27
|
+
const seenActive = React.useRef(null);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
controls.set(active ? "active" : "rest");
|
|
30
|
+
seenActive.current = active;
|
|
31
|
+
}, []);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
if (replayToken === seenToken.current) return;
|
|
34
|
+
seenToken.current = replayToken;
|
|
35
|
+
lastPlayAt.current = Date.now();
|
|
36
|
+
void controls.start("play");
|
|
37
|
+
}, [replayToken, controls]);
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
if (seenActive.current === null || seenActive.current === active) return;
|
|
40
|
+
seenActive.current = active;
|
|
41
|
+
if (!active) {
|
|
42
|
+
void controls.start("rest");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (Date.now() - lastPlayAt.current < 600) return;
|
|
46
|
+
void controls.start("play");
|
|
47
|
+
}, [active, controls]);
|
|
48
|
+
return controls;
|
|
49
|
+
}
|
|
50
|
+
function MotionIcon({
|
|
51
|
+
active = false,
|
|
52
|
+
replayToken = 0,
|
|
53
|
+
className,
|
|
54
|
+
children
|
|
55
|
+
}) {
|
|
56
|
+
const controls = useIconGesture(active, replayToken);
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
motion.svg,
|
|
59
|
+
{
|
|
60
|
+
viewBox: "0 0 24 24",
|
|
61
|
+
overflow: "visible",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeLinecap: "round",
|
|
65
|
+
strokeLinejoin: "round",
|
|
66
|
+
variants: rootVariants,
|
|
67
|
+
initial: false,
|
|
68
|
+
animate: controls,
|
|
69
|
+
className: cn("size-6", className),
|
|
70
|
+
"aria-hidden": true,
|
|
71
|
+
children
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { MotionIcon, beats, poses, returnTransition, useIconGesture };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { LucideProps, LucideIcon } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
declare const SIZE_CLASSES: {
|
|
5
|
+
readonly xs: "w-3 h-3";
|
|
6
|
+
readonly sm: "w-4 h-4";
|
|
7
|
+
readonly md: "w-5 h-5";
|
|
8
|
+
};
|
|
9
|
+
type IconSize = keyof typeof SIZE_CLASSES;
|
|
10
|
+
type IconProps = Omit<LucideProps, "size"> & {
|
|
11
|
+
/** The lucide icon component to render. */
|
|
12
|
+
icon: LucideIcon;
|
|
13
|
+
/** Canonical size stop. "xs" = 12px | "sm" = 16px (default) | "md" = 20px */
|
|
14
|
+
size?: IconSize;
|
|
15
|
+
};
|
|
16
|
+
declare function Icon({ icon: LucideIconComponent, size, strokeWidth, className, ...props }: IconProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Icon, type IconProps, type IconSize };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var SIZE_CLASSES = {
|
|
6
|
+
xs: "w-3 h-3",
|
|
7
|
+
sm: "w-4 h-4",
|
|
8
|
+
md: "w-5 h-5"
|
|
9
|
+
};
|
|
10
|
+
function Icon(_a) {
|
|
11
|
+
var _b = _a, {
|
|
12
|
+
icon: LucideIconComponent,
|
|
13
|
+
size = "sm",
|
|
14
|
+
strokeWidth = 1.75,
|
|
15
|
+
className
|
|
16
|
+
} = _b, props = __objRest(_b, [
|
|
17
|
+
"icon",
|
|
18
|
+
"size",
|
|
19
|
+
"strokeWidth",
|
|
20
|
+
"className"
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
LucideIconComponent,
|
|
24
|
+
__spreadValues({
|
|
25
|
+
strokeWidth,
|
|
26
|
+
className: cn(SIZE_CLASSES[size], className)
|
|
27
|
+
}, props)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Icon };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { MotionIconProps } from './motion-icon.js';
|
|
3
|
+
import 'framer-motion';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare function MotionHeart(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare function MotionBookmark(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function MotionSliders(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function MotionSearch(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function MotionShare(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare function MotionSort(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function MotionCheck(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* `active` is dark mode. The sun does not fade into the moon — its rays pull
|
|
15
|
+
* into the disc first, then the crescent swings in, so the two shapes never
|
|
16
|
+
* cross-dissolve into visual mush at 20px.
|
|
17
|
+
*/
|
|
18
|
+
declare function MotionTheme(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function MotionChevron(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function MotionPlayPause(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function MotionEye(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function MotionStar(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function MotionCopy(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function MotionRefresh(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { MotionBookmark, MotionCheck, MotionChevron, MotionCopy, MotionEye, MotionHeart, MotionPlayPause, MotionRefresh, MotionSearch, MotionShare, MotionSliders, MotionSort, MotionStar, MotionTheme };
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { beats, returnTransition, MotionIcon } from '../chunk-2WDJR6K7.js';
|
|
2
|
+
import '../chunk-FEK5XGZW.js';
|
|
3
|
+
import { __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
4
|
+
import { motion } from 'framer-motion';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var HEART_TIMES = [0, 0.18, 0.5, 0.76, 1];
|
|
8
|
+
var heartBody = {
|
|
9
|
+
rest: { scaleX: 1, scaleY: 1, fillOpacity: 0, transition: returnTransition },
|
|
10
|
+
active: { scaleX: 1, scaleY: 1, fillOpacity: 1, transition: returnTransition },
|
|
11
|
+
play: {
|
|
12
|
+
scaleX: [1, 1.14, 0.9, 1.03, 1],
|
|
13
|
+
scaleY: [1, 0.82, 1.26, 0.96, 1],
|
|
14
|
+
fillOpacity: [0, 0, 1, 1, 1],
|
|
15
|
+
transition: beats(HEART_TIMES, 0.58)
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function MotionHeart(props) {
|
|
19
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx(
|
|
20
|
+
motion.path,
|
|
21
|
+
{
|
|
22
|
+
variants: heartBody,
|
|
23
|
+
style: { originX: "12px", originY: "13px" },
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
fillOpacity: 0,
|
|
26
|
+
d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"
|
|
27
|
+
}
|
|
28
|
+
) }));
|
|
29
|
+
}
|
|
30
|
+
var BOOKMARK_TIMES = [0, 0.2, 0.56, 0.8, 1];
|
|
31
|
+
var bookmarkBody = {
|
|
32
|
+
rest: { y: 0, scaleY: 1, fillOpacity: 0, transition: returnTransition },
|
|
33
|
+
active: { y: 0, scaleY: 1, fillOpacity: 1, transition: returnTransition },
|
|
34
|
+
play: {
|
|
35
|
+
// Lifts clear, drops, compresses against the notch, settles filled.
|
|
36
|
+
y: [0, -7, 1.5, 0, 0],
|
|
37
|
+
scaleY: [1, 1.07, 0.88, 1.02, 1],
|
|
38
|
+
fillOpacity: [0, 0, 0, 1, 1],
|
|
39
|
+
transition: beats(BOOKMARK_TIMES, 0.6)
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
function MotionBookmark(props) {
|
|
43
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx(
|
|
44
|
+
motion.path,
|
|
45
|
+
{
|
|
46
|
+
variants: bookmarkBody,
|
|
47
|
+
style: { originX: "12px", originY: "21px" },
|
|
48
|
+
fill: "currentColor",
|
|
49
|
+
fillOpacity: 0,
|
|
50
|
+
d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z"
|
|
51
|
+
}
|
|
52
|
+
) }));
|
|
53
|
+
}
|
|
54
|
+
var SLIDER_ROWS = [5, 12, 19];
|
|
55
|
+
var HANDLE_X = [14, 8, 16];
|
|
56
|
+
var HANDLE_ACTIVE_DX = [-6, 7, -4];
|
|
57
|
+
function sliderHandle(index) {
|
|
58
|
+
const dx = HANDLE_ACTIVE_DX[index];
|
|
59
|
+
return {
|
|
60
|
+
rest: { x: 0, transition: returnTransition },
|
|
61
|
+
active: { x: dx, transition: returnTransition },
|
|
62
|
+
play: {
|
|
63
|
+
x: [0, -dx * 0.12, dx * 1.12, dx],
|
|
64
|
+
transition: beats([0, 0.16, 0.72, 1], 0.55 + index * 0.04)
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function MotionSliders(props) {
|
|
69
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
70
|
+
SLIDER_ROWS.map((y) => /* @__PURE__ */ jsx("path", { d: `M3 ${y}h18`, opacity: 0.45 }, `track-${y}`)),
|
|
71
|
+
SLIDER_ROWS.map((y, i) => /* @__PURE__ */ jsx(motion.path, { variants: sliderHandle(i), d: `M${HANDLE_X[i]} ${y - 2}v4` }, `handle-${y}`))
|
|
72
|
+
] }));
|
|
73
|
+
}
|
|
74
|
+
var lens = {
|
|
75
|
+
rest: { rotate: 0, transition: returnTransition },
|
|
76
|
+
active: { rotate: 0, transition: returnTransition },
|
|
77
|
+
play: {
|
|
78
|
+
// Pivots on the handle end, so the glass sweeps an arc like someone scanning.
|
|
79
|
+
rotate: [0, 9, -16, 4, 0],
|
|
80
|
+
transition: beats([0, 0.16, 0.48, 0.78, 1], 0.6)
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var found = {
|
|
84
|
+
rest: { scale: 0, opacity: 0, transition: { duration: 0.15 } },
|
|
85
|
+
active: { scale: 1, opacity: 1, transition: { duration: 0.15 } },
|
|
86
|
+
play: {
|
|
87
|
+
scale: [0, 0, 0, 1.3, 1],
|
|
88
|
+
opacity: [0, 0, 0, 1, 1],
|
|
89
|
+
transition: beats([0, 0.16, 0.48, 0.78, 1], 0.6)
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
function MotionSearch(props) {
|
|
93
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxs(motion.g, { variants: lens, style: { originX: "21px", originY: "21px" }, children: [
|
|
94
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
95
|
+
/* @__PURE__ */ jsx("path", { d: "m21 21-4.34-4.34" }),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
motion.circle,
|
|
98
|
+
{
|
|
99
|
+
variants: found,
|
|
100
|
+
opacity: 0,
|
|
101
|
+
style: { originX: "11px", originY: "11px" },
|
|
102
|
+
fill: "currentColor",
|
|
103
|
+
cx: "11",
|
|
104
|
+
cy: "11",
|
|
105
|
+
r: "2.5"
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] }) }));
|
|
109
|
+
}
|
|
110
|
+
var SHARE_TIMES = [0, 0.2, 0.62, 1];
|
|
111
|
+
function shareNode(dx, dy) {
|
|
112
|
+
return {
|
|
113
|
+
rest: { x: 0, y: 0, opacity: 1, transition: returnTransition },
|
|
114
|
+
active: { x: 0, y: 0, opacity: 1, transition: returnTransition },
|
|
115
|
+
play: {
|
|
116
|
+
x: [0, -dx * 0.18, dx, 0],
|
|
117
|
+
y: [0, -dy * 0.18, dy, 0],
|
|
118
|
+
opacity: [1, 1, 0.15, 1],
|
|
119
|
+
transition: beats(SHARE_TIMES, 0.58)
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var shareTop = shareNode(7, -4);
|
|
124
|
+
var shareBottom = shareNode(7, 4);
|
|
125
|
+
function MotionShare(props) {
|
|
126
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
127
|
+
/* @__PURE__ */ jsx("circle", { cx: "6", cy: "12", r: "3" }),
|
|
128
|
+
/* @__PURE__ */ jsxs(motion.g, { variants: shareTop, children: [
|
|
129
|
+
/* @__PURE__ */ jsx("circle", { cx: "18", cy: "5", r: "3" }),
|
|
130
|
+
/* @__PURE__ */ jsx("line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49" })
|
|
131
|
+
] }),
|
|
132
|
+
/* @__PURE__ */ jsxs(motion.g, { variants: shareBottom, children: [
|
|
133
|
+
/* @__PURE__ */ jsx("circle", { cx: "18", cy: "19", r: "3" }),
|
|
134
|
+
/* @__PURE__ */ jsx("line", { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49" })
|
|
135
|
+
] })
|
|
136
|
+
] }));
|
|
137
|
+
}
|
|
138
|
+
var SORT_TIMES = [0, 0.18, 0.6, 1];
|
|
139
|
+
function sortArm(dy) {
|
|
140
|
+
return {
|
|
141
|
+
rest: { y: 0, transition: returnTransition },
|
|
142
|
+
active: { y: 0, transition: returnTransition },
|
|
143
|
+
play: {
|
|
144
|
+
y: [0, -dy * 0.2, dy, 0],
|
|
145
|
+
transition: beats(SORT_TIMES, 0.56)
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
var sortDown = sortArm(6);
|
|
150
|
+
var sortUp = sortArm(-6);
|
|
151
|
+
function MotionSort(props) {
|
|
152
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
153
|
+
/* @__PURE__ */ jsxs(motion.g, { variants: sortDown, children: [
|
|
154
|
+
/* @__PURE__ */ jsx("path", { d: "m21 16-4 4-4-4" }),
|
|
155
|
+
/* @__PURE__ */ jsx("path", { d: "M17 20V4" })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsxs(motion.g, { variants: sortUp, children: [
|
|
158
|
+
/* @__PURE__ */ jsx("path", { d: "m3 8 4-4 4 4" }),
|
|
159
|
+
/* @__PURE__ */ jsx("path", { d: "M7 4v16" })
|
|
160
|
+
] })
|
|
161
|
+
] }));
|
|
162
|
+
}
|
|
163
|
+
var checkStroke = {
|
|
164
|
+
rest: { pathLength: 0, opacity: 0, transition: { duration: 0.15 } },
|
|
165
|
+
active: { pathLength: 1, opacity: 1, transition: { duration: 0.15 } },
|
|
166
|
+
play: {
|
|
167
|
+
pathLength: [0, 1],
|
|
168
|
+
opacity: [1, 1],
|
|
169
|
+
transition: { duration: 0.26, ease: "easeOut" }
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
function MotionCheck(props) {
|
|
173
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx(motion.path, { variants: checkStroke, opacity: 0, d: "M20 6 9 17l-5-5" }) }));
|
|
174
|
+
}
|
|
175
|
+
var SUN_RAYS = [
|
|
176
|
+
"M12 2v2",
|
|
177
|
+
"M12 20v2",
|
|
178
|
+
"m4.93 4.93 1.41 1.41",
|
|
179
|
+
"m17.66 17.66 1.41 1.41",
|
|
180
|
+
"M2 12h2",
|
|
181
|
+
"M20 12h2",
|
|
182
|
+
"m6.34 17.66-1.41 1.41",
|
|
183
|
+
"m19.07 4.93-1.41 1.41"
|
|
184
|
+
];
|
|
185
|
+
var THEME_TIMES = [0, 0.3, 0.7, 1];
|
|
186
|
+
var rays = {
|
|
187
|
+
rest: { scale: 1, opacity: 1, transition: returnTransition },
|
|
188
|
+
active: { scale: 0, opacity: 0, transition: returnTransition },
|
|
189
|
+
play: {
|
|
190
|
+
scale: [1, 0.4, 0, 0],
|
|
191
|
+
opacity: [1, 0.5, 0, 0],
|
|
192
|
+
transition: beats(THEME_TIMES, 0.5)
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
var disc = {
|
|
196
|
+
rest: { scale: 1, opacity: 1, transition: returnTransition },
|
|
197
|
+
active: { scale: 0.6, opacity: 0, transition: returnTransition },
|
|
198
|
+
play: { scale: [1, 0.85, 0.6, 0.6], opacity: [1, 1, 0, 0], transition: beats(THEME_TIMES, 0.5) }
|
|
199
|
+
};
|
|
200
|
+
var crescent = {
|
|
201
|
+
rest: { scale: 0.6, opacity: 0, rotate: -35, transition: returnTransition },
|
|
202
|
+
active: { scale: 1, opacity: 1, rotate: 0, transition: returnTransition },
|
|
203
|
+
play: {
|
|
204
|
+
scale: [0.6, 0.7, 1.06, 1],
|
|
205
|
+
opacity: [0, 0, 1, 1],
|
|
206
|
+
rotate: [-35, -22, 4, 0],
|
|
207
|
+
transition: beats(THEME_TIMES, 0.5)
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
function MotionTheme(props) {
|
|
211
|
+
const origin = { originX: "12px", originY: "12px" };
|
|
212
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
213
|
+
/* @__PURE__ */ jsx(motion.g, { variants: rays, style: origin, children: SUN_RAYS.map((d) => /* @__PURE__ */ jsx("path", { d }, d)) }),
|
|
214
|
+
/* @__PURE__ */ jsx(motion.circle, { variants: disc, style: origin, cx: "12", cy: "12", r: "4" }),
|
|
215
|
+
/* @__PURE__ */ jsx(
|
|
216
|
+
motion.path,
|
|
217
|
+
{
|
|
218
|
+
variants: crescent,
|
|
219
|
+
opacity: 0,
|
|
220
|
+
style: origin,
|
|
221
|
+
d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] }));
|
|
225
|
+
}
|
|
226
|
+
var chevron = {
|
|
227
|
+
rest: { rotate: 0, y: 0, transition: returnTransition },
|
|
228
|
+
active: { rotate: 180, y: 0, transition: returnTransition },
|
|
229
|
+
play: {
|
|
230
|
+
rotate: [0, -12, 196, 180],
|
|
231
|
+
y: [0, 1, -1, 0],
|
|
232
|
+
transition: beats([0, 0.16, 0.72, 1], 0.44)
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
function MotionChevron(props) {
|
|
236
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx(motion.path, { variants: chevron, style: { originX: "12px", originY: "12px" }, d: "m6 9 6 6 6-6" }) }));
|
|
237
|
+
}
|
|
238
|
+
var PLAYPAUSE_TIMES = [0, 0.24, 0.72, 1];
|
|
239
|
+
var playHead = {
|
|
240
|
+
rest: { scale: 1, opacity: 1, transition: returnTransition },
|
|
241
|
+
active: { scale: 0.2, opacity: 0, transition: returnTransition },
|
|
242
|
+
play: { scale: [1, 1.1, 0.2, 0.2], opacity: [1, 1, 0, 0], transition: beats(PLAYPAUSE_TIMES, 0.46) }
|
|
243
|
+
};
|
|
244
|
+
function pauseBar(dx) {
|
|
245
|
+
return {
|
|
246
|
+
rest: { x: dx, scaleY: 0.2, opacity: 0, transition: returnTransition },
|
|
247
|
+
active: { x: 0, scaleY: 1, opacity: 1, transition: returnTransition },
|
|
248
|
+
play: {
|
|
249
|
+
x: [dx, dx * 0.7, -dx * 0.08, 0],
|
|
250
|
+
scaleY: [0.2, 0.4, 1.08, 1],
|
|
251
|
+
opacity: [0, 0.4, 1, 1],
|
|
252
|
+
transition: beats(PLAYPAUSE_TIMES, 0.46)
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
var barLeft = pauseBar(5);
|
|
257
|
+
var barRight = pauseBar(-5);
|
|
258
|
+
function MotionPlayPause(props) {
|
|
259
|
+
const origin = { originX: "12px", originY: "12px" };
|
|
260
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
261
|
+
/* @__PURE__ */ jsx(
|
|
262
|
+
motion.path,
|
|
263
|
+
{
|
|
264
|
+
variants: playHead,
|
|
265
|
+
style: origin,
|
|
266
|
+
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ jsx(motion.rect, { variants: barLeft, opacity: 0, style: origin, x: "5", y: "3", width: "5", height: "18", rx: "1" }),
|
|
270
|
+
/* @__PURE__ */ jsx(motion.rect, { variants: barRight, opacity: 0, style: origin, x: "14", y: "3", width: "5", height: "18", rx: "1" })
|
|
271
|
+
] }));
|
|
272
|
+
}
|
|
273
|
+
var EYE_TIMES = [0, 0.3, 0.74, 1];
|
|
274
|
+
var lid = {
|
|
275
|
+
rest: { scaleY: 1, transition: returnTransition },
|
|
276
|
+
active: { scaleY: 0.18, transition: returnTransition },
|
|
277
|
+
play: { scaleY: [1, 1.06, 0.14, 0.18], transition: beats(EYE_TIMES, 0.46) }
|
|
278
|
+
};
|
|
279
|
+
var pupil = {
|
|
280
|
+
rest: { scale: 1, opacity: 1, transition: returnTransition },
|
|
281
|
+
active: { scale: 0.2, opacity: 0, transition: returnTransition },
|
|
282
|
+
play: { scale: [1, 1, 0.2, 0.2], opacity: [1, 1, 0, 0], transition: beats(EYE_TIMES, 0.46) }
|
|
283
|
+
};
|
|
284
|
+
var slash = {
|
|
285
|
+
rest: { pathLength: 0, opacity: 0, transition: { duration: 0.16 } },
|
|
286
|
+
active: { pathLength: 1, opacity: 1, transition: { duration: 0.16 } },
|
|
287
|
+
play: {
|
|
288
|
+
pathLength: [0, 0, 1, 1],
|
|
289
|
+
opacity: [0, 1, 1, 1],
|
|
290
|
+
transition: beats(EYE_TIMES, 0.46)
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
function MotionEye(props) {
|
|
294
|
+
const origin = { originX: "12px", originY: "12px" };
|
|
295
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
296
|
+
/* @__PURE__ */ jsx(
|
|
297
|
+
motion.path,
|
|
298
|
+
{
|
|
299
|
+
variants: lid,
|
|
300
|
+
style: origin,
|
|
301
|
+
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ jsx(motion.circle, { variants: pupil, style: origin, cx: "12", cy: "12", r: "3" }),
|
|
305
|
+
/* @__PURE__ */ jsx(motion.path, { variants: slash, opacity: 0, d: "m2 2 20 20" })
|
|
306
|
+
] }));
|
|
307
|
+
}
|
|
308
|
+
var STAR_TIMES = [0, 0.2, 0.62, 1];
|
|
309
|
+
var starBody = {
|
|
310
|
+
rest: { scale: 1, rotate: 0, fillOpacity: 0, transition: returnTransition },
|
|
311
|
+
active: { scale: 1, rotate: 0, fillOpacity: 1, transition: returnTransition },
|
|
312
|
+
play: {
|
|
313
|
+
scale: [1, 0.72, 1.22, 1],
|
|
314
|
+
rotate: [0, -14, 6, 0],
|
|
315
|
+
fillOpacity: [0, 0, 1, 1],
|
|
316
|
+
transition: beats(STAR_TIMES, 0.5)
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
function MotionStar(props) {
|
|
320
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx(
|
|
321
|
+
motion.path,
|
|
322
|
+
{
|
|
323
|
+
variants: starBody,
|
|
324
|
+
style: { originX: "12px", originY: "12px" },
|
|
325
|
+
fill: "currentColor",
|
|
326
|
+
fillOpacity: 0,
|
|
327
|
+
d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"
|
|
328
|
+
}
|
|
329
|
+
) }));
|
|
330
|
+
}
|
|
331
|
+
var COPY_TIMES = [0, 0.22, 0.5, 0.76, 1];
|
|
332
|
+
var copySheet = {
|
|
333
|
+
rest: { x: 0, y: 0, opacity: 1, transition: returnTransition },
|
|
334
|
+
active: { x: 0, y: 0, opacity: 0, transition: returnTransition },
|
|
335
|
+
play: {
|
|
336
|
+
x: [0, 2.5, 4, 0, 0],
|
|
337
|
+
y: [0, -2.5, -4, 0, 0],
|
|
338
|
+
opacity: [1, 1, 1, 0, 0],
|
|
339
|
+
transition: beats(COPY_TIMES, 0.6)
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
var copyBack = {
|
|
343
|
+
rest: { opacity: 1, transition: returnTransition },
|
|
344
|
+
active: { opacity: 0, transition: returnTransition },
|
|
345
|
+
play: { opacity: [1, 1, 1, 0, 0], transition: beats(COPY_TIMES, 0.6) }
|
|
346
|
+
};
|
|
347
|
+
var copyCheck = {
|
|
348
|
+
rest: { pathLength: 0, opacity: 0, transition: { duration: 0.14 } },
|
|
349
|
+
active: { pathLength: 1, opacity: 1, transition: { duration: 0.14 } },
|
|
350
|
+
play: {
|
|
351
|
+
pathLength: [0, 0, 0, 0, 1],
|
|
352
|
+
opacity: [0, 0, 0, 1, 1],
|
|
353
|
+
transition: beats(COPY_TIMES, 0.6)
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
function MotionCopy(props) {
|
|
357
|
+
return /* @__PURE__ */ jsxs(MotionIcon, __spreadProps(__spreadValues({}, props), { children: [
|
|
358
|
+
/* @__PURE__ */ jsx(motion.path, { variants: copyBack, d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }),
|
|
359
|
+
/* @__PURE__ */ jsx(motion.rect, { variants: copySheet, width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
360
|
+
/* @__PURE__ */ jsx(motion.path, { variants: copyCheck, opacity: 0, d: "M20 6 9 17l-5-5" })
|
|
361
|
+
] }));
|
|
362
|
+
}
|
|
363
|
+
var refreshRing = {
|
|
364
|
+
rest: { rotate: 0, transition: returnTransition },
|
|
365
|
+
active: { rotate: 0, transition: returnTransition },
|
|
366
|
+
play: {
|
|
367
|
+
rotate: [0, -18, 372, 360],
|
|
368
|
+
transition: beats([0, 0.14, 0.8, 1], 0.66)
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
function MotionRefresh(props) {
|
|
372
|
+
return /* @__PURE__ */ jsx(MotionIcon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxs(motion.g, { variants: refreshRing, style: { originX: "12px", originY: "12px" }, children: [
|
|
373
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
374
|
+
/* @__PURE__ */ jsx("path", { d: "M21 3v5h-5" }),
|
|
375
|
+
/* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
376
|
+
/* @__PURE__ */ jsx("path", { d: "M8 16H3v5" })
|
|
377
|
+
] }) }));
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export { MotionBookmark, MotionCheck, MotionChevron, MotionCopy, MotionEye, MotionHeart, MotionPlayPause, MotionRefresh, MotionSearch, MotionShare, MotionSliders, MotionSort, MotionStar, MotionTheme };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { MotionIconProps } from './motion-icon.js';
|
|
3
|
+
import 'framer-motion';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lucide draws roof and walls as one closed path; it is cut at the eaves
|
|
8
|
+
* (y=10) so the roof can leave. At rest the round caps of the two open paths
|
|
9
|
+
* overlap and the seam is invisible.
|
|
10
|
+
*/
|
|
11
|
+
declare function MotionHouse(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* The one gesture that HOLDS: uncrossed is the active pose. ~89° of relative
|
|
14
|
+
* separation, so the outline changes completely and the state is readable from
|
|
15
|
+
* the silhouette alone.
|
|
16
|
+
*/
|
|
17
|
+
declare function MotionUtensils(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function MotionMapPin(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Lucide's calendar has no pages — it is a box, a rule and six dots, and
|
|
21
|
+
* nothing in that geometry can roll. So the day dots become the page content,
|
|
22
|
+
* clipped to the body interior. The frame and binder rings hold perfectly
|
|
23
|
+
* still, which is what sells the contents moving.
|
|
24
|
+
*/
|
|
25
|
+
declare function MotionCalendar(props: MotionIconProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { MotionCalendar, MotionHouse, MotionMapPin, MotionUtensils };
|