winduum 0.6.0 → 0.7.0-next.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/dist/main.css +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +1 -1
- package/plugin/tailwind.cjs +198 -163
- package/plugin/tailwind.d.ts +19 -0
- package/plugin/tailwind.js +30 -184
- package/plugin/utilities/color.js +69 -0
- package/plugin/utilities/common.js +80 -0
- package/plugin/utilities/divide-gap.js +20 -0
- package/plugin/utilities/dot.js +11 -0
- package/plugin/utilities/flex.js +12 -0
- package/src/base/defaults.css +1 -1
- package/src/base/theme/default.css +0 -2
- package/src/components/compare.css +10 -11
- package/src/components/dialog/content.css +1 -1
- package/src/components/dialog/default.css +9 -7
- package/src/components/field.css +1 -1
- package/src/ui/badge/bordered.css +4 -3
- package/src/ui/badge/default.css +7 -11
- package/src/ui/badge/muted.css +2 -2
- package/src/ui/btn/bordered.css +6 -5
- package/src/ui/btn/default.css +17 -11
- package/src/ui/btn/ghosted.css +4 -4
- package/src/ui/btn/gradient-bordered.css +9 -7
- package/src/ui/btn/gradient.css +3 -1
- package/src/ui/btn/hover-fill.css +4 -4
- package/src/ui/btn/interactive.css +17 -9
- package/src/ui/btn/loading.css +1 -1
- package/src/ui/btn/muted.css +4 -4
- package/src/ui/btn/raised.css +6 -10
- package/src/ui/check/default.css +38 -24
- package/src/ui/control/default.css +38 -14
- package/src/ui/control/file.css +11 -8
- package/src/ui/control/select.css +2 -2
- package/src/ui/group/default.css +9 -4
- package/src/ui/info.css +1 -1
- package/src/ui/link/interactive.css +5 -7
- package/src/ui/notice/default.css +15 -6
- package/src/ui/progress/default.css +6 -7
- package/src/ui/range/default-props.css +3 -3
- package/src/ui/range/default.css +48 -35
- package/src/ui/range/multi.css +12 -33
- package/src/ui/range/vertical.css +3 -4
- package/src/ui/switch/default.css +32 -24
- package/src/ui/text/default.css +5 -5
- package/src/ui/title/default.css +1 -1
- package/src/utilities/ripple.css +4 -1
- package/src/utilities/skeleton.css +6 -4
- package/tailwind.config.js +5 -1
package/plugin/tailwind.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import plugin from 'tailwindcss/plugin'
|
|
2
|
-
import withAlphaVariable from 'tailwindcss/src/util/withAlphaVariable'
|
|
3
2
|
import flattenColorPalette from 'tailwindcss/src/util/flattenColorPalette'
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import FlexUtility from './utilities/flex.js'
|
|
4
|
+
import DotUtility from './utilities/dot.js'
|
|
5
|
+
import divideGap from './utilities/divide-gap.js'
|
|
6
|
+
import { accentColor, textColor } from './utilities/color.js'
|
|
7
|
+
import { tailwindAnimations, tailwindColors, tailwindPropertyUtilities, tailwindVariables, tailwindVariablesFont } from './utilities/common.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {import('./tailwind').PluginOptions} options.
|
|
11
|
+
*/
|
|
6
12
|
export const defaultConfig = {
|
|
7
13
|
colors: [
|
|
8
|
-
'primary', 'accent',
|
|
14
|
+
'primary', 'accent',
|
|
9
15
|
'warning', 'error', 'info', 'success', 'light', 'dark',
|
|
10
16
|
'main', 'main-primary', 'main-secondary', 'main-tertiary',
|
|
11
17
|
'body', 'body-primary', 'body-secondary', 'body-tertiary',
|
|
@@ -17,7 +23,7 @@ export const defaultConfig = {
|
|
|
17
23
|
fontFamily: ['primary', 'secondary'],
|
|
18
24
|
fontWeight: ['light', 'normal', 'medium', 'semibold', 'bold', 'extrabold'],
|
|
19
25
|
ease: ['linear', 'in', 'out', 'in-out'],
|
|
20
|
-
zIndex: [10, 20, 30, 40, 50, 60],
|
|
26
|
+
zIndex: ['10', '20', '30', '40', '50', '60'],
|
|
21
27
|
fontSize: ['xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', '3xl', '4xl', '5xl', '6xl', '7xl', '7xl', '8xl', '9xl'],
|
|
22
28
|
spacing: ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'],
|
|
23
29
|
borderRadius: ['xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', 'full'],
|
|
@@ -41,202 +47,40 @@ export const defaultConfig = {
|
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
colors[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
colors[name] = defaultConfig.settings.colorMix
|
|
51
|
-
? `color-mix(in var(--space), var(--color-${name}) calc(<alpha-value> * 100%), transparent)`
|
|
52
|
-
: `rgb(var(--color-${name}) / <alpha-value>)`
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
return colors
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const tailwindVariables = (type, variables = [], values = {}) => {
|
|
59
|
-
variables.forEach(name => {
|
|
60
|
-
values[name] = `var(--${type}-${name})`
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
return values
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const tailwindVariablesFont = (type, variables = [], values = {}) => {
|
|
67
|
-
variables.forEach(name => {
|
|
68
|
-
values[name] = [`var(--${type}-${name})`, `calc(var(--${type}-${name}) + 0.5rem)`]
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
return values
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const tailwindPropertyUtilities = (type, variables = []) => {
|
|
75
|
-
const result = {}
|
|
76
|
-
|
|
77
|
-
variables.forEach(name => {
|
|
78
|
-
result[`.${type}-${name}`] = {
|
|
79
|
-
[type]: `var(--${type}-${name})`
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
return result
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const tailwindAnimations = (values) => {
|
|
87
|
-
const result = {}
|
|
88
|
-
|
|
89
|
-
values.forEach(value => {
|
|
90
|
-
result[`.animation-${value}`] = {
|
|
91
|
-
'animation-name': value
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
return result
|
|
96
|
-
}
|
|
97
|
-
|
|
50
|
+
/**
|
|
51
|
+
* @param {import('./tailwind').PluginOptions} userConfig
|
|
52
|
+
*/
|
|
98
53
|
export const createPlugin = (userConfig = {}) => {
|
|
54
|
+
const settings = {
|
|
55
|
+
...defaultConfig.settings,
|
|
56
|
+
...userConfig.settings
|
|
57
|
+
}
|
|
58
|
+
|
|
99
59
|
userConfig = {
|
|
100
60
|
...defaultConfig,
|
|
101
|
-
...userConfig
|
|
61
|
+
...userConfig,
|
|
62
|
+
settings
|
|
102
63
|
}
|
|
103
64
|
|
|
104
|
-
return plugin(({
|
|
65
|
+
return plugin(({ addComponents, matchUtilities, theme, e, corePlugins }) => {
|
|
105
66
|
matchUtilities(
|
|
106
67
|
{
|
|
107
|
-
accent:
|
|
108
|
-
const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
|
|
109
|
-
const fallbackRgb = matchValue && matchValue[0].includes('-rgb')
|
|
110
|
-
|
|
111
|
-
const colorProperties = {}
|
|
112
|
-
|
|
113
|
-
if (fallbackRgb) {
|
|
114
|
-
colorProperties['--color-accent-rgb'] = matchValue[0]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if ((matchValue && matchValue[0] === 'var(--color-accent)') || (matchValue && matchValue[0] === 'var(--color-accent-rgb)')) {
|
|
118
|
-
return {
|
|
119
|
-
'accent-color': matchValue && toColorValue(value).includes('calc(1 * 100%)') ? matchValue[0] : toColorValue(value)
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (matchValue) {
|
|
124
|
-
if (fallbackRgb) {
|
|
125
|
-
colorProperties['--color-accent-foreground-rgb'] = `var(${matchValue[1].replace('-rgb', '-foreground-rgb')})`
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (toColorValue(value).includes('calc(1 * 100%)') || toColorValue(value).includes(' / 1')) {
|
|
129
|
-
return {
|
|
130
|
-
...colorProperties,
|
|
131
|
-
'--color-accent': fallbackRgb ? toColorValue(value) : matchValue[0],
|
|
132
|
-
'--color-accent-foreground': fallbackRgb ? `rgb(var(${matchValue[1].replace('-rgb', '-foreground-rgb')}, var(--color-light-rgb)))` : `var(${matchValue[1]}-foreground, var(--color-light))`,
|
|
133
|
-
'accent-color': defaultConfig.settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
return {
|
|
137
|
-
...colorProperties,
|
|
138
|
-
'--color-accent': toColorValue(value),
|
|
139
|
-
'--color-accent-foreground': fallbackRgb ? `rgb(var(${matchValue[1].replace('-rgb', '-foreground-rgb')}, var(--color-light-rgb)))` : `var(${matchValue[1]}-foreground, var(--color-light))`,
|
|
140
|
-
'accent-color': defaultConfig.settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
'--color-accent': toColorValue(value),
|
|
147
|
-
'accent-color': 'var(--color-accent)'
|
|
148
|
-
}
|
|
149
|
-
}
|
|
68
|
+
accent: value => accentColor({ value }, userConfig.settings)
|
|
150
69
|
},
|
|
151
70
|
{ values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] }
|
|
152
71
|
)
|
|
153
72
|
matchUtilities(
|
|
154
73
|
{
|
|
155
|
-
text:
|
|
156
|
-
const matchValue = toColorValue(value).match(/var\((.*?)\)/)
|
|
157
|
-
const fallbackRgb = matchValue && matchValue[0].includes('-rgb')
|
|
158
|
-
|
|
159
|
-
const colorProperties = {}
|
|
160
|
-
|
|
161
|
-
if (fallbackRgb) {
|
|
162
|
-
colorProperties['--color-current-rgb'] = matchValue[0]
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if ((matchValue && matchValue[0] === 'var(--color-current)') || (matchValue && matchValue[0] === 'var(--color-current-rgb)')) {
|
|
166
|
-
return {
|
|
167
|
-
color: toColorValue(value)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const color = {
|
|
172
|
-
...withAlphaVariable({
|
|
173
|
-
color: value,
|
|
174
|
-
property: 'color',
|
|
175
|
-
variable: '--tw-text-opacity'
|
|
176
|
-
})
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (!corePlugins('textOpacity')) {
|
|
180
|
-
return {
|
|
181
|
-
...colorProperties,
|
|
182
|
-
'--color-current': toColorValue(value),
|
|
183
|
-
...color
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return {
|
|
188
|
-
...colorProperties,
|
|
189
|
-
...withAlphaVariable({
|
|
190
|
-
color: value,
|
|
191
|
-
property: '--color-current',
|
|
192
|
-
variable: '--tw-text-opacity'
|
|
193
|
-
}),
|
|
194
|
-
...color
|
|
195
|
-
}
|
|
196
|
-
}
|
|
74
|
+
text: value => textColor({ value, corePlugins }, userConfig.settings)
|
|
197
75
|
},
|
|
198
76
|
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
|
|
199
77
|
)
|
|
200
78
|
addComponents(tailwindAnimations(userConfig.animations))
|
|
201
79
|
addComponents(tailwindPropertyUtilities('mask', userConfig.mask))
|
|
202
|
-
addComponents(
|
|
203
|
-
Object.entries(theme('spacing')).map(([key, value]) => {
|
|
204
|
-
return {
|
|
205
|
-
[`.${e(`divide-gap-x-${key}`)}`]: {
|
|
206
|
-
'& > :where(*:not(:first-child))': {
|
|
207
|
-
paddingLeft: value,
|
|
208
|
-
marginLeft: value
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
[`.${e(`divide-gap-y-${key}`)}`]: {
|
|
212
|
-
'& > :where(*:not(:first-child))': {
|
|
213
|
-
paddingTop: value,
|
|
214
|
-
marginTop: value
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
})
|
|
219
|
-
])
|
|
80
|
+
addComponents(divideGap({ theme, e }))
|
|
220
81
|
addComponents({
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
alignItems: 'center',
|
|
224
|
-
gap: 'var(--spacing-sm)'
|
|
225
|
-
},
|
|
226
|
-
'.flex-between': {
|
|
227
|
-
display: 'flex',
|
|
228
|
-
justifyContent: 'space-between',
|
|
229
|
-
gap: 'var(--spacing-sm)'
|
|
230
|
-
},
|
|
231
|
-
'.dot': {
|
|
232
|
-
'--tw-bg-opacity': '1',
|
|
233
|
-
display: 'inline-flex',
|
|
234
|
-
width: '0.625rem',
|
|
235
|
-
height: '0.625rem',
|
|
236
|
-
borderRadius: 'var(--rounded-full)',
|
|
237
|
-
backgroundColor: 'color-mix(in srgb, var(--color-accent) calc(var(--tw-bg-opacity) * 100%), transparent)',
|
|
238
|
-
flexShrink: '0'
|
|
239
|
-
}
|
|
82
|
+
...FlexUtility,
|
|
83
|
+
...DotUtility
|
|
240
84
|
})
|
|
241
85
|
}, {
|
|
242
86
|
corePlugins: {
|
|
@@ -253,7 +97,7 @@ export const createPlugin = (userConfig = {}) => {
|
|
|
253
97
|
DEFAULT: 'var(--duration)'
|
|
254
98
|
},
|
|
255
99
|
transitionTimingFunction: tailwindVariables('ease', userConfig.ease),
|
|
256
|
-
colors: tailwindColors(userConfig.colors),
|
|
100
|
+
colors: tailwindColors(userConfig.colors, settings.colorMix, settings.rgb),
|
|
257
101
|
fontSize: tailwindVariablesFont('text', userConfig.fontSize),
|
|
258
102
|
fontFamily: tailwindVariables('font', userConfig.fontFamily),
|
|
259
103
|
fontWeight: tailwindVariables('font', userConfig.fontWeight),
|
|
@@ -271,4 +115,6 @@ export const createPlugin = (userConfig = {}) => {
|
|
|
271
115
|
})
|
|
272
116
|
}
|
|
273
117
|
|
|
118
|
+
export { tailwindAnimations, tailwindColors, tailwindPropertyUtilities, tailwindVariables, tailwindVariablesFont }
|
|
119
|
+
|
|
274
120
|
export default createPlugin
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import withAlphaVariable from 'tailwindcss/src/util/withAlphaVariable'
|
|
2
|
+
import toColorValue from 'tailwindcss/src/util/toColorValue'
|
|
3
|
+
|
|
4
|
+
export const accentColor = ({ value }, settings) => {
|
|
5
|
+
const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
|
|
6
|
+
const colorProperties = {}
|
|
7
|
+
|
|
8
|
+
if (matchValue) {
|
|
9
|
+
if (settings.rgb) {
|
|
10
|
+
colorProperties['--color-accent-rgb'] =
|
|
11
|
+
`var(${matchValue[1].includes('-rgb') ? matchValue[1] : matchValue[1] + '-rgb'})`
|
|
12
|
+
colorProperties['--color-accent-foreground-rgb'] =
|
|
13
|
+
`var(${matchValue[1].includes('-rgb') ? matchValue[1].replace('-rgb', '-foreground-rgb') : matchValue[1] + '-foreground-rgb, var(--color-light-rgb)'})`
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (toColorValue(value).includes('calc(1 * 100%)') || toColorValue(value).includes(' / 1')) {
|
|
17
|
+
colorProperties['--color-accent'] = matchValue[0].replace('-rgb', '')
|
|
18
|
+
colorProperties['--color-accent-foreground'] = `var(${matchValue[1].replace('-rgb', '')}-foreground, var(--color-light))`
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
...colorProperties,
|
|
22
|
+
'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
if (matchValue[1].includes('-rgb')) {
|
|
26
|
+
colorProperties['--color-accent'] = toColorValue(value)
|
|
27
|
+
} else {
|
|
28
|
+
colorProperties['--color-accent'] = settings.rgb ? `rgb(var(--color-accent-rgb) / ${toColorValue(value).match(/calc\((.*?)\)/)[0]})` : toColorValue(value)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
colorProperties['--color-accent-foreground'] = settings.rgb ? 'rgb(var(--color-accent-foreground-rgb))' : `var(${matchValue[1]}-foreground, var(--color-light))`
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
...colorProperties,
|
|
35
|
+
'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
'--color-accent': toColorValue(value),
|
|
42
|
+
'accent-color': 'var(--color-accent)'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const textColor = ({ value, corePlugins }, settings) => {
|
|
47
|
+
const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
|
|
48
|
+
const withCurrentRgb = {}
|
|
49
|
+
|
|
50
|
+
if (matchValue && settings.rgb) {
|
|
51
|
+
withCurrentRgb['--tw-text-current-rgb'] = matchValue[1].includes('rgb') ? matchValue[0] : `var(${matchValue[1]}-rgb)`
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!corePlugins('textOpacity')) {
|
|
55
|
+
return {
|
|
56
|
+
...withCurrentRgb,
|
|
57
|
+
color: toColorValue(value)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
...withCurrentRgb,
|
|
63
|
+
...withAlphaVariable({
|
|
64
|
+
color: value,
|
|
65
|
+
property: 'color',
|
|
66
|
+
variable: '--tw-text-opacity'
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {[]} colors
|
|
3
|
+
* @param {boolean} colorMix
|
|
4
|
+
* @param {boolean} rgb
|
|
5
|
+
* @returns {[]}
|
|
6
|
+
*/
|
|
7
|
+
export const tailwindColors = (colors = [], colorMix = true, rgb = false) => {
|
|
8
|
+
colors.forEach(name => {
|
|
9
|
+
if (rgb) {
|
|
10
|
+
colors[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
colors[name] = colorMix
|
|
14
|
+
? `color-mix(in var(--space), var(--color-${name}) calc(<alpha-value> * 100%), transparent)`
|
|
15
|
+
: `rgb(var(--color-${name}) / <alpha-value>)`
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
return colors
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} type
|
|
23
|
+
* @param {string[]} variables
|
|
24
|
+
* @param {Object} values
|
|
25
|
+
* @returns {Object}
|
|
26
|
+
*/
|
|
27
|
+
export const tailwindVariables = (type, variables = [], values = {}) => {
|
|
28
|
+
variables.forEach(name => {
|
|
29
|
+
values[name] = `var(--${type}-${name})`
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
return values
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} type
|
|
37
|
+
* @param {string[]} variables
|
|
38
|
+
* @param {Object} values
|
|
39
|
+
* @returns {Object}
|
|
40
|
+
*/
|
|
41
|
+
export const tailwindVariablesFont = (type, variables = [], values = {}) => {
|
|
42
|
+
variables.forEach(name => {
|
|
43
|
+
values[name] = [`var(--${type}-${name})`, `calc(var(--${type}-${name}) + 0.5rem)`]
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
return values
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} type
|
|
51
|
+
* @param {string[]} variables
|
|
52
|
+
* @returns {Object}
|
|
53
|
+
*/
|
|
54
|
+
export const tailwindPropertyUtilities = (type, variables = []) => {
|
|
55
|
+
const result = {}
|
|
56
|
+
|
|
57
|
+
variables.forEach(name => {
|
|
58
|
+
result[`.${type}-${name}`] = {
|
|
59
|
+
[type]: `var(--${type}-${name})`
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
return result
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @param {string[]} values
|
|
68
|
+
* @returns {Object}
|
|
69
|
+
*/
|
|
70
|
+
export const tailwindAnimations = (values) => {
|
|
71
|
+
const result = {}
|
|
72
|
+
|
|
73
|
+
values.forEach(value => {
|
|
74
|
+
result[`.animation-${value}`] = {
|
|
75
|
+
'animation-name': value
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
return result
|
|
80
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default function divideGap ({ theme, e }) {
|
|
2
|
+
return [
|
|
3
|
+
...Object.entries(theme('spacing')).map(([key, value]) => {
|
|
4
|
+
return {
|
|
5
|
+
[`.${e(`divide-gap-x-${key}`)}`]: {
|
|
6
|
+
'& > :where(*:not(:first-child))': {
|
|
7
|
+
paddingLeft: value,
|
|
8
|
+
marginLeft: value
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
[`.${e(`divide-gap-y-${key}`)}`]: {
|
|
12
|
+
'& > :where(*:not(:first-child))': {
|
|
13
|
+
paddingTop: value,
|
|
14
|
+
marginTop: value
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'.dot': {
|
|
3
|
+
'--tw-bg-opacity': '1',
|
|
4
|
+
display: 'inline-flex',
|
|
5
|
+
width: '0.625rem',
|
|
6
|
+
height: '0.625rem',
|
|
7
|
+
borderRadius: 'var(--rounded-full)',
|
|
8
|
+
backgroundColor: 'color-mix(in srgb, var(--color-accent) calc(var(--tw-bg-opacity) * 100%), transparent)',
|
|
9
|
+
flexShrink: '0'
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/base/defaults.css
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
:where(hr) {
|
|
34
34
|
--tw-border-opacity: 1;
|
|
35
35
|
|
|
36
|
-
border-
|
|
36
|
+
border-block-start: 1px solid color-mix(in var(--space), currentColor calc(var(--tw-border-opacity) * 100%), transparent);
|
|
37
37
|
border-radius: var(--rounded);
|
|
38
38
|
width: 100%;
|
|
39
39
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
:root, :host {
|
|
2
2
|
--space: sRGB;
|
|
3
3
|
--scheme: light;
|
|
4
|
-
--color-current: var(--color-main);
|
|
5
|
-
--color-current-foreground: var(--color-main-foreground);
|
|
6
4
|
--color-accent: var(--color-primary);
|
|
7
5
|
--color-accent-foreground: var(--color-primary-foreground);
|
|
8
6
|
--color-primary: #3b82f6; /* color.blue.500 */
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
border-radius: inherit;
|
|
8
8
|
|
|
9
9
|
> *, &::before {
|
|
10
|
-
grid-area: 1/1;
|
|
11
10
|
position: relative;
|
|
12
|
-
z-index: 1;
|
|
13
11
|
pointer-events: none;
|
|
12
|
+
grid-area: 1/1;
|
|
13
|
+
z-index: 1;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&::before {
|
|
17
|
-
content: "";
|
|
18
|
-
inline-size: 1px;
|
|
19
17
|
background-color: var(--color-accent);
|
|
20
18
|
inset-inline-start: var(--c-compare-position);
|
|
19
|
+
inline-size: 1px;
|
|
20
|
+
content: "";
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
> :where(input) {
|
|
@@ -27,15 +27,14 @@
|
|
|
27
27
|
|
|
28
28
|
&:is(:focus-visible, :active) {
|
|
29
29
|
~ .ui-btn {
|
|
30
|
-
--ui-btn-
|
|
31
|
-
--
|
|
32
|
-
--ui-btn-bg-opacity: 80%;
|
|
30
|
+
--tw-bg-mix: var(--ui-btn-hover-bg-mix, var(--color-dark));
|
|
31
|
+
--tw-bg-opacity: 0.8;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
&:focus-visible ~ .ui-btn {
|
|
37
|
-
outline-
|
|
38
|
-
outline-
|
|
36
|
+
--ui-btn-outline-offset: 2px;
|
|
37
|
+
--tw-outline-opacity: 0.5;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
&:active {
|
|
@@ -44,9 +43,9 @@
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
> :where(.ui-btn) {
|
|
47
|
-
margin-block: auto;
|
|
48
46
|
inset-inline-start: var(--c-compare-position);
|
|
49
47
|
margin-inline-start: calc(var(--ui-btn-width) / 2 * -1);
|
|
48
|
+
margin-block: auto;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
> :where(.ui-image) {
|
|
@@ -59,8 +58,8 @@
|
|
|
59
58
|
grid-area: 1/1;
|
|
60
59
|
|
|
61
60
|
&:first-child {
|
|
62
|
-
position: relative;
|
|
63
61
|
clip-path: var(--c-compare-clip-path);
|
|
62
|
+
position: relative;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
background-color: var(--color-body-primary);
|
|
3
3
|
border-radius: var(--rounded-3xl);
|
|
4
4
|
padding: var(--c-dialog-py) var(--c-dialog-px);
|
|
5
|
-
|
|
5
|
+
inline-size: min(100%, var(--c-dialog-width, 35rem));
|
|
6
6
|
margin: auto;
|
|
7
7
|
animation: var(--duration) ease 0s backwards 1 fade-in-down;
|
|
8
8
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
.c-dialog {
|
|
2
2
|
--tw-bg-opacity: 0.8;
|
|
3
|
+
--tw-bg-space: var(--space);
|
|
3
4
|
|
|
5
|
+
|
|
6
|
+
z-index: var(--z-30);
|
|
7
|
+
padding: var(--c-dialog-py) var(--c-dialog-px);
|
|
8
|
+
background-color: color-mix(in var(--tw-bg-space), var(--c-dialog-bg, var(--color-dark)) var(--c-dialog-bg-opacity, calc(var(--tw-bg-opacity) * 100%)), transparent);
|
|
9
|
+
transition: var(--transition-background);
|
|
10
|
+
display: flex;
|
|
4
11
|
position: fixed;
|
|
5
12
|
inset: 0;
|
|
6
|
-
z-index: var(--z-30);
|
|
7
13
|
overflow: auto;
|
|
8
|
-
-webkit-overflow-scrolling: touch;
|
|
9
|
-
background-color: var(--c-dialog-bg, color-mix(in var(--space), var(--color-dark) var(--c-dialog-bg-opacity, calc(var(--tw-bg-opacity) * 100%)), transparent));
|
|
10
14
|
overscroll-behavior: contain;
|
|
11
|
-
|
|
12
|
-
padding: var(--c-dialog-py) var(--c-dialog-px);
|
|
13
|
-
transition: var(--transition-background);
|
|
15
|
+
-webkit-overflow-scrolling: touch;
|
|
14
16
|
|
|
15
17
|
&, &::backdrop {
|
|
16
18
|
visibility: hidden;
|
|
@@ -23,8 +25,8 @@
|
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
html:has(.c-dialog.visible) {
|
|
26
|
-
scrollbar-width: none;
|
|
27
28
|
padding-inline-end: var(--c-dialog-scrollbar-width, 0);
|
|
29
|
+
scrollbar-width: none;
|
|
28
30
|
|
|
29
31
|
&::-webkit-scrollbar {
|
|
30
32
|
display: none;
|
package/src/components/field.css
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
.ui-badge {
|
|
2
2
|
&:where(.bordered) {
|
|
3
3
|
--tw-border-opacity: 1;
|
|
4
|
+
--tw-border-space: var(--space);
|
|
4
5
|
|
|
5
|
-
border: var(--ui-badge-border-width, 1px) solid color-mix(in var(--space), var(--color-accent) calc(var(--tw-border-opacity) * 100%), transparent);
|
|
6
|
+
border: var(--ui-badge-border-width, 1px) solid color-mix(in var(--tw-border-space), var(--color-accent) calc(var(--tw-border-opacity) * 100%), transparent);
|
|
6
7
|
padding-inline: calc(var(--ui-badge-px) - var(--ui-badge-border-width, 1px));
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
&:is(.bordered) {
|
|
10
|
-
--color-
|
|
11
|
-
--
|
|
11
|
+
--color-accent-foreground: var(--color-accent);
|
|
12
|
+
--tw-bg-opacity: 0;
|
|
12
13
|
}
|
|
13
14
|
}
|
package/src/ui/badge/default.css
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
.ui-badge {
|
|
2
2
|
--tw-bg-opacity: 1;
|
|
3
3
|
--tw-text-opacity: 1;
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--ui-badge-color: color-mix(in var(--space), var(--color-current) var(--ui-badge-color-opacity), transparent);
|
|
8
|
-
--ui-badge-color-opacity: calc(var(--tw-text-opacity) * 100%);
|
|
4
|
+
--tw-bg-mix: transparent;
|
|
5
|
+
--tw-bg-space: var(--space);
|
|
6
|
+
--tw-text-space: var(--space);
|
|
9
7
|
|
|
10
|
-
width: var(--ui-badge-width
|
|
8
|
+
width: var(--ui-badge-width);
|
|
11
9
|
height: var(--ui-badge-height);
|
|
12
10
|
padding: var(--ui-badge-py) var(--ui-badge-px);
|
|
13
11
|
border-radius: var(--ui-badge-border-radius, var(--rounded-lg));
|
|
@@ -15,15 +13,13 @@
|
|
|
15
13
|
font-weight: var(--ui-badge-font-weight, inherit);
|
|
16
14
|
font-size: var(--ui-badge-font-size, var(--text-xs));
|
|
17
15
|
letter-spacing: var(--ui-badge-letter-spacing, inherit);
|
|
18
|
-
background-color: var(--
|
|
19
|
-
color: var(--
|
|
16
|
+
background-color: color-mix(in var(--tw-bg-space), var(--color-accent) calc(var(--tw-bg-opacity) * 100%), var(--tw-bg-mix));
|
|
17
|
+
color: color-mix(in var(--tw-text-space), var(--color-accent-foreground) calc(var(--tw-text-opacity) * 100%), transparent);
|
|
20
18
|
gap: var(--ui-badge-gap, var(--spacing-xs));
|
|
21
19
|
display: inline-flex;
|
|
22
20
|
text-align: center;
|
|
23
21
|
align-items: center;
|
|
24
22
|
justify-content: center;
|
|
25
|
-
|
|
23
|
+
line-height: 1;
|
|
26
24
|
flex-shrink: 0;
|
|
27
|
-
position: relative;
|
|
28
|
-
transition: var(--transition-opacity);
|
|
29
25
|
}
|
package/src/ui/badge/muted.css
CHANGED