@orioncactuscorp/ui 1.2.0 → 1.4.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.
Files changed (120) hide show
  1. package/README.md +56 -27
  2. package/dist/components/Accordion/Accordion.css +1 -1
  3. package/dist/components/Accordion/Accordion.js +39 -38
  4. package/dist/components/Accordion/Accordion.module.scss.js +5 -5
  5. package/dist/components/ActionArea/ActionArea.css +1 -1
  6. package/dist/components/ActionArea/ActionArea.js +101 -71
  7. package/dist/components/ActionArea/ActionAreaLayout.css +1 -0
  8. package/dist/components/ActionArea/ActionAreaLayout.js +145 -0
  9. package/dist/components/ActionArea/ActionAreaLayout.module.scss.js +11 -0
  10. package/dist/components/ActionArea.js +10 -4
  11. package/dist/components/Alert/Alert.css +1 -1
  12. package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
  13. package/dist/components/BackgroundIconButton/BackgroundIconButton.js +72 -52
  14. package/dist/components/Badge/Badge.css +1 -1
  15. package/dist/components/Badge/Badge.js +69 -25
  16. package/dist/components/Button/Button.css +1 -1
  17. package/dist/components/Button/Button.js +79 -139
  18. package/dist/components/Cell/Cell.css +1 -1
  19. package/dist/components/Cell/Cell.js +98 -88
  20. package/dist/components/CheckMark/CheckMark.css +1 -1
  21. package/dist/components/CheckMark/CheckMark.js +20 -18
  22. package/dist/components/CheckMark/CheckMark.module.scss.js +7 -3
  23. package/dist/components/Checkbox/Checkbox.css +1 -1
  24. package/dist/components/Checkbox/Checkbox.module.scss.js +10 -8
  25. package/dist/components/Field/Field.css +1 -1
  26. package/dist/components/Fieldset/Fieldset.css +1 -1
  27. package/dist/components/IconButton/IconButton.css +1 -1
  28. package/dist/components/IconButton/IconButton.js +48 -29
  29. package/dist/components/Interaction/Interaction.css +1 -1
  30. package/dist/components/Loading/Loading.css +1 -1
  31. package/dist/components/Loading/Loading.js +10 -10
  32. package/dist/components/Menu/Menu.css +1 -1
  33. package/dist/components/Modal/Modal.css +1 -1
  34. package/dist/components/Modal/Modal.js +377 -346
  35. package/dist/components/Modal/useModalDrag.js +654 -614
  36. package/dist/components/Radio/Radio.css +1 -1
  37. package/dist/components/Radio/Radio.module.scss.js +9 -7
  38. package/dist/components/ScrollArea/ScrollArea.css +1 -1
  39. package/dist/components/SectionHeader/SectionHeader.css +1 -1
  40. package/dist/components/Select/Select.css +1 -1
  41. package/dist/components/Select/Select.js +15 -15
  42. package/dist/components/Select/SelectContent.css +1 -1
  43. package/dist/components/Switch/Switch.css +1 -1
  44. package/dist/components/Switch/Switch.module.scss.js +6 -4
  45. package/dist/components/TextArea/TextArea.css +1 -1
  46. package/dist/components/TextArea/TextAreaContent.css +1 -1
  47. package/dist/components/TextButton/TextButton.css +1 -1
  48. package/dist/components/TextInput/TextInput.css +1 -1
  49. package/dist/components/TextInput/TextInputContent.css +1 -1
  50. package/dist/components/Tooltip/Tooltip.css +1 -1
  51. package/dist/components/internal/Pressable.js +90 -0
  52. package/dist/foundations/atomic.css +1 -1
  53. package/dist/foundations/motion.css +1 -1
  54. package/dist/foundations/typo.css +1 -1
  55. package/dist/foundations.css +3 -3
  56. package/dist/index.js +102 -96
  57. package/dist/react/motion.js +109 -106
  58. package/dist/styles.css +32 -31
  59. package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
  60. package/dist/ui/src/components/ActionArea/ActionArea.d.ts +1 -1
  61. package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -1
  62. package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts +12 -0
  63. package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts.map +1 -0
  64. package/dist/ui/src/components/ActionArea/index.d.ts +2 -1
  65. package/dist/ui/src/components/ActionArea/index.d.ts.map +1 -1
  66. package/dist/ui/src/components/ActionArea/types.d.ts +13 -2
  67. package/dist/ui/src/components/ActionArea/types.d.ts.map +1 -1
  68. package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts +1 -1
  69. package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts.map +1 -1
  70. package/dist/ui/src/components/BackgroundIconButton/index.d.ts +1 -1
  71. package/dist/ui/src/components/BackgroundIconButton/index.d.ts.map +1 -1
  72. package/dist/ui/src/components/BackgroundIconButton/types.d.ts +6 -5
  73. package/dist/ui/src/components/BackgroundIconButton/types.d.ts.map +1 -1
  74. package/dist/ui/src/components/Badge/Badge.d.ts +1 -1
  75. package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -1
  76. package/dist/ui/src/components/Badge/types.d.ts +19 -2
  77. package/dist/ui/src/components/Badge/types.d.ts.map +1 -1
  78. package/dist/ui/src/components/Button/Button.d.ts.map +1 -1
  79. package/dist/ui/src/components/Button/types.d.ts +3 -7
  80. package/dist/ui/src/components/Button/types.d.ts.map +1 -1
  81. package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -1
  82. package/dist/ui/src/components/CheckMark/CheckMark.d.ts +1 -1
  83. package/dist/ui/src/components/CheckMark/CheckMark.d.ts.map +1 -1
  84. package/dist/ui/src/components/CheckMark/index.d.ts +1 -1
  85. package/dist/ui/src/components/CheckMark/index.d.ts.map +1 -1
  86. package/dist/ui/src/components/CheckMark/types.d.ts +2 -0
  87. package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
  88. package/dist/ui/src/components/IconButton/IconButton.d.ts +1 -1
  89. package/dist/ui/src/components/IconButton/IconButton.d.ts.map +1 -1
  90. package/dist/ui/src/components/IconButton/index.d.ts +1 -1
  91. package/dist/ui/src/components/IconButton/index.d.ts.map +1 -1
  92. package/dist/ui/src/components/IconButton/types.d.ts +6 -5
  93. package/dist/ui/src/components/IconButton/types.d.ts.map +1 -1
  94. package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
  95. package/dist/ui/src/components/Modal/contexts.d.ts +1 -0
  96. package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
  97. package/dist/ui/src/components/Modal/types.d.ts +7 -6
  98. package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
  99. package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
  100. package/dist/ui/src/components/internal/Pressable.d.ts +19 -0
  101. package/dist/ui/src/components/internal/Pressable.d.ts.map +1 -0
  102. package/dist/ui/src/index.d.ts +5 -5
  103. package/dist/ui/src/index.d.ts.map +1 -1
  104. package/dist/ui/src/react/motion/index.d.ts +9 -8
  105. package/dist/ui/src/react/motion/index.d.ts.map +1 -1
  106. package/dist/ui/src/utils/motion.d.ts +15 -14
  107. package/dist/ui/src/utils/motion.d.ts.map +1 -1
  108. package/dist/utils/motion.js +282 -183
  109. package/dist/vscode/oc-ui-vars.css +31 -16
  110. package/package.json +2 -2
  111. package/src/scss/foundations/atomic.scss +12 -10
  112. package/src/scss/foundations/atomic.test.ts +34 -0
  113. package/src/scss/foundations/motion.scss +30 -16
  114. package/src/scss/foundations/typo.scss +1 -1
  115. package/src/scss/index.scss +1 -0
  116. package/src/scss/mixins/_motion.scss +168 -77
  117. package/src/scss/mixins/_motion.test.ts +137 -54
  118. package/src/scss/mixins/_radius.scss +3 -0
  119. package/src/scss/mixins/_radius.test.ts +52 -0
  120. package/src/scss/mixins/_typo.scss +2 -2
