@spark-ui/tailwind-plugins 2.8.0 → 2.9.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 +10 -0
- package/animations/index.doc.mdx +1 -1
- package/animations/index.js +23 -14
- package/package.json +3 -3
- package/spark-theme/constants.js +25 -1
- package/spark-theme/getCSSVariableReferences.js +15 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [2.9.1](https://github.com/adevinta/spark/compare/@spark-ui/tailwind-plugins@2.9.0...@spark-ui/tailwind-plugins@2.9.1) (2023-04-26)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @spark-ui/tailwind-plugins
|
9
|
+
|
10
|
+
# [2.9.0](https://github.com/adevinta/spark/compare/@spark-ui/tailwind-plugins@2.8.0...@spark-ui/tailwind-plugins@2.9.0) (2023-04-24)
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
- **tailwind-plugins:** update transition theme values to match figma ([92f37c2](https://github.com/adevinta/spark/commit/92f37c23e89d5b491a8feef9cf8764c0dc4c1b66)), closes [#642](https://github.com/adevinta/spark/issues/642)
|
15
|
+
|
6
16
|
# [2.8.0](https://github.com/adevinta/spark/compare/@spark-ui/tailwind-plugins@2.7.1...@spark-ui/tailwind-plugins@2.8.0) (2023-04-21)
|
7
17
|
|
8
18
|
### Features
|
package/animations/index.doc.mdx
CHANGED
@@ -33,7 +33,7 @@ This plugin provides the following **animation-related** declaration properties
|
|
33
33
|
- **animation-duration**: `spark-anime-duration-{value}` (where `value` can be any keys of `theme.transitionDuration` or an arbitrary value like `spark-anime-duration-[458ms]`)
|
34
34
|
- **animation-delay**: `spark-anime-delay-{value}` (where `value` can be any keys of `theme.transitionDuration` or an arbitrary value like `spark-anime-delay-[458ms]`)
|
35
35
|
- **animation-direction**: `spark-anime-direction-{value}` (where `value` can be `normal`, `reverse`, `alternate`, `alternate-reverse`, `revert`, or `revert-layer`)
|
36
|
-
- **animation-iteration-count**: `spark-anime-iteration-{value}` (where `value` can be `1`, `2`, `3`, `infinite`, or an arbitrary value like `
|
36
|
+
- **animation-iteration-count**: `spark-anime-iteration-{value}` (where `value` can be `1`, `2`, `3`, `infinite`, or an arbitrary value like `spark-anime-iteration-[12]`)
|
37
37
|
- **animation-play-running**: `spark-anime-play-{value}` (where `value` can be `running`, or `paused`)
|
38
38
|
- **animation-timing-function**: `spark-anime-easing-{value}` (where `value` can be, `linear`, `in`, `out`, `in-out`, `in-back`, `out-back`, `in-out-back` or an arbitrary value like `spark-anime-easing-[cubic-bezier(0.95,0.05,0.795,0.035)]`)
|
39
39
|
|
package/animations/index.js
CHANGED
@@ -16,19 +16,13 @@ const fillModes = ['none', 'forwards', 'backwards', 'both']
|
|
16
16
|
const directions = ['normal', 'reverse', 'alternate', 'alternate-reverse']
|
17
17
|
const playStates = ['running', 'paused']
|
18
18
|
|
19
|
-
const
|
20
|
-
'in-back': 'cubic-bezier(0.36, 0, 0.66, -0.56)',
|
21
|
-
'out-back': 'cubic-bezier(0.34, 1.56, 0.64, 1)',
|
22
|
-
'in-out-back': 'cubic-bezier(0.68, -0.6, 0.32, 1.6)',
|
23
|
-
}
|
19
|
+
const commonValuesObj = arrToObj(commonValues)
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
2000: '2s',
|
28
|
-
3000: '3s',
|
29
|
-
}
|
21
|
+
function removeKeyFromObj(obj, key) {
|
22
|
+
const { [key]: _, ...rest } = obj
|
30
23
|
|
31
|
-
|
24
|
+
return rest
|
25
|
+
}
|
32
26
|
|
33
27
|
module.exports = plugin.withOptions(
|
34
28
|
/**
|
@@ -53,7 +47,12 @@ module.exports = plugin.withOptions(
|
|
53
47
|
animationDuration: value,
|
54
48
|
}),
|
55
49
|
},
|
56
|
-
{
|
50
|
+
{
|
51
|
+
values: {
|
52
|
+
...removeKeyFromObj(theme('transitionDuration'), 'DEFAULT'),
|
53
|
+
...commonValuesObj,
|
54
|
+
},
|
55
|
+
}
|
57
56
|
)
|
58
57
|
|
59
58
|
matchUtilities(
|
@@ -62,7 +61,12 @@ module.exports = plugin.withOptions(
|
|
62
61
|
animationDelay: value,
|
63
62
|
}),
|
64
63
|
},
|
65
|
-
{
|
64
|
+
{
|
65
|
+
values: {
|
66
|
+
...removeKeyFromObj(theme('transitionDuration'), 'DEFAULT'),
|
67
|
+
...commonValuesObj,
|
68
|
+
},
|
69
|
+
}
|
66
70
|
)
|
67
71
|
|
68
72
|
matchUtilities(
|
@@ -80,7 +84,12 @@ module.exports = plugin.withOptions(
|
|
80
84
|
animationTimingFunction: value,
|
81
85
|
}),
|
82
86
|
},
|
83
|
-
{
|
87
|
+
{
|
88
|
+
values: {
|
89
|
+
...removeKeyFromObj(theme('transitionTimingFunction'), 'DEFAULT'),
|
90
|
+
...commonValuesObj,
|
91
|
+
},
|
92
|
+
}
|
84
93
|
)
|
85
94
|
|
86
95
|
fillModes.forEach(mode => {
|
package/package.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spark-ui/tailwind-plugins",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.9.1",
|
4
4
|
"description": "Spark Tailwind plugins",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
7
7
|
},
|
8
8
|
"main": "index.js",
|
9
9
|
"dependencies": {
|
10
|
-
"@spark-ui/theme-utils": "2",
|
10
|
+
"@spark-ui/theme-utils": "^2.14.0",
|
11
11
|
"tailwindcss-radix": "^2.8.0"
|
12
12
|
},
|
13
13
|
"peerDependencies": {
|
@@ -18,5 +18,5 @@
|
|
18
18
|
"url": "git@github.com:adevinta/spark.git",
|
19
19
|
"directory": "packages/utils/tailwind-plugins"
|
20
20
|
},
|
21
|
-
"gitHead": "
|
21
|
+
"gitHead": "3153e420fdd5018852408e8387571a4b301c78df"
|
22
22
|
}
|
package/spark-theme/constants.js
CHANGED
@@ -10,6 +10,30 @@ const unassignedColors = {
|
|
10
10
|
transparent: 'transparent',
|
11
11
|
}
|
12
12
|
|
13
|
+
const transitionDurationLookup = {
|
14
|
+
0: '0ms',
|
15
|
+
50: '50ms',
|
16
|
+
100: '100ms',
|
17
|
+
200: '200ms',
|
18
|
+
300: '300ms',
|
19
|
+
400: '400ms',
|
20
|
+
500: '500ms',
|
21
|
+
600: '600ms',
|
22
|
+
800: '800ms',
|
23
|
+
}
|
24
|
+
|
25
|
+
const transitionTimingFunctionLookup = {
|
26
|
+
'in-back': 'cubic-bezier(0.3, -0.05, 0.7, -0.5)',
|
27
|
+
'out-back': 'cubic-bezier(0.45, 1.45, 0.8, 1)',
|
28
|
+
'in-out-back': 'cubic-bezier(0.42, 0, 0.58, 1)',
|
29
|
+
}
|
30
|
+
|
13
31
|
const DEFAULT_KEY = 'DEFAULT'
|
14
32
|
|
15
|
-
module.exports = {
|
33
|
+
module.exports = {
|
34
|
+
tailwindCategoryKeys,
|
35
|
+
unassignedColors,
|
36
|
+
transitionDurationLookup,
|
37
|
+
transitionTimingFunctionLookup,
|
38
|
+
DEFAULT_KEY,
|
39
|
+
}
|
@@ -1,5 +1,11 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
2
|
-
const {
|
2
|
+
const {
|
3
|
+
DEFAULT_KEY,
|
4
|
+
tailwindCategoryKeys,
|
5
|
+
transitionDurationLookup,
|
6
|
+
transitionTimingFunctionLookup,
|
7
|
+
unassignedColors,
|
8
|
+
} = require('./constants')
|
3
9
|
const {
|
4
10
|
doubleHyphensRegex,
|
5
11
|
hasNumber,
|
@@ -105,7 +111,14 @@ function getCSSVariableReferences(_theme) {
|
|
105
111
|
|
106
112
|
traverse(themeCpy)
|
107
113
|
|
108
|
-
return {
|
114
|
+
return {
|
115
|
+
...themeCpy,
|
116
|
+
colors: { ...themeCpy.colors, ...unassignedColors },
|
117
|
+
transitionDuration: transitionDurationLookup,
|
118
|
+
extend: {
|
119
|
+
transitionTimingFunction: transitionTimingFunctionLookup,
|
120
|
+
},
|
121
|
+
}
|
109
122
|
}
|
110
123
|
|
111
124
|
module.exports = { getCSSVariableReferences }
|