@bearmenu/ui 0.7.0 → 0.7.1

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,84 @@
1
+ import { __spreadValues } from './chunk-3GWWZKX7.js';
2
+
3
+ // src/lib/motion.ts
4
+ var duration = {
5
+ instant: 0.12,
6
+ quick: 0.18,
7
+ standard: 0.26,
8
+ deliberate: 0.36,
9
+ narrative: 0.5,
10
+ exitQuick: 0.11,
11
+ exitStandard: 0.21
12
+ };
13
+ var ease = {
14
+ enter: [0, 0, 0.2, 1],
15
+ standard: [0.4, 0, 0.2, 1],
16
+ exit: [0.55, 0, 1, 0.45]
17
+ };
18
+ var springSnappy = {
19
+ type: "spring",
20
+ damping: 30,
21
+ stiffness: 380
22
+ };
23
+ var springSmooth = {
24
+ type: "spring",
25
+ damping: 30,
26
+ stiffness: 220
27
+ };
28
+ var springSoft = {
29
+ type: "spring",
30
+ damping: 35,
31
+ stiffness: 140
32
+ };
33
+ var springGentle = springSoft;
34
+ var archetype = {
35
+ /** Drawer / Sheet / Dialog entrance. Surface arrives first; content layers after. */
36
+ surfaceOpen: __spreadValues({}, springSmooth),
37
+ surfaceClose: { duration: duration.exitStandard, ease: ease.exit },
38
+ /** First-reveal stagger for card grids. Per-item spring. Cap stagger at 8 items. */
39
+ listReveal: __spreadValues({}, springSoft),
40
+ listRevealStagger: 0.04,
41
+ listRevealMaxItems: 8,
42
+ /** Tab content swap, skeleton → data swap. Opacity-only — no transform. */
43
+ contentSwap: { duration: duration.quick, ease: ease.standard },
44
+ contentSwapExit: { duration: duration.exitQuick, ease: ease.exit },
45
+ /** Bottom-sheet / side-drawer entry. */
46
+ edgeEnter: __spreadValues({}, springSmooth),
47
+ edgeExit: { duration: duration.exitStandard, ease: ease.exit },
48
+ /** Card / button tap feedback. */
49
+ pressResponse: { duration: duration.instant, ease: ease.enter },
50
+ /** Active tab pill, active filter chip — use with Framer Motion `layoutId`. */
51
+ indicatorMorph: __spreadValues({}, springSnappy),
52
+ /** Image enter — slight scale on load. */
53
+ imageEnter: { duration: 0.3, ease: ease.standard }
54
+ };
55
+ var stagger = {
56
+ tight: 0.03,
57
+ standard: 0.04,
58
+ loose: 0.06
59
+ };
60
+ var listRevealVariants = {
61
+ container: {
62
+ hidden: { opacity: 1 },
63
+ show: {
64
+ opacity: 1,
65
+ transition: { staggerChildren: stagger.standard }
66
+ }
67
+ },
68
+ item: {
69
+ hidden: { opacity: 0, y: 8 },
70
+ show: { opacity: 1, y: 0, transition: archetype.listReveal }
71
+ }
72
+ };
73
+ var contentSwapVariants = {
74
+ hidden: { opacity: 0, y: 6 },
75
+ show: { opacity: 1, y: 0, transition: archetype.contentSwap },
76
+ exit: { opacity: 0, y: -4, transition: archetype.contentSwapExit }
77
+ };
78
+ var skeletonSwapVariants = {
79
+ hidden: { opacity: 0 },
80
+ show: { opacity: 1, transition: archetype.contentSwap },
81
+ exit: { opacity: 0, transition: archetype.contentSwapExit }
82
+ };
83
+
84
+ export { archetype, contentSwapVariants, duration, ease, listRevealVariants, skeletonSwapVariants, springGentle, springSmooth, springSnappy, springSoft, stagger };
@@ -1,34 +1,11 @@
1
+ import { archetype } from '../chunk-LEAYBICI.js';
1
2
  import { cn } from '../chunk-FEK5XGZW.js';
2
- import { __spreadValues, __objRest, __spreadProps } from '../chunk-3GWWZKX7.js';
3
+ import { __objRest, __spreadValues, __spreadProps } from '../chunk-3GWWZKX7.js';
3
4
  import * as React from 'react';
4
5
  import * as TabsPrimitive from '@radix-ui/react-tabs';
5
6
  import { motion } from 'framer-motion';
6
7
  import { jsx, jsxs } from 'react/jsx-runtime';
7
8
 
