beez-ui 2.6.1 → 2.7.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/CHANGELOG.md +29 -0
- package/README.md +48 -28
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +3 -3
- package/dist/components/dialog-surface.js +1 -1
- package/dist/components/dialog.d.ts +5 -4
- package/dist/components/dialog.js +7 -6
- package/dist/components/sidebar.js +4 -9
- package/dist/components/themed-toaster.d.ts +3 -4
- package/dist/components/themed-toaster.js +42 -56
- package/dist/components/toaster.d.ts +12 -0
- package/dist/components/toaster.js +62 -0
- package/dist/motion/arc-tokens.d.ts +5 -1
- package/dist/motion/arc-tokens.js +19 -3
- package/dist/motion/glide-indicator.d.ts +4 -6
- package/dist/motion/glide-indicator.js +61 -23
- package/dist/motion/motion-slot.js +30 -61
- package/dist/motion/surface-keyframes.d.ts +12 -1
- package/dist/motion/surface-keyframes.js +48 -83
- package/dist/motion/tokens.d.ts +97 -61
- package/dist/motion/tokens.js +95 -99
- package/dist/sonner.d.ts +6 -1
- package/dist/sonner.js +6 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/motion/tokens.d.ts
CHANGED
|
@@ -1,30 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defines the timing, curves and physics shared by Motion animations, aligned with beui.dev/components/motion.
|
|
3
|
-
* Public: consumers animate their own product surfaces with these tokens so they move like the library.
|
|
4
|
-
*/
|
|
5
1
|
export declare const MOTION_TIMING: {
|
|
6
|
-
|
|
7
|
-
readonly
|
|
8
|
-
|
|
9
|
-
readonly
|
|
10
|
-
|
|
11
|
-
readonly
|
|
2
|
+
/** Arc `duration.instant`: color answers and fades that must feel immediate. */
|
|
3
|
+
readonly instant: 0.12;
|
|
4
|
+
/** Arc `duration.fast`: small fades, the opacity of a spring entrance, and dialog exits. */
|
|
5
|
+
readonly fast: 0.16;
|
|
6
|
+
/** Arc `duration.standard`: entrance tweens. */
|
|
7
|
+
readonly enter: 0.24;
|
|
8
|
+
/** Arc `duration.standard`: tween length for a deliberate on-screen change. */
|
|
9
|
+
readonly standard: 0.24;
|
|
10
|
+
/** Arc `duration.considered`: the slowest tween, for large layout changes. */
|
|
11
|
+
readonly considered: 0.48;
|
|
12
|
+
/** Arc `duration.standard`: inline messages that appear next to the content they describe. */
|
|
13
|
+
readonly message: 0.24;
|
|
14
|
+
/** Arc `duration.standard`: opacity of panels whose size moves on a spring. */
|
|
15
|
+
readonly panel: 0.24;
|
|
16
|
+
/** Arc `duration.standard`: scrims fading in behind dialogs and sheets. */
|
|
17
|
+
readonly overlay: 0.24;
|
|
18
|
+
/** Arc `duration.exit`: leaving is faster than arriving. */
|
|
19
|
+
readonly exit: 0.18;
|
|
12
20
|
readonly surfaceClip: 0.32;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Invalid fields no longer shake: the error is told by color and message. Kept for consumers that
|
|
23
|
+
* animate their own fields.
|
|
24
|
+
*/
|
|
13
25
|
readonly shake: 0.45;
|
|
14
26
|
readonly checkDraw: 0.3;
|
|
15
27
|
readonly checkDrawDelay: 0.04;
|
|
16
|
-
|
|
17
|
-
readonly
|
|
28
|
+
/** Arc `duration.fast`: the fade of an icon swapped in place; its scale rides `SPRING_POP`. */
|
|
29
|
+
readonly iconSwap: 0.16;
|
|
30
|
+
/** Arc `duration.fast`: options fading in with their list. */
|
|
31
|
+
readonly listItem: 0.16;
|
|
18
32
|
readonly listDelay: 0.05;
|
|
33
|
+
/** Arc `stagger.item`. */
|
|
19
34
|
readonly listStagger: 0.035;
|
|
20
35
|
readonly closeEnter: 0.2;
|
|
21
36
|
readonly closeDelay: 0.16;
|
|
37
|
+
/** Arc `duration.standard`: edge panels leaving the viewport. */
|
|
22
38
|
readonly sheetExit: 0.24;
|
|
23
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Dialogs no longer unfold from their center; they rise and scale in on `SPRING_PANEL`. Kept for
|
|
41
|
+
* consumers that animate their own surfaces with it.
|
|
42
|
+
*/
|
|
24
43
|
readonly centerMorph: 0.43;
|
|
25
44
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
45
|
+
* @deprecated Dialogs no longer fold back to their center; they leave in `MOTION_TIMING.fast`. Kept for consumers
|
|
46
|
+
* that animate their own surfaces with it.
|
|
28
47
|
*/
|
|
29
48
|
readonly centerMorphFold: 0.24;
|
|
30
49
|
readonly reveal: 0.4;
|
|
@@ -32,96 +51,95 @@ export declare const MOTION_TIMING: {
|
|
|
32
51
|
readonly pop: 0.32;
|
|
33
52
|
/** Height of expanding and collapsing regions. */
|
|
34
53
|
readonly collapse: 0.26;
|
|
54
|
+
/** Arc `duration.standard`. */
|
|
35
55
|
readonly monthSwap: 0.24;
|
|
36
56
|
readonly cursorBlink: 1;
|
|
37
57
|
readonly skeleton: 1.8;
|
|
38
58
|
};
|
|
39
59
|
/** Items beyond this position share the last stagger delay, so long lists never lag behind. */
|
|
40
60
|
export declare const MOTION_LIST_STAGGER_LIMIT = 10;
|
|
41
|
-
/**
|
|
61
|
+
/** Arc `ease.enter`: strong ease-out for entrances; weak defaults such as `ease-out` feel sluggish. */
|
|
42
62
|
export declare const MOTION_EASE: readonly [0.16, 1, 0.3, 1];
|
|
43
|
-
/**
|
|
44
|
-
export declare const
|
|
63
|
+
/** Arc `ease.exit`: accelerates away, for elements leaving the screen. */
|
|
64
|
+
export declare const MOTION_EASE_EXIT: readonly [0.7, 0, 0.84, 0];
|
|
65
|
+
/** Arc `ease.standard`: color and opacity changes, and quick exits that must not linger. */
|
|
66
|
+
export declare const MOTION_EASE_STANDARD: readonly [0.22, 1, 0.36, 1];
|
|
67
|
+
/** Arc `ease.inOut`: elements that move while already on screen, and looping effects. */
|
|
68
|
+
export declare const MOTION_EASE_IN_OUT: readonly [0.65, 0, 0.35, 1];
|
|
45
69
|
/** Drawer curve for edge panels leaving the viewport. */
|
|
46
70
|
export declare const MOTION_EASE_DRAWER: readonly [0.32, 0.72, 0, 1];
|
|
47
71
|
/**
|
|
48
72
|
* Near-linear curve for the center morph: a spring or strong ease-out would resolve the clip
|
|
49
73
|
* early and spend the last frames barely moving, so the whole duration reads as unfolding.
|
|
74
|
+
* @deprecated Dialogs no longer unfold from their center. Kept for consumers that animate their own surfaces with it.
|
|
50
75
|
*/
|
|
51
76
|
export declare const MOTION_EASE_UNFOLD: readonly [0.2, 0, 0.2, 1];
|
|
52
|
-
/**
|
|
77
|
+
/** Arc `spring.snappy`: press feedback on buttons and other tappable surfaces. */
|
|
53
78
|
export declare const SPRING_PRESS: {
|
|
54
79
|
readonly type: "spring";
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
57
|
-
readonly mass: 0.6;
|
|
80
|
+
readonly visualDuration: 0.26;
|
|
81
|
+
readonly bounce: 0.12;
|
|
58
82
|
};
|
|
59
|
-
/**
|
|
83
|
+
/** Arc `spring.smooth`: overlay panel entrances (dialogs, sheets and floating surfaces); never overshoots. */
|
|
60
84
|
export declare const SPRING_PANEL: {
|
|
61
85
|
readonly type: "spring";
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
readonly mass: 0.5;
|
|
86
|
+
readonly visualDuration: 0.4;
|
|
87
|
+
readonly bounce: 0;
|
|
65
88
|
};
|
|
66
|
-
/**
|
|
89
|
+
/** Arc `spring.morph`: shared-layout glides, indicators and highlights moving between items. */
|
|
67
90
|
export declare const SPRING_LAYOUT: {
|
|
68
91
|
readonly type: "spring";
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
71
|
-
readonly mass: 0.6;
|
|
92
|
+
readonly visualDuration: 0.42;
|
|
93
|
+
readonly bounce: 0.16;
|
|
72
94
|
};
|
|
73
|
-
/**
|
|
95
|
+
/** Arc `spring.snappy`: keyboard highlight in menus and lists, quick enough to keep up with a held arrow key. */
|
|
74
96
|
export declare const SPRING_HIGHLIGHT: {
|
|
75
97
|
readonly type: "spring";
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly mass: 0.5;
|
|
98
|
+
readonly visualDuration: 0.26;
|
|
99
|
+
readonly bounce: 0.12;
|
|
79
100
|
};
|
|
80
|
-
/**
|
|
101
|
+
/** Arc `spring.morph`: the tab indicator gliding between tabs. */
|
|
81
102
|
export declare const SPRING_TABS: {
|
|
82
103
|
readonly type: "spring";
|
|
83
|
-
readonly
|
|
84
|
-
readonly
|
|
85
|
-
readonly mass: 1.2;
|
|
104
|
+
readonly visualDuration: 0.42;
|
|
105
|
+
readonly bounce: 0.16;
|
|
86
106
|
};
|
|
87
|
-
/**
|
|
107
|
+
/** Arc `spring.snappy`: small tooltip surfaces. */
|
|
88
108
|
export declare const SPRING_TOOLTIP: {
|
|
89
109
|
readonly type: "spring";
|
|
90
|
-
readonly
|
|
91
|
-
readonly
|
|
92
|
-
readonly mass: 0.7;
|
|
110
|
+
readonly visualDuration: 0.26;
|
|
111
|
+
readonly bounce: 0.12;
|
|
93
112
|
};
|
|
94
|
-
/**
|
|
113
|
+
/** Arc `spring.snappy`: disclosure chevrons turning toward their new state. */
|
|
95
114
|
export declare const SPRING_CHEVRON: {
|
|
96
115
|
readonly type: "spring";
|
|
97
|
-
readonly
|
|
98
|
-
readonly bounce: 0.
|
|
116
|
+
readonly visualDuration: 0.26;
|
|
117
|
+
readonly bounce: 0.12;
|
|
99
118
|
};
|
|
100
|
-
/**
|
|
119
|
+
/** Arc `spring.smooth`: the switch thumb reports state, so it lands without overshoot. */
|
|
101
120
|
export declare const SPRING_THUMB: {
|
|
102
121
|
readonly type: "spring";
|
|
103
|
-
readonly
|
|
104
|
-
readonly
|
|
105
|
-
readonly mass: 4;
|
|
122
|
+
readonly visualDuration: 0.4;
|
|
123
|
+
readonly bounce: 0;
|
|
106
124
|
};
|
|
107
|
-
/**
|
|
125
|
+
/** Arc `spring.snappy`: small, confident pops for counters, badges and swapped icons. */
|
|
108
126
|
export declare const SPRING_POP: {
|
|
109
127
|
readonly type: "spring";
|
|
110
|
-
readonly
|
|
111
|
-
readonly
|
|
112
|
-
readonly mass: 0.5;
|
|
128
|
+
readonly visualDuration: 0.26;
|
|
129
|
+
readonly bounce: 0.12;
|
|
113
130
|
};
|
|
114
|
-
/**
|
|
115
|
-
export declare const MOTION_PRESS_SCALE = 0.
|
|
131
|
+
/** Arc's press: about 0.97, so every pressable reads as the same push. */
|
|
132
|
+
export declare const MOTION_PRESS_SCALE = 0.97;
|
|
116
133
|
export declare const MOTION_SUBTLE_PRESS_SCALE = 0.98;
|
|
117
134
|
export declare const MOTION_TOGGLE_PRESS_SCALE = 0.92;
|
|
118
135
|
export declare const MOTION_HOVER_SCALE = 1.02;
|
|
119
136
|
export declare const MOTION_THUMB_SQUISH_SCALE = 0.9;
|
|
120
137
|
export declare const MOTION_ITEM_CHECK_SCALE = 0.75;
|
|
121
|
-
|
|
138
|
+
/** Arc's icon swap: the incoming icon grows from 0.6 on `SPRING_POP`. */
|
|
139
|
+
export declare const MOTION_ICON_SWAP_SCALE = 0.6;
|
|
122
140
|
export declare const MOTION_CLOSE_BUTTON_SCALE = 0.8;
|
|
123
141
|
export declare const MOTION_LIST_ITEM_DISTANCE = 6;
|
|
124
|
-
/** Scale a freshly inserted list item starts from, and a leaving one shrinks to. */
|
|
142
|
+
/** Scale a freshly inserted list item, option or inline message starts from, and a leaving one shrinks to. */
|
|
125
143
|
export declare const MOTION_ITEM_ENTER_SCALE = 0.98;
|
|
126
144
|
/** Loaded images settle from a slight zoom, so they develop in place instead of popping in. */
|
|
127
145
|
export declare const MOTION_REVEAL_SCALE = 1.06;
|
|
@@ -133,17 +151,35 @@ export declare const MOTION_SHIMMER_TRANSLATE: readonly ["-100% 0", "100% 0"];
|
|
|
133
151
|
/** Hovered interactive cards gain a soft drop shadow; the rest value has the same shape, invisible. */
|
|
134
152
|
export declare const MOTION_CARD_SHADOW_LIFT = "0px 4px 16px 0px rgba(0, 0, 0, 0.08)";
|
|
135
153
|
export declare const MOTION_CARD_SHADOW_REST = "0px 0px 0px 0px rgba(0, 0, 0, 0)";
|
|
154
|
+
/** Arc's dialog panel scale on entrance; floating surfaces start from it too. */
|
|
136
155
|
export declare const MOTION_SURFACE_SCALE = 0.96;
|
|
156
|
+
/** Scale a dialog or tooltip shrinks to while it leaves (Arc). */
|
|
157
|
+
export declare const MOTION_EXIT_SCALE = 0.98;
|
|
137
158
|
/** Fraction of the surface kept hidden by the clip at the start of its reveal, in percent. */
|
|
138
159
|
export declare const MOTION_SURFACE_CLIP_PERCENT = 92;
|
|
139
160
|
/** Room left outside a revealing surface for its ring and drop shadow (`shadow-lg` spans ~22px). */
|
|
140
161
|
export declare const MOTION_SURFACE_CLIP_BLEED_PX = 24;
|
|
141
|
-
|
|
142
|
-
export declare const
|
|
143
|
-
/**
|
|
162
|
+
/** Arc's tooltip rise from its trigger, in pixels. */
|
|
163
|
+
export declare const MOTION_TOOLTIP_DISTANCE = 3;
|
|
164
|
+
/** Arc's tooltip scale on entrance. */
|
|
165
|
+
export declare const MOTION_TOOLTIP_SCALE = 0.97;
|
|
166
|
+
/** Arc's dialog rise on entrance, in pixels. */
|
|
167
|
+
export declare const MOTION_DIALOG_DISTANCE = 8;
|
|
168
|
+
/** Arc's dialog drop while it leaves, in pixels. */
|
|
169
|
+
export declare const MOTION_DIALOG_EXIT_DISTANCE = 4;
|
|
170
|
+
/**
|
|
171
|
+
* Inset kept on every side of a center-morph dialog while folded, in percent: a sliver at its center.
|
|
172
|
+
* @deprecated Dialogs no longer unfold from their center. Kept for consumers that animate their own surfaces with it.
|
|
173
|
+
*/
|
|
144
174
|
export declare const MOTION_CENTER_MORPH_FOLDED_PERCENT = 48;
|
|
145
175
|
export declare const MOTION_CONTENT_DISTANCE = 4;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated Invalid fields no longer shake: the error is told by color and message. Kept for consumers that
|
|
178
|
+
* animate their own fields.
|
|
179
|
+
*/
|
|
146
180
|
export declare const MOTION_INVALID_SHAKE_PX: readonly [0, -6, 6, -4, 4, -2, 0];
|
|
147
181
|
/** Time after an item loses its active state during which a new active item still glides from it. */
|
|
148
182
|
export declare const GLIDE_CONTINUITY_MS = 300;
|
|
149
|
-
export type MotionKind = "press" | "subtle-press" | "toggle" | "fade" | "content" | "message" | "card" | "row" | "field" | "thumb" | "check" | "selection" | "item-check" | "rotate" | "list-item" | "icon-swap" | "delayed-pop" | "skeleton" | "reveal" | "link" | "icon" | "tooltip" | "surface" | "dialog"
|
|
183
|
+
export type MotionKind = "press" | "subtle-press" | "toggle" | "fade" | "content" | "message" | "card" | "row" | "field" | "thumb" | "check" | "selection" | "item-check" | "rotate" | "list-item" | "icon-swap" | "delayed-pop" | "skeleton" | "reveal" | "link" | "icon" | "tooltip" | "surface" | "dialog"
|
|
184
|
+
/** @deprecated Library dialogs use `dialog`. */
|
|
185
|
+
| "center-morph" | "sheet" | "overlay";
|
package/dist/motion/tokens.js
CHANGED
|
@@ -1,30 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Defines the timing, curves and physics shared by Motion animations, aligned with
|
|
3
|
-
*
|
|
2
|
+
* Defines the timing, curves and physics shared by Motion animations, aligned with Arc's motion presets
|
|
3
|
+
* (https://uiarc.dev, `components/arc/lib/motion-tokens.ts`): `snappy` for presses and small indicators, `smooth` for
|
|
4
|
+
* panels and anything that reports state, `morph` for shared highlights. Motion explains cause and effect; it does not
|
|
5
|
+
* decorate. Public: consumers animate their own product surfaces with these tokens so they move like the library.
|
|
6
|
+
* Names are stable API; values follow Arc.
|
|
4
7
|
*/
|
|
8
|
+
import { ARC_DURATION, ARC_EASE, ARC_SPRING_MORPH, ARC_SPRING_SMOOTH, ARC_SPRING_SNAPPY, ARC_STAGGER } from "./arc-tokens.js";
|
|
5
9
|
export const MOTION_TIMING = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/** Arc `duration.instant`: color answers and fades that must feel immediate. */
|
|
11
|
+
instant: ARC_DURATION.instant,
|
|
12
|
+
/** Arc `duration.fast`: small fades, the opacity of a spring entrance, and dialog exits. */
|
|
13
|
+
fast: ARC_DURATION.fast,
|
|
14
|
+
/** Arc `duration.standard`: entrance tweens. */
|
|
15
|
+
enter: ARC_DURATION.standard,
|
|
16
|
+
/** Arc `duration.standard`: tween length for a deliberate on-screen change. */
|
|
17
|
+
standard: ARC_DURATION.standard,
|
|
18
|
+
/** Arc `duration.considered`: the slowest tween, for large layout changes. */
|
|
19
|
+
considered: ARC_DURATION.considered,
|
|
20
|
+
/** Arc `duration.standard`: inline messages that appear next to the content they describe. */
|
|
21
|
+
message: ARC_DURATION.standard,
|
|
22
|
+
/** Arc `duration.standard`: opacity of panels whose size moves on a spring. */
|
|
23
|
+
panel: ARC_DURATION.standard,
|
|
24
|
+
/** Arc `duration.standard`: scrims fading in behind dialogs and sheets. */
|
|
25
|
+
overlay: ARC_DURATION.standard,
|
|
26
|
+
/** Arc `duration.exit`: leaving is faster than arriving. */
|
|
27
|
+
exit: ARC_DURATION.exit,
|
|
12
28
|
surfaceClip: .32,
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Invalid fields no longer shake: the error is told by color and message. Kept for consumers that
|
|
31
|
+
* animate their own fields.
|
|
32
|
+
*/
|
|
13
33
|
shake: .45,
|
|
14
34
|
checkDraw: .3,
|
|
15
35
|
checkDrawDelay: .04,
|
|
16
|
-
|
|
17
|
-
|
|
36
|
+
/** Arc `duration.fast`: the fade of an icon swapped in place; its scale rides `SPRING_POP`. */
|
|
37
|
+
iconSwap: ARC_DURATION.fast,
|
|
38
|
+
/** Arc `duration.fast`: options fading in with their list. */
|
|
39
|
+
listItem: ARC_DURATION.fast,
|
|
18
40
|
listDelay: .05,
|
|
19
|
-
|
|
41
|
+
/** Arc `stagger.item`. */
|
|
42
|
+
listStagger: ARC_STAGGER.item,
|
|
20
43
|
closeEnter: .2,
|
|
21
44
|
closeDelay: .16,
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
/** Arc `duration.standard`: edge panels leaving the viewport. */
|
|
46
|
+
sheetExit: ARC_DURATION.standard,
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Dialogs no longer unfold from their center; they rise and scale in on `SPRING_PANEL`. Kept for
|
|
49
|
+
* consumers that animate their own surfaces with it.
|
|
50
|
+
*/
|
|
24
51
|
centerMorph: .43,
|
|
25
52
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
53
|
+
* @deprecated Dialogs no longer fold back to their center; they leave in `MOTION_TIMING.fast`. Kept for consumers
|
|
54
|
+
* that animate their own surfaces with it.
|
|
28
55
|
*/
|
|
29
56
|
centerMorphFold: .24,
|
|
30
57
|
reveal: .4,
|
|
@@ -32,26 +59,21 @@ export const MOTION_TIMING = {
|
|
|
32
59
|
pop: .32,
|
|
33
60
|
/** Height of expanding and collapsing regions. */
|
|
34
61
|
collapse: .26,
|
|
35
|
-
|
|
62
|
+
/** Arc `duration.standard`. */
|
|
63
|
+
monthSwap: ARC_DURATION.standard,
|
|
36
64
|
cursorBlink: 1,
|
|
37
65
|
skeleton: 1.8
|
|
38
66
|
};
|
|
39
67
|
/** Items beyond this position share the last stagger delay, so long lists never lag behind. */
|
|
40
68
|
export const MOTION_LIST_STAGGER_LIMIT = 10;
|
|
41
|
-
/**
|
|
42
|
-
export const MOTION_EASE =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export const MOTION_EASE_IN_OUT = [
|
|
50
|
-
.77,
|
|
51
|
-
0,
|
|
52
|
-
.175,
|
|
53
|
-
1
|
|
54
|
-
];
|
|
69
|
+
/** Arc `ease.enter`: strong ease-out for entrances; weak defaults such as `ease-out` feel sluggish. */
|
|
70
|
+
export const MOTION_EASE = ARC_EASE.enter;
|
|
71
|
+
/** Arc `ease.exit`: accelerates away, for elements leaving the screen. */
|
|
72
|
+
export const MOTION_EASE_EXIT = ARC_EASE.exit;
|
|
73
|
+
/** Arc `ease.standard`: color and opacity changes, and quick exits that must not linger. */
|
|
74
|
+
export const MOTION_EASE_STANDARD = ARC_EASE.standard;
|
|
75
|
+
/** Arc `ease.inOut`: elements that move while already on screen, and looping effects. */
|
|
76
|
+
export const MOTION_EASE_IN_OUT = ARC_EASE.inOut;
|
|
55
77
|
/** Drawer curve for edge panels leaving the viewport. */
|
|
56
78
|
export const MOTION_EASE_DRAWER = [
|
|
57
79
|
.32,
|
|
@@ -62,6 +84,7 @@ export const MOTION_EASE_DRAWER = [
|
|
|
62
84
|
/**
|
|
63
85
|
* Near-linear curve for the center morph: a spring or strong ease-out would resolve the clip
|
|
64
86
|
* early and spend the last frames barely moving, so the whole duration reads as unfolding.
|
|
87
|
+
* @deprecated Dialogs no longer unfold from their center. Kept for consumers that animate their own surfaces with it.
|
|
65
88
|
*/
|
|
66
89
|
export const MOTION_EASE_UNFOLD = [
|
|
67
90
|
.2,
|
|
@@ -69,79 +92,36 @@ export const MOTION_EASE_UNFOLD = [
|
|
|
69
92
|
.2,
|
|
70
93
|
1
|
|
71
94
|
];
|
|
72
|
-
/**
|
|
73
|
-
export const SPRING_PRESS =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
export const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
/** Keyboard highlight in menus and lists: quick enough to keep up with a held arrow key. */
|
|
94
|
-
export const SPRING_HIGHLIGHT = {
|
|
95
|
-
type: "spring",
|
|
96
|
-
stiffness: 700,
|
|
97
|
-
damping: 45,
|
|
98
|
-
mass: .5
|
|
99
|
-
};
|
|
100
|
-
/** Tab indicator glide, tuned to settle without overshooting the list edges. */
|
|
101
|
-
export const SPRING_TABS = {
|
|
102
|
-
type: "spring",
|
|
103
|
-
stiffness: 245,
|
|
104
|
-
damping: 36,
|
|
105
|
-
mass: 1.2
|
|
106
|
-
};
|
|
107
|
-
/** Lighter spawn for small tooltip surfaces. */
|
|
108
|
-
export const SPRING_TOOLTIP = {
|
|
109
|
-
type: "spring",
|
|
110
|
-
stiffness: 380,
|
|
111
|
-
damping: 30,
|
|
112
|
-
mass: .7
|
|
113
|
-
};
|
|
114
|
-
/** Disclosure chevrons rotate with a little bounce, as if flicked. */
|
|
115
|
-
export const SPRING_CHEVRON = {
|
|
116
|
-
type: "spring",
|
|
117
|
-
duration: .4,
|
|
118
|
-
bounce: .3
|
|
119
|
-
};
|
|
120
|
-
/** Heavy, deliberate switch thumb — high mass keeps the travel weighty without wobble. */
|
|
121
|
-
export const SPRING_THUMB = {
|
|
122
|
-
type: "spring",
|
|
123
|
-
stiffness: 800,
|
|
124
|
-
damping: 80,
|
|
125
|
-
mass: 4
|
|
126
|
-
};
|
|
127
|
-
/** Small, confident pops for counters, badges and toggled icons. */
|
|
128
|
-
export const SPRING_POP = {
|
|
129
|
-
type: "spring",
|
|
130
|
-
stiffness: 520,
|
|
131
|
-
damping: 30,
|
|
132
|
-
mass: .5
|
|
133
|
-
};
|
|
134
|
-
/** Primary actions compress noticeably; dense navigation items stay subtle. */
|
|
135
|
-
export const MOTION_PRESS_SCALE = .93;
|
|
95
|
+
/** Arc `spring.snappy`: press feedback on buttons and other tappable surfaces. */
|
|
96
|
+
export const SPRING_PRESS = ARC_SPRING_SNAPPY;
|
|
97
|
+
/** Arc `spring.smooth`: overlay panel entrances (dialogs, sheets and floating surfaces); never overshoots. */
|
|
98
|
+
export const SPRING_PANEL = ARC_SPRING_SMOOTH;
|
|
99
|
+
/** Arc `spring.morph`: shared-layout glides, indicators and highlights moving between items. */
|
|
100
|
+
export const SPRING_LAYOUT = ARC_SPRING_MORPH;
|
|
101
|
+
/** Arc `spring.snappy`: keyboard highlight in menus and lists, quick enough to keep up with a held arrow key. */
|
|
102
|
+
export const SPRING_HIGHLIGHT = ARC_SPRING_SNAPPY;
|
|
103
|
+
/** Arc `spring.morph`: the tab indicator gliding between tabs. */
|
|
104
|
+
export const SPRING_TABS = ARC_SPRING_MORPH;
|
|
105
|
+
/** Arc `spring.snappy`: small tooltip surfaces. */
|
|
106
|
+
export const SPRING_TOOLTIP = ARC_SPRING_SNAPPY;
|
|
107
|
+
/** Arc `spring.snappy`: disclosure chevrons turning toward their new state. */
|
|
108
|
+
export const SPRING_CHEVRON = ARC_SPRING_SNAPPY;
|
|
109
|
+
/** Arc `spring.smooth`: the switch thumb reports state, so it lands without overshoot. */
|
|
110
|
+
export const SPRING_THUMB = ARC_SPRING_SMOOTH;
|
|
111
|
+
/** Arc `spring.snappy`: small, confident pops for counters, badges and swapped icons. */
|
|
112
|
+
export const SPRING_POP = ARC_SPRING_SNAPPY;
|
|
113
|
+
/** Arc's press: about 0.97, so every pressable reads as the same push. */
|
|
114
|
+
export const MOTION_PRESS_SCALE = .97;
|
|
136
115
|
export const MOTION_SUBTLE_PRESS_SCALE = .98;
|
|
137
116
|
export const MOTION_TOGGLE_PRESS_SCALE = .92;
|
|
138
117
|
export const MOTION_HOVER_SCALE = 1.02;
|
|
139
118
|
export const MOTION_THUMB_SQUISH_SCALE = .9;
|
|
140
119
|
export const MOTION_ITEM_CHECK_SCALE = .75;
|
|
141
|
-
|
|
120
|
+
/** Arc's icon swap: the incoming icon grows from 0.6 on `SPRING_POP`. */
|
|
121
|
+
export const MOTION_ICON_SWAP_SCALE = .6;
|
|
142
122
|
export const MOTION_CLOSE_BUTTON_SCALE = .8;
|
|
143
123
|
export const MOTION_LIST_ITEM_DISTANCE = 6;
|
|
144
|
-
/** Scale a freshly inserted list item starts from, and a leaving one shrinks to. */
|
|
124
|
+
/** Scale a freshly inserted list item, option or inline message starts from, and a leaving one shrinks to. */
|
|
145
125
|
export const MOTION_ITEM_ENTER_SCALE = .98;
|
|
146
126
|
/** Loaded images settle from a slight zoom, so they develop in place instead of popping in. */
|
|
147
127
|
export const MOTION_REVEAL_SCALE = 1.06;
|
|
@@ -153,16 +133,32 @@ export const MOTION_SHIMMER_TRANSLATE = ["-100% 0", "100% 0"];
|
|
|
153
133
|
/** Hovered interactive cards gain a soft drop shadow; the rest value has the same shape, invisible. */
|
|
154
134
|
export const MOTION_CARD_SHADOW_LIFT = "0px 4px 16px 0px rgba(0, 0, 0, 0.08)";
|
|
155
135
|
export const MOTION_CARD_SHADOW_REST = "0px 0px 0px 0px rgba(0, 0, 0, 0)";
|
|
136
|
+
/** Arc's dialog panel scale on entrance; floating surfaces start from it too. */
|
|
156
137
|
export const MOTION_SURFACE_SCALE = .96;
|
|
138
|
+
/** Scale a dialog or tooltip shrinks to while it leaves (Arc). */
|
|
139
|
+
export const MOTION_EXIT_SCALE = .98;
|
|
157
140
|
/** Fraction of the surface kept hidden by the clip at the start of its reveal, in percent. */
|
|
158
141
|
export const MOTION_SURFACE_CLIP_PERCENT = 92;
|
|
159
142
|
/** Room left outside a revealing surface for its ring and drop shadow (`shadow-lg` spans ~22px). */
|
|
160
143
|
export const MOTION_SURFACE_CLIP_BLEED_PX = 24;
|
|
161
|
-
|
|
162
|
-
export const
|
|
163
|
-
/**
|
|
144
|
+
/** Arc's tooltip rise from its trigger, in pixels. */
|
|
145
|
+
export const MOTION_TOOLTIP_DISTANCE = 3;
|
|
146
|
+
/** Arc's tooltip scale on entrance. */
|
|
147
|
+
export const MOTION_TOOLTIP_SCALE = .97;
|
|
148
|
+
/** Arc's dialog rise on entrance, in pixels. */
|
|
149
|
+
export const MOTION_DIALOG_DISTANCE = 8;
|
|
150
|
+
/** Arc's dialog drop while it leaves, in pixels. */
|
|
151
|
+
export const MOTION_DIALOG_EXIT_DISTANCE = 4;
|
|
152
|
+
/**
|
|
153
|
+
* Inset kept on every side of a center-morph dialog while folded, in percent: a sliver at its center.
|
|
154
|
+
* @deprecated Dialogs no longer unfold from their center. Kept for consumers that animate their own surfaces with it.
|
|
155
|
+
*/
|
|
164
156
|
export const MOTION_CENTER_MORPH_FOLDED_PERCENT = 48;
|
|
165
157
|
export const MOTION_CONTENT_DISTANCE = 4;
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated Invalid fields no longer shake: the error is told by color and message. Kept for consumers that
|
|
160
|
+
* animate their own fields.
|
|
161
|
+
*/
|
|
166
162
|
export const MOTION_INVALID_SHAKE_PX = [
|
|
167
163
|
0,
|
|
168
164
|
-6,
|
package/dist/sonner.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Exposes the shared notification implementation and its public types. `Toaster` is beez-ui's own, which keeps
|
|
3
|
+
* Sonner's look and props but lets toasts work while a modal is open; this local export takes precedence over the
|
|
4
|
+
* one `export *` would bring from Sonner.
|
|
5
|
+
*/
|
|
2
6
|
export * from "sonner";
|
|
7
|
+
export { Toaster } from "./components/toaster.js";
|
package/dist/sonner.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Exposes the shared notification implementation and its public types. `Toaster` is beez-ui's own, which keeps
|
|
4
|
+
* Sonner's look and props but lets toasts work while a modal is open; this local export takes precedence over the
|
|
5
|
+
* one `export *` would bring from Sonner.
|
|
6
|
+
*/
|
|
3
7
|
export * from "sonner";
|
|
8
|
+
export { Toaster } from "./components/toaster.js";
|