@azmr/ui 0.2.0 → 0.3.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.
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ // src/motion/library/features-dom.ts
4
+ import { domAnimation } from "motion/react";
5
+ export {
6
+ domAnimation as default
7
+ };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ // src/motion/library/features-max.ts
4
+ import { domMax } from "motion/react";
5
+ export {
6
+ domMax as default
7
+ };
@@ -0,0 +1,49 @@
1
+ export { AnimatePresence, Reorder, animate, m, useAnimate, useDragControls, useInView, useMotionValue, useSpring, useTransform } from 'motion/react';
2
+ import * as react from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ interface MotionProviderProps {
6
+ children: ReactNode;
7
+ /**
8
+ * What the `m` components can do. `dom` (default): animation, variants, hover, tap and exit. `max`
9
+ * adds layout animation, drag and reorder, at a larger download. Either loads on demand.
10
+ */
11
+ features?: "dom" | "max";
12
+ /** Forbid the full `motion` component inside (use `m`), so the whole bundle is never pulled in by accident. Default true. */
13
+ strict?: boolean;
14
+ }
15
+ /**
16
+ * Sets up the `motion` library the cheap way: `LazyMotion` loads the animation features after first
17
+ * render instead of in your main bundle, and `MotionConfig reducedMotion="user"` makes every
18
+ * animation inside follow the system setting (movement is skipped, fades still play). Wrap the part
19
+ * of the app that uses `m`.
20
+ */
21
+ declare function MotionProvider({ children, features, strict }: MotionProviderProps): react.JSX.Element;
22
+
23
+ /**
24
+ * Spring presets for the `transition` prop of an `m` element. Springs suit movement that follows a
25
+ * gesture (a dropped item settling); for plain enters and exits prefer the CSS presets, which are
26
+ * cheaper and follow the motion tokens.
27
+ */
28
+ declare const springs: {
29
+ /** Soft and slow to settle: a panel gliding into place. */
30
+ readonly gentle: {
31
+ readonly type: "spring";
32
+ readonly stiffness: 120;
33
+ readonly damping: 20;
34
+ };
35
+ /** Quick with no wobble: a control responding. */
36
+ readonly snappy: {
37
+ readonly type: "spring";
38
+ readonly stiffness: 300;
39
+ readonly damping: 30;
40
+ };
41
+ /** A visible overshoot: a playful confirmation. Use sparingly. */
42
+ readonly bouncy: {
43
+ readonly type: "spring";
44
+ readonly stiffness: 400;
45
+ readonly damping: 15;
46
+ };
47
+ };
48
+
49
+ export { MotionProvider, type MotionProviderProps, springs };
package/dist/motion.js ADDED
@@ -0,0 +1,48 @@
1
+ "use client";
2
+
3
+ // src/motion/library/index.ts
4
+ import {
5
+ AnimatePresence,
6
+ animate,
7
+ m,
8
+ Reorder,
9
+ useAnimate,
10
+ useDragControls,
11
+ useInView,
12
+ useMotionValue,
13
+ useSpring,
14
+ useTransform
15
+ } from "motion/react";
16
+
17
+ // src/motion/library/provider.tsx
18
+ import { LazyMotion, MotionConfig } from "motion/react";
19
+ import { jsx } from "react/jsx-runtime";
20
+ var loadDom = () => import("./features-dom-MCGKRLN5.js").then((module) => module.default);
21
+ var loadMax = () => import("./features-max-COBTQCO6.js").then((module) => module.default);
22
+ function MotionProvider({ children, features = "dom", strict = true }) {
23
+ return /* @__PURE__ */ jsx(MotionConfig, { reducedMotion: "user", children: /* @__PURE__ */ jsx(LazyMotion, { features: features === "max" ? loadMax : loadDom, strict, children }) });
24
+ }
25
+
26
+ // src/motion/library/springs.ts
27
+ var springs = {
28
+ /** Soft and slow to settle: a panel gliding into place. */
29
+ gentle: { type: "spring", stiffness: 120, damping: 20 },
30
+ /** Quick with no wobble: a control responding. */
31
+ snappy: { type: "spring", stiffness: 300, damping: 30 },
32
+ /** A visible overshoot: a playful confirmation. Use sparingly. */
33
+ bouncy: { type: "spring", stiffness: 400, damping: 15 }
34
+ };
35
+ export {
36
+ AnimatePresence,
37
+ MotionProvider,
38
+ Reorder,
39
+ animate,
40
+ m,
41
+ springs,
42
+ useAnimate,
43
+ useDragControls,
44
+ useInView,
45
+ useMotionValue,
46
+ useSpring,
47
+ useTransform
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azmr/ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "React UI components wired to reactive Signals — Grid, useSignal",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -157,6 +157,10 @@
157
157
  "types": "./dist/presets.d.ts",
158
158
  "import": "./dist/presets.js"
159
159
  },
160
+ "./motion": {
161
+ "types": "./dist/motion.d.ts",
162
+ "import": "./dist/motion.js"
163
+ },
160
164
  "./styles.css": "./dist/styles.css",
161
165
  "./tokens.css": "./dist/tokens.css"
162
166
  },
@@ -173,7 +177,8 @@
173
177
  "peerDependencies": {
174
178
  "@azmr/core": ">=0.0.2 <1.0.0",
175
179
  "react": "^18.0.0 || ^19.0.0",
176
- "react-dom": "^18.0.0 || ^19.0.0"
180
+ "react-dom": "^18.0.0 || ^19.0.0",
181
+ "motion": "^14.0.0"
177
182
  },
178
183
  "devDependencies": {
179
184
  "@mui/icons-material": "^9.5.0",
@@ -191,6 +196,7 @@
191
196
  "culori": "^4.0.2",
192
197
  "esbuild": "^0.28.1",
193
198
  "jsdom": "^29.1.1",
199
+ "motion": "^14.2.0",
194
200
  "postcss": "^8.5.30",
195
201
  "react": "^19.2.8",
196
202
  "react-dom": "^19.2.8",
@@ -206,6 +212,11 @@
206
212
  "publishConfig": {
207
213
  "access": "public"
208
214
  },
215
+ "peerDependenciesMeta": {
216
+ "motion": {
217
+ "optional": true
218
+ }
219
+ },
209
220
  "scripts": {
210
221
  "build": "node scripts/clean.mjs && tsup && node scripts/copy-css.mjs && node scripts/verify-dist.mjs",
211
222
  "dev": "tsup --watch --onSuccess \"node scripts/copy-css.mjs\"",