beez-ui 2.6.2 → 2.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.
- package/CHANGELOG.md +29 -0
- package/README.md +47 -27
- 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/rich-link-editor.js +1 -1
- package/dist/components/sidebar.js +4 -9
- 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/styles.css +1 -1
- package/package.json +1 -1
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,
|