@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.
- package/README.md +56 -27
- 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/ActionArea/ActionAreaLayout.css +1 -0
- package/dist/components/ActionArea/ActionAreaLayout.js +145 -0
- package/dist/components/ActionArea/ActionAreaLayout.module.scss.js +11 -0
- package/dist/components/ActionArea.js +10 -4
- package/dist/components/Alert/Alert.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.js +72 -52
- 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 +79 -139
- 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/IconButton/IconButton.js +48 -29
- package/dist/components/Interaction/Interaction.css +1 -1
- package/dist/components/Loading/Loading.css +1 -1
- package/dist/components/Loading/Loading.js +10 -10
- 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/components/internal/Pressable.js +90 -0
- 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/index.js +102 -96
- package/dist/react/motion.js +109 -106
- package/dist/styles.css +32 -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/ActionAreaLayout.d.ts +12 -0
- package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts.map +1 -0
- package/dist/ui/src/components/ActionArea/index.d.ts +2 -1
- package/dist/ui/src/components/ActionArea/index.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/types.d.ts +13 -2
- package/dist/ui/src/components/ActionArea/types.d.ts.map +1 -1
- package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts +1 -1
- package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts.map +1 -1
- package/dist/ui/src/components/BackgroundIconButton/index.d.ts +1 -1
- package/dist/ui/src/components/BackgroundIconButton/index.d.ts.map +1 -1
- package/dist/ui/src/components/BackgroundIconButton/types.d.ts +6 -5
- package/dist/ui/src/components/BackgroundIconButton/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/Button/types.d.ts +3 -7
- package/dist/ui/src/components/Button/types.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/IconButton/IconButton.d.ts +1 -1
- package/dist/ui/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/ui/src/components/IconButton/index.d.ts +1 -1
- package/dist/ui/src/components/IconButton/index.d.ts.map +1 -1
- package/dist/ui/src/components/IconButton/types.d.ts +6 -5
- package/dist/ui/src/components/IconButton/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 +7 -6
- 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/components/internal/Pressable.d.ts +19 -0
- package/dist/ui/src/components/internal/Pressable.d.ts.map +1 -0
- package/dist/ui/src/index.d.ts +5 -5
- 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
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
$oc-motion-token-duration-by-intent: (
|
|
9
9
|
feedback: var(--oc-motion-duration-feedback),
|
|
10
10
|
reject: var(--oc-motion-duration-reject),
|
|
11
|
-
|
|
11
|
+
disclosure: var(--oc-motion-duration-disclosure),
|
|
12
|
+
surface: var(--oc-motion-duration-surface),
|
|
13
|
+
sheet: var(--oc-motion-duration-sheet),
|
|
14
|
+
expand: var(--oc-motion-duration-expand),
|
|
12
15
|
move: var(--oc-motion-duration-move),
|
|
13
16
|
gesture: var(--oc-motion-duration-gesture),
|
|
14
17
|
ambient: var(--oc-motion-duration-ambient),
|
|
@@ -17,82 +20,120 @@ $oc-motion-token-duration-by-intent: (
|
|
|
17
20
|
$oc-motion-token-timing-by-intent: (
|
|
18
21
|
feedback: var(--oc-motion-timing-feedback),
|
|
19
22
|
reject: var(--oc-motion-timing-reject),
|
|
20
|
-
|
|
23
|
+
disclosure: var(--oc-motion-timing-disclosure),
|
|
24
|
+
surface: var(--oc-motion-timing-surface),
|
|
25
|
+
sheet: var(--oc-motion-timing-sheet),
|
|
26
|
+
expand: var(--oc-motion-timing-expand),
|
|
21
27
|
move: var(--oc-motion-timing-move),
|
|
22
28
|
gesture: var(--oc-motion-timing-gesture),
|
|
23
29
|
ambient: var(--oc-motion-timing-ambient),
|
|
24
30
|
) !default;
|
|
25
31
|
|
|
26
32
|
$oc-motion-token-duration-by-phase: (
|
|
27
|
-
|
|
28
|
-
exit: var(--oc-motion-duration-
|
|
33
|
+
disclosure: (
|
|
34
|
+
exit: var(--oc-motion-duration-disclosure-exit),
|
|
35
|
+
),
|
|
36
|
+
surface: (
|
|
37
|
+
exit: var(--oc-motion-duration-surface-exit),
|
|
38
|
+
),
|
|
39
|
+
sheet: (
|
|
40
|
+
exit: var(--oc-motion-duration-sheet-exit),
|
|
41
|
+
release: var(--oc-motion-duration-sheet-release),
|
|
42
|
+
),
|
|
43
|
+
expand: (
|
|
44
|
+
exit: var(--oc-motion-duration-expand-exit),
|
|
29
45
|
),
|
|
30
46
|
gesture: (
|
|
31
|
-
|
|
47
|
+
release: var(--oc-motion-duration-gesture-release),
|
|
32
48
|
),
|
|
33
49
|
) !default;
|
|
34
50
|
|
|
35
51
|
$oc-motion-token-timing-by-phase: (
|
|
36
|
-
|
|
37
|
-
exit: var(--oc-motion-timing-
|
|
52
|
+
disclosure: (
|
|
53
|
+
exit: var(--oc-motion-timing-disclosure-exit),
|
|
54
|
+
),
|
|
55
|
+
surface: (
|
|
56
|
+
exit: var(--oc-motion-timing-surface-exit),
|
|
57
|
+
),
|
|
58
|
+
sheet: (
|
|
59
|
+
exit: var(--oc-motion-timing-sheet-exit),
|
|
60
|
+
release: var(--oc-motion-timing-sheet-release),
|
|
61
|
+
),
|
|
62
|
+
expand: (
|
|
63
|
+
exit: var(--oc-motion-timing-expand-exit),
|
|
38
64
|
),
|
|
39
65
|
gesture: (
|
|
40
|
-
|
|
66
|
+
release: var(--oc-motion-timing-gesture-release),
|
|
41
67
|
),
|
|
42
68
|
) !default;
|
|
43
69
|
|
|
44
|
-
$oc-motion-token-pace-
|
|
70
|
+
$oc-motion-token-pace-factor: (
|
|
45
71
|
quick: var(--oc-motion-pace-quick),
|
|
46
72
|
normal: var(--oc-motion-pace-normal),
|
|
47
73
|
slow: var(--oc-motion-pace-slow),
|
|
48
74
|
) !default;
|
|
49
75
|
|
|
50
76
|
$oc-motion-token-scale-by-intent: (
|
|
51
|
-
feedback: var(--oc-motion-scale-feedback),
|
|
52
|
-
reject: var(--oc-motion-scale-feedback),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
feedback: var(--oc-motion-scale-factor-feedback),
|
|
78
|
+
reject: var(--oc-motion-scale-factor-feedback),
|
|
79
|
+
disclosure: var(--oc-motion-scale-factor-spatial),
|
|
80
|
+
surface: var(--oc-motion-scale-factor-spatial),
|
|
81
|
+
sheet: var(--oc-motion-scale-factor-spatial),
|
|
82
|
+
expand: var(--oc-motion-scale-factor-spatial),
|
|
83
|
+
move: var(--oc-motion-scale-factor-spatial),
|
|
84
|
+
gesture: var(--oc-motion-scale-factor-feedback),
|
|
85
|
+
ambient: var(--oc-motion-scale-factor-feedback),
|
|
57
86
|
) !default;
|
|
58
87
|
|
|
59
88
|
$oc-motion-token-distance-by-intent: (
|
|
60
|
-
feedback: var(--oc-motion-distance-
|
|
61
|
-
reject: var(--oc-motion-distance-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
89
|
+
feedback: var(--oc-motion-distance-factor-reject),
|
|
90
|
+
reject: var(--oc-motion-distance-factor-reject),
|
|
91
|
+
disclosure: var(--oc-motion-distance-factor-spatial),
|
|
92
|
+
surface: var(--oc-motion-distance-factor-spatial),
|
|
93
|
+
sheet: var(--oc-motion-distance-factor-spatial),
|
|
94
|
+
expand: var(--oc-motion-distance-factor-spatial),
|
|
95
|
+
move: var(--oc-motion-distance-factor-spatial),
|
|
96
|
+
gesture: var(--oc-motion-distance-factor-reject),
|
|
97
|
+
ambient: var(--oc-motion-distance-factor-spatial),
|
|
66
98
|
) !default;
|
|
67
99
|
|
|
68
100
|
// Spring profiles need compile-time Sass values because oc-spring() samples timing curves.
|
|
69
101
|
$oc-motion-spring-duration-by-intent: (
|
|
70
102
|
feedback: 0.2s,
|
|
71
103
|
reject: 0.32s,
|
|
72
|
-
|
|
104
|
+
disclosure: 0.2s,
|
|
105
|
+
surface: 0.26s,
|
|
106
|
+
sheet: 0.26s,
|
|
107
|
+
expand: 0.3s,
|
|
73
108
|
move: 0.3s,
|
|
74
109
|
gesture: 0.2s,
|
|
75
110
|
ambient: 1.2s,
|
|
76
111
|
) !default;
|
|
77
112
|
|
|
78
113
|
$oc-motion-spring-duration-by-phase: (
|
|
79
|
-
|
|
80
|
-
exit: 0.
|
|
114
|
+
disclosure: (
|
|
115
|
+
exit: 0.14s,
|
|
116
|
+
),
|
|
117
|
+
surface: (
|
|
118
|
+
exit: 0.24s,
|
|
119
|
+
),
|
|
120
|
+
sheet: (
|
|
121
|
+
exit: 0.33s,
|
|
122
|
+
release: 0.33s,
|
|
123
|
+
),
|
|
124
|
+
expand: (
|
|
125
|
+
exit: 0.24s,
|
|
126
|
+
),
|
|
127
|
+
gesture: (
|
|
128
|
+
release: 0.52s,
|
|
81
129
|
),
|
|
82
130
|
) !default;
|
|
83
131
|
|
|
84
|
-
$oc-motion-phases: (change, enter, exit,
|
|
132
|
+
$oc-motion-phases: (change, enter, exit, release, loop) !default;
|
|
85
133
|
$oc-motion-reduced-policies: (auto, preserve, fade, static, feedback) !default;
|
|
86
134
|
|
|
87
135
|
// Intent-level spring profiles preserve component motion quality without raw oc-spring() calls in components.
|
|
88
136
|
$oc-motion-spring-by-intent: (
|
|
89
|
-
feedback: (
|
|
90
|
-
phases: (
|
|
91
|
-
settle,
|
|
92
|
-
),
|
|
93
|
-
preset: snappy,
|
|
94
|
-
extra-bounce: 0,
|
|
95
|
-
),
|
|
96
137
|
reject: (
|
|
97
138
|
phases: (
|
|
98
139
|
change,
|
|
@@ -101,7 +142,7 @@ $oc-motion-spring-by-intent: (
|
|
|
101
142
|
preset: smooth,
|
|
102
143
|
extra-bounce: 0,
|
|
103
144
|
),
|
|
104
|
-
|
|
145
|
+
disclosure: (
|
|
105
146
|
preset: smooth,
|
|
106
147
|
extra-bounce: 0,
|
|
107
148
|
phases: (
|
|
@@ -112,7 +153,7 @@ $oc-motion-spring-by-intent: (
|
|
|
112
153
|
transform: snappy,
|
|
113
154
|
),
|
|
114
155
|
property-extra-bounce: (
|
|
115
|
-
transform: 0.
|
|
156
|
+
transform: 0.04,
|
|
116
157
|
),
|
|
117
158
|
),
|
|
118
159
|
enter: (
|
|
@@ -122,15 +163,35 @@ $oc-motion-spring-by-intent: (
|
|
|
122
163
|
transform: snappy,
|
|
123
164
|
),
|
|
124
165
|
property-extra-bounce: (
|
|
125
|
-
transform: 0.
|
|
166
|
+
transform: 0.04,
|
|
126
167
|
),
|
|
127
168
|
),
|
|
169
|
+
exit: null,
|
|
128
170
|
),
|
|
129
171
|
),
|
|
172
|
+
surface: (
|
|
173
|
+
preset: smooth,
|
|
174
|
+
extra-bounce: 0,
|
|
175
|
+
),
|
|
176
|
+
sheet: (
|
|
177
|
+
preset: smooth,
|
|
178
|
+
extra-bounce: 0,
|
|
179
|
+
),
|
|
180
|
+
expand: (
|
|
181
|
+
preset: smooth,
|
|
182
|
+
extra-bounce: 0,
|
|
183
|
+
),
|
|
130
184
|
move: (
|
|
131
185
|
preset: smooth,
|
|
132
186
|
extra-bounce: 0,
|
|
133
187
|
),
|
|
188
|
+
gesture: (
|
|
189
|
+
phases: (
|
|
190
|
+
release,
|
|
191
|
+
),
|
|
192
|
+
preset: snappy,
|
|
193
|
+
extra-bounce: 0,
|
|
194
|
+
),
|
|
134
195
|
ambient: (
|
|
135
196
|
phases: (
|
|
136
197
|
loop,
|
|
@@ -143,7 +204,10 @@ $oc-motion-spring-by-intent: (
|
|
|
143
204
|
$oc-motion-reduced-policy-by-intent: (
|
|
144
205
|
feedback: feedback,
|
|
145
206
|
reject: feedback,
|
|
146
|
-
|
|
207
|
+
disclosure: fade,
|
|
208
|
+
surface: fade,
|
|
209
|
+
sheet: static,
|
|
210
|
+
expand: static,
|
|
147
211
|
move: static,
|
|
148
212
|
gesture: feedback,
|
|
149
213
|
ambient: static,
|
|
@@ -159,21 +223,33 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
159
223
|
@return $intent;
|
|
160
224
|
}
|
|
161
225
|
|
|
162
|
-
@function _oc-motion-require-duration-
|
|
163
|
-
@if meta.type-of($duration-
|
|
164
|
-
@error 'oc-motion $duration-
|
|
226
|
+
@function _oc-motion-require-duration-factor($duration-factor) {
|
|
227
|
+
@if meta.type-of($duration-factor) != 'number' or not math.is-unitless($duration-factor) {
|
|
228
|
+
@error 'oc-motion $duration-factor must be a unitless number.';
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@if $duration-factor < 0 {
|
|
232
|
+
@error 'oc-motion $duration-factor must be greater than or equal to 0.';
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@return $duration-factor;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@function _oc-motion-require-extra-bounce($extra-bounce) {
|
|
239
|
+
@if $extra-bounce == null {
|
|
240
|
+
@return null;
|
|
165
241
|
}
|
|
166
242
|
|
|
167
|
-
@if $
|
|
168
|
-
@error 'oc-motion $
|
|
243
|
+
@if meta.type-of($extra-bounce) != 'number' or not math.is-unitless($extra-bounce) {
|
|
244
|
+
@error 'oc-motion $extra-bounce must be a unitless number.';
|
|
169
245
|
}
|
|
170
246
|
|
|
171
|
-
@return $
|
|
247
|
+
@return $extra-bounce;
|
|
172
248
|
}
|
|
173
249
|
|
|
174
250
|
@function _oc-motion-require-phase($phase) {
|
|
175
251
|
@if list.index($oc-motion-phases, $phase) == null {
|
|
176
|
-
@error 'Unknown oc-motion phase: #{$phase}. Use change, enter, exit,
|
|
252
|
+
@error 'Unknown oc-motion phase: #{$phase}. Use change, enter, exit, release, or loop.';
|
|
177
253
|
}
|
|
178
254
|
|
|
179
255
|
@return $phase;
|
|
@@ -187,12 +263,12 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
187
263
|
@return $reduced;
|
|
188
264
|
}
|
|
189
265
|
|
|
190
|
-
@function _oc-motion-token-pace-
|
|
191
|
-
@if not map.has-key($oc-motion-token-pace-
|
|
266
|
+
@function _oc-motion-token-pace-factor($pace) {
|
|
267
|
+
@if not map.has-key($oc-motion-token-pace-factor, $pace) {
|
|
192
268
|
@error 'Unknown oc-motion pace: #{$pace}. Use quick, normal, or slow.';
|
|
193
269
|
}
|
|
194
270
|
|
|
195
|
-
@return map.get($oc-motion-token-pace-
|
|
271
|
+
@return map.get($oc-motion-token-pace-factor, $pace);
|
|
196
272
|
}
|
|
197
273
|
|
|
198
274
|
@function _oc-motion-require-scale-value($scale) {
|
|
@@ -275,7 +351,13 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
275
351
|
|
|
276
352
|
@if meta.type-of($phases) == 'map' {
|
|
277
353
|
@if map.has-key($phases, $phase) {
|
|
278
|
-
|
|
354
|
+
$phase-config: map.get($phases, $phase);
|
|
355
|
+
|
|
356
|
+
@if $phase-config == null {
|
|
357
|
+
@return null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@return map.merge($config, $phase-config);
|
|
279
361
|
}
|
|
280
362
|
|
|
281
363
|
@return $config;
|
|
@@ -288,7 +370,11 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
288
370
|
@return null;
|
|
289
371
|
}
|
|
290
372
|
|
|
291
|
-
@function _oc-motion-spring-extra-bounce($config, $property) {
|
|
373
|
+
@function _oc-motion-spring-extra-bounce($config, $property, $extra-bounce) {
|
|
374
|
+
@if $extra-bounce != null {
|
|
375
|
+
@return $extra-bounce;
|
|
376
|
+
}
|
|
377
|
+
|
|
292
378
|
$property-extra-bounce: map.get($config, property-extra-bounce);
|
|
293
379
|
|
|
294
380
|
@if $property-extra-bounce != null and map.has-key($property-extra-bounce, $property) {
|
|
@@ -308,31 +394,31 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
308
394
|
@return map.get($config, preset);
|
|
309
395
|
}
|
|
310
396
|
|
|
311
|
-
@function _oc-motion-spring-transition-item($property, $spring-duration, $config, $pace, $duration-
|
|
397
|
+
@function _oc-motion-spring-transition-item($property, $spring-duration, $config, $pace, $duration-factor, $extra-bounce) {
|
|
312
398
|
$preset: _oc-motion-spring-preset($config, $property);
|
|
313
|
-
$extra-bounce: _oc-motion-spring-extra-bounce($config, $property);
|
|
314
|
-
$settle-duration: oc-spring-settle-duration($spring-duration, $preset, $extra-bounce);
|
|
315
|
-
$duration: calc(#{$settle-duration} * var(--oc-motion-duration-
|
|
316
|
-
$timing: oc-spring-timing($spring-duration, $preset, $extra-bounce);
|
|
399
|
+
$spring-extra-bounce: _oc-motion-spring-extra-bounce($config, $property, $extra-bounce);
|
|
400
|
+
$settle-duration: oc-spring-settle-duration($spring-duration, $preset, $spring-extra-bounce);
|
|
401
|
+
$duration: calc(#{$settle-duration} * var(--oc-motion-duration-factor) * #{_oc-motion-token-pace-factor($pace)} * #{$duration-factor});
|
|
402
|
+
$timing: oc-spring-timing($spring-duration, $preset, $spring-extra-bounce);
|
|
317
403
|
|
|
318
404
|
@return _oc-motion-transition-item($property, $duration, $timing);
|
|
319
405
|
}
|
|
320
406
|
|
|
321
|
-
@function _oc-motion-spring($properties, $intent, $phase, $pace, $duration-
|
|
407
|
+
@function _oc-motion-spring($properties, $intent, $phase, $pace, $duration-factor, $config, $extra-bounce) {
|
|
322
408
|
$spring-duration: _oc-motion-spring-duration-value($intent, $phase);
|
|
323
409
|
$transitions: ();
|
|
324
410
|
|
|
325
411
|
@each $property in _oc-motion-properties($properties) {
|
|
326
|
-
$transitions: list.append($transitions, _oc-motion-spring-transition-item($property, $spring-duration, $config, $pace, $duration-
|
|
412
|
+
$transitions: list.append($transitions, _oc-motion-spring-transition-item($property, $spring-duration, $config, $pace, $duration-factor, $extra-bounce), $separator: comma);
|
|
327
413
|
}
|
|
328
414
|
|
|
329
415
|
@return $transitions;
|
|
330
416
|
}
|
|
331
417
|
|
|
332
|
-
@function oc-motion-duration($intent, $phase: change, $pace: normal, $duration-
|
|
418
|
+
@function oc-motion-duration($intent, $phase: change, $pace: normal, $duration-factor: 1, $duration-factor-token: var(--oc-motion-duration-factor), $duration-token: null) {
|
|
333
419
|
$intent: _oc-motion-require-intent($intent);
|
|
334
420
|
$phase: _oc-motion-require-phase($phase);
|
|
335
|
-
$duration-
|
|
421
|
+
$duration-factor: _oc-motion-require-duration-factor($duration-factor);
|
|
336
422
|
$base-duration: map.get($oc-motion-token-duration-by-intent, $intent);
|
|
337
423
|
$duration: $duration-token;
|
|
338
424
|
|
|
@@ -340,9 +426,9 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
340
426
|
$duration: _oc-motion-phase-value($oc-motion-token-duration-by-phase, $intent, $phase, $base-duration);
|
|
341
427
|
}
|
|
342
428
|
|
|
343
|
-
$pace-
|
|
429
|
+
$pace-factor: _oc-motion-token-pace-factor($pace);
|
|
344
430
|
|
|
345
|
-
@return calc(#{$duration} * #{$duration-
|
|
431
|
+
@return calc(#{$duration} * #{$duration-factor-token} * #{$pace-factor} * #{$duration-factor});
|
|
346
432
|
}
|
|
347
433
|
|
|
348
434
|
@function oc-motion-timing($intent, $phase: change) {
|
|
@@ -353,31 +439,32 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
353
439
|
@return _oc-motion-phase-value($oc-motion-token-timing-by-phase, $intent, $phase, $base-timing);
|
|
354
440
|
}
|
|
355
441
|
|
|
356
|
-
@function oc-motion-scale($scale, $intent: feedback, $scale-token: null) {
|
|
442
|
+
@function oc-motion-scale($scale, $intent: feedback, $scale-factor-token: null) {
|
|
357
443
|
$intent: _oc-motion-require-intent($intent);
|
|
358
444
|
$scale: _oc-motion-require-scale-value($scale);
|
|
359
445
|
|
|
360
|
-
@if $scale-token == null {
|
|
361
|
-
$scale-token: map.get($oc-motion-token-scale-by-intent, $intent);
|
|
446
|
+
@if $scale-factor-token == null {
|
|
447
|
+
$scale-factor-token: map.get($oc-motion-token-scale-by-intent, $intent);
|
|
362
448
|
}
|
|
363
449
|
|
|
364
|
-
@return max(0, calc(1 + (#{$scale} - 1) * #{$scale-token}));
|
|
450
|
+
@return max(0, calc(1 + (#{$scale} - 1) * #{$scale-factor-token}));
|
|
365
451
|
}
|
|
366
452
|
|
|
367
|
-
@function oc-motion-distance($distance, $intent
|
|
453
|
+
@function oc-motion-distance($distance, $intent, $distance-factor-token: null) {
|
|
368
454
|
$intent: _oc-motion-require-intent($intent);
|
|
369
455
|
|
|
370
|
-
@if $distance-token == null {
|
|
371
|
-
$distance-token: map.get($oc-motion-token-distance-by-intent, $intent);
|
|
456
|
+
@if $distance-factor-token == null {
|
|
457
|
+
$distance-factor-token: map.get($oc-motion-token-distance-by-intent, $intent);
|
|
372
458
|
}
|
|
373
459
|
|
|
374
|
-
@return calc(#{$distance} * #{$distance-token});
|
|
460
|
+
@return calc(#{$distance} * #{$distance-factor-token});
|
|
375
461
|
}
|
|
376
462
|
|
|
377
|
-
@function oc-motion($properties, $intent, $phase: change, $pace: normal, $duration-
|
|
463
|
+
@function oc-motion($properties, $intent, $phase: change, $pace: normal, $duration-factor: 1, $duration-token: null, $extra-bounce: null) {
|
|
378
464
|
$intent: _oc-motion-require-intent($intent);
|
|
379
465
|
$phase: _oc-motion-require-phase($phase);
|
|
380
|
-
$duration-
|
|
466
|
+
$duration-factor: _oc-motion-require-duration-factor($duration-factor);
|
|
467
|
+
$extra-bounce: _oc-motion-require-extra-bounce($extra-bounce);
|
|
381
468
|
$spring-config: _oc-motion-spring-config($intent, $phase);
|
|
382
469
|
|
|
383
470
|
@if $spring-config != null {
|
|
@@ -385,10 +472,14 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
385
472
|
@error 'oc-motion $duration-token is not supported for spring-backed motion.';
|
|
386
473
|
}
|
|
387
474
|
|
|
388
|
-
@return _oc-motion-spring($properties, $intent, $phase, $pace, $duration-
|
|
475
|
+
@return _oc-motion-spring($properties, $intent, $phase, $pace, $duration-factor, $spring-config, $extra-bounce);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@if $extra-bounce != null {
|
|
479
|
+
@error 'oc-motion $extra-bounce is only supported for spring-backed motion.';
|
|
389
480
|
}
|
|
390
481
|
|
|
391
|
-
$duration: oc-motion-duration($intent, $phase, $pace, $duration-
|
|
482
|
+
$duration: oc-motion-duration($intent, $phase, $pace, $duration-factor, $duration-token: $duration-token);
|
|
392
483
|
$timing: oc-motion-timing($intent, $phase);
|
|
393
484
|
$transitions: ();
|
|
394
485
|
|
|
@@ -410,11 +501,11 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
410
501
|
}
|
|
411
502
|
|
|
412
503
|
// stylelint-disable-next-line scss/at-mixin-pattern -- Private helper mirrors the public oc-motion mixin name.
|
|
413
|
-
@mixin _oc-motion-reduced($properties, $intent, $phase, $pace, $duration-
|
|
504
|
+
@mixin _oc-motion-reduced($properties, $intent, $phase, $pace, $duration-factor, $reduced, $duration-token) {
|
|
414
505
|
$policy: _oc-motion-reduced-policy($intent, $reduced);
|
|
415
506
|
|
|
416
507
|
@if $policy == preserve {
|
|
417
|
-
transition-duration: oc-motion-duration($intent, $phase, $pace, $duration-
|
|
508
|
+
transition-duration: oc-motion-duration($intent, $phase, $pace, $duration-factor, var(--oc-motion-duration-factor-preserve), $duration-token);
|
|
418
509
|
transition-timing-function: oc-motion-timing($intent, $phase);
|
|
419
510
|
} @else if $policy == static {
|
|
420
511
|
transition: none;
|
|
@@ -429,7 +520,7 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
429
520
|
transition: none;
|
|
430
521
|
} @else {
|
|
431
522
|
transition-property: $reduced-properties;
|
|
432
|
-
transition-duration: oc-motion-duration($intent, $phase, $pace, $duration-
|
|
523
|
+
transition-duration: oc-motion-duration($intent, $phase, $pace, $duration-factor, var(--oc-motion-duration-factor-reduced), $duration-token);
|
|
433
524
|
transition-timing-function: oc-motion-timing($intent, $phase);
|
|
434
525
|
}
|
|
435
526
|
|
|
@@ -441,10 +532,10 @@ $oc-motion-feedback-properties: (opacity, color, background-color, border-color,
|
|
|
441
532
|
}
|
|
442
533
|
}
|
|
443
534
|
|
|
444
|
-
@mixin oc-motion($properties, $intent, $phase: change, $pace: normal, $duration-
|
|
445
|
-
transition: oc-motion($properties, $intent, $phase, $pace, $duration-
|
|
535
|
+
@mixin oc-motion($properties, $intent, $phase: change, $pace: normal, $duration-factor: 1, $reduced: auto, $duration-token: null, $extra-bounce: null) {
|
|
536
|
+
transition: oc-motion($properties, $intent, $phase, $pace, $duration-factor, $duration-token, $extra-bounce);
|
|
446
537
|
|
|
447
538
|
@media (prefers-reduced-motion: reduce) {
|
|
448
|
-
@include _oc-motion-reduced($properties, $intent, $phase, $pace, $duration-
|
|
539
|
+
@include _oc-motion-reduced($properties, $intent, $phase, $pace, $duration-factor, $reduced, $duration-token);
|
|
449
540
|
}
|
|
450
541
|
}
|