@@ -1,28 +1,31 @@
1
- import { ocSpring as M } from "./spring.js";
2
- const p = [
1
+ import { ocSpring as A } from "./spring.js";
2
+ const y = [
3
3
  "feedback",
4
4
  "reject",
5
- "reveal",
5
+ "disclosure",
6
+ "surface",
7
+ "sheet",
8
+ "expand",
6
9
  "move",
7
10
  "gesture",
8
11
  "ambient"
9
- ], k = [
12
+ ], w = [
10
13
  "change",
11
14
  "enter",
12
15
  "exit",
13
- "settle",
16
+ "release",
14
17
  "loop"
15
- ], E = ["quick", "normal", "slow"], x = [
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
- durationScale: 1,
23
- durationScaleReduced: 0.75,
24
- durationScalePreserve: 1,
25
- paceScale: {
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
- reveal: 0.3,
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
- reveal: {
40
- exit: 0.125
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
- settle: 0.52
59
+ release: 0.52
44
60
  }
45
61
  },
46
62
  timingByIntent: {
47
63
  feedback: "ease",
48
64
  reject: "ease",
49
- reveal: "ease",
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
- reveal: {
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
- settle: "cubic-bezier(0.32, 0.72, 0, 1)"
88
+ release: "cubic-bezier(0.32, 0.72, 0, 1)"
60
89
  }
61
90
  }
62
- }, q = o, A = {
91
+ }, C = o, L = {
63
92
  feedback: "feedback",
64
93
  reject: "feedback",
65
- reveal: "fade",
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
- }, C = /* @__PURE__ */ new Set([
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
- ]), L = {
79
- reveal: { preset: "smooth" },
110
+ ]), Y = {
111
+ disclosure: { preset: "smooth" },
112
+ surface: { preset: "smooth" },
113
+ sheet: { preset: "smooth" },
114
+ expand: { preset: "smooth" },
80
115
  move: { preset: "smooth" }
81
- }, V = {
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
- settle: { preset: "snappy" }
122
+ release: { preset: "snappy" }
91
123
  },
