@aziontech/theme 1.6.0 → 1.8.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 CHANGED
@@ -364,7 +364,7 @@ export { tokenRef } from './build/refs.js';
364
364
  export { resolveRefsToCssVars } from './build/resolve.js';
365
365
  export { createCssVars, cssVarsString, injectCssVars } from './build/css-vars.js';
366
366
  export { preset } from './build/preset.js';
367
- export { tokenUtilities } from './build/tailwind-plugin.js';
367
+ export { tokenUtilities } from './build/tailwind-plugin';
368
368
  ```
369
369
 
370
370
  ## Token Resolution
@@ -425,7 +425,7 @@ packages/theme/
425
425
  │ └── build/ # Build utilities
426
426
  │ ├── preset.js
427
427
  │ ├── css-vars.js
428
- │ └── tailwind-plugin.js
428
+ │ └── tailwind-plugin
429
429
  └── package.json
430
430
  ```
431
431
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aziontech/theme",
3
3
  "type": "module",
4
- "version": "1.6.0",
4
+ "version": "1.8.0",
5
5
  "author": "aziontech",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -58,11 +58,12 @@
58
58
  "./tokens/semantic/borders": "./tokens.js",
59
59
  "./tokens/build/preset": "./src/tokens/build/preset.js",
60
60
  "./tokens/build/tailwind-helper": "./src/tokens/build/tailwind-helper.js",
61
- "./tokens/build/tailwind-plugin": "./src/tokens/build/tailwind-plugin.js",
61
+ "./tokens/build/tailwind-plugin": "./src/tokens/build/tailwind-plugin",
62
62
  "./tokens/build/css-vars.js": "./src/tokens/build/css-vars.js",
63
- "./tailwind/tailwind-theme.js": "./src/tailwind/tailwind-theme.js",
64
- "./tailwind/semantic-colors-plugin.js": "./src/tailwind/semantic-colors-plugin.js",
65
- "./tailwind/semantic-texts-plugin.js": "./src/tailwind/semantic-texts-plugin.js",
66
- "./tailwind/semantic-spacing-plugin.js": "./src/tailwind/semantic-spacing-plugin.js"
63
+ "./tailwind/tailwind-theme": "./src/tailwind/tailwind-theme.js",
64
+ "./tailwind/semantic-colors-plugin": "./src/tailwind/semantic-colors-plugin.js",
65
+ "./tailwind/semantic-texts-plugin": "./src/tailwind/semantic-texts-plugin.js",
66
+ "./tailwind/semantic-spacing-plugin": "./src/tailwind/semantic-spacing-plugin.js",
67
+ "./tailwind/semantic-animations-plugin": "./src/tailwind/semantic-animations-plugin.js"
67
68
  }
68
69
  }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Tailwind plugin to expose semantic animations and keyframes.
3
+ *
4
+ * This adds animation utilities and keyframes for common UI animations.
5
+ *
6
+ * Usage in tailwind.config.js:
7
+ * ```javascript
8
+ * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
+ * import semanticAnimations from '@aziontech/theme/tailwind/semantic-animations-plugin';
10
+ *
11
+ * export default {
12
+ * theme,
13
+ * plugins: [semanticAnimations()],
14
+ * };
15
+ * ```
16
+ */
17
+
18
+ // Lazy-require to avoid hard dependency for consumers
19
+ const plugin = (() => {
20
+ try {
21
+ return require('tailwindcss/plugin');
22
+ } catch {
23
+ return (handler) => handler;
24
+ }
25
+ })();
26
+
27
+ /**
28
+ * Generate semantic animation utilities and keyframes
29
+ * @returns {import('tailwindcss/plugin').Plugin}
30
+ */
31
+ export const semanticAnimations = () => {
32
+ return plugin(({ addUtilities, addComponents, theme }) => {
33
+ // Animation utilities
34
+ const animations = {
35
+ '.animate-fade-in': {
36
+ animation: 'fadeIn 220ms ease-in-out',
37
+ },
38
+ '.animate-fade-out': {
39
+ animation: 'fadeOut 220ms ease-in-out',
40
+ },
41
+ '.animate-slide-down': {
42
+ animation: 'slideDown 220ms ease-in-out',
43
+ },
44
+ '.animate-blink': {
45
+ animation: 'blink 1s step-end infinite',
46
+ },
47
+ '.animate-highlight-fade': {
48
+ animation: 'highlight ease-in forwards',
49
+ },
50
+ };
51
+
52
+ // Keyframes components
53
+ const keyframes = {
54
+ '@keyframes fadeIn': {
55
+ '0%': { opacity: '0' },
56
+ '100%': { opacity: '1' },
57
+ },
58
+ '@keyframes fadeOut': {
59
+ '0%': { opacity: '1' },
60
+ '100%': { opacity: '0' },
61
+ },
62
+ '@keyframes slideDown': {
63
+ '0%': { height: '0' },
64
+ '100%': { height: 'auto' },
65
+ },
66
+ '@keyframes blink': {
67
+ '0%, 100%': { opacity: '1' },
68
+ '50%': { opacity: '0' },
69
+ },
70
+ '@keyframes highlight': {
71
+ '0%': { backgroundColor: 'var(--surface-hover)', fontWeight: '500' },
72
+ '100%': { backgroundColor: 'var(--surface-hover)', fontWeight: '500' },
73
+ },
74
+ };
75
+
76
+ const variants = ['responsive', 'hover', 'focus', 'active', 'motion-safe', 'motion-reduce'];
77
+ addUtilities(animations, variants);
78
+ addComponents(keyframes);
79
+ });
80
+ };
81
+
82
+ export default semanticAnimations;
@@ -6,7 +6,7 @@
6
6
  * Usage in tailwind.config.js:
7
7
  * ```javascript
8
8
  * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
- * import semanticColors from '@aziontech/theme/tailwind/semantic-colors-plugin.js';
9
+ * import semanticColors from '@aziontech/theme/tailwind/semantic-colors-plugin';
10
10
  *
11
11
  * export default {
12
12
  * theme,
@@ -6,7 +6,7 @@
6
6
  * Usage in tailwind.config.js:
7
7
  * ```javascript
8
8
  * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
- * import semanticSpacing from '@aziontech/theme/tailwind/semantic-spacing-plugin.js';
9
+ * import semanticSpacing from '@aziontech/theme/tailwind/semantic-spacing-plugin';
10
10
  *
11
11
  * export default {
12
12
  * theme,
@@ -6,7 +6,7 @@
6
6
  * Usage in tailwind.config.js:
7
7
  * ```javascript
8
8
  * import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
9
- * import semanticTexts from '@aziontech/theme/tailwind/semantic-texts-plugin.js';
9
+ * import semanticTexts from '@aziontech/theme/tailwind/semantic-texts-plugin';
10
10
  *
11
11
  * export default {
12
12
  * theme,