@orioncactuscorp/ui 1.2.0 → 1.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.
- package/README.md +55 -26
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.js +39 -38
- package/dist/components/Accordion/Accordion.module.scss.js +5 -5
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/ActionArea/ActionArea.js +101 -71
- package/dist/components/Alert/Alert.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/Badge.js +69 -25
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Button/Button.js +27 -27
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/Cell/Cell.js +98 -88
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/CheckMark/CheckMark.js +20 -18
- package/dist/components/CheckMark/CheckMark.module.scss.js +7 -3
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.js +10 -8
- package/dist/components/Field/Field.css +1 -1
- package/dist/components/Fieldset/Fieldset.css +1 -1
- package/dist/components/IconButton/IconButton.css +1 -1
- package/dist/components/Interaction/Interaction.css +1 -1
- package/dist/components/Loading/Loading.css +1 -1
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +377 -346
- package/dist/components/Modal/useModalDrag.js +654 -614
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/Radio/Radio.module.scss.js +9 -7
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/SectionHeader/SectionHeader.css +1 -1
- package/dist/components/Select/Select.css +1 -1
- package/dist/components/Select/Select.js +15 -15
- package/dist/components/Select/SelectContent.css +1 -1
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Switch/Switch.module.scss.js +6 -4
- package/dist/components/TextArea/TextArea.css +1 -1
- package/dist/components/TextArea/TextAreaContent.css +1 -1
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextInput/TextInput.css +1 -1
- package/dist/components/TextInput/TextInputContent.css +1 -1
- package/dist/components/Tooltip/Tooltip.css +1 -1
- package/dist/foundations/atomic.css +1 -1
- package/dist/foundations/motion.css +1 -1
- package/dist/foundations/typo.css +1 -1
- package/dist/foundations.css +3 -3
- package/dist/react/motion.js +109 -106
- package/dist/styles.css +31 -31
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts +1 -1
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/index.d.ts +1 -1
- package/dist/ui/src/components/ActionArea/index.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/types.d.ts +2 -2
- package/dist/ui/src/components/ActionArea/types.d.ts.map +1 -1
- package/dist/ui/src/components/Badge/Badge.d.ts +1 -1
- package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -1
- package/dist/ui/src/components/Badge/types.d.ts +19 -2
- package/dist/ui/src/components/Badge/types.d.ts.map +1 -1
- package/dist/ui/src/components/Button/Button.d.ts.map +1 -1
- package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/CheckMark.d.ts +1 -1
- package/dist/ui/src/components/CheckMark/CheckMark.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/index.d.ts +1 -1
- package/dist/ui/src/components/CheckMark/index.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/types.d.ts +2 -0
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/contexts.d.ts +1 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +5 -4
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +4 -4
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/react/motion/index.d.ts +9 -8
- package/dist/ui/src/react/motion/index.d.ts.map +1 -1
- package/dist/ui/src/utils/motion.d.ts +15 -14
- package/dist/ui/src/utils/motion.d.ts.map +1 -1
- package/dist/utils/motion.js +282 -183
- package/dist/vscode/oc-ui-vars.css +31 -16
- package/package.json +2 -2
- package/src/scss/foundations/atomic.scss +12 -10
- package/src/scss/foundations/atomic.test.ts +34 -0
- package/src/scss/foundations/motion.scss +30 -16
- package/src/scss/foundations/typo.scss +1 -1
- package/src/scss/index.scss +1 -0
- package/src/scss/mixins/_motion.scss +168 -77
- package/src/scss/mixins/_motion.test.ts +137 -54
- package/src/scss/mixins/_radius.scss +3 -0
- package/src/scss/mixins/_radius.test.ts +52 -0
- package/src/scss/mixins/_typo.scss +2 -2
package/dist/utils/motion.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import { ocSpring as
|
|
2
|
-
const
|
|
1
|
+
import { ocSpring as A } from "./spring.js";
|
|
2
|
+
const y = [
|
|
3
3
|
"feedback",
|
|
4
4
|
"reject",
|
|
5
|
-
"
|
|
5
|
+
"disclosure",
|
|
6
|
+
"surface",
|
|
7
|
+
"sheet",
|
|
8
|
+
"expand",
|
|
6
9
|
"move",
|
|
7
10
|
"gesture",
|
|
8
11
|
"ambient"
|
|
9
|
-
],
|
|
12
|
+
], w = [
|
|
10
13
|
"change",
|
|
11
14
|
"enter",
|
|
12
15
|
"exit",
|
|
13
|
-
"
|
|
16
|
+
"release",
|
|
14
17
|
"loop"
|
|
15
|
-
],
|
|
18
|
+
], R = ["quick", "normal", "slow"], S = [
|
|
16
19
|
"auto",
|
|
17
20
|
"preserve",
|
|
18
21
|
"fade",
|
|
19
22
|
"static",
|
|
20
23
|
"feedback"
|
|
21
24
|
], o = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
durationFactor: 1,
|
|
26
|
+
durationFactorReduced: 0.75,
|
|
27
|
+
durationFactorPreserve: 1,
|
|
28
|
+
paceFactor: {
|
|
26
29
|
quick: 0.75,
|
|
27
30
|
normal: 1,
|
|
28
31
|
slow: 1.35
|
|
@@ -30,43 +33,72 @@ const p = [
|
|
|
30
33
|
durationByIntent: {
|
|
31
34
|
feedback: 0.2,
|
|
32
35
|
reject: 0.32,
|
|
33
|
-
|
|
36
|
+
disclosure: 0.2,
|
|
37
|
+
surface: 0.26,
|
|
38
|
+
sheet: 0.26,
|
|
39
|
+
expand: 0.3,
|
|
34
40
|
move: 0.3,
|
|
35
41
|
gesture: 0.2,
|
|
36
42
|
ambient: 1.2
|
|
37
43
|
},
|
|
38
44
|
durationByPhase: {
|
|
39
|
-
|
|
40
|
-
exit: 0.
|
|
45
|
+
disclosure: {
|
|
46
|
+
exit: 0.14
|
|
47
|
+
},
|
|
48
|
+
surface: {
|
|
49
|
+
exit: 0.24
|
|
50
|
+
},
|
|
51
|
+
sheet: {
|
|
52
|
+
exit: 0.33,
|
|
53
|
+
release: 0.33
|
|
54
|
+
},
|
|
55
|
+
expand: {
|
|
56
|
+
exit: 0.24
|
|
41
57
|
},
|
|
42
58
|
gesture: {
|
|
43
|
-
|
|
59
|
+
release: 0.52
|
|
44
60
|
}
|
|
45
61
|
},
|
|
46
62
|
timingByIntent: {
|
|
47
63
|
feedback: "ease",
|
|
48
64
|
reject: "ease",
|
|
49
|
-
|
|
65
|
+
disclosure: "ease",
|
|
66
|
+
surface: "ease",
|
|
67
|
+
sheet: "ease",
|
|
68
|
+
expand: "ease",
|
|
50
69
|
move: "cubic-bezier(0.32, 0.72, 0, 1)",
|
|
51
70
|
gesture: "ease",
|
|
52
71
|
ambient: "linear"
|
|
53
72
|
},
|
|
54
73
|
timingByPhase: {
|
|
55
|
-
|
|
74
|
+
disclosure: {
|
|
75
|
+
exit: "cubic-bezier(0.8, 0, 1, 1)"
|
|
76
|
+
},
|
|
77
|
+
surface: {
|
|
78
|
+
exit: "ease-in"
|
|
79
|
+
},
|
|
80
|
+
sheet: {
|
|
81
|
+
exit: "ease-in",
|
|
82
|
+
release: "ease"
|
|
83
|
+
},
|
|
84
|
+
expand: {
|
|
56
85
|
exit: "ease-in"
|
|
57
86
|
},
|
|
58
87
|
gesture: {
|
|
59
|
-
|
|
88
|
+
release: "cubic-bezier(0.32, 0.72, 0, 1)"
|
|
60
89
|
}
|
|
61
90
|
}
|
|
62
|
-
},
|
|
91
|
+
}, C = o, L = {
|
|
63
92
|
feedback: "feedback",
|
|
64
93
|
reject: "feedback",
|
|
65
|
-
|
|
94
|
+
disclosure: "fade",
|
|
95
|
+
surface: "fade",
|
|
96
|
+
sheet: "static",
|
|
97
|
+
expand: "static",
|
|
66
98
|
move: "static",
|
|
67
99
|
gesture: "feedback",
|
|
68
100
|
ambient: "static"
|
|
69
|
-
},
|
|
101
|
+
}, V = /* @__PURE__ */ new Set([
|
|
70
102
|
"opacity",
|
|
71
103
|
"color",
|
|
72
104
|
"background-color",
|
|
@@ -75,74 +107,81 @@ const p = [
|
|
|
75
107
|
"outline-color",
|
|
76
108
|
"fill",
|
|
77
109
|
"stroke"
|
|
78
|
-
]),
|
|
79
|
-
|
|
110
|
+
]), Y = {
|
|
111
|
+
disclosure: { preset: "smooth" },
|
|
112
|
+
surface: { preset: "smooth" },
|
|
113
|
+
sheet: { preset: "smooth" },
|
|
114
|
+
expand: { preset: "smooth" },
|
|
80
115
|
move: { preset: "smooth" }
|
|
81
|
-
},
|
|
116
|
+
}, z = {
|
|
82
117
|
reject: {
|
|
83
118
|
change: { preset: "smooth" },
|
|
84
119
|
enter: { preset: "smooth" }
|
|
85
120
|
},
|
|
86
|
-
feedback: {
|
|
87
|
-
settle: { preset: "snappy" }
|
|
88
|
-
},
|
|
89
121
|
gesture: {
|
|
90
|
-
|
|
122
|
+
release: { preset: "snappy" }
|
|
91
123
|
},
|
|
92
|
-
|
|
124
|
+
disclosure: {
|
|
93
125
|
change: {
|
|
94
126
|
preset: "snappy",
|
|
95
127
|
propertyPreset: { opacity: "smooth", transform: "snappy" },
|
|
96
|
-
propertyExtraBounce: { transform: 0.
|
|
128
|
+
propertyExtraBounce: { transform: 0.04 }
|
|
97
129
|
},
|
|
98
130
|
enter: {
|
|
99
131
|
preset: "snappy",
|
|
100
132
|
propertyPreset: { opacity: "smooth", transform: "snappy" },
|
|
101
|
-
propertyExtraBounce: { transform: 0.
|
|
102
|
-
}
|
|
133
|
+
propertyExtraBounce: { transform: 0.04 }
|
|
134
|
+
},
|
|
135
|
+
exit: null
|
|
103
136
|
},
|
|
104
137
|
ambient: {
|
|
105
138
|
loop: { preset: "smooth" }
|
|
106
139
|
}
|
|
107
|
-
},
|
|
108
|
-
if (
|
|
140
|
+
}, U = z, $ = (t, e) => e.includes(t), l = (t, e, r) => {
|
|
141
|
+
if (!$(e, r))
|
|
109
142
|
throw new Error(`Unknown oc-motion ${t}: ${e}.`);
|
|
110
143
|
return e;
|
|
111
|
-
},
|
|
144
|
+
}, G = (t) => {
|
|
112
145
|
if (!Number.isFinite(t) || t < 0)
|
|
113
|
-
throw new Error("oc-motion
|
|
146
|
+
throw new Error("oc-motion durationFactor must be a non-negative number.");
|
|
114
147
|
return t;
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
}, H = (t) => {
|
|
149
|
+
if (t !== void 0) {
|
|
150
|
+
if (!Number.isFinite(t))
|
|
151
|
+
throw new Error("oc-motion extraBounce must be a finite number.");
|
|
152
|
+
return t;
|
|
153
|
+
}
|
|
154
|
+
}, d = (t, e) => {
|
|
155
|
+
const r = Number.parseFloat(t.trim());
|
|
156
|
+
return Number.isFinite(r) ? r : e;
|
|
157
|
+
}, i = (t, e) => {
|
|
158
|
+
const a = t.trim().match(/^(-?\d*\.?\d+)(ms|s)?$/);
|
|
159
|
+
if (!a) return e;
|
|
160
|
+
const s = Number.parseFloat(a[1]);
|
|
161
|
+
return !Number.isFinite(s) || s < 0 ? e : a[2] === "ms" ? s / 1e3 : s;
|
|
162
|
+
}, n = (t, e) => typeof t?.getPropertyValue == "function" ? t.getPropertyValue(e).trim() : "", E = (t, e) => {
|
|
163
|
+
const r = { ...t };
|
|
164
|
+
for (const a of y) {
|
|
165
|
+
const s = e?.[a];
|
|
166
|
+
s && (r[a] = {
|
|
167
|
+
...t[a],
|
|
168
|
+
...s
|
|
130
169
|
});
|
|
131
170
|
}
|
|
132
|
-
return
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
...o.
|
|
139
|
-
...t?.
|
|
171
|
+
return r;
|
|
172
|
+
}, K = (t) => ({
|
|
173
|
+
durationFactor: t?.durationFactor ?? o.durationFactor,
|
|
174
|
+
durationFactorReduced: t?.durationFactorReduced ?? o.durationFactorReduced,
|
|
175
|
+
durationFactorPreserve: t?.durationFactorPreserve ?? o.durationFactorPreserve,
|
|
176
|
+
paceFactor: {
|
|
177
|
+
...o.paceFactor,
|
|
178
|
+
...t?.paceFactor
|
|
140
179
|
},
|
|
141
180
|
durationByIntent: {
|
|
142
181
|
...o.durationByIntent,
|
|
143
182
|
...t?.durationByIntent
|
|
144
183
|
},
|
|
145
|
-
durationByPhase:
|
|
184
|
+
durationByPhase: E(
|
|
146
185
|
o.durationByPhase,
|
|
147
186
|
t?.durationByPhase
|
|
148
187
|
),
|
|
@@ -150,194 +189,254 @@ const p = [
|
|
|
150
189
|
...o.timingByIntent,
|
|
151
190
|
...t?.timingByIntent
|
|
152
191
|
},
|
|
153
|
-
timingByPhase:
|
|
192
|
+
timingByPhase: E(
|
|
154
193
|
o.timingByPhase,
|
|
155
194
|
t?.timingByPhase
|
|
156
195
|
)
|
|
157
196
|
});
|
|
158
|
-
function
|
|
197
|
+
function N(t) {
|
|
159
198
|
const e = t && typeof getComputedStyle == "function" ? getComputedStyle(t) : null;
|
|
160
199
|
return {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
o.
|
|
200
|
+
durationFactor: d(
|
|
201
|
+
n(e, "--oc-motion-duration-factor"),
|
|
202
|
+
o.durationFactor
|
|
164
203
|
),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
o.
|
|
204
|
+
durationFactorReduced: d(
|
|
205
|
+
n(e, "--oc-motion-duration-factor-reduced"),
|
|
206
|
+
o.durationFactorReduced
|
|
168
207
|
),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
o.
|
|
208
|
+
durationFactorPreserve: d(
|
|
209
|
+
n(e, "--oc-motion-duration-factor-preserve"),
|
|
210
|
+
o.durationFactorPreserve
|
|
172
211
|
),
|
|
173
|
-
|
|
174
|
-
quick:
|
|
175
|
-
|
|
176
|
-
o.
|
|
212
|
+
paceFactor: {
|
|
213
|
+
quick: d(
|
|
214
|
+
n(e, "--oc-motion-pace-quick"),
|
|
215
|
+
o.paceFactor.quick
|
|
177
216
|
),
|
|
178
|
-
normal:
|
|
179
|
-
|
|
180
|
-
o.
|
|
217
|
+
normal: d(
|
|
218
|
+
n(e, "--oc-motion-pace-normal"),
|
|
219
|
+
o.paceFactor.normal
|
|
181
220
|
),
|
|
182
|
-
slow:
|
|
183
|
-
|
|
184
|
-
o.
|
|
221
|
+
slow: d(
|
|
222
|
+
n(e, "--oc-motion-pace-slow"),
|
|
223
|
+
o.paceFactor.slow
|
|
185
224
|
)
|
|
186
225
|
},
|
|
187
226
|
durationByIntent: {
|
|
188
|
-
feedback:
|
|
189
|
-
|
|
227
|
+
feedback: i(
|
|
228
|
+
n(e, "--oc-motion-duration-feedback"),
|
|
190
229
|
o.durationByIntent.feedback
|
|
191
230
|
),
|
|
192
|
-
reject:
|
|
193
|
-
|
|
231
|
+
reject: i(
|
|
232
|
+
n(e, "--oc-motion-duration-reject"),
|
|
194
233
|
o.durationByIntent.reject
|
|
195
234
|
),
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
o.durationByIntent.
|
|
235
|
+
disclosure: i(
|
|
236
|
+
n(e, "--oc-motion-duration-disclosure"),
|
|
237
|
+
o.durationByIntent.disclosure
|
|
238
|
+
),
|
|
239
|
+
surface: i(
|
|
240
|
+
n(e, "--oc-motion-duration-surface"),
|
|
241
|
+
o.durationByIntent.surface
|
|
242
|
+
),
|
|
243
|
+
sheet: i(
|
|
244
|
+
n(e, "--oc-motion-duration-sheet"),
|
|
245
|
+
o.durationByIntent.sheet
|
|
199
246
|
),
|
|
200
|
-
|
|
201
|
-
|
|
247
|
+
expand: i(
|
|
248
|
+
n(e, "--oc-motion-duration-expand"),
|
|
249
|
+
o.durationByIntent.expand
|
|
250
|
+
),
|
|
251
|
+
move: i(
|
|
252
|
+
n(e, "--oc-motion-duration-move"),
|
|
202
253
|
o.durationByIntent.move
|
|
203
254
|
),
|
|
204
|
-
gesture:
|
|
205
|
-
|
|
255
|
+
gesture: i(
|
|
256
|
+
n(e, "--oc-motion-duration-gesture"),
|
|
206
257
|
o.durationByIntent.gesture
|
|
207
258
|
),
|
|
208
|
-
ambient:
|
|
209
|
-
|
|
259
|
+
ambient: i(
|
|
260
|
+
n(e, "--oc-motion-duration-ambient"),
|
|
210
261
|
o.durationByIntent.ambient
|
|
211
262
|
)
|
|
212
263
|
},
|
|
213
264
|
durationByPhase: {
|
|
214
|
-
|
|
215
|
-
exit:
|
|
216
|
-
|
|
217
|
-
o.durationByPhase.
|
|
265
|
+
disclosure: {
|
|
266
|
+
exit: i(
|
|
267
|
+
n(e, "--oc-motion-duration-disclosure-exit"),
|
|
268
|
+
o.durationByPhase.disclosure?.exit ?? o.durationByIntent.disclosure
|
|
269
|
+
)
|
|
270
|
+
},
|
|
271
|
+
surface: {
|
|
272
|
+
exit: i(
|
|
273
|
+
n(e, "--oc-motion-duration-surface-exit"),
|
|
274
|
+
o.durationByPhase.surface?.exit ?? o.durationByIntent.surface
|
|
275
|
+
)
|
|
276
|
+
},
|
|
277
|
+
sheet: {
|
|
278
|
+
exit: i(
|
|
279
|
+
n(e, "--oc-motion-duration-sheet-exit"),
|
|
280
|
+
o.durationByPhase.sheet?.exit ?? o.durationByIntent.sheet
|
|
281
|
+
),
|
|
282
|
+
release: i(
|
|
283
|
+
n(e, "--oc-motion-duration-sheet-release"),
|
|
284
|
+
o.durationByPhase.sheet?.release ?? o.durationByIntent.sheet
|
|
285
|
+
)
|
|
286
|
+
},
|
|
287
|
+
expand: {
|
|
288
|
+
exit: i(
|
|
289
|
+
n(e, "--oc-motion-duration-expand-exit"),
|
|
290
|
+
o.durationByPhase.expand?.exit ?? o.durationByIntent.expand
|
|
218
291
|
)
|
|
219
292
|
},
|
|
220
293
|
gesture: {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
o.durationByPhase.gesture?.
|
|
294
|
+
release: i(
|
|
295
|
+
n(e, "--oc-motion-duration-gesture-release"),
|
|
296
|
+
o.durationByPhase.gesture?.release ?? o.durationByIntent.gesture
|
|
224
297
|
)
|
|
225
298
|
}
|
|
226
299
|
},
|
|
227
300
|
timingByIntent: {
|
|
228
|
-
feedback:
|
|
229
|
-
reject:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
301
|
+
feedback: n(e, "--oc-motion-timing-feedback") || o.timingByIntent.feedback,
|
|
302
|
+
reject: n(e, "--oc-motion-timing-reject") || o.timingByIntent.reject,
|
|
303
|
+
disclosure: n(e, "--oc-motion-timing-disclosure") || o.timingByIntent.disclosure,
|
|
304
|
+
surface: n(e, "--oc-motion-timing-surface") || o.timingByIntent.surface,
|
|
305
|
+
sheet: n(e, "--oc-motion-timing-sheet") || o.timingByIntent.sheet,
|
|
306
|
+
expand: n(e, "--oc-motion-timing-expand") || o.timingByIntent.expand,
|
|
307
|
+
move: n(e, "--oc-motion-timing-move") || o.timingByIntent.move,
|
|
308
|
+
gesture: n(e, "--oc-motion-timing-gesture") || o.timingByIntent.gesture,
|
|
309
|
+
ambient: n(e, "--oc-motion-timing-ambient") || o.timingByIntent.ambient
|
|
234
310
|
},
|
|
235
311
|
timingByPhase: {
|
|
236
|
-
|
|
237
|
-
exit:
|
|
312
|
+
disclosure: {
|
|
313
|
+
exit: n(e, "--oc-motion-timing-disclosure-exit") || o.timingByPhase.disclosure?.exit
|
|
314
|
+
},
|
|
315
|
+
surface: {
|
|
316
|
+
exit: n(e, "--oc-motion-timing-surface-exit") || o.timingByPhase.surface?.exit
|
|
317
|
+
},
|
|
318
|
+
sheet: {
|
|
319
|
+
exit: n(e, "--oc-motion-timing-sheet-exit") || o.timingByPhase.sheet?.exit,
|
|
320
|
+
release: n(e, "--oc-motion-timing-sheet-release") || o.timingByPhase.sheet?.release
|
|
321
|
+
},
|
|
322
|
+
expand: {
|
|
323
|
+
exit: n(e, "--oc-motion-timing-expand-exit") || o.timingByPhase.expand?.exit
|
|
238
324
|
},
|
|
239
325
|
gesture: {
|
|
240
|
-
|
|
326
|
+
release: n(e, "--oc-motion-timing-gesture-release") || o.timingByPhase.gesture?.release
|
|
241
327
|
}
|
|
242
328
|
}
|
|
243
329
|
};
|
|
244
330
|
}
|
|
245
|
-
function
|
|
246
|
-
return
|
|
331
|
+
function T(t, e = "auto") {
|
|
332
|
+
return l("intent", t, y), l("reduced policy", e, S), e === "auto" ? L[t] : e;
|
|
247
333
|
}
|
|
248
|
-
function
|
|
249
|
-
return
|
|
334
|
+
function _(t) {
|
|
335
|
+
return V.has(t);
|
|
250
336
|
}
|
|
251
|
-
function
|
|
337
|
+
function j({
|
|
252
338
|
property: t,
|
|
253
339
|
reducedMotion: e,
|
|
254
|
-
reducedPolicy:
|
|
340
|
+
reducedPolicy: r
|
|
255
341
|
}) {
|
|
256
|
-
return !e ||
|
|
342
|
+
return !e || r === "preserve" ? !0 : r === "static" || t === void 0 ? !1 : _(t);
|
|
257
343
|
}
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
344
|
+
const O = (t, e, r, a) => t[e]?.[r] ?? a, J = (t, e, r, a) => {
|
|
345
|
+
const s = U[t], m = s !== void 0 && Object.prototype.hasOwnProperty.call(s, e) ? s[e] : void 0;
|
|
346
|
+
if (m === null) return null;
|
|
347
|
+
const c = m ?? Y[t];
|
|
348
|
+
if (c === void 0) return null;
|
|
349
|
+
const p = r === void 0 ? void 0 : c.propertyExtraBounce?.[r];
|
|
262
350
|
return {
|
|
263
|
-
preset: (
|
|
264
|
-
extraBounce:
|
|
351
|
+
preset: (r === void 0 ? void 0 : c.propertyPreset?.[r]) ?? c.preset,
|
|
352
|
+
extraBounce: a ?? p ?? c.extraBounce
|
|
265
353
|
};
|
|
266
354
|
};
|
|
267
|
-
function
|
|
355
|
+
function Q({
|
|
268
356
|
intent: t,
|
|
269
357
|
phase: e = "change",
|
|
270
|
-
pace:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
358
|
+
pace: r = "normal",
|
|
359
|
+
durationFactor: a = 1,
|
|
360
|
+
extraBounce: s,
|
|
361
|
+
reduced: m = "auto",
|
|
362
|
+
reducedMotion: c = !1,
|
|
363
|
+
property: p,
|
|
364
|
+
element: B,
|
|
365
|
+
tokens: D
|
|
277
366
|
}) {
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
),
|
|
282
|
-
property:
|
|
283
|
-
reducedMotion:
|
|
284
|
-
reducedPolicy:
|
|
285
|
-
}),
|
|
286
|
-
|
|
367
|
+
l("intent", t, y), l("phase", e, w), l("pace", r, R);
|
|
368
|
+
const x = G(a), P = H(s), u = K(
|
|
369
|
+
D ?? N(B)
|
|
370
|
+
), f = T(t, m), b = j({
|
|
371
|
+
property: p,
|
|
372
|
+
reducedMotion: c,
|
|
373
|
+
reducedPolicy: f
|
|
374
|
+
}), F = c && f === "preserve" ? u.durationFactorPreserve : c ? u.durationFactorReduced : u.durationFactor, I = O(
|
|
375
|
+
u.durationByPhase,
|
|
376
|
+
t,
|
|
377
|
+
e,
|
|
378
|
+
u.durationByIntent[t]
|
|
379
|
+
), v = u.paceFactor[r], g = b ? I * F * v * x : 0, M = O(
|
|
380
|
+
u.timingByPhase,
|
|
287
381
|
t,
|
|
288
382
|
e,
|
|
289
|
-
|
|
290
|
-
),
|
|
291
|
-
s.timingByPhase,
|
|
383
|
+
u.timingByIntent[t]
|
|
384
|
+
), h = J(
|
|
292
385
|
t,
|
|
293
386
|
e,
|
|
294
|
-
|
|
295
|
-
|
|
387
|
+
p,
|
|
388
|
+
P
|
|
389
|
+
), k = h !== null;
|
|
390
|
+
if (!k && P !== void 0)
|
|
391
|
+
throw new Error(
|
|
392
|
+
"oc-motion extraBounce is only supported for spring-backed motion."
|
|
393
|
+
);
|
|
394
|
+
const q = g > 0 ? g : I;
|
|
296
395
|
return {
|
|
297
396
|
intent: t,
|
|
298
397
|
phase: e,
|
|
299
|
-
pace:
|
|
300
|
-
reduced:
|
|
301
|
-
reducedPolicy:
|
|
302
|
-
reducedMotion:
|
|
303
|
-
property:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
durationSeconds:
|
|
308
|
-
timingFunction:
|
|
309
|
-
animate:
|
|
310
|
-
springBacked:
|
|
311
|
-
spring:
|
|
312
|
-
duration:
|
|
313
|
-
extraBounce:
|
|
398
|
+
pace: r,
|
|
399
|
+
reduced: m,
|
|
400
|
+
reducedPolicy: f,
|
|
401
|
+
reducedMotion: c,
|
|
402
|
+
property: p,
|
|
403
|
+
durationFactor: x,
|
|
404
|
+
durationFactorToken: F,
|
|
405
|
+
paceFactor: v,
|
|
406
|
+
durationSeconds: g,
|
|
407
|
+
timingFunction: M,
|
|
408
|
+
animate: b,
|
|
409
|
+
springBacked: k,
|
|
410
|
+
spring: A[h?.preset ?? "smooth"]({
|
|
411
|
+
duration: q,
|
|
412
|
+
extraBounce: h?.extraBounce
|
|
314
413
|
})
|
|
315
414
|
};
|
|
316
415
|
}
|
|
317
|
-
const
|
|
318
|
-
intents:
|
|
319
|
-
phases:
|
|
320
|
-
paces:
|
|
321
|
-
reducedPolicies:
|
|
322
|
-
defaultTokens:
|
|
323
|
-
parseDuration:
|
|
324
|
-
readTokens:
|
|
325
|
-
resolve:
|
|
326
|
-
resolveReducedPolicy:
|
|
327
|
-
isFeedbackSafeProperty:
|
|
328
|
-
shouldAnimateProperty:
|
|
416
|
+
const X = {
|
|
417
|
+
intents: y,
|
|
418
|
+
phases: w,
|
|
419
|
+
paces: R,
|
|
420
|
+
reducedPolicies: S,
|
|
421
|
+
defaultTokens: C,
|
|
422
|
+
parseDuration: i,
|
|
423
|
+
readTokens: N,
|
|
424
|
+
resolve: Q,
|
|
425
|
+
resolveReducedPolicy: T,
|
|
426
|
+
isFeedbackSafeProperty: _,
|
|
427
|
+
shouldAnimateProperty: j
|
|
329
428
|
};
|
|
330
429
|
export {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
430
|
+
_ as isOcMotionFeedbackSafeProperty,
|
|
431
|
+
X as ocMotion,
|
|
432
|
+
C as ocMotionDefaultTokens,
|
|
433
|
+
y as ocMotionIntents,
|
|
434
|
+
R as ocMotionPaces,
|
|
435
|
+
w as ocMotionPhases,
|
|
436
|
+
S as ocMotionReducedPolicies,
|
|
437
|
+
i as parseOcMotionDuration,
|
|
438
|
+
N as readOcMotionTokens,
|
|
439
|
+
Q as resolveOcMotion,
|
|
440
|
+
T as resolveOcMotionReducedPolicy,
|
|
441
|
+
j as shouldAnimateOcMotionProperty
|
|
343
442
|
};
|