@stateglyph/transitions 0.1.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/LICENSE +21 -0
- package/README.md +30 -0
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +19 -0
- package/dist/styles.css +82 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kamalveer Singh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @stateglyph/transitions
|
|
2
|
+
|
|
3
|
+
Optional, accessible CSS transitions for StateGlyph React icons.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @stateglyph/react @stateglyph/transitions
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Import the stylesheet once near the root of your application:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import "@stateglyph/transitions/styles.css";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
StateGlyph components expose their definition's transition through a
|
|
16
|
+
`data-transition` attribute, so no wrapper or per-icon class is required. The
|
|
17
|
+
stylesheet implements `crossfade`, `scale-fade`, `rotate`, `slide`, and
|
|
18
|
+
`morph`, plus continuous rotation for loading states.
|
|
19
|
+
|
|
20
|
+
You can customize timing with CSS custom properties:
|
|
21
|
+
|
|
22
|
+
```css
|
|
23
|
+
.status-icon {
|
|
24
|
+
--stateglyph-duration: 300ms;
|
|
25
|
+
--stateglyph-spin-duration: 1.2s;
|
|
26
|
+
--stateglyph-easing: ease-in-out;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
All animation is disabled when the user enables reduced motion.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
StateGlyph uses glyphs from [Lucide](https://lucide.dev/) through
|
|
4
|
+
`lucide-react`. Lucide is licensed under the ISC License. Some Lucide glyphs
|
|
5
|
+
are derived from Feather Icons and remain available under the MIT License.
|
|
6
|
+
|
|
7
|
+
## Lucide Icons
|
|
8
|
+
|
|
9
|
+
ISC License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
12
|
+
|
|
13
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
14
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
15
|
+
copyright notice and this permission notice appear in all copies.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
18
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
19
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
20
|
+
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
21
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
22
|
+
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
23
|
+
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
|
|
25
|
+
## Feather Icons
|
|
26
|
+
|
|
27
|
+
The following Lucide glyphs used by StateGlyph are derived from Feather Icons:
|
|
28
|
+
`check`, `chevron-down`, `chevron-left`, `chevron-right`, `chevron-up`,
|
|
29
|
+
`download`, `maximize`, `minimize`, `minimize-2`, `pause`, `sidebar`,
|
|
30
|
+
`trash-2`, `upload`, and `x`.
|
|
31
|
+
|
|
32
|
+
The MIT License (MIT)
|
|
33
|
+
|
|
34
|
+
Copyright (c) 2013-present Cole Bemis
|
|
35
|
+
|
|
36
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
37
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
38
|
+
in the Software without restriction, including without limitation the rights
|
|
39
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
40
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
41
|
+
furnished to do so, subject to the following conditions:
|
|
42
|
+
|
|
43
|
+
The above copyright notice and this permission notice shall be included in all
|
|
44
|
+
copies or substantial portions of the Software.
|
|
45
|
+
|
|
46
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
47
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
48
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
49
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
50
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
51
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
52
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const stateGlyphTransitions: readonly ["crossfade", "scale-fade", "rotate", "slide", "morph"];
|
|
2
|
+
type StateGlyphTransitionName = (typeof stateGlyphTransitions)[number];
|
|
3
|
+
declare const stateGlyphTransitionDurations: {
|
|
4
|
+
crossfade: string;
|
|
5
|
+
"scale-fade": string;
|
|
6
|
+
rotate: string;
|
|
7
|
+
slide: string;
|
|
8
|
+
morph: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { type StateGlyphTransitionName, stateGlyphTransitionDurations, stateGlyphTransitions };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var stateGlyphTransitions = [
|
|
3
|
+
"crossfade",
|
|
4
|
+
"scale-fade",
|
|
5
|
+
"rotate",
|
|
6
|
+
"slide",
|
|
7
|
+
"morph"
|
|
8
|
+
];
|
|
9
|
+
var stateGlyphTransitionDurations = {
|
|
10
|
+
crossfade: "180ms",
|
|
11
|
+
"scale-fade": "200ms",
|
|
12
|
+
rotate: "240ms",
|
|
13
|
+
slide: "220ms",
|
|
14
|
+
morph: "240ms"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
stateGlyphTransitionDurations,
|
|
18
|
+
stateGlyphTransitions
|
|
19
|
+
};
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
:where([data-state-icon][data-transition]) {
|
|
2
|
+
transform-box: fill-box;
|
|
3
|
+
transform-origin: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-state-icon][data-transition="crossfade"] {
|
|
7
|
+
animation: stateglyph-crossfade var(--stateglyph-duration, 180ms)
|
|
8
|
+
var(--stateglyph-easing, ease-out) both;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-state-icon][data-transition="scale-fade"] {
|
|
12
|
+
animation: stateglyph-scale-fade var(--stateglyph-duration, 200ms)
|
|
13
|
+
var(--stateglyph-easing, cubic-bezier(0.22, 1, 0.36, 1)) both;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-state-icon][data-transition="rotate"] {
|
|
17
|
+
animation: stateglyph-rotate var(--stateglyph-duration, 240ms)
|
|
18
|
+
var(--stateglyph-easing, cubic-bezier(0.22, 1, 0.36, 1)) both;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-state-icon][data-transition="slide"] {
|
|
22
|
+
animation: stateglyph-slide var(--stateglyph-duration, 220ms)
|
|
23
|
+
var(--stateglyph-easing, cubic-bezier(0.22, 1, 0.36, 1)) both;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-state-icon][data-transition="morph"] {
|
|
27
|
+
animation: stateglyph-morph var(--stateglyph-duration, 240ms)
|
|
28
|
+
var(--stateglyph-easing, cubic-bezier(0.22, 1, 0.36, 1)) both;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-state-icon][data-state-continuous="true"] {
|
|
32
|
+
animation: stateglyph-spin var(--stateglyph-spin-duration, 900ms) linear
|
|
33
|
+
infinite;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@keyframes stateglyph-crossfade {
|
|
37
|
+
from {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes stateglyph-scale-fade {
|
|
43
|
+
from {
|
|
44
|
+
opacity: 0;
|
|
45
|
+
transform: scale(0.82);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes stateglyph-rotate {
|
|
50
|
+
from {
|
|
51
|
+
opacity: 0;
|
|
52
|
+
transform: rotate(-35deg) scale(0.9);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes stateglyph-slide {
|
|
57
|
+
from {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
transform: translateY(18%);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes stateglyph-morph {
|
|
64
|
+
from {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
filter: blur(2px);
|
|
67
|
+
transform: scale(0.9) rotate(-8deg);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@keyframes stateglyph-spin {
|
|
72
|
+
to {
|
|
73
|
+
transform: rotate(360deg);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (prefers-reduced-motion: reduce) {
|
|
78
|
+
[data-state-icon][data-transition],
|
|
79
|
+
[data-state-icon][data-state-continuous="true"] {
|
|
80
|
+
animation: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stateglyph/transitions",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CSS transitions for StateGlyph React icons.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Kamalveer Singh",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"icons",
|
|
9
|
+
"css",
|
|
10
|
+
"transitions",
|
|
11
|
+
"animation",
|
|
12
|
+
"accessibility"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/kamalhara/StateGlyph.git",
|
|
17
|
+
"directory": "packages/transitions"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/kamalhara/StateGlyph#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/kamalhara/StateGlyph/issues"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"./dist/styles.css"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./styles.css": "./dist/styles.css"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"THIRD_PARTY_NOTICES.md"
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsup src/index.ts --format esm --dts --clean && cp src/styles.css dist/styles.css",
|
|
47
|
+
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
48
|
+
"prepack": "node ../../scripts/sync-package-legal-files.mjs",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"prepublishOnly": "npm run build"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.19.0"
|
|
54
|
+
}
|
|
55
|
+
}
|