@onereach/styles 3.1.0 → 3.1.1-beta.3176.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.
@@ -0,0 +1,197 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const values = {
4
+ 'primary': 'primary',
5
+ 'primary-dark': 'primary..-dark',
6
+
7
+ 'secondary': 'secondary',
8
+ 'secondary-dark': 'secondary..-dark',
9
+
10
+ 'tertiary': 'tertiary',
11
+ 'tertiary-dark': 'tertiary..-dark',
12
+
13
+ 'success': 'success',
14
+ 'success-dark': 'success..-dark',
15
+
16
+ 'warning': 'warning',
17
+ 'warning-dark': 'warning..-dark',
18
+
19
+ 'error': 'error',
20
+ 'error-dark': 'error..-dark',
21
+ };
22
+
23
+ module.exports = {
24
+ values,
25
+
26
+ plugin: plugin(({ matchUtilities, theme }) => {
27
+ matchUtilities({
28
+ 'theme-preset-1': (value) => {
29
+ const [token, suffix = ''] = value.split('..');
30
+
31
+ return {
32
+ color: theme(`textColor.on-${token}` + suffix),
33
+ backgroundColor: theme(`backgroundColor.${token}` + suffix),
34
+
35
+ borderStyle: 'none',
36
+ outlineStyle: 'none',
37
+
38
+ '&[disabled]': {
39
+ color: `${theme('textColor.on-disabled' + suffix)} !important`,
40
+ backgroundColor: `${theme('backgroundColor.disabled' + suffix)} !important`,
41
+ },
42
+
43
+ '&:not(.interactivity-none)': {
44
+ '&:active, &[force-state="active"]': {
45
+ backgroundColor: theme(`backgroundColor.${token}-hover` + suffix),
46
+ },
47
+
48
+ // Desktop
49
+ [`@media (min-width: ${theme('screens.md')})`]: {
50
+ '&:hover, &[force-state="hover"]': {
51
+ backgroundColor: theme(`backgroundColor.${token}-hover` + suffix),
52
+ },
53
+
54
+ '&:focus-visible, &[force-state="focus"]': {
55
+ backgroundColor: theme(`backgroundColor.${token}-hover` + suffix),
56
+ },
57
+
58
+ '&:active, &[force-state="active"]': {
59
+ backgroundColor: theme(`backgroundColor.${token}` + suffix),
60
+ },
61
+ },
62
+ },
63
+
64
+ transitionProperty: 'color, background-color, border-color, outline-color',
65
+ transitionDuration: theme('transitionDuration.short'),
66
+ transitionTimingFunction: theme('transitionTimingFunction.standard'),
67
+ };
68
+ },
69
+
70
+ 'theme-preset-2': (value) => {
71
+ const [token, suffix = ''] = value.split('..');
72
+
73
+ return {
74
+ color: theme(`textColor.${token}` + suffix),
75
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
76
+
77
+ borderStyle: 'none',
78
+ outlineStyle: 'none',
79
+
80
+ '&[disabled]': {
81
+ color: `${theme('textColor.on-disabled' + suffix)} !important`,
82
+ backgroundColor: `${theme('backgroundColor.disabled' + suffix)} !important`,
83
+ },
84
+
85
+ '&:not(.interactivity-none)': {
86
+ '&:active, &[force-state="active"]': {
87
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-12` + suffix),
88
+ },
89
+
90
+ // Desktop
91
+ [`@media (min-width: ${theme('screens.md')})`]: {
92
+ '&:hover, &[force-state="hover"]': {
93
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-12` + suffix),
94
+ },
95
+
96
+ '&:focus-visible, &[force-state="focus"]': {
97
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-12` + suffix),
98
+ },
99
+
100
+ '&:active, &[force-state="active"]': {
101
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-16` + suffix),
102
+ },
103
+ },
104
+ },
105
+
106
+ transitionProperty: 'color, background-color, border-color, outline-color',
107
+ transitionDuration: theme('transitionDuration.short'),
108
+ transitionTimingFunction: theme('transitionTimingFunction.standard'),
109
+ };
110
+ },
111
+
112
+ 'theme-preset-3': (value) => {
113
+ const [token, suffix = ''] = value.split('..');
114
+
115
+ return {
116
+ color: theme(`textColor.${token}` + suffix),
117
+ backgroundColor: 'transparent',
118
+
119
+ borderStyle: 'none',
120
+ outlineStyle: 'none',
121
+
122
+ '&[disabled]': {
123
+ color: `${theme('textColor.on-disabled' + suffix)} !important`,
124
+ backgroundColor: 'transparent !important',
125
+ },
126
+
127
+ '&:not(.interactivity-none)': {
128
+ '&:active, &[force-state="active"]': {
129
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
130
+ },
131
+
132
+ // Desktop
133
+ [`@media (min-width: ${theme('screens.md')})`]: {
134
+ '&:hover, &[force-state="hover"]': {
135
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
136
+ },
137
+
138
+ '&:focus-visible, &[force-state="focus"]': {
139
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
140
+ },
141
+
142
+ '&:active, &[force-state="active"]': {
143
+ backgroundColor: theme(`backgroundColor.${token}-opacity-0-16` + suffix),
144
+ },
145
+ },
146
+ },
147
+
148
+ transitionProperty: 'color, background-color, border-color, outline-color',
149
+ transitionDuration: theme('transitionDuration.short'),
150
+ transitionTimingFunction: theme('transitionTimingFunction.standard'),
151
+ };
152
+ },
153
+
154
+ 'theme-preset-4': (value) => {
155
+ const [token, suffix = ''] = value.split('..');
156
+
157
+ return {
158
+ color: theme(`textColor.${token}` + suffix),
159
+ backgroundColor: 'transparent',
160
+
161
+ borderStyle: 'none',
162
+ outlineStyle: 'none',
163
+
164
+ '&[disabled]': {
165
+ color: `${theme('textColor.on-disabled' + suffix)} !important`,
166
+ backgroundColor: 'transparent !important',
167
+ },
168
+
169
+ '&:not(.interactivity-none)': {
170
+ '&:active, &[force-state="active"]': {
171
+ color: theme(`textColor.${token}-hover` + suffix),
172
+ },
173
+
174
+ // Desktop
175
+ [`@media (min-width: ${theme('screens.md')})`]: {
176
+ '&:hover, &[force-state="hover"]': {
177
+ color: theme(`textColor.${token}-hover` + suffix),
178
+ },
179
+
180
+ '&:focus-visible, &[force-state="focus"]': {
181
+ color: theme(`textColor.${token}-hover` + suffix),
182
+ },
183
+
184
+ '&:active, &[force-state="active"]': {
185
+ color: theme(`textColor.${token}` + suffix),
186
+ },
187
+ },
188
+ },
189
+
190
+ transitionProperty: 'color, background-color, border-color, outline-color',
191
+ transitionDuration: theme('transitionDuration.short'),
192
+ transitionTimingFunction: theme('transitionTimingFunction.standard'),
193
+ };
194
+ },
195
+ }, { values });
196
+ }),
197
+ };
@@ -0,0 +1,58 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const values = {
4
+ 'display-large': 'display-large',
5
+ 'display-medium': 'display-medium',
6
+ 'display-small': 'display-small',
7
+
8
+ 'headline-1': 'headline-1',
9
+ 'headline-2': 'headline-2',
10
+ 'headline-3': 'headline-3',
11
+ 'headline-4': 'headline-4',
12
+
13
+ 'body-1-regular': 'body-1-regular',
14
+ 'body-1-semibold': 'body-1-semibold',
15
+ 'body-1-bold': 'body-1-bold',
16
+
17
+ 'body-2-regular': 'body-2-regular',
18
+ 'body-2-semibold': 'body-2-semibold',
19
+ 'body-2-bold': 'body-2-bold',
20
+
21
+ 'caption-regular': 'caption-regular',
22
+ 'caption-semibold': 'caption-semibold',
23
+ 'caption-bold': 'caption-bold',
24
+
25
+ 'button': 'button',
26
+
27
+ 'inherit': 'inherit',
28
+ };
29
+
30
+ module.exports = {
31
+ values,
32
+
33
+ plugin: plugin(({ matchUtilities, theme }) => {
34
+ matchUtilities({
35
+ 'typography': (value) => {
36
+ const fontSizeConfig = theme('fontSize');
37
+
38
+ const [fontSizeDesktop, optionsDesktop] = fontSizeConfig[value] ?? [];
39
+ const [fontSizeMobile, optionsMobile] = fontSizeConfig[`mobile-${value}`] ?? [];
40
+
41
+ return {
42
+ fontFamily: theme(`fontFamily.mobile-${value}`) ?? theme(`fontFamily.${value}`),
43
+ fontWeight: theme(`fontWeight.mobile-${value}`) ?? theme(`fontWeight.${value}`),
44
+ fontSize: fontSizeMobile ?? fontSizeDesktop,
45
+ lineHeight: optionsMobile?.lineHeight ?? optionsDesktop?.lineHeight,
46
+
47
+ // Desktop
48
+ [`@media (min-width: ${theme('screens.md')})`]: {
49
+ fontFamily: theme(`fontFamily.${value}`),
50
+ fontWeight: theme(`fontWeight.${value}`),
51
+ fontSize: fontSizeDesktop,
52
+ lineHeight: optionsDesktop?.lineHeight,
53
+ },
54
+ };
55
+ },
56
+ }, { values });
57
+ }),
58
+ };
@@ -3635,6 +3635,10 @@
3635
3635
  "content"
3636
3636
  ],
3637
3637
  "plugins": [
3638
+ {},
3639
+ {},
3640
+ {},
3641
+ {},
3638
3642
  {},
3639
3643
  {},
3640
3644
  {},