@umami/react-zen 0.255.0 → 1.0.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.
@@ -1,140 +0,0 @@
1
- import type { Config } from 'tailwindcss';
2
- import plugin from 'tailwindcss/plugin';
3
-
4
- /**
5
- * Tailwind CSS preset for @umami/react-zen
6
- *
7
- * Usage in your tailwind.config.ts:
8
- * ```ts
9
- * import zenPreset from '@umami/react-zen/tailwind-preset';
10
- *
11
- * export default {
12
- * presets: [zenPreset],
13
- * content: [
14
- * './src/**\/*.{ts,tsx}',
15
- * './node_modules/@umami/react-zen/dist/**\/*.{js,mjs}',
16
- * ],
17
- * } satisfies Config;
18
- * ```
19
- */
20
- const preset: Config = {
21
- darkMode: ['selector', '[data-theme="dark"], .dark'],
22
- theme: {
23
- extend: {
24
- keyframes: {
25
- spin: {
26
- to: { transform: 'rotate(360deg)' },
27
- },
28
- 'spinner-rotate': {
29
- '0%': { transform: 'rotate(0deg)' },
30
- '100%': { transform: 'rotate(360deg)' },
31
- },
32
- 'spinner-dash': {
33
- '0%': { strokeDasharray: '1, 200', strokeDashoffset: '0' },
34
- '50%': { strokeDasharray: '89, 200', strokeDashoffset: '-35' },
35
- '100%': { strokeDasharray: '89, 200', strokeDashoffset: '-124' },
36
- },
37
- 'icon-pop': {
38
- from: { transform: 'scale(0.5)', opacity: '0' },
39
- to: { transform: 'scale(1)', opacity: '1' },
40
- },
41
- },
42
- animation: {
43
- spin: 'spin 1s linear infinite',
44
- 'spinner-rotate': 'spinner-rotate 1.6s linear infinite',
45
- 'spinner-dash': 'spinner-dash 1.2s ease-in-out infinite',
46
- 'icon-pop': 'icon-pop 200ms ease-out',
47
- },
48
- fontFamily: {
49
- sans: 'var(--zen-font-family)',
50
- mono: 'var(--zen-font-family-mono)',
51
- },
52
- colors: {
53
- // Primary accent/brand color
54
- primary: {
55
- DEFAULT: 'var(--zen-primary)',
56
- fg: 'var(--zen-primary-fg)',
57
- },
58
- // Surface colors (backgrounds)
59
- surface: {
60
- DEFAULT: 'var(--zen-surface)',
61
- raised: 'var(--zen-surface-raised)',
62
- sunken: 'var(--zen-surface-sunken)',
63
- overlay: 'var(--zen-surface-overlay)',
64
- inverted: 'var(--zen-surface-inverted)',
65
- disabled: 'var(--zen-surface-disabled)',
66
- },
67
- // Text colors
68
- fg: {
69
- DEFAULT: 'var(--zen-fg)',
70
- muted: 'var(--zen-fg-muted)',
71
- disabled: 'var(--zen-fg-disabled)',
72
- },
73
- // Border colors
74
- edge: {
75
- DEFAULT: 'var(--zen-border)',
76
- muted: 'var(--zen-border-muted)',
77
- strong: 'var(--zen-border-strong)',
78
- },
79
- // Interactive state colors
80
- interactive: {
81
- DEFAULT: 'var(--zen-interactive-bg)',
82
- hover: 'var(--zen-interactive-bg-hover)',
83
- pressed: 'var(--zen-interactive-bg-pressed)',
84
- },
85
- // Focus colors
86
- focus: {
87
- ring: 'var(--zen-focus-ring)',
88
- offset: 'var(--zen-focus-offset)',
89
- },
90
- // Status colors
91
- status: {
92
- info: 'var(--zen-status-info)',
93
- 'info-bg': 'var(--zen-status-info-bg)',
94
- 'info-fg': 'var(--zen-status-info-fg)',
95
- success: 'var(--zen-status-success)',
96
- 'success-bg': 'var(--zen-status-success-bg)',
97
- 'success-fg': 'var(--zen-status-success-fg)',
98
- warning: 'var(--zen-status-warning)',
99
- 'warning-bg': 'var(--zen-status-warning-bg)',
100
- 'warning-fg': 'var(--zen-status-warning-fg)',
101
- error: 'var(--zen-status-error)',
102
- 'error-bg': 'var(--zen-status-error-bg)',
103
- 'error-fg': 'var(--zen-status-error-fg)',
104
- },
105
- },
106
- },
107
- },
108
- plugins: [
109
- plugin(({ addVariant }) => {
110
- // Data-attribute state variants emitted by Base UI parts.
111
- // `disabled`, `focus-visible`, `hover` and `active` are intentionally NOT
112
- // overridden so the native pseudo-classes keep working; use Tailwind's
113
- // built-in `data-disabled:` / `data-highlighted:` for non-native Base UI parts.
114
- addVariant('selected', '&[data-selected]');
115
- addVariant('indeterminate', '&[data-indeterminate]');
116
- addVariant('expanded', '&[data-expanded]');
117
- addVariant('readonly', '&[data-readonly]');
118
- addVariant('dragging', '&[data-dragging]');
119
- addVariant('outside-month', '&[data-outside-month]');
120
-
121
- // Placement variants for Popover/Tooltip
122
- addVariant('placement-top', "&[data-side='top']");
123
- addVariant('placement-bottom', "&[data-side='bottom']");
124
- addVariant('placement-left', "&[data-side='left']");
125
- addVariant('placement-right', "&[data-side='right']");
126
-
127
- // Orientation variants
128
- addVariant('orientation-horizontal', "&[data-orientation='horizontal']");
129
- addVariant('orientation-vertical', "&[data-orientation='vertical']");
130
-
131
- // Group variants for nested state selectors
132
- addVariant('group-selected', ':merge(.group)[data-selected] &');
133
- addVariant('group-disabled', ':merge(.group)[data-disabled] &');
134
- addVariant('group-expanded', ':merge(.group)[data-expanded] &');
135
- addVariant('group-indeterminate', ':merge(.group)[data-indeterminate] &');
136
- }),
137
- ],
138
- };
139
-
140
- export default preset;