8
- var springSnappy = {
9
- type: "spring",
10
- damping: 30,
11
- stiffness: 380
12
- };
13
- var springSmooth = {
14
- type: "spring",
15
- damping: 30,
16
- stiffness: 220
17
- };
18
- var springSoft = {
19
- type: "spring",
20
- damping: 35,
21
- stiffness: 140
22
- };
23
- var archetype = {
24
- /** Drawer / Sheet / Dialog entrance. Surface arrives first; content layers after. */
25
- surfaceOpen: __spreadValues({}, springSmooth),
26
- /** First-reveal stagger for card grids. Per-item spring. Cap stagger at 8 items. */
27
- listReveal: __spreadValues({}, springSoft),
28
- /** Bottom-sheet / side-drawer entry. */
29
- edgeEnter: __spreadValues({}, springSmooth),
30
- /** Active tab pill, active filter chip — use with Framer Motion `layoutId`. */
31
- indicatorMorph: __spreadValues({}, springSnappy)};
32
9
  var TabsContext = React.createContext({
33
10
  variant: "pill",
34
11
  orientation: "horizontal",
@@ -0,0 +1,83 @@
1
+ import { Transition, Variants } from 'framer-motion';
2
+
3
+ /**
4
+ * BearMenu Motion System — v1.0
5
+ *
6
+ * Three layers:
7
+ * 1. Primitives — durations + easing curves (raw values)
8
+ * 2. Springs — Framer Motion spring configs (named)
9
+ * 3. Archetypes — compound presets that compose primitives + springs
10
+ *
11
+ * Feature code reaches for archetypes, never primitives.
12
+ * Adding a new archetype is a DS-maintainer task.
13
+ *
14
+ * Companion CSS custom properties live in `./globals.css`:
15
+ * --duration-instant / --duration-quick / --duration-standard /
16
+ * --duration-deliberate / --duration-narrative /
17
+ * --duration-exit-quick / --duration-exit-standard
18
+ * --ease-enter / --ease-standard / --ease-exit
19
+ */
20
+ declare const duration: {
21
+ readonly instant: 0.12;
22
+ readonly quick: 0.18;
23
+ readonly standard: 0.26;
24
+ readonly deliberate: 0.36;
25
+ readonly narrative: 0.5;
26
+ readonly exitQuick: 0.11;
27
+ readonly exitStandard: 0.21;
28
+ };
29
+ declare const ease: {
30
+ readonly enter: readonly [0, 0, 0.2, 1];
31
+ readonly standard: readonly [0.4, 0, 0.2, 1];
32
+ readonly exit: readonly [0.55, 0, 1, 0.45];
33
+ };
34
+ declare const springSnappy: Transition;
35
+ declare const springSmooth: Transition;
36
+ declare const springSoft: Transition;
37
+ /** @deprecated use `springSoft`. Kept as alias during migration. */
38
+ declare const springGentle: Transition;
39
+ declare const archetype: {
40
+ /** Drawer / Sheet / Dialog entrance. Surface arrives first; content layers after. */
41
+ readonly surfaceOpen: Transition;
42
+ readonly surfaceClose: Transition;
43
+ /** First-reveal stagger for card grids. Per-item spring. Cap stagger at 8 items. */
44
+ readonly listReveal: Transition;
45
+ readonly listRevealStagger: 0.04;
46
+ readonly listRevealMaxItems: 8;
47
+ /** Tab content swap, skeleton → data swap. Opacity-only — no transform. */
48
+ readonly contentSwap: Transition;
49
+ readonly contentSwapExit: Transition;
50
+ /** Bottom-sheet / side-drawer entry. */
51
+ readonly edgeEnter: Transition;
52
+ readonly edgeExit: Transition;
53
+ /** Card / button tap feedback. */
54
+ readonly pressResponse: Transition;
55
+ /** Active tab pill, active filter chip — use with Framer Motion `layoutId`. */
56
+ readonly indicatorMorph: Transition;
57
+ /** Image enter — slight scale on load. */
58
+ readonly imageEnter: Transition;
59
+ };
60
+ declare const stagger: {
61
+ readonly tight: 0.03;
62
+ readonly standard: 0.04;
63
+ readonly loose: 0.06;
64
+ };
65
+ /**
66
+ * List-reveal container + item variants. Pair with Framer Motion `motion.ul`/`motion.div`.
67
+ * Container drives stagger; item handles the actual fade + Y-shift.
68
+ */
69
+ declare const listRevealVariants: {
70
+ container: Variants;
71
+ item: Variants;
72
+ };
73
+ /**
74
+ * Content-swap variants for `AnimatePresence mode="wait"`. Opacity + tiny Y shift.
75
+ * Use for tab panels.
76
+ */
77
+ declare const contentSwapVariants: Variants;
78
+ /**
79
+ * Skeleton → data swap. Opacity-only to prevent layout shift on slow networks.
80
+ */
81
+ declare const skeletonSwapVariants: Variants;
82
+
83
+ export { archetype, contentSwapVariants, duration, ease, listRevealVariants, skeletonSwapVariants, springGentle, springSmooth, springSnappy, springSoft, stagger };
@@ -0,0 +1,2 @@
1
+ export { archetype, contentSwapVariants, duration, ease, listRevealVariants, skeletonSwapVariants, springGentle, springSmooth, springSnappy, springSoft, stagger } from '../chunk-LEAYBICI.js';
2
+ import '../chunk-3GWWZKX7.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bearmenu/ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "BearMenu design system — shared UI tokens, primitives, and components",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {