@carbon/motion 10.11.0 → 10.13.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 +0 -6
- package/index.scss +56 -0
- package/package.json +4 -4
- package/umd/index.js +1 -1
- package/docs/sass.md +0 -110
package/README.md
CHANGED
|
@@ -69,12 +69,6 @@ import { easings, motion } from '@carbon/motion';
|
|
|
69
69
|
motion('standard', 'productive'); // Returns a string `cubic-bezier()` function
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
## 📖 API Documentation
|
|
73
|
-
|
|
74
|
-
If you're looking for `@carbon/motion` API documentation, check out:
|
|
75
|
-
|
|
76
|
-
- [Sass](./docs/sass.md)
|
|
77
|
-
|
|
78
72
|
## 🙌 Contributing
|
|
79
73
|
|
|
80
74
|
We're always looking for contributors to help us fix bugs, build new features,
|
package/index.scss
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2018, 2018
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
|
|
10
|
+
/// Common component easings
|
|
11
|
+
/// @type Map
|
|
12
|
+
/// @access public
|
|
13
|
+
/// @group @carbon/motion
|
|
14
|
+
$easings: (
|
|
15
|
+
standard: (
|
|
16
|
+
productive: cubic-bezier(0.2, 0, 0.38, 0.9),
|
|
17
|
+
expressive: cubic-bezier(0.4, 0.14, 0.3, 1),
|
|
18
|
+
),
|
|
19
|
+
entrance: (
|
|
20
|
+
productive: cubic-bezier(0, 0, 0.38, 0.9),
|
|
21
|
+
expressive: cubic-bezier(0, 0, 0.3, 1),
|
|
22
|
+
),
|
|
23
|
+
exit: (
|
|
24
|
+
productive: cubic-bezier(0.2, 0, 1, 0.9),
|
|
25
|
+
expressive: cubic-bezier(0.4, 0.14, 1, 1),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/// Get the transition-timing-function for a given easing and motion mode
|
|
30
|
+
/// @param {String} $name - Can be `standard`, `entrance`, or `exit`
|
|
31
|
+
/// @param {String} $mode [productive] - Can be `productive` or `expressive`
|
|
32
|
+
/// @param {Map} $easings [$carbon--easings] - Easings map
|
|
33
|
+
/// @access public
|
|
34
|
+
/// @group @carbon/motion
|
|
35
|
+
/// @return {Function} CSS `cubic-bezier()` function
|
|
36
|
+
@function motion($name, $mode: productive, $easings: $easings) {
|
|
37
|
+
@if map.has-key($easings, $name) {
|
|
38
|
+
$easing: map.get($easings, $name);
|
|
39
|
+
@if map.has-key($easing, $mode) {
|
|
40
|
+
@return map.get($easing, $mode);
|
|
41
|
+
} @else {
|
|
42
|
+
@error 'Unable to find a mode for the easing #{$easing} called: #{$mode}.';
|
|
43
|
+
}
|
|
44
|
+
} @else {
|
|
45
|
+
@error 'Unable to find an easing named #{$name} in our supported easings.';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Set the transition-timing-function for a given easing and motion mode
|
|
50
|
+
/// @param {String} $name - The name of the easing curve to apply
|
|
51
|
+
/// @param {String} $mode - The mode for the easing curve to use
|
|
52
|
+
/// @access public
|
|
53
|
+
/// @group @carbon/motion
|
|
54
|
+
@mixin motion($name, $mode) {
|
|
55
|
+
transition-timing-function: motion($name, $mode);
|
|
56
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/motion",
|
|
3
3
|
"description": "Motion helpers for digital and software products using the Carbon Design System",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.13.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "yarn clean &&
|
|
28
|
+
"build": "yarn clean && carbon-cli bundle src/index.js --name CarbonMotion",
|
|
29
29
|
"clean": "rimraf es lib umd"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@carbon/
|
|
32
|
+
"@carbon/cli": "^10.19.0",
|
|
33
33
|
"rimraf": "^3.0.0"
|
|
34
34
|
},
|
|
35
35
|
"eyeglass": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"sassDir": "scss",
|
|
39
39
|
"needs": "^1.3.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "79db5535fee7f58e0fe21bac154b638cd17f659e"
|
|
42
42
|
}
|
package/umd/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
-
(factory(
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CarbonMotion = {}));
|
|
5
5
|
}(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/**
|
package/docs/sass.md
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# Sass API
|
|
2
|
-
|
|
3
|
-
| Mark | Description |
|
|
4
|
-
| ---- | ---------------------------------------------------------- |
|
|
5
|
-
| ✅ | Public functions, mixins, placeholders, and variables |
|
|
6
|
-
| ❌ | Private items - not supported outside package's build |
|
|
7
|
-
| ⚠️ | Deprecated items - may not be available in future releases |
|
|
8
|
-
|
|
9
|
-
<!-- toc -->
|
|
10
|
-
|
|
11
|
-
- [@carbon/motion](#carbonmotion)
|
|
12
|
-
- [✅carbon--easings [variable]](#carbon--easings-variable)
|
|
13
|
-
- [✅carbon--motion [function]](#carbon--motion-function)
|
|
14
|
-
- [✅carbon--motion [mixin]](#carbon--motion-mixin)
|
|
15
|
-
|
|
16
|
-
<!-- tocstop -->
|
|
17
|
-
|
|
18
|
-
## @carbon/motion
|
|
19
|
-
|
|
20
|
-
### ✅carbon--easings [variable]
|
|
21
|
-
|
|
22
|
-
Common component easings
|
|
23
|
-
|
|
24
|
-
<details>
|
|
25
|
-
<summary>Source code</summary>
|
|
26
|
-
|
|
27
|
-
```scss
|
|
28
|
-
$carbon--easings: (
|
|
29
|
-
standard: (
|
|
30
|
-
productive: cubic-bezier(0.2, 0, 0.38, 0.9),
|
|
31
|
-
expressive: cubic-bezier(0.4, 0.14, 0.3, 1),
|
|
32
|
-
),
|
|
33
|
-
entrance: (
|
|
34
|
-
productive: cubic-bezier(0, 0, 0.38, 0.9),
|
|
35
|
-
expressive: cubic-bezier(0, 0, 0.3, 1),
|
|
36
|
-
),
|
|
37
|
-
exit: (
|
|
38
|
-
productive: cubic-bezier(0.2, 0, 1, 0.9),
|
|
39
|
-
expressive: cubic-bezier(0.4, 0.14, 1, 1),
|
|
40
|
-
),
|
|
41
|
-
);
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
</details>
|
|
45
|
-
|
|
46
|
-
- **Group**: [@carbon/motion](#carbonmotion)
|
|
47
|
-
- **Type**: `Map`
|
|
48
|
-
|
|
49
|
-
### ✅carbon--motion [function]
|
|
50
|
-
|
|
51
|
-
Get the transition-timing-function for a given easing and motion mode
|
|
52
|
-
|
|
53
|
-
<details>
|
|
54
|
-
<summary>Source code</summary>
|
|
55
|
-
|
|
56
|
-
```scss
|
|
57
|
-
@function carbon--motion($name, $mode: productive, $easings: $carbon--easings) {
|
|
58
|
-
@if map-has-key($easings, $name) {
|
|
59
|
-
$easing: map-get($easings, $name);
|
|
60
|
-
@if map-has-key($easing, $mode) {
|
|
61
|
-
@return map-get($easing, $mode);
|
|
62
|
-
} @else {
|
|
63
|
-
@error 'Unable to find a mode for the easing #{$easing} called: #{$mode}.';
|
|
64
|
-
}
|
|
65
|
-
} @else {
|
|
66
|
-
@error 'Unable to find an easing named #{$name} in our supported easings.';
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
</details>
|
|
72
|
-
|
|
73
|
-
- **Parameters**:
|
|
74
|
-
|
|
75
|
-
| Name | Description | Type | Default value |
|
|
76
|
-
| ---------- | ---------------------------------------- | -------- | ------------------ |
|
|
77
|
-
| `$name` | Can be `standard`, `entrance`, or `exit` | `String` | — |
|
|
78
|
-
| `$mode` | Can be `productive` or `expressive` | `String` | `productive` |
|
|
79
|
-
| `$easings` | Easings map | `Map` | `$carbon--easings` |
|
|
80
|
-
|
|
81
|
-
- **Group**: [@carbon/motion](#carbonmotion)
|
|
82
|
-
- **Returns**: `Function` CSS `cubic-bezier()` function
|
|
83
|
-
- **Used by**:
|
|
84
|
-
- [carbon--motion [mixin]](#carbon--motion-mixin)
|
|
85
|
-
|
|
86
|
-
### ✅carbon--motion [mixin]
|
|
87
|
-
|
|
88
|
-
Set the transition-timing-function for a given easing and motion mode
|
|
89
|
-
|
|
90
|
-
<details>
|
|
91
|
-
<summary>Source code</summary>
|
|
92
|
-
|
|
93
|
-
```scss
|
|
94
|
-
@mixin carbon--motion($name, $mode) {
|
|
95
|
-
transition-timing-function: carbon--motion($name, $mode);
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
</details>
|
|
100
|
-
|
|
101
|
-
- **Parameters**:
|
|
102
|
-
|
|
103
|
-
| Name | Description | Type | Default value |
|
|
104
|
-
| ------- | ------------------------------------- | -------- | ------------- |
|
|
105
|
-
| `$name` | The name of the easing curve to apply | `String` | — |
|
|
106
|
-
| `$mode` | The mode for the easing curve to use | `String` | — |
|
|
107
|
-
|
|
108
|
-
- **Group**: [@carbon/motion](#carbonmotion)
|
|
109
|
-
- **Requires**:
|
|
110
|
-
- [carbon--motion [function]](#carbon--motion-function)
|