92
- reveal: {
124
+ disclosure: {
93
125
  change: {
94
126
  preset: "snappy",
95
127
  propertyPreset: { opacity: "smooth", transform: "snappy" },
96
- propertyExtraBounce: { transform: 0.1 }
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.1 }
102
- }
133
+ propertyExtraBounce: { transform: 0.04 }
134
+ },
135
+ exit: null
103
136
  },
104
137
  ambient: {
105
138
  loop: { preset: "smooth" }
106
139
  }
107
- }, Y = V, U = (t, e) => e.includes(t), m = (t, e, n) => {
108
- if (!U(e, n))
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
- }, $ = (t) => {
144
+ }, G = (t) => {
112
145
  if (!Number.isFinite(t) || t < 0)
113
- throw new Error("oc-motion durationScale must be a non-negative number.");
146
+ throw new Error("oc-motion durationFactor must be a non-negative number.");
114
147
  return t;
115
- }, l = (t, e) => {
116
- const n = Number.parseFloat(t.trim());
117
- return Number.isFinite(n) ? n : e;
118
- }, c = (t, e) => {
119
- const i = t.trim().match(/^(-?\d*\.?\d+)(ms|s)?$/);
120
- if (!i) return e;
121
- const a = Number.parseFloat(i[1]);
122
- return !Number.isFinite(a) || a < 0 ? e : i[2] === "ms" ? a / 1e3 : a;
123
- }, r = (t, e) => typeof t?.getPropertyValue == "function" ? t.getPropertyValue(e).trim() : "", h = (t, e) => {
124
- const n = { ...t };
125
- for (const i of p) {
126
- const a = e?.[i];
127
- a && (n[i] = {
128
- ...t[i],
129
- ...a
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 n;
133
- }, z = (t) => ({
134
- durationScale: t?.durationScale ?? o.durationScale,
135
- durationScaleReduced: t?.durationScaleReduced ?? o.durationScaleReduced,
136
- durationScalePreserve: t?.durationScalePreserve ?? o.durationScalePreserve,
137
- paceScale: {
138
- ...o.paceScale,
139
- ...t?.paceScale
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: h(
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: h(
192
+ timingByPhase: E(
154
193
  o.timingByPhase,
155
194
  t?.timingByPhase
156
195
  )
157
196
  });
158
- function O(t) {
197
+ function N(t) {
159
198
  const e = t && typeof getComputedStyle == "function" ? getComputedStyle(t) : null;
160
199
  return {
161
- durationScale: l(
162
- r(e, "--oc-motion-duration-scale"),
163
- o.durationScale
200
+ durationFactor: d(
201
+ n(e, "--oc-motion-duration-factor"),
202
+ o.durationFactor
164
203
  ),
165
- durationScaleReduced: l(
166
- r(e, "--oc-motion-duration-scale-reduced"),
167
- o.durationScaleReduced
204
+ durationFactorReduced: d(
205
+ n(e, "--oc-motion-duration-factor-reduced"),
206
+ o.durationFactorReduced
168
207
  ),
169
- durationScalePreserve: l(
170
- r(e, "--oc-motion-duration-scale-preserve"),
171
- o.durationScalePreserve
208
+ durationFactorPreserve: d(
209
+ n(e, "--oc-motion-duration-factor-preserve"),
210
+ o.durationFactorPreserve
172
211
  ),
173
- paceScale: {
174
- quick: l(
175
- r(e, "--oc-motion-pace-quick"),
176
- o.paceScale.quick
212
+ paceFactor: {
213
+ quick: d(
214
+ n(e, "--oc-motion-pace-quick"),
215
+ o.paceFactor.quick
177
216
  ),
178
- normal: l(
179
- r(e, "--oc-motion-pace-normal"),
180
- o.paceScale.normal
217
+ normal: d(
218
+ n(e, "--oc-motion-pace-normal"),
219
+ o.paceFactor.normal
181
220
  ),
182
- slow: l(
183
- r(e, "--oc-motion-pace-slow"),
184
- o.paceScale.slow
221
+ slow: d(
222
+ n(e, "--oc-motion-pace-slow"),
223
+ o.paceFactor.slow
185
224
  )
186
225
  },
187
226
  durationByIntent: {
188
- feedback: c(
189
- r(e, "--oc-motion-duration-feedback"),
227
+ feedback: i(
228
+ n(e, "--oc-motion-duration-feedback"),
190
229
  o.durationByIntent.feedback
191
230
  ),
192
- reject: c(
193
- r(e, "--oc-motion-duration-reject"),
231
+ reject: i(
232
+ n(e, "--oc-motion-duration-reject"),
194
233
  o.durationByIntent.reject
195
234
  ),
196
- reveal: c(
197
- r(e, "--oc-motion-duration-reveal"),
198
- o.durationByIntent.reveal
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
- move: c(
201
- r(e, "--oc-motion-duration-move"),
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: c(
205
- r(e, "--oc-motion-duration-gesture"),
255
+ gesture: i(
256
+ n(e, "--oc-motion-duration-gesture"),
206
257
  o.durationByIntent.gesture
207
258
  ),
208
- ambient: c(
209
- r(e, "--oc-motion-duration-ambient"),
259
+ ambient: i(
260
+ n(e, "--oc-motion-duration-ambient"),
210
261
  o.durationByIntent.ambient
211
262
  )
212
263
  },
213
264
  durationByPhase: {
214
- reveal: {
215
- exit: c(
216
- r(e, "--oc-motion-duration-reveal-exit"),
217
- o.durationByPhase.reveal?.exit ?? o.durationByIntent.reveal
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
- settle: c(
222
- r(e, "--oc-motion-duration-gesture-settle"),
223
- o.durationByPhase.gesture?.settle ?? o.durationByIntent.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: r(e, "--oc-motion-timing-feedback") || o.timingByIntent.feedback,
229
- reject: r(e, "--oc-motion-timing-reject") || o.timingByIntent.reject,
230
- reveal: r(e, "--oc-motion-timing-reveal") || o.timingByIntent.reveal,
231
- move: r(e, "--oc-motion-timing-move") || o.timingByIntent.move,
232
- gesture: r(e, "--oc-motion-timing-gesture") || o.timingByIntent.gesture,
233
- ambient: r(e, "--oc-motion-timing-ambient") || o.timingByIntent.ambient
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
- reveal: {
237
- exit: r(e, "--oc-motion-timing-reveal-exit") || o.timingByPhase.reveal?.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
- settle: r(e, "--oc-motion-timing-gesture-settle") || o.timingByPhase.gesture?.settle
326
+ release: n(e, "--oc-motion-timing-gesture-release") || o.timingByPhase.gesture?.release
241
327
  }
242
328
  }
243
329
  };
244
330
  }
245
- function R(t, e = "auto") {
246
- return m("intent", t, p), m("reduced policy", e, x), e === "auto" ? A[t] : e;
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 T(t) {
249
- return C.has(t);
334
+ function _(t) {
335
+ return V.has(t);
250
336
  }
251
- function N({
337
+ function j({
252
338
  property: t,
253
339
  reducedMotion: e,
254
- reducedPolicy: n
340
+ reducedPolicy: r
255
341
  }) {
256
- return !e || n === "preserve" ? !0 : n === "static" || t === void 0 ? !1 : T(t);
342
+ return !e || r === "preserve" ? !0 : r === "static" || t === void 0 ? !1 : _(t);
257
343
  }
258
- const I = (t, e, n, i) => t[e]?.[n] ?? i, G = (t, e, n) => {
259
- const a = Y[t]?.[e] ?? L[t];
260
- if (a === void 0) return null;
261
- const u = n === void 0 ? void 0 : a.propertyExtraBounce?.[n];
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: (n === void 0 ? void 0 : a.propertyPreset?.[n]) ?? a.preset,
264
- extraBounce: u ?? a.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 H({
355
+ function Q({
268
356
  intent: t,
269
357
  phase: e = "change",
270
- pace: n = "normal",
271
- durationScale: i = 1,
272
- reduced: a = "auto",
273
- reducedMotion: u = !1,
274
- property: d,
275
- element: F,
276
- tokens: _
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
- m("intent", t, p), m("phase", e, k), m("pace", n, E);
279
- const v = $(i), s = z(
280
- _ ?? O(F)
281
- ), g = R(t, a), P = N({
282
- property: d,
283
- reducedMotion: u,
284
- reducedPolicy: g
285
- }), B = u && g === "preserve" ? s.durationScalePreserve : u ? s.durationScaleReduced : s.durationScale, S = I(
286
- s.durationByPhase,
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
- s.durationByIntent[t]
290
- ), b = s.paceScale[n], y = P ? S * B * b * v : 0, w = I(
291
- s.timingByPhase,
383
+ u.timingByIntent[t]
384
+ ), h = J(
292
385
  t,
293
386
  e,
294
- s.timingByIntent[t]
295
- ), f = G(t, e, d), j = f !== null, D = y > 0 ? y : S;
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: n,
300
- reduced: a,
301
- reducedPolicy: g,
302
- reducedMotion: u,
303
- property: d,
304
- durationScale: v,
305
- durationScaleToken: B,
306
- paceScale: b,
307
- durationSeconds: y,
308
- timingFunction: w,
309
- animate: P,
310
- springBacked: j,
311
- spring: M[f?.preset ?? "smooth"]({
312
- duration: D,
313
- extraBounce: f?.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 J = {
318
- intents: p,
319
- phases: k,
320
- paces: E,
321
- reducedPolicies: x,
322
- defaultTokens: q,
323
- parseDuration: c,
324
- readTokens: O,
325
- resolve: H,
326
- resolveReducedPolicy: R,
327
- isFeedbackSafeProperty: T,
328
- shouldAnimateProperty: N
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
- T as isOcMotionFeedbackSafeProperty,
332
- J as ocMotion,
333
- q as ocMotionDefaultTokens,
334
- p as ocMotionIntents,
335
- E as ocMotionPaces,
336
- k as ocMotionPhases,
337
- x as ocMotionReducedPolicies,
338
- c as parseOcMotionDuration,
339
- O as readOcMotionTokens,
340
- H as resolveOcMotion,
341
- R as resolveOcMotionReducedPolicy,
342
- N as shouldAnimateOcMotionProperty
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
  };