winduum 2.2.8 → 2.2.10

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.
Files changed (101) hide show
  1. package/package.json +13 -14
  2. package/plugin/index.cjs +219 -217
  3. package/plugin/index.js +94 -94
  4. package/plugin/utilities/color.js +52 -50
  5. package/plugin/utilities/common.js +60 -60
  6. package/plugin/utilities/divide-gap.js +19 -19
  7. package/plugin/utilities/dot.js +10 -10
  8. package/src/base/defaults.css +1 -1
  9. package/src/base/reset.css +4 -1
  10. package/src/common.js +6 -6
  11. package/src/components/badge/props/default.css +2 -1
  12. package/src/components/breadcrumb/default.css +2 -1
  13. package/src/components/breadcrumb/props/default.css +2 -1
  14. package/src/components/button/interactive.css +3 -1
  15. package/src/components/button/props/default.css +2 -1
  16. package/src/components/button/props/interactive.css +2 -1
  17. package/src/components/card/props/default.css +2 -1
  18. package/src/components/carousel/content.css +2 -1
  19. package/src/components/carousel/index.js +128 -126
  20. package/src/components/check/default.css +1 -1
  21. package/src/components/check/props/default.css +4 -3
  22. package/src/components/color/default.css +2 -1
  23. package/src/components/color/interactive.css +2 -1
  24. package/src/components/color/props/default.css +3 -2
  25. package/src/components/compare/default.css +2 -1
  26. package/src/components/compare/index.js +9 -9
  27. package/src/components/control/icon.css +4 -2
  28. package/src/components/control/interactive.css +2 -1
  29. package/src/components/control/props/color.css +2 -1
  30. package/src/components/control/props/default.css +5 -4
  31. package/src/components/control/props/floating.css +2 -1
  32. package/src/components/control/props/icon.css +2 -1
  33. package/src/components/control/props/select-picker.css +4 -3
  34. package/src/components/control/props/select.css +2 -1
  35. package/src/components/control/select-picker.css +4 -2
  36. package/src/components/control/select.css +1 -1
  37. package/src/components/details/index.js +39 -38
  38. package/src/components/dialog/default.css +2 -1
  39. package/src/components/dialog/index.d.ts +1 -1
  40. package/src/components/dialog/index.js +42 -40
  41. package/src/components/dialog/props/content.css +2 -1
  42. package/src/components/dialog/props/default.css +2 -1
  43. package/src/components/drawer/default.css +2 -1
  44. package/src/components/drawer/index.d.ts +2 -0
  45. package/src/components/drawer/index.js +46 -31
  46. package/src/components/drawer/props/content.css +2 -1
  47. package/src/components/drawer/props/default.css +2 -1
  48. package/src/components/form/index.js +83 -80
  49. package/src/components/heading/props/default.css +2 -1
  50. package/src/components/info/props/default.css +2 -1
  51. package/src/components/label/props/default.css +2 -1
  52. package/src/components/link/props/default.css +2 -1
  53. package/src/components/notice/props/default.css +2 -1
  54. package/src/components/popover/content.css +4 -2
  55. package/src/components/popover/index.js +45 -44
  56. package/src/components/popover/props/content.css +2 -1
  57. package/src/components/progress/props/default.css +2 -1
  58. package/src/components/range/index.js +37 -37
  59. package/src/components/range/props/default.css +2 -1
  60. package/src/components/rating/default.css +1 -1
  61. package/src/components/rating/props/default.css +2 -1
  62. package/src/components/switch/props/default.css +4 -3
  63. package/src/components/table/interactive.css +10 -5
  64. package/src/components/table/props/default.css +2 -1
  65. package/src/components/tabs/index.js +5 -5
  66. package/src/components/text/props/default.css +2 -1
  67. package/src/components/title/props/default.css +2 -1
  68. package/src/components/toast/index.js +25 -25
  69. package/src/components/toast/props/content.css +2 -1
  70. package/src/components/toast/props/default.css +2 -1
  71. package/src/components/toaster/index.js +3 -3
  72. package/src/components/toaster/props/default.css +2 -1
  73. package/src/components/tooltip/default.css +4 -2
  74. package/src/components/tooltip/props/default.css +2 -1
  75. package/src/theme/config/font.css +2 -1
  76. package/src/theme/config/radius.css +2 -1
  77. package/src/theme/config/spacing.css +2 -1
  78. package/src/theme/config/transition.css +2 -1
  79. package/src/theme/config/z.css +2 -1
  80. package/src/theme/dark-rgb.css +2 -1
  81. package/src/theme/dark.css +2 -1
  82. package/src/theme/default-p3.css +2 -1
  83. package/src/theme/default-rgb.css +3 -2
  84. package/src/theme/default.css +3 -2
  85. package/src/utilities/container/props/default.css +2 -1
  86. package/src/utilities/divider.css +5 -3
  87. package/src/utilities/dot.css +1 -1
  88. package/src/utilities/ripple/index.js +13 -13
  89. package/src/utilities/skeleton/props/default.css +2 -1
  90. package/src/utilities/spinner/default.css +4 -4
  91. package/src/utilities/spinner/ring.css +1 -1
  92. package/src/utilities/swap/index.js +4 -4
  93. package/tailwind.config.js +16 -17
  94. package/tailwindcss/base/defaults.css +3 -2
  95. package/tailwindcss/theme/config/transition.css +2 -1
  96. package/tailwindcss/theme/default.css +1 -1
  97. package/tailwindcss/utilities/divider.css +4 -2
  98. package/tailwindcss/utilities/dot.css +1 -1
  99. package/tailwindcss/utilities/spinner.css +5 -5
  100. package/types/index.d.ts +3 -1
  101. package/types/index.d.ts.map +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winduum",
3
- "version": "2.2.8",
3
+ "version": "2.2.10",
4
4
  "type": "module",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "plugin/index.cjs",
@@ -9,38 +9,37 @@
9
9
  "dev": "vite --host",
10
10
  "build": "vite build",
11
11
  "build-prod": "vite build -c vite.config.prod.js",
12
- "eslint": "eslint 'src/**/*.js'",
13
- "eslint-fix": "eslint 'src/**/*.js' --fix",
14
- "stylelint": "npx stylelint 'src/**/*.css'",
15
- "stylelint-fix": "npx stylelint 'src/**/*.css' --fix",
12
+ "eslint": "eslint",
13
+ "eslint-fix": "eslint --fix",
14
+ "stylelint": "npx stylelint '**/*.css'",
15
+ "stylelint-fix": "npx stylelint '**/*.css' --fix",
16
16
  "plugin": "rollup plugin/index.js --file plugin/index.cjs -f cjs --exports named",
17
17
  "tsc": "tsc",
18
18
  "dts": "node dts.js",
19
19
  "publish-next": "npm publish --tag next"
20
20
  },
21
21
  "devDependencies": {
22
+ "@eslint/js": "^9.32.0",
22
23
  "@floating-ui/dom": "^1.7.2",
23
- "@stylistic/stylelint-config": "^2.0.0",
24
- "@tailwindcss/container-queries": "^0.1.1",
24
+ "@stylistic/eslint-plugin": "^5.2.2",
25
+ "@stylistic/stylelint-config": "^3.0.1",
25
26
  "@tailwindcss/vite": "^4.1.11",
26
- "@vitejs/plugin-vue": "^6.0.0",
27
+ "@vitejs/plugin-vue": "^6.0.1",
27
28
  "autoprefixer": "^10.4.21",
28
29
  "dts-buddy": "^0.6.2",
29
- "eslint": "^9.30.1",
30
+ "eslint": "^9.32.0",
30
31
  "fast-glob": "^3.3.3",
31
- "neostandard": "^0.12.2",
32
32
  "postcss": "^8.5.6",
33
33
  "postcss-custom-media": "^11.0.6",
34
34
  "postcss-import": "^16.1.1",
35
35
  "postcss-nesting": "^13.0.2",
36
36
  "slide-element": "^2.3.1",
37
- "stylelint": "^16.21.1",
37
+ "stylelint": "^16.22.0",
38
38
  "stylelint-config-standard": "^38.0.0",
39
39
  "tailwindcss": "^4.1.11",
40
- "tailwindcss-animate": "^1.0.7",
41
40
  "typescript": "^5",
42
- "vite": "^7.0.3",
43
- "vue": "^3.5.17"
41
+ "vite": "^7.0.6",
42
+ "vue": "^3.5.18"
44
43
  },
45
44
  "files": [
46
45
  "index.js",
package/plugin/index.cjs CHANGED
@@ -12,91 +12,93 @@ const node_path = require('node:path')
12
12
 
13
13
  const _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null
14
14
  function divideGap({ theme, e }) {
15
- return [
16
- ...Object.entries(theme('spacing')).map(([key, value]) => {
17
- return {
18
- [`.${e(`divide-gap-x-${key}`)}`]: {
19
- '& > :where(*:not(:first-child))': {
20
- paddingLeft: value,
21
- marginLeft: value
22
- }
23
- },
24
- [`.${e(`divide-gap-y-${key}`)}`]: {
25
- '& > :where(*:not(:first-child))': {
26
- paddingTop: value,
27
- marginTop: value
28
- }
29
- }
30
- }
31
- })
32
- ]
15
+ return [
16
+ ...Object.entries(theme('spacing')).map(([key, value]) => {
17
+ return {
18
+ [`.${e(`divide-gap-x-${key}`)}`]: {
19
+ '& > :where(*:not(:first-child))': {
20
+ paddingLeft: value,
21
+ marginLeft: value,
22
+ },
23
+ },
24
+ [`.${e(`divide-gap-y-${key}`)}`]: {
25
+ '& > :where(*:not(:first-child))': {
26
+ paddingTop: value,
27
+ marginTop: value,
28
+ },
29
+ },
30
+ }
31
+ }),
32
+ ]
33
33
  }
34
34
 
35
35
  const accentColor = ({ value }, settings) => {
36
- const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
37
- const colorProperties = {}
36
+ const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
37
+ const colorProperties = {}
38
38
 
39
- if (matchValue) {
40
- if (settings.rgb) {
41
- colorProperties['--color-accent-rgb']
39
+ if (matchValue) {
40
+ if (settings.rgb) {
41
+ colorProperties['--color-accent-rgb']
42
42
  = `var(${matchValue[1].includes('-rgb') ? matchValue[1] : matchValue[1] + '-rgb'})`
43
- colorProperties['--color-accent-foreground-rgb']
43
+ colorProperties['--color-accent-foreground-rgb']
44
44
  = `var(${matchValue[1].includes('-rgb') ? matchValue[1].replace('-rgb', '-foreground-rgb') : matchValue[1] + '-foreground-rgb, var(--color-light-rgb)'})`
45
- }
46
-
47
- if (toColorValue(value).includes('calc(1 * 100%)') || toColorValue(value).includes(' / 1')) {
48
- colorProperties['--color-accent'] = matchValue[0].replace('-rgb', '')
49
- colorProperties['--color-accent-foreground'] = `var(${matchValue[1].replace('-rgb', '')}-foreground, var(--color-light))`
50
-
51
- return {
52
- ...colorProperties,
53
- 'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
54
- }
55
- } else {
56
- if (matchValue[1].includes('-rgb')) {
57
- colorProperties['--color-accent'] = toColorValue(value)
58
- } else {
59
- colorProperties['--color-accent'] = settings.rgb ? `rgb(var(--color-accent-rgb) / ${toColorValue(value).match(/calc\((.*?)\)/)[0]})` : toColorValue(value)
60
- }
61
-
62
- colorProperties['--color-accent-foreground'] = settings.rgb ? 'rgb(var(--color-accent-foreground-rgb))' : `var(${matchValue[1]}-foreground, var(--color-light))`
63
-
64
- return {
65
- ...colorProperties,
66
- 'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
67
- }
68
- }
69
45
  }
70
46
 
71
- return {
72
- '--color-accent': toColorValue(value),
73
- 'accent-color': 'var(--color-accent)'
47
+ if (toColorValue(value).includes('calc(1 * 100%)') || toColorValue(value).includes(' / 1')) {
48
+ colorProperties['--color-accent'] = matchValue[0].replace('-rgb', '')
49
+ colorProperties['--color-accent-foreground'] = `var(${matchValue[1].replace('-rgb', '')}-foreground, var(--color-light))`
50
+
51
+ return {
52
+ ...colorProperties,
53
+ 'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))',
54
+ }
55
+ }
56
+ else {
57
+ if (matchValue[1].includes('-rgb')) {
58
+ colorProperties['--color-accent'] = toColorValue(value)
59
+ }
60
+ else {
61
+ colorProperties['--color-accent'] = settings.rgb ? `rgb(var(--color-accent-rgb) / ${toColorValue(value).match(/calc\((.*?)\)/)[0]})` : toColorValue(value)
62
+ }
63
+
64
+ colorProperties['--color-accent-foreground'] = settings.rgb ? 'rgb(var(--color-accent-foreground-rgb))' : `var(${matchValue[1]}-foreground, var(--color-light))`
65
+
66
+ return {
67
+ ...colorProperties,
68
+ 'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))',
69
+ }
74
70
  }
71
+ }
72
+
73
+ return {
74
+ '--color-accent': toColorValue(value),
75
+ 'accent-color': 'var(--color-accent)',
76
+ }
75
77
  }
76
78
 
77
79
  const textColor = ({ value, corePlugins }, settings) => {
78
- const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
79
- const withCurrentRgb = {}
80
-
81
- if (matchValue && settings.rgb) {
82
- withCurrentRgb['--tw-text-current-rgb'] = matchValue[1].includes('rgb') ? matchValue[0] : `var(${matchValue[1]}-rgb)`
83
- }
80
+ const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
81
+ const withCurrentRgb = {}
84
82
 
85
- if (!corePlugins('textOpacity')) {
86
- return {
87
- ...withCurrentRgb,
88
- color: toColorValue(value)
89
- }
90
- }
83
+ if (matchValue && settings.rgb) {
84
+ withCurrentRgb['--tw-text-current-rgb'] = matchValue[1].includes('rgb') ? matchValue[0] : `var(${matchValue[1]}-rgb)`
85
+ }
91
86
 
87
+ if (!corePlugins('textOpacity')) {
92
88
  return {
93
- ...withCurrentRgb,
94
- ...withAlphaVariable({
95
- color: value,
96
- property: 'color',
97
- variable: '--tw-text-opacity'
98
- })
89
+ ...withCurrentRgb,
90
+ color: toColorValue(value),
99
91
  }
92
+ }
93
+
94
+ return {
95
+ ...withCurrentRgb,
96
+ ...withAlphaVariable({
97
+ color: value,
98
+ property: 'color',
99
+ variable: '--tw-text-opacity',
100
+ }),
101
+ }
100
102
  }
101
103
 
102
104
  /**
@@ -106,21 +108,21 @@ const textColor = ({ value, corePlugins }, settings) => {
106
108
  * @returns {Object}
107
109
  */
108
110
  const tailwindColors = (colors = [], colorMix = true, rgb = false) => {
109
- const result = {
110
- current: 'color-mix(in var(--default-color-space), currentcolor calc(<alpha-value> * 100%), var(--default-color-mix, transparent))'
111
- }
111
+ const result = {
112
+ current: 'color-mix(in var(--default-color-space), currentcolor calc(<alpha-value> * 100%), var(--default-color-mix, transparent))',
113
+ }
112
114
 
113
- colors.forEach((name) => {
114
- if (rgb) {
115
- result[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
116
- }
115
+ colors.forEach((name) => {
116
+ if (rgb) {
117
+ result[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
118
+ }
117
119
 
118
- result[name] = colorMix
119
- ? `color-mix(in var(--default-color-space), var(--color-${name}) calc(<alpha-value> * 100%), var(--default-color-mix, transparent))`
120
- : `rgb(var(--color-${name}) / <alpha-value>)`
121
- })
120
+ result[name] = colorMix
121
+ ? `color-mix(in var(--default-color-space), var(--color-${name}) calc(<alpha-value> * 100%), var(--default-color-mix, transparent))`
122
+ : `rgb(var(--color-${name}) / <alpha-value>)`
123
+ })
122
124
 
123
- return result
125
+ return result
124
126
  }
125
127
 
126
128
  /**
@@ -130,46 +132,46 @@ const tailwindColors = (colors = [], colorMix = true, rgb = false) => {
130
132
  * @returns {Object}
131
133
  */
132
134
  const tailwindVariables = (type, variables = [], values = {}) => {
133
- if (!Array.isArray(variables)) {
134
- return values
135
- }
135
+ if (!Array.isArray(variables)) {
136
+ return values
137
+ }
136
138
 
137
- variables.forEach((name) => {
138
- values[name] = `var(--${type}-${name.replace(/\./g, '_')})`
139
- })
139
+ variables.forEach((name) => {
140
+ values[name] = `var(--${type}-${name.replace(/\./g, '_')})`
141
+ })
140
142
 
141
- return values
143
+ return values
142
144
  }
143
145
 
144
146
  const tailwindParseVariables = (type, file, customValues = {}, customPath, initialValues = true) => {
145
- const parseFile = (fileContent) => {
146
- const regex = /(--[\w-]+):\s*([^;]+);/g
147
- const matches = [...fileContent.matchAll(regex)]
148
- const variables = matches.map(match => [match[1], match[2]])
149
- const values = {}
147
+ const parseFile = (fileContent) => {
148
+ const regex = /(--[\w-]+):\s*([^;]+);/g
149
+ const matches = [...fileContent.matchAll(regex)]
150
+ const variables = matches.map(match => [match[1], match[2]])
151
+ const values = {}
150
152
 
151
- variables.forEach((match, index) => {
152
- if (!match[0].startsWith(`--${type}-`) || match[0].endsWith('--line-height')) {
153
- return
154
- }
153
+ variables.forEach((match, index) => {
154
+ if (!match[0].startsWith(`--${type}-`) || match[0].endsWith('--line-height')) {
155
+ return
156
+ }
155
157
 
156
- const name = match[0].replace(`--${type}-`, '')
158
+ const name = match[0].replace(`--${type}-`, '')
157
159
 
158
- values[name.replace(/_/g, '.')] = type === 'font-size' ? [`var(${match})`, `var(${variables[index + 1]})`] : `var(${initialValues ? match : match[0]})`
159
- })
160
+ values[name.replace(/_/g, '.')] = type === 'font-size' ? [`var(${match})`, `var(${variables[index + 1]})`] : `var(${initialValues ? match : match[0]})`
161
+ })
160
162
 
161
- return values
162
- }
163
+ return values
164
+ }
163
165
 
164
- const fileContent = node_fs.readFileSync(file).toString()
165
- const values = parseFile(fileContent)
166
+ const fileContent = node_fs.readFileSync(file).toString()
167
+ const values = parseFile(fileContent)
166
168
 
167
- if (customPath && !Array.isArray(customPath)) {
168
- const customFileContent = node_fs.readFileSync(node_path.resolve(process.cwd(), customPath)).toString()
169
- customValues = { ...customValues, ...parseFile(customFileContent) }
170
- }
169
+ if (customPath && !Array.isArray(customPath)) {
170
+ const customFileContent = node_fs.readFileSync(node_path.resolve(process.cwd(), customPath)).toString()
171
+ customValues = { ...customValues, ...parseFile(customFileContent) }
172
+ }
171
173
 
172
- return { ...values, ...customValues }
174
+ return { ...values, ...customValues }
173
175
  }
174
176
 
175
177
  /**
@@ -179,11 +181,11 @@ const tailwindParseVariables = (type, file, customValues = {}, customPath, initi
179
181
  * @returns {Object}
180
182
  */
181
183
  const tailwindVariablesFont = (type, variables = [], values = {}) => {
182
- variables.forEach(({ value, initial }) => {
183
- values[value] = [`var(--${type}-${value}, ${initial})`, `calc(var(--${type}-${value}) + 0.5rem)`]
184
- })
184
+ variables.forEach(({ value, initial }) => {
185
+ values[value] = [`var(--${type}-${value}, ${initial})`, `calc(var(--${type}-${value}) + 0.5rem)`]
186
+ })
185
187
 
186
- return values
188
+ return values
187
189
  }
188
190
 
189
191
  /**
@@ -192,15 +194,15 @@ const tailwindVariablesFont = (type, variables = [], values = {}) => {
192
194
  * @returns {Object}
193
195
  */
194
196
  const tailwindPropertyUtilities = (type, variables = []) => {
195
- const result = {}
197
+ const result = {}
196
198
 
197
- variables.forEach((name) => {
198
- result[`.${type}-${name}`] = {
199
- [type]: `var(--${type}-${name})`
200
- }
201
- })
199
+ variables.forEach((name) => {
200
+ result[`.${type}-${name}`] = {
201
+ [type]: `var(--${type}-${name})`,
202
+ }
203
+ })
202
204
 
203
- return result
205
+ return result
204
206
  }
205
207
 
206
208
  /**
@@ -208,15 +210,15 @@ const tailwindPropertyUtilities = (type, variables = []) => {
208
210
  * @returns {Object}
209
211
  */
210
212
  const tailwindAnimations = (values) => {
211
- const result = {}
213
+ const result = {}
212
214
 
213
- values.forEach((value) => {
214
- result[`.animation-${value}`] = {
215
- 'animation-name': value
216
- }
217
- })
215
+ values.forEach((value) => {
216
+ result[`.animation-${value}`] = {
217
+ 'animation-name': value,
218
+ }
219
+ })
218
220
 
219
- return result
221
+ return result
220
222
  }
221
223
 
222
224
  const relativePath = file => node_path.resolve(node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), file)
@@ -225,103 +227,103 @@ const relativePath = file => node_path.resolve(node_path.dirname(node_url.fileUR
225
227
  * @type {import('./').PluginOptions} options.
226
228
  */
227
229
  const defaultConfig = {
228
- animations: ['ripple', 'spin', 'move-indeterminate', 'fade-in', 'fade-out'],
229
- screens: {
230
- 'xs': '22.5rem',
231
- 'sm': '26rem',
232
- 'md': '46.5rem',
233
- 'lg': '60rem',
234
- 'xl': '76rem',
235
- '2xl': '82rem',
236
- '3xl': '88rem',
237
- '4xl': '100rem',
238
- 'xxl': '126rem',
239
- '2xxl': '158rem'
240
- },
241
- settings: {
242
- rgb: false,
243
- colorMix: true
244
- }
230
+ animations: ['ripple', 'spin', 'move-indeterminate', 'fade-in', 'fade-out'],
231
+ screens: {
232
+ 'xs': '22.5rem',
233
+ 'sm': '26rem',
234
+ 'md': '46.5rem',
235
+ 'lg': '60rem',
236
+ 'xl': '76rem',
237
+ '2xl': '82rem',
238
+ '3xl': '88rem',
239
+ '4xl': '100rem',
240
+ 'xxl': '126rem',
241
+ '2xxl': '158rem',
242
+ },
243
+ settings: {
244
+ rgb: false,
245
+ colorMix: true,
246
+ },
245
247
  }
246
248
 
247
249
  /**
248
250
  * @param {import('./').PluginOptions} userConfig
249
251
  */
250
252
  const createPlugin = (userConfig = {}) => {
251
- const settings = {
252
- ...defaultConfig.settings,
253
- ...userConfig.settings
254
- }
255
-
256
- userConfig = {
257
- ...defaultConfig,
258
- ...userConfig,
259
- settings
260
- }
261
-
262
- return plugin(({ addComponents, matchUtilities, theme, e, corePlugins }) => {
263
- matchUtilities(
264
- {
265
- accent: value => accentColor({ value }, userConfig.settings)
266
- },
267
- { values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] }
268
- )
269
- matchUtilities(
270
- {
271
- text: value => textColor({ value, corePlugins }, userConfig.settings)
272
- },
273
- { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
274
- )
275
- addComponents(tailwindAnimations(userConfig.animations))
276
- addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', relativePath('../src/theme/config/mask.css'), {
277
- ...tailwindVariables('mask', userConfig.mask ?? [])
278
- }, userConfig.mask, false))))
279
- addComponents(divideGap({ theme, e }))
280
- }, {
281
- corePlugins: {
282
- preflight: false,
283
- textColor: false,
284
- accentColor: false
253
+ const settings = {
254
+ ...defaultConfig.settings,
255
+ ...userConfig.settings,
256
+ }
257
+
258
+ userConfig = {
259
+ ...defaultConfig,
260
+ ...userConfig,
261
+ settings,
262
+ }
263
+
264
+ return plugin(({ addComponents, matchUtilities, theme, e, corePlugins }) => {
265
+ matchUtilities(
266
+ {
267
+ accent: value => accentColor({ value }, userConfig.settings),
268
+ },
269
+ { values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] },
270
+ )
271
+ matchUtilities(
272
+ {
273
+ text: value => textColor({ value, corePlugins }, userConfig.settings),
274
+ },
275
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] },
276
+ )
277
+ addComponents(tailwindAnimations(userConfig.animations))
278
+ addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', relativePath('../src/theme/config/mask.css'), {
279
+ ...tailwindVariables('mask', userConfig.mask ?? []),
280
+ }, userConfig.mask, false))))
281
+ addComponents(divideGap({ theme, e }))
282
+ }, {
283
+ corePlugins: {
284
+ preflight: false,
285
+ textColor: false,
286
+ accentColor: false,
287
+ },
288
+ theme: {
289
+ extend: {
290
+ transitionProperty: {
291
+ DEFAULT: 'var(--default-transition-property)',
285
292
  },
286
- theme: {
287
- extend: {
288
- transitionProperty: {
289
- DEFAULT: 'var(--default-transition-property)'
290
- },
291
- transitionDuration: {
292
- DEFAULT: 'var(--default-transition-duration)'
293
- },
294
- transitionTimingFunction: tailwindParseVariables('ease', relativePath('../src/theme/config/transition.css'), {
295
- ...tailwindVariables('ease', userConfig.ease ?? [])
296
- }, userConfig.ease),
297
- colors: tailwindColors(Object.keys(tailwindParseVariables('color', relativePath('../src/theme/default.css'), {
298
- ...tailwindVariables('color', userConfig.colors ?? [])
299
- }, userConfig.colors)), settings.colorMix, settings.rgb),
300
- fontSize: tailwindParseVariables('text', relativePath('../src/theme/config/font.css'), {
301
- ...tailwindVariables('text', userConfig.fontSize ?? [])
302
- }, userConfig.fontSize),
303
- fontFamily: tailwindParseVariables('font', relativePath('../src/theme/config/font.css'), {
304
- ...tailwindVariables('font', userConfig.fontFamily ?? [])
305
- }, userConfig.fontFamily),
306
- fontWeight: tailwindParseVariables('font-weight', relativePath('../src/theme/config/font.css'), {
307
- ...tailwindVariables('font-weight', userConfig.fontWeight ?? [])
308
- }, userConfig.fontWeight),
309
- zIndex: tailwindParseVariables('z-index', relativePath('../src/theme/config/z.css'), {
310
- ...tailwindVariables('z-index', userConfig.zIndex ?? []),
311
- 0: 0,
312
- auto: 'auto'
313
- }, userConfig.zIndex),
314
- spacing: tailwindParseVariables('spacing', relativePath('../src/theme/config/spacing.css'), {
315
- ...tailwindVariables('spacing', userConfig.spacing ?? [])
316
- }, userConfig.spacing),
317
- borderRadius: tailwindParseVariables('radius', relativePath('../src/theme/config/radius.css'), {
318
- ...tailwindVariables('radius', userConfig.borderRadius ?? []),
319
- DEFAULT: 'var(--radius-xl)'
320
- }, userConfig.borderRadius),
321
- screens: userConfig.screens
322
- }
323
- }
324
- })
293
+ transitionDuration: {
294
+ DEFAULT: 'var(--default-transition-duration)',
295
+ },
296
+ transitionTimingFunction: tailwindParseVariables('ease', relativePath('../src/theme/config/transition.css'), {
297
+ ...tailwindVariables('ease', userConfig.ease ?? []),
298
+ }, userConfig.ease),
299
+ colors: tailwindColors(Object.keys(tailwindParseVariables('color', relativePath('../src/theme/default.css'), {
300
+ ...tailwindVariables('color', userConfig.colors ?? []),
301
+ }, userConfig.colors)), settings.colorMix, settings.rgb),
302
+ fontSize: tailwindParseVariables('text', relativePath('../src/theme/config/font.css'), {
303
+ ...tailwindVariables('text', userConfig.fontSize ?? []),
304
+ }, userConfig.fontSize),
305
+ fontFamily: tailwindParseVariables('font', relativePath('../src/theme/config/font.css'), {
306
+ ...tailwindVariables('font', userConfig.fontFamily ?? []),
307
+ }, userConfig.fontFamily),
308
+ fontWeight: tailwindParseVariables('font-weight', relativePath('../src/theme/config/font.css'), {
309
+ ...tailwindVariables('font-weight', userConfig.fontWeight ?? []),
310
+ }, userConfig.fontWeight),
311
+ zIndex: tailwindParseVariables('z-index', relativePath('../src/theme/config/z.css'), {
312
+ ...tailwindVariables('z-index', userConfig.zIndex ?? []),
313
+ 0: 0,
314
+ auto: 'auto',
315
+ }, userConfig.zIndex),
316
+ spacing: tailwindParseVariables('spacing', relativePath('../src/theme/config/spacing.css'), {
317
+ ...tailwindVariables('spacing', userConfig.spacing ?? []),
318
+ }, userConfig.spacing),
319
+ borderRadius: tailwindParseVariables('radius', relativePath('../src/theme/config/radius.css'), {
320
+ ...tailwindVariables('radius', userConfig.borderRadius ?? []),
321
+ DEFAULT: 'var(--radius-xl)',
322
+ }, userConfig.borderRadius),
323
+ screens: userConfig.screens,
324
+ },
325
+ },
326
+ })
325
327
  }
326
328
 
327
329
  exports.createPlugin = createPlugin