bromcom-ui 2.12.1-test.1 → 2.12.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/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-0ce727a4.entry.js → p-01aece46.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4e5491bc.entry.js → p-0c71ac41.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d1298c40.js → p-155da55c.js} +1 -1
- package/dist/bromcom-ui/{p-db2551ef.entry.js → p-1b422511.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0def72fe.entry.js → p-1c0d550d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d5931cf3.entry.js → p-24b620ac.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9a906583.entry.js → p-272c20fa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c1d7db8f.entry.js → p-28c2da95.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8f76ddd6.entry.js → p-310657c7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8811428c.entry.js → p-421cff4a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ef04fd6b.entry.js → p-43728934.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c66192fb.entry.js → p-49f6976d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-44545e3c.entry.js → p-4a14dcce.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3575cff5.js → p-63f582ce.js} +1 -1
- package/dist/bromcom-ui/{p-91b72db1.js → p-65c3745b.js} +1 -1
- package/dist/bromcom-ui/{p-23922dab.entry.js → p-67eac255.entry.js} +1 -1
- package/dist/bromcom-ui/{p-bcf286cb.js → p-6e5bed12.js} +1 -1
- package/dist/bromcom-ui/{p-38b02377.entry.js → p-7c8b099f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-641977db.entry.js → p-894491ba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-01d5ea34.entry.js → p-8b2166b4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9e755088.entry.js → p-8d8b4193.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9f8aed8c.entry.js → p-911510fd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a2324032.entry.js → p-adc705e4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9a92e61e.entry.js → p-b7142d16.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f8a795ec.entry.js → p-bb062396.entry.js} +1 -1
- package/dist/bromcom-ui/p-bde0f04a.entry.js +5 -0
- package/dist/bromcom-ui/{p-0c1ab9c7.entry.js → p-beee9228.entry.js} +1 -1
- package/dist/bromcom-ui/p-ccc61045.js +5 -0
- package/dist/bromcom-ui/{p-d6dd26f2.entry.js → p-d12c23ef.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e896ce94.entry.js → p-d6c9aead.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3440e8b9.js → p-d95588c5.js} +1 -1
- package/dist/bromcom-ui/{p-7e608148.entry.js → p-e4ce91d5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-678b25bb.entry.js → p-f197ab71.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a959de89.entry.js → p-f66b54af.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e9c348e7.js → p-fc04fa93.js} +1 -1
- package/dist/cjs/bcm-accordion_63.cjs.entry.js +5 -5
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +5 -5
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +5 -5
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
- package/dist/cjs/bcm-card.cjs.entry.js +2 -2
- package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -4
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-default.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-number-input.cjs.entry.js +6 -6
- package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
- package/dist/cjs/bcm-range.cjs.entry.js +2 -2
- package/dist/cjs/bcm-skeleton.cjs.entry.js +5 -5
- package/dist/cjs/bcm-table.cjs.entry.js +4 -4
- package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
- package/dist/cjs/bromcom-ui.cjs.js +2 -2
- package/dist/cjs/{generate-920aff8f.js → generate-6e358f9a.js} +1 -1
- package/dist/cjs/{global-1526173b.js → global-070f1384.js} +1 -1
- package/dist/cjs/{index-5279dea2.js → index-d3b89435.js} +386 -347
- package/dist/cjs/{input.style-b5676e6a.js → input.style-890ee369.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{number-helper-a99f8b57.js → number-helper-a0552778.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
- package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
- package/dist/cjs/{package-fc8c9633.js → package-f3052296.js} +1 -1
- package/dist/cjs/{validators-aafcc99c.js → validators-9e4395ac.js} +1 -1
- package/dist/components/generate.js +1 -1
- package/dist/components/index5.js +386 -347
- package/dist/esm/bcm-accordion_63.entry.js +5 -5
- package/dist/esm/bcm-alert.entry.js +2 -2
- package/dist/esm/bcm-attendance-actions-comment.entry.js +5 -5
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +5 -5
- package/dist/esm/bcm-breadcrumb.entry.js +2 -2
- package/dist/esm/bcm-caption.entry.js +4 -4
- package/dist/esm/bcm-card.entry.js +2 -2
- package/dist/esm/bcm-chip-group.entry.js +4 -4
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-datetime-picker.entry.js +2 -2
- package/dist/esm/bcm-default.entry.js +2 -2
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-input-2.entry.js +4 -4
- package/dist/esm/bcm-input-custom.entry.js +2 -2
- package/dist/esm/bcm-input-dropdown.entry.js +5 -5
- package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
- package/dist/esm/bcm-modal-2-header.entry.js +4 -4
- package/dist/esm/bcm-modal-2.entry.js +4 -4
- package/dist/esm/bcm-number-input.entry.js +6 -6
- package/dist/esm/bcm-popover.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +2 -2
- package/dist/esm/bcm-skeleton.entry.js +5 -5
- package/dist/esm/bcm-table.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +2 -2
- package/dist/esm/bromcom-ui.js +2 -2
- package/dist/esm/{generate-d71d0301.js → generate-2af3f6c6.js} +1 -1
- package/dist/esm/{global-80fedcf7.js → global-e0801f6b.js} +1 -1
- package/dist/esm/{index-3bc8c6e3.js → index-9f698d35.js} +386 -347
- package/dist/esm/{input.style-e855c0f3.js → input.style-fadcc0bd.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{number-helper-407e89d0.js → number-helper-b496c950.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +3 -3
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{package-dec9ed1a.js → package-5d6c3b5f.js} +1 -1
- package/dist/esm/{validators-2cce19e1.js → validators-178f5d88.js} +1 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-08c75801.js +0 -5
- package/dist/bromcom-ui/p-42111a9b.entry.js +0 -5
|
@@ -2,57 +2,24 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import { c as createCommonjsModule } from './_commonjsHelpers-7002e5de.js';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Specifically:
|
|
11
|
-
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
12
|
-
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
13
|
-
*
|
|
14
|
-
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
15
|
-
*/
|
|
16
|
-
function twJoin() {
|
|
17
|
-
var index = 0;
|
|
18
|
-
var argument;
|
|
19
|
-
var resolvedValue;
|
|
20
|
-
var string = '';
|
|
21
|
-
while (index < arguments.length) {
|
|
22
|
-
if (argument = arguments[index++]) {
|
|
23
|
-
if (resolvedValue = toValue(argument)) {
|
|
24
|
-
string && (string += ' ');
|
|
25
|
-
string += resolvedValue;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return string;
|
|
30
|
-
}
|
|
31
|
-
function toValue(mix) {
|
|
32
|
-
if (typeof mix === 'string') {
|
|
33
|
-
return mix;
|
|
34
|
-
}
|
|
35
|
-
var resolvedValue;
|
|
36
|
-
var string = '';
|
|
37
|
-
for (var k = 0; k < mix.length; k++) {
|
|
38
|
-
if (mix[k]) {
|
|
39
|
-
if (resolvedValue = toValue(mix[k])) {
|
|
40
|
-
string && (string += ' ');
|
|
41
|
-
string += resolvedValue;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return string;
|
|
46
|
-
}
|
|
7
|
+
var l=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,u=e=>!e||typeof e!="object"||Object.keys(e).length===0,x=(e,o)=>JSON.stringify(e)===JSON.stringify(o);function i(e,o){e.forEach(function(r){Array.isArray(r)?i(r,o):o.push(r);});}function y(e){let o=[];return i(e,o),o}var a=(...e)=>y(e).filter(Boolean),p=(e,o)=>{let r={},c=Object.keys(e),f=Object.keys(o);for(let t of c)if(f.includes(t)){let s=e[t],n=o[t];typeof s=="object"&&typeof n=="object"?r[t]=p(s,n):Array.isArray(s)||Array.isArray(n)?r[t]=a(n,s):r[t]=n+" "+s;}else r[t]=e[t];for(let t of f)c.includes(t)||(r[t]=o[t]);return r},g=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();
|
|
8
|
+
|
|
9
|
+
var bundleCjs = createCommonjsModule(function (module, exports) {
|
|
47
10
|
|
|
48
|
-
|
|
11
|
+
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
12
|
+
value: 'Module'
|
|
13
|
+
});
|
|
14
|
+
const CLASS_PART_SEPARATOR = '-';
|
|
49
15
|
function createClassUtils(config) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
conflictingClassGroupModifiers
|
|
16
|
+
const classMap = createClassMap(config);
|
|
17
|
+
const {
|
|
18
|
+
conflictingClassGroups,
|
|
19
|
+
conflictingClassGroupModifiers
|
|
20
|
+
} = config;
|
|
54
21
|
function getClassGroupId(className) {
|
|
55
|
-
|
|
22
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
56
23
|
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts.
|
|
57
24
|
if (classParts[0] === '' && classParts.length !== 1) {
|
|
58
25
|
classParts.shift();
|
|
@@ -60,41 +27,40 @@ function createClassUtils(config) {
|
|
|
60
27
|
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
61
28
|
}
|
|
62
29
|
function getConflictingClassGroupIds(classGroupId, hasPostfixModifier) {
|
|
63
|
-
|
|
30
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
64
31
|
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
65
|
-
return [
|
|
32
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
66
33
|
}
|
|
67
34
|
return conflicts;
|
|
68
35
|
}
|
|
69
36
|
return {
|
|
70
|
-
getClassGroupId
|
|
71
|
-
getConflictingClassGroupIds
|
|
37
|
+
getClassGroupId,
|
|
38
|
+
getConflictingClassGroupIds
|
|
72
39
|
};
|
|
73
40
|
}
|
|
74
41
|
function getGroupRecursive(classParts, classPartObject) {
|
|
75
42
|
if (classParts.length === 0) {
|
|
76
43
|
return classPartObject.classGroupId;
|
|
77
44
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
45
|
+
const currentClassPart = classParts[0];
|
|
46
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
47
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
|
|
81
48
|
if (classGroupFromNextClassPart) {
|
|
82
49
|
return classGroupFromNextClassPart;
|
|
83
50
|
}
|
|
84
51
|
if (classPartObject.validators.length === 0) {
|
|
85
52
|
return undefined;
|
|
86
53
|
}
|
|
87
|
-
|
|
88
|
-
return classPartObject.validators.find(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})?.classGroupId;
|
|
54
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
55
|
+
return classPartObject.validators.find(({
|
|
56
|
+
validator
|
|
57
|
+
}) => validator(classRest))?.classGroupId;
|
|
92
58
|
}
|
|
93
|
-
|
|
59
|
+
const arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
94
60
|
function getGroupIdForArbitraryProperty(className) {
|
|
95
61
|
if (arbitraryPropertyRegex.test(className)) {
|
|
96
|
-
|
|
97
|
-
|
|
62
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
63
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
|
|
98
64
|
if (property) {
|
|
99
65
|
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
100
66
|
return 'arbitrary..' + property;
|
|
@@ -105,24 +71,24 @@ function getGroupIdForArbitraryProperty(className) {
|
|
|
105
71
|
* Exported for testing only
|
|
106
72
|
*/
|
|
107
73
|
function createClassMap(config) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
74
|
+
const {
|
|
75
|
+
theme,
|
|
76
|
+
prefix
|
|
77
|
+
} = config;
|
|
78
|
+
const classMap = {
|
|
111
79
|
nextPart: new Map(),
|
|
112
80
|
validators: []
|
|
113
81
|
};
|
|
114
|
-
|
|
115
|
-
prefixedClassGroupEntries.forEach(
|
|
116
|
-
var classGroupId = _ref2[0],
|
|
117
|
-
classGroup = _ref2[1];
|
|
82
|
+
const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
|
|
83
|
+
prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
|
|
118
84
|
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
119
85
|
});
|
|
120
86
|
return classMap;
|
|
121
87
|
}
|
|
122
88
|
function processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {
|
|
123
|
-
classGroup.forEach(
|
|
89
|
+
classGroup.forEach(classDefinition => {
|
|
124
90
|
if (typeof classDefinition === 'string') {
|
|
125
|
-
|
|
91
|
+
const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
|
|
126
92
|
classPartObjectToEdit.classGroupId = classGroupId;
|
|
127
93
|
return;
|
|
128
94
|
}
|
|
@@ -133,20 +99,18 @@ function processClassesRecursively(classGroup, classPartObject, classGroupId, th
|
|
|
133
99
|
}
|
|
134
100
|
classPartObject.validators.push({
|
|
135
101
|
validator: classDefinition,
|
|
136
|
-
classGroupId
|
|
102
|
+
classGroupId
|
|
137
103
|
});
|
|
138
104
|
return;
|
|
139
105
|
}
|
|
140
|
-
Object.entries(classDefinition).forEach(
|
|
141
|
-
var key = _ref3[0],
|
|
142
|
-
classGroup = _ref3[1];
|
|
106
|
+
Object.entries(classDefinition).forEach(([key, classGroup]) => {
|
|
143
107
|
processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
|
|
144
108
|
});
|
|
145
109
|
});
|
|
146
110
|
}
|
|
147
111
|
function getPart(classPartObject, path) {
|
|
148
|
-
|
|
149
|
-
path.split(CLASS_PART_SEPARATOR).forEach(
|
|
112
|
+
let currentClassPartObject = classPartObject;
|
|
113
|
+
path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {
|
|
150
114
|
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
151
115
|
currentClassPartObject.nextPart.set(pathPart, {
|
|
152
116
|
nextPart: new Map(),
|
|
@@ -164,19 +128,13 @@ function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
|
|
|
164
128
|
if (!prefix) {
|
|
165
129
|
return classGroupEntries;
|
|
166
130
|
}
|
|
167
|
-
return classGroupEntries.map(
|
|
168
|
-
|
|
169
|
-
classGroup = _ref4[1];
|
|
170
|
-
var prefixedClassGroup = classGroup.map(function (classDefinition) {
|
|
131
|
+
return classGroupEntries.map(([classGroupId, classGroup]) => {
|
|
132
|
+
const prefixedClassGroup = classGroup.map(classDefinition => {
|
|
171
133
|
if (typeof classDefinition === 'string') {
|
|
172
134
|
return prefix + classDefinition;
|
|
173
135
|
}
|
|
174
136
|
if (typeof classDefinition === 'object') {
|
|
175
|
-
return Object.fromEntries(Object.entries(classDefinition).map(
|
|
176
|
-
var key = _ref5[0],
|
|
177
|
-
value = _ref5[1];
|
|
178
|
-
return [prefix + key, value];
|
|
179
|
-
}));
|
|
137
|
+
return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
|
|
180
138
|
}
|
|
181
139
|
return classDefinition;
|
|
182
140
|
});
|
|
@@ -188,15 +146,13 @@ function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
|
|
|
188
146
|
function createLruCache(maxCacheSize) {
|
|
189
147
|
if (maxCacheSize < 1) {
|
|
190
148
|
return {
|
|
191
|
-
get:
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
set: function set() {}
|
|
149
|
+
get: () => undefined,
|
|
150
|
+
set: () => {}
|
|
195
151
|
};
|
|
196
152
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
153
|
+
let cacheSize = 0;
|
|
154
|
+
let cache = new Map();
|
|
155
|
+
let previousCache = new Map();
|
|
200
156
|
function update(key, value) {
|
|
201
157
|
cache.set(key, value);
|
|
202
158
|
cacheSize++;
|
|
@@ -207,8 +163,8 @@ function createLruCache(maxCacheSize) {
|
|
|
207
163
|
}
|
|
208
164
|
}
|
|
209
165
|
return {
|
|
210
|
-
get
|
|
211
|
-
|
|
166
|
+
get(key) {
|
|
167
|
+
let value = cache.get(key);
|
|
212
168
|
if (value !== undefined) {
|
|
213
169
|
return value;
|
|
214
170
|
}
|
|
@@ -217,7 +173,7 @@ function createLruCache(maxCacheSize) {
|
|
|
217
173
|
return value;
|
|
218
174
|
}
|
|
219
175
|
},
|
|
220
|
-
set
|
|
176
|
+
set(key, value) {
|
|
221
177
|
if (cache.has(key)) {
|
|
222
178
|
cache.set(key, value);
|
|
223
179
|
} else {
|
|
@@ -226,21 +182,20 @@ function createLruCache(maxCacheSize) {
|
|
|
226
182
|
}
|
|
227
183
|
};
|
|
228
184
|
}
|
|
229
|
-
|
|
230
|
-
var IMPORTANT_MODIFIER = '!';
|
|
185
|
+
const IMPORTANT_MODIFIER = '!';
|
|
231
186
|
function createSplitModifiers(config) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
187
|
+
const separator = config.separator;
|
|
188
|
+
const isSeparatorSingleCharacter = separator.length === 1;
|
|
189
|
+
const firstSeparatorCharacter = separator[0];
|
|
190
|
+
const separatorLength = separator.length;
|
|
236
191
|
// splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
|
|
237
192
|
return function splitModifiers(className) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
for (
|
|
243
|
-
|
|
193
|
+
const modifiers = [];
|
|
194
|
+
let bracketDepth = 0;
|
|
195
|
+
let modifierStart = 0;
|
|
196
|
+
let postfixModifierPosition;
|
|
197
|
+
for (let index = 0; index < className.length; index++) {
|
|
198
|
+
let currentCharacter = className[index];
|
|
244
199
|
if (bracketDepth === 0) {
|
|
245
200
|
if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
|
|
246
201
|
modifiers.push(className.slice(modifierStart, index));
|
|
@@ -258,15 +213,15 @@ function createSplitModifiers(config) {
|
|
|
258
213
|
bracketDepth--;
|
|
259
214
|
}
|
|
260
215
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
216
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
217
|
+
const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
|
|
218
|
+
const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
|
|
219
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
|
|
265
220
|
return {
|
|
266
|
-
modifiers
|
|
267
|
-
hasImportantModifier
|
|
268
|
-
baseClassName
|
|
269
|
-
maybePostfixModifierPosition
|
|
221
|
+
modifiers,
|
|
222
|
+
hasImportantModifier,
|
|
223
|
+
baseClassName,
|
|
224
|
+
maybePostfixModifierPosition
|
|
270
225
|
};
|
|
271
226
|
};
|
|
272
227
|
}
|
|
@@ -279,21 +234,20 @@ function sortModifiers(modifiers) {
|
|
|
279
234
|
if (modifiers.length <= 1) {
|
|
280
235
|
return modifiers;
|
|
281
236
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
modifiers.forEach(
|
|
285
|
-
|
|
237
|
+
const sortedModifiers = [];
|
|
238
|
+
let unsortedModifiers = [];
|
|
239
|
+
modifiers.forEach(modifier => {
|
|
240
|
+
const isArbitraryVariant = modifier[0] === '[';
|
|
286
241
|
if (isArbitraryVariant) {
|
|
287
|
-
sortedModifiers.push
|
|
242
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
288
243
|
unsortedModifiers = [];
|
|
289
244
|
} else {
|
|
290
245
|
unsortedModifiers.push(modifier);
|
|
291
246
|
}
|
|
292
247
|
});
|
|
293
|
-
sortedModifiers.push
|
|
248
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
294
249
|
return sortedModifiers;
|
|
295
250
|
}
|
|
296
|
-
|
|
297
251
|
function createConfigUtils(config) {
|
|
298
252
|
return {
|
|
299
253
|
cache: createLruCache(config.cacheSize),
|
|
@@ -301,12 +255,13 @@ function createConfigUtils(config) {
|
|
|
301
255
|
...createClassUtils(config)
|
|
302
256
|
};
|
|
303
257
|
}
|
|
304
|
-
|
|
305
|
-
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
258
|
+
const SPLIT_CLASSES_REGEX = /\s+/;
|
|
306
259
|
function mergeClassList(classList, configUtils) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
260
|
+
const {
|
|
261
|
+
splitModifiers,
|
|
262
|
+
getClassGroupId,
|
|
263
|
+
getConflictingClassGroupIds
|
|
264
|
+
} = configUtils;
|
|
310
265
|
/**
|
|
311
266
|
* Set of classGroupIds in following format:
|
|
312
267
|
* `{importantModifier}{variantModifiers}{classGroupId}`
|
|
@@ -314,77 +269,109 @@ function mergeClassList(classList, configUtils) {
|
|
|
314
269
|
* @example 'hover:focus:bg-color'
|
|
315
270
|
* @example 'md:!pr'
|
|
316
271
|
*/
|
|
317
|
-
|
|
318
|
-
return classList.trim().split(SPLIT_CLASSES_REGEX).map(
|
|
319
|
-
|
|
320
|
-
modifiers
|
|
321
|
-
hasImportantModifier
|
|
322
|
-
baseClassName
|
|
323
|
-
maybePostfixModifierPosition
|
|
324
|
-
|
|
325
|
-
|
|
272
|
+
const classGroupsInConflict = new Set();
|
|
273
|
+
return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName => {
|
|
274
|
+
const {
|
|
275
|
+
modifiers,
|
|
276
|
+
hasImportantModifier,
|
|
277
|
+
baseClassName,
|
|
278
|
+
maybePostfixModifierPosition
|
|
279
|
+
} = splitModifiers(originalClassName);
|
|
280
|
+
let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
281
|
+
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
326
282
|
if (!classGroupId) {
|
|
327
283
|
if (!maybePostfixModifierPosition) {
|
|
328
284
|
return {
|
|
329
285
|
isTailwindClass: false,
|
|
330
|
-
originalClassName
|
|
286
|
+
originalClassName
|
|
331
287
|
};
|
|
332
288
|
}
|
|
333
289
|
classGroupId = getClassGroupId(baseClassName);
|
|
334
290
|
if (!classGroupId) {
|
|
335
291
|
return {
|
|
336
292
|
isTailwindClass: false,
|
|
337
|
-
originalClassName
|
|
293
|
+
originalClassName
|
|
338
294
|
};
|
|
339
295
|
}
|
|
340
296
|
hasPostfixModifier = false;
|
|
341
297
|
}
|
|
342
|
-
|
|
343
|
-
|
|
298
|
+
const variantModifier = sortModifiers(modifiers).join(':');
|
|
299
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
344
300
|
return {
|
|
345
301
|
isTailwindClass: true,
|
|
346
|
-
modifierId
|
|
347
|
-
classGroupId
|
|
348
|
-
originalClassName
|
|
349
|
-
hasPostfixModifier
|
|
302
|
+
modifierId,
|
|
303
|
+
classGroupId,
|
|
304
|
+
originalClassName,
|
|
305
|
+
hasPostfixModifier
|
|
350
306
|
};
|
|
351
307
|
}).reverse()
|
|
352
308
|
// Last class in conflict wins, so we need to filter conflicting classes in reverse order.
|
|
353
|
-
.filter(
|
|
309
|
+
.filter(parsed => {
|
|
354
310
|
if (!parsed.isTailwindClass) {
|
|
355
311
|
return true;
|
|
356
312
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
313
|
+
const {
|
|
314
|
+
modifierId,
|
|
315
|
+
classGroupId,
|
|
316
|
+
hasPostfixModifier
|
|
317
|
+
} = parsed;
|
|
318
|
+
const classId = modifierId + classGroupId;
|
|
361
319
|
if (classGroupsInConflict.has(classId)) {
|
|
362
320
|
return false;
|
|
363
321
|
}
|
|
364
322
|
classGroupsInConflict.add(classId);
|
|
365
|
-
getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(
|
|
366
|
-
return classGroupsInConflict.add(modifierId + group);
|
|
367
|
-
});
|
|
323
|
+
getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(group => classGroupsInConflict.add(modifierId + group));
|
|
368
324
|
return true;
|
|
369
|
-
}).reverse().map(
|
|
370
|
-
return parsed.originalClassName;
|
|
371
|
-
}).join(' ');
|
|
325
|
+
}).reverse().map(parsed => parsed.originalClassName).join(' ');
|
|
372
326
|
}
|
|
373
327
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
328
|
+
/**
|
|
329
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
330
|
+
*
|
|
331
|
+
* Specifically:
|
|
332
|
+
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
333
|
+
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
334
|
+
*
|
|
335
|
+
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
336
|
+
*/
|
|
337
|
+
function twJoin() {
|
|
338
|
+
let index = 0;
|
|
339
|
+
let argument;
|
|
340
|
+
let resolvedValue;
|
|
341
|
+
let string = '';
|
|
342
|
+
while (index < arguments.length) {
|
|
343
|
+
if (argument = arguments[index++]) {
|
|
344
|
+
if (resolvedValue = toValue(argument)) {
|
|
345
|
+
string && (string += ' ');
|
|
346
|
+
string += resolvedValue;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return string;
|
|
351
|
+
}
|
|
352
|
+
function toValue(mix) {
|
|
353
|
+
if (typeof mix === 'string') {
|
|
354
|
+
return mix;
|
|
355
|
+
}
|
|
356
|
+
let resolvedValue;
|
|
357
|
+
let string = '';
|
|
358
|
+
for (let k = 0; k < mix.length; k++) {
|
|
359
|
+
if (mix[k]) {
|
|
360
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
361
|
+
string && (string += ' ');
|
|
362
|
+
string += resolvedValue;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
377
365
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
366
|
+
return string;
|
|
367
|
+
}
|
|
368
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
369
|
+
let configUtils;
|
|
370
|
+
let cacheGet;
|
|
371
|
+
let cacheSet;
|
|
372
|
+
let functionToCall = initTailwindMerge;
|
|
382
373
|
function initTailwindMerge(classList) {
|
|
383
|
-
|
|
384
|
-
restCreateConfig = createConfig.slice(1);
|
|
385
|
-
var config = restCreateConfig.reduce(function (previousConfig, createConfigCurrent) {
|
|
386
|
-
return createConfigCurrent(previousConfig);
|
|
387
|
-
}, firstCreateConfig());
|
|
374
|
+
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
388
375
|
configUtils = createConfigUtils(config);
|
|
389
376
|
cacheGet = configUtils.cache.get;
|
|
390
377
|
cacheSet = configUtils.cache.set;
|
|
@@ -392,11 +379,11 @@ function createTailwindMerge() {
|
|
|
392
379
|
return tailwindMerge(classList);
|
|
393
380
|
}
|
|
394
381
|
function tailwindMerge(classList) {
|
|
395
|
-
|
|
382
|
+
const cachedResult = cacheGet(classList);
|
|
396
383
|
if (cachedResult) {
|
|
397
384
|
return cachedResult;
|
|
398
385
|
}
|
|
399
|
-
|
|
386
|
+
const result = mergeClassList(classList, configUtils);
|
|
400
387
|
cacheSet(classList, result);
|
|
401
388
|
return result;
|
|
402
389
|
}
|
|
@@ -404,166 +391,156 @@ function createTailwindMerge() {
|
|
|
404
391
|
return functionToCall(twJoin.apply(null, arguments));
|
|
405
392
|
};
|
|
406
393
|
}
|
|
407
|
-
|
|
408
394
|
function fromTheme(key) {
|
|
409
|
-
|
|
410
|
-
return theme[key] || [];
|
|
411
|
-
};
|
|
395
|
+
const themeGetter = theme => theme[key] || [];
|
|
412
396
|
themeGetter.isThemeGetter = true;
|
|
413
397
|
return themeGetter;
|
|
414
398
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
// Shadow always begins with x and y offset separated by underscore
|
|
422
|
-
|
|
399
|
+
const arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
400
|
+
const fractionRegex = /^\d+\/\d+$/;
|
|
401
|
+
const stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);
|
|
402
|
+
const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
403
|
+
const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
404
|
+
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
|
|
405
|
+
// Shadow always begins with x and y offset separated by underscore optionally prepended by inset
|
|
406
|
+
const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
407
|
+
const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
423
408
|
function isLength(value) {
|
|
424
|
-
return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value)
|
|
409
|
+
return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
425
410
|
}
|
|
426
411
|
function isArbitraryLength(value) {
|
|
427
412
|
return getIsArbitraryValue(value, 'length', isLengthOnly);
|
|
428
413
|
}
|
|
429
|
-
function
|
|
430
|
-
return
|
|
431
|
-
}
|
|
432
|
-
function isArbitraryPosition(value) {
|
|
433
|
-
return getIsArbitraryValue(value, 'position', isNever);
|
|
434
|
-
}
|
|
435
|
-
function isArbitraryUrl(value) {
|
|
436
|
-
return getIsArbitraryValue(value, 'url', isUrl);
|
|
414
|
+
function isNumber(value) {
|
|
415
|
+
return Boolean(value) && !Number.isNaN(Number(value));
|
|
437
416
|
}
|
|
438
417
|
function isArbitraryNumber(value) {
|
|
439
418
|
return getIsArbitraryValue(value, 'number', isNumber);
|
|
440
419
|
}
|
|
441
|
-
function
|
|
442
|
-
return
|
|
420
|
+
function isInteger(value) {
|
|
421
|
+
return Boolean(value) && Number.isInteger(Number(value));
|
|
443
422
|
}
|
|
444
423
|
function isPercent(value) {
|
|
445
424
|
return value.endsWith('%') && isNumber(value.slice(0, -1));
|
|
446
425
|
}
|
|
447
|
-
function isInteger(value) {
|
|
448
|
-
return isIntegerOnly(value) || getIsArbitraryValue(value, 'number', isIntegerOnly);
|
|
449
|
-
}
|
|
450
426
|
function isArbitraryValue(value) {
|
|
451
427
|
return arbitraryValueRegex.test(value);
|
|
452
428
|
}
|
|
453
|
-
function isAny() {
|
|
454
|
-
return true;
|
|
455
|
-
}
|
|
456
429
|
function isTshirtSize(value) {
|
|
457
430
|
return tshirtUnitRegex.test(value);
|
|
458
431
|
}
|
|
432
|
+
const sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);
|
|
433
|
+
function isArbitrarySize(value) {
|
|
434
|
+
return getIsArbitraryValue(value, sizeLabels, isNever);
|
|
435
|
+
}
|
|
436
|
+
function isArbitraryPosition(value) {
|
|
437
|
+
return getIsArbitraryValue(value, 'position', isNever);
|
|
438
|
+
}
|
|
439
|
+
const imageLabels = /*#__PURE__*/new Set(['image', 'url']);
|
|
440
|
+
function isArbitraryImage(value) {
|
|
441
|
+
return getIsArbitraryValue(value, imageLabels, isImage);
|
|
442
|
+
}
|
|
459
443
|
function isArbitraryShadow(value) {
|
|
460
444
|
return getIsArbitraryValue(value, '', isShadow);
|
|
461
445
|
}
|
|
446
|
+
function isAny() {
|
|
447
|
+
return true;
|
|
448
|
+
}
|
|
462
449
|
function getIsArbitraryValue(value, label, testValue) {
|
|
463
|
-
|
|
450
|
+
const result = arbitraryValueRegex.exec(value);
|
|
464
451
|
if (result) {
|
|
465
452
|
if (result[1]) {
|
|
466
|
-
return result[1] === label;
|
|
453
|
+
return typeof label === 'string' ? result[1] === label : label.has(result[1]);
|
|
467
454
|
}
|
|
468
455
|
return testValue(result[2]);
|
|
469
456
|
}
|
|
470
457
|
return false;
|
|
471
458
|
}
|
|
472
459
|
function isLengthOnly(value) {
|
|
473
|
-
|
|
460
|
+
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
461
|
+
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
462
|
+
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
463
|
+
return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
474
464
|
}
|
|
475
465
|
function isNever() {
|
|
476
466
|
return false;
|
|
477
467
|
}
|
|
478
|
-
function isUrl(value) {
|
|
479
|
-
return value.startsWith('url(');
|
|
480
|
-
}
|
|
481
|
-
function isIntegerOnly(value) {
|
|
482
|
-
return Number.isInteger(Number(value));
|
|
483
|
-
}
|
|
484
468
|
function isShadow(value) {
|
|
485
469
|
return shadowRegex.test(value);
|
|
486
470
|
}
|
|
487
|
-
|
|
471
|
+
function isImage(value) {
|
|
472
|
+
return imageRegex.test(value);
|
|
473
|
+
}
|
|
474
|
+
const validators = /*#__PURE__*/Object.defineProperty({
|
|
475
|
+
__proto__: null,
|
|
476
|
+
isAny,
|
|
477
|
+
isArbitraryImage,
|
|
478
|
+
isArbitraryLength,
|
|
479
|
+
isArbitraryNumber,
|
|
480
|
+
isArbitraryPosition,
|
|
481
|
+
isArbitraryShadow,
|
|
482
|
+
isArbitrarySize,
|
|
483
|
+
isArbitraryValue,
|
|
484
|
+
isInteger,
|
|
485
|
+
isLength,
|
|
486
|
+
isNumber,
|
|
487
|
+
isPercent,
|
|
488
|
+
isTshirtSize
|
|
489
|
+
}, Symbol.toStringTag, {
|
|
490
|
+
value: 'Module'
|
|
491
|
+
});
|
|
488
492
|
function getDefaultConfig() {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
};
|
|
529
|
-
var getNumberWithAutoAndArbitrary = function getNumberWithAutoAndArbitrary() {
|
|
530
|
-
return ['auto', isNumber, isArbitraryValue];
|
|
531
|
-
};
|
|
532
|
-
var getPositions = function getPositions() {
|
|
533
|
-
return ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];
|
|
534
|
-
};
|
|
535
|
-
var getLineStyles = function getLineStyles() {
|
|
536
|
-
return ['solid', 'dashed', 'dotted', 'double', 'none'];
|
|
537
|
-
};
|
|
538
|
-
var getBlendModes = function getBlendModes() {
|
|
539
|
-
return ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];
|
|
540
|
-
};
|
|
541
|
-
var getAlign = function getAlign() {
|
|
542
|
-
return ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];
|
|
543
|
-
};
|
|
544
|
-
var getZeroAndEmpty = function getZeroAndEmpty() {
|
|
545
|
-
return ['', '0', isArbitraryValue];
|
|
546
|
-
};
|
|
547
|
-
var getBreaks = function getBreaks() {
|
|
548
|
-
return ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
|
|
549
|
-
};
|
|
550
|
-
var getNumber = function getNumber() {
|
|
551
|
-
return [isNumber, isArbitraryNumber];
|
|
552
|
-
};
|
|
553
|
-
var getNumberAndArbitrary = function getNumberAndArbitrary() {
|
|
554
|
-
return [isNumber, isArbitraryValue];
|
|
555
|
-
};
|
|
493
|
+
const colors = fromTheme('colors');
|
|
494
|
+
const spacing = fromTheme('spacing');
|
|
495
|
+
const blur = fromTheme('blur');
|
|
496
|
+
const brightness = fromTheme('brightness');
|
|
497
|
+
const borderColor = fromTheme('borderColor');
|
|
498
|
+
const borderRadius = fromTheme('borderRadius');
|
|
499
|
+
const borderSpacing = fromTheme('borderSpacing');
|
|
500
|
+
const borderWidth = fromTheme('borderWidth');
|
|
501
|
+
const contrast = fromTheme('contrast');
|
|
502
|
+
const grayscale = fromTheme('grayscale');
|
|
503
|
+
const hueRotate = fromTheme('hueRotate');
|
|
504
|
+
const invert = fromTheme('invert');
|
|
505
|
+
const gap = fromTheme('gap');
|
|
506
|
+
const gradientColorStops = fromTheme('gradientColorStops');
|
|
507
|
+
const gradientColorStopPositions = fromTheme('gradientColorStopPositions');
|
|
508
|
+
const inset = fromTheme('inset');
|
|
509
|
+
const margin = fromTheme('margin');
|
|
510
|
+
const opacity = fromTheme('opacity');
|
|
511
|
+
const padding = fromTheme('padding');
|
|
512
|
+
const saturate = fromTheme('saturate');
|
|
513
|
+
const scale = fromTheme('scale');
|
|
514
|
+
const sepia = fromTheme('sepia');
|
|
515
|
+
const skew = fromTheme('skew');
|
|
516
|
+
const space = fromTheme('space');
|
|
517
|
+
const translate = fromTheme('translate');
|
|
518
|
+
const getOverscroll = () => ['auto', 'contain', 'none'];
|
|
519
|
+
const getOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
|
|
520
|
+
const getSpacingWithAutoAndArbitrary = () => ['auto', isArbitraryValue, spacing];
|
|
521
|
+
const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
|
|
522
|
+
const getLengthWithEmptyAndArbitrary = () => ['', isLength, isArbitraryLength];
|
|
523
|
+
const getNumberWithAutoAndArbitrary = () => ['auto', isNumber, isArbitraryValue];
|
|
524
|
+
const getPositions = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];
|
|
525
|
+
const getLineStyles = () => ['solid', 'dashed', 'dotted', 'double', 'none'];
|
|
526
|
+
const getBlendModes = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];
|
|
527
|
+
const getAlign = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];
|
|
528
|
+
const getZeroAndEmpty = () => ['', '0', isArbitraryValue];
|
|
529
|
+
const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
|
|
530
|
+
const getNumber = () => [isNumber, isArbitraryNumber];
|
|
531
|
+
const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
|
|
556
532
|
return {
|
|
557
533
|
cacheSize: 500,
|
|
534
|
+
separator: ':',
|
|
558
535
|
theme: {
|
|
559
536
|
colors: [isAny],
|
|
560
|
-
spacing: [isLength],
|
|
537
|
+
spacing: [isLength, isArbitraryLength],
|
|
561
538
|
blur: ['none', '', isTshirtSize, isArbitraryValue],
|
|
562
539
|
brightness: getNumber(),
|
|
563
540
|
borderColor: [colors],
|
|
564
541
|
borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],
|
|
565
542
|
borderSpacing: getSpacingWithArbitrary(),
|
|
566
|
-
borderWidth:
|
|
543
|
+
borderWidth: getLengthWithEmptyAndArbitrary(),
|
|
567
544
|
contrast: getNumber(),
|
|
568
545
|
grayscale: getZeroAndEmpty(),
|
|
569
546
|
hueRotate: getNumberAndArbitrary(),
|
|
@@ -647,15 +624,15 @@ function getDefaultConfig() {
|
|
|
647
624
|
* Floats
|
|
648
625
|
* @see https://tailwindcss.com/docs/float
|
|
649
626
|
*/
|
|
650
|
-
|
|
651
|
-
|
|
627
|
+
float: [{
|
|
628
|
+
float: ['right', 'left', 'none', 'start', 'end']
|
|
652
629
|
}],
|
|
653
630
|
/**
|
|
654
631
|
* Clear
|
|
655
632
|
* @see https://tailwindcss.com/docs/clear
|
|
656
633
|
*/
|
|
657
634
|
clear: [{
|
|
658
|
-
clear: ['left', 'right', 'both', 'none']
|
|
635
|
+
clear: ['left', 'right', 'both', 'none', 'start', 'end']
|
|
659
636
|
}],
|
|
660
637
|
/**
|
|
661
638
|
* Isolation
|
|
@@ -674,7 +651,7 @@ function getDefaultConfig() {
|
|
|
674
651
|
* @see https://tailwindcss.com/docs/object-position
|
|
675
652
|
*/
|
|
676
653
|
'object-position': [{
|
|
677
|
-
object: [
|
|
654
|
+
object: [...getPositions(), isArbitraryValue]
|
|
678
655
|
}],
|
|
679
656
|
/**
|
|
680
657
|
* Overflow
|
|
@@ -796,7 +773,7 @@ function getDefaultConfig() {
|
|
|
796
773
|
* @see https://tailwindcss.com/docs/z-index
|
|
797
774
|
*/
|
|
798
775
|
z: [{
|
|
799
|
-
z: ['auto', isInteger]
|
|
776
|
+
z: ['auto', isInteger, isArbitraryValue]
|
|
800
777
|
}],
|
|
801
778
|
// Flexbox and Grid
|
|
802
779
|
/**
|
|
@@ -846,7 +823,7 @@ function getDefaultConfig() {
|
|
|
846
823
|
* @see https://tailwindcss.com/docs/order
|
|
847
824
|
*/
|
|
848
825
|
order: [{
|
|
849
|
-
order: ['first', 'last', 'none', isInteger]
|
|
826
|
+
order: ['first', 'last', 'none', isInteger, isArbitraryValue]
|
|
850
827
|
}],
|
|
851
828
|
/**
|
|
852
829
|
* Grid Template Columns
|
|
@@ -861,7 +838,7 @@ function getDefaultConfig() {
|
|
|
861
838
|
*/
|
|
862
839
|
'col-start-end': [{
|
|
863
840
|
col: ['auto', {
|
|
864
|
-
span: ['full', isInteger]
|
|
841
|
+
span: ['full', isInteger, isArbitraryValue]
|
|
865
842
|
}, isArbitraryValue]
|
|
866
843
|
}],
|
|
867
844
|
/**
|
|
@@ -891,7 +868,7 @@ function getDefaultConfig() {
|
|
|
891
868
|
*/
|
|
892
869
|
'row-start-end': [{
|
|
893
870
|
row: ['auto', {
|
|
894
|
-
span: [isInteger]
|
|
871
|
+
span: [isInteger, isArbitraryValue]
|
|
895
872
|
}, isArbitraryValue]
|
|
896
873
|
}],
|
|
897
874
|
/**
|
|
@@ -955,7 +932,7 @@ function getDefaultConfig() {
|
|
|
955
932
|
* @see https://tailwindcss.com/docs/justify-content
|
|
956
933
|
*/
|
|
957
934
|
'justify-content': [{
|
|
958
|
-
justify: ['normal'
|
|
935
|
+
justify: ['normal', ...getAlign()]
|
|
959
936
|
}],
|
|
960
937
|
/**
|
|
961
938
|
* Justify Items
|
|
@@ -976,7 +953,7 @@ function getDefaultConfig() {
|
|
|
976
953
|
* @see https://tailwindcss.com/docs/align-content
|
|
977
954
|
*/
|
|
978
955
|
'align-content': [{
|
|
979
|
-
content: ['normal'
|
|
956
|
+
content: ['normal', ...getAlign(), 'baseline']
|
|
980
957
|
}],
|
|
981
958
|
/**
|
|
982
959
|
* Align Items
|
|
@@ -997,7 +974,7 @@ function getDefaultConfig() {
|
|
|
997
974
|
* @see https://tailwindcss.com/docs/place-content
|
|
998
975
|
*/
|
|
999
976
|
'place-content': [{
|
|
1000
|
-
'place-content': [
|
|
977
|
+
'place-content': [...getAlign(), 'baseline']
|
|
1001
978
|
}],
|
|
1002
979
|
/**
|
|
1003
980
|
* Place Items
|
|
@@ -1170,44 +1147,51 @@ function getDefaultConfig() {
|
|
|
1170
1147
|
* @see https://tailwindcss.com/docs/width
|
|
1171
1148
|
*/
|
|
1172
1149
|
w: [{
|
|
1173
|
-
w: ['auto', 'min', 'max', 'fit', isArbitraryValue, spacing]
|
|
1150
|
+
w: ['auto', 'min', 'max', 'fit', 'svw', 'lvw', 'dvw', isArbitraryValue, spacing]
|
|
1174
1151
|
}],
|
|
1175
1152
|
/**
|
|
1176
1153
|
* Min-Width
|
|
1177
1154
|
* @see https://tailwindcss.com/docs/min-width
|
|
1178
1155
|
*/
|
|
1179
1156
|
'min-w': [{
|
|
1180
|
-
'min-w': ['min', 'max', 'fit'
|
|
1157
|
+
'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit']
|
|
1181
1158
|
}],
|
|
1182
1159
|
/**
|
|
1183
1160
|
* Max-Width
|
|
1184
1161
|
* @see https://tailwindcss.com/docs/max-width
|
|
1185
1162
|
*/
|
|
1186
1163
|
'max-w': [{
|
|
1187
|
-
'max-w': [
|
|
1164
|
+
'max-w': [isArbitraryValue, spacing, 'none', 'full', 'min', 'max', 'fit', 'prose', {
|
|
1188
1165
|
screen: [isTshirtSize]
|
|
1189
|
-
}, isTshirtSize
|
|
1166
|
+
}, isTshirtSize]
|
|
1190
1167
|
}],
|
|
1191
1168
|
/**
|
|
1192
1169
|
* Height
|
|
1193
1170
|
* @see https://tailwindcss.com/docs/height
|
|
1194
1171
|
*/
|
|
1195
1172
|
h: [{
|
|
1196
|
-
h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']
|
|
1173
|
+
h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']
|
|
1197
1174
|
}],
|
|
1198
1175
|
/**
|
|
1199
1176
|
* Min-Height
|
|
1200
1177
|
* @see https://tailwindcss.com/docs/min-height
|
|
1201
1178
|
*/
|
|
1202
1179
|
'min-h': [{
|
|
1203
|
-
'min-h': ['min', 'max', 'fit',
|
|
1180
|
+
'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']
|
|
1204
1181
|
}],
|
|
1205
1182
|
/**
|
|
1206
1183
|
* Max-Height
|
|
1207
1184
|
* @see https://tailwindcss.com/docs/max-height
|
|
1208
1185
|
*/
|
|
1209
1186
|
'max-h': [{
|
|
1210
|
-
'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit']
|
|
1187
|
+
'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']
|
|
1188
|
+
}],
|
|
1189
|
+
/**
|
|
1190
|
+
* Size
|
|
1191
|
+
* @see https://tailwindcss.com/docs/size
|
|
1192
|
+
*/
|
|
1193
|
+
size: [{
|
|
1194
|
+
size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']
|
|
1211
1195
|
}],
|
|
1212
1196
|
// Typography
|
|
1213
1197
|
/**
|
|
@@ -1290,7 +1274,7 @@ function getDefaultConfig() {
|
|
|
1290
1274
|
* @see https://tailwindcss.com/docs/line-height
|
|
1291
1275
|
*/
|
|
1292
1276
|
leading: [{
|
|
1293
|
-
leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose',
|
|
1277
|
+
leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue]
|
|
1294
1278
|
}],
|
|
1295
1279
|
/**
|
|
1296
1280
|
* List Style Image
|
|
@@ -1359,21 +1343,21 @@ function getDefaultConfig() {
|
|
|
1359
1343
|
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
1360
1344
|
*/
|
|
1361
1345
|
'text-decoration-style': [{
|
|
1362
|
-
decoration: [
|
|
1346
|
+
decoration: [...getLineStyles(), 'wavy']
|
|
1363
1347
|
}],
|
|
1364
1348
|
/**
|
|
1365
1349
|
* Text Decoration Thickness
|
|
1366
1350
|
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
1367
1351
|
*/
|
|
1368
1352
|
'text-decoration-thickness': [{
|
|
1369
|
-
decoration: ['auto', 'from-font', isLength]
|
|
1353
|
+
decoration: ['auto', 'from-font', isLength, isArbitraryLength]
|
|
1370
1354
|
}],
|
|
1371
1355
|
/**
|
|
1372
1356
|
* Text Underline Offset
|
|
1373
1357
|
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
1374
1358
|
*/
|
|
1375
1359
|
'underline-offset': [{
|
|
1376
|
-
'underline-offset': ['auto',
|
|
1360
|
+
'underline-offset': ['auto', isLength, isArbitraryValue]
|
|
1377
1361
|
}],
|
|
1378
1362
|
/**
|
|
1379
1363
|
* Text Decoration Color
|
|
@@ -1392,6 +1376,13 @@ function getDefaultConfig() {
|
|
|
1392
1376
|
* @see https://tailwindcss.com/docs/text-overflow
|
|
1393
1377
|
*/
|
|
1394
1378
|
'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],
|
|
1379
|
+
/**
|
|
1380
|
+
* Text Wrap
|
|
1381
|
+
* @see https://tailwindcss.com/docs/text-wrap
|
|
1382
|
+
*/
|
|
1383
|
+
'text-wrap': [{
|
|
1384
|
+
text: ['wrap', 'nowrap', 'balance', 'pretty']
|
|
1385
|
+
}],
|
|
1395
1386
|
/**
|
|
1396
1387
|
* Text Indent
|
|
1397
1388
|
* @see https://tailwindcss.com/docs/text-indent
|
|
@@ -1417,8 +1408,8 @@ function getDefaultConfig() {
|
|
|
1417
1408
|
* Word Break
|
|
1418
1409
|
* @see https://tailwindcss.com/docs/word-break
|
|
1419
1410
|
*/
|
|
1420
|
-
|
|
1421
|
-
|
|
1411
|
+
break: [{
|
|
1412
|
+
break: ['normal', 'words', 'all', 'keep']
|
|
1422
1413
|
}],
|
|
1423
1414
|
/**
|
|
1424
1415
|
* Hyphens
|
|
@@ -1469,7 +1460,7 @@ function getDefaultConfig() {
|
|
|
1469
1460
|
* @see https://tailwindcss.com/docs/background-position
|
|
1470
1461
|
*/
|
|
1471
1462
|
'bg-position': [{
|
|
1472
|
-
bg: [
|
|
1463
|
+
bg: [...getPositions(), isArbitraryPosition]
|
|
1473
1464
|
}],
|
|
1474
1465
|
/**
|
|
1475
1466
|
* Background Repeat
|
|
@@ -1494,7 +1485,7 @@ function getDefaultConfig() {
|
|
|
1494
1485
|
'bg-image': [{
|
|
1495
1486
|
bg: ['none', {
|
|
1496
1487
|
'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
|
|
1497
|
-
},
|
|
1488
|
+
}, isArbitraryImage]
|
|
1498
1489
|
}],
|
|
1499
1490
|
/**
|
|
1500
1491
|
* Background Color
|
|
@@ -1726,7 +1717,7 @@ function getDefaultConfig() {
|
|
|
1726
1717
|
* @see https://tailwindcss.com/docs/border-style
|
|
1727
1718
|
*/
|
|
1728
1719
|
'border-style': [{
|
|
1729
|
-
border: [
|
|
1720
|
+
border: [...getLineStyles(), 'hidden']
|
|
1730
1721
|
}],
|
|
1731
1722
|
/**
|
|
1732
1723
|
* Divide Width X
|
|
@@ -1827,21 +1818,21 @@ function getDefaultConfig() {
|
|
|
1827
1818
|
* @see https://tailwindcss.com/docs/outline-style
|
|
1828
1819
|
*/
|
|
1829
1820
|
'outline-style': [{
|
|
1830
|
-
outline: [''
|
|
1821
|
+
outline: ['', ...getLineStyles()]
|
|
1831
1822
|
}],
|
|
1832
1823
|
/**
|
|
1833
1824
|
* Outline Offset
|
|
1834
1825
|
* @see https://tailwindcss.com/docs/outline-offset
|
|
1835
1826
|
*/
|
|
1836
1827
|
'outline-offset': [{
|
|
1837
|
-
'outline-offset': [
|
|
1828
|
+
'outline-offset': [isLength, isArbitraryValue]
|
|
1838
1829
|
}],
|
|
1839
1830
|
/**
|
|
1840
1831
|
* Outline Width
|
|
1841
1832
|
* @see https://tailwindcss.com/docs/outline-width
|
|
1842
1833
|
*/
|
|
1843
1834
|
'outline-w': [{
|
|
1844
|
-
outline: [isLength]
|
|
1835
|
+
outline: [isLength, isArbitraryLength]
|
|
1845
1836
|
}],
|
|
1846
1837
|
/**
|
|
1847
1838
|
* Outline Color
|
|
@@ -1855,7 +1846,7 @@ function getDefaultConfig() {
|
|
|
1855
1846
|
* @see https://tailwindcss.com/docs/ring-width
|
|
1856
1847
|
*/
|
|
1857
1848
|
'ring-w': [{
|
|
1858
|
-
ring:
|
|
1849
|
+
ring: getLengthWithEmptyAndArbitrary()
|
|
1859
1850
|
}],
|
|
1860
1851
|
/**
|
|
1861
1852
|
* Ring Width Inset
|
|
@@ -1881,7 +1872,7 @@ function getDefaultConfig() {
|
|
|
1881
1872
|
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
1882
1873
|
*/
|
|
1883
1874
|
'ring-offset-w': [{
|
|
1884
|
-
'ring-offset': [isLength]
|
|
1875
|
+
'ring-offset': [isLength, isArbitraryLength]
|
|
1885
1876
|
}],
|
|
1886
1877
|
/**
|
|
1887
1878
|
* Ring Offset Color
|
|
@@ -2231,7 +2222,9 @@ function getDefaultConfig() {
|
|
|
2231
2222
|
* Appearance
|
|
2232
2223
|
* @see https://tailwindcss.com/docs/appearance
|
|
2233
2224
|
*/
|
|
2234
|
-
appearance: [
|
|
2225
|
+
appearance: [{
|
|
2226
|
+
appearance: ['none', 'auto']
|
|
2227
|
+
}],
|
|
2235
2228
|
/**
|
|
2236
2229
|
* Cursor
|
|
2237
2230
|
* @see https://tailwindcss.com/docs/cursor
|
|
@@ -2426,10 +2419,27 @@ function getDefaultConfig() {
|
|
|
2426
2419
|
* @see https://tailwindcss.com/docs/touch-action
|
|
2427
2420
|
*/
|
|
2428
2421
|
touch: [{
|
|
2429
|
-
touch: ['auto', 'none', '
|
|
2430
|
-
|
|
2431
|
-
|
|
2422
|
+
touch: ['auto', 'none', 'manipulation']
|
|
2423
|
+
}],
|
|
2424
|
+
/**
|
|
2425
|
+
* Touch Action X
|
|
2426
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2427
|
+
*/
|
|
2428
|
+
'touch-x': [{
|
|
2429
|
+
'touch-pan': ['x', 'left', 'right']
|
|
2430
|
+
}],
|
|
2431
|
+
/**
|
|
2432
|
+
* Touch Action Y
|
|
2433
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2434
|
+
*/
|
|
2435
|
+
'touch-y': [{
|
|
2436
|
+
'touch-pan': ['y', 'up', 'down']
|
|
2432
2437
|
}],
|
|
2438
|
+
/**
|
|
2439
|
+
* Touch Action Pinch Zoom
|
|
2440
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2441
|
+
*/
|
|
2442
|
+
'touch-pz': ['touch-pinch-zoom'],
|
|
2433
2443
|
/**
|
|
2434
2444
|
* User Select
|
|
2435
2445
|
* @see https://tailwindcss.com/docs/user-select
|
|
@@ -2457,7 +2467,7 @@ function getDefaultConfig() {
|
|
|
2457
2467
|
* @see https://tailwindcss.com/docs/stroke-width
|
|
2458
2468
|
*/
|
|
2459
2469
|
'stroke-w': [{
|
|
2460
|
-
stroke: [isLength, isArbitraryNumber]
|
|
2470
|
+
stroke: [isLength, isArbitraryLength, isArbitraryNumber]
|
|
2461
2471
|
}],
|
|
2462
2472
|
/**
|
|
2463
2473
|
* Stroke
|
|
@@ -2471,7 +2481,14 @@ function getDefaultConfig() {
|
|
|
2471
2481
|
* Screen Readers
|
|
2472
2482
|
* @see https://tailwindcss.com/docs/screen-readers
|
|
2473
2483
|
*/
|
|
2474
|
-
sr: ['sr-only', 'not-sr-only']
|
|
2484
|
+
sr: ['sr-only', 'not-sr-only'],
|
|
2485
|
+
/**
|
|
2486
|
+
* Forced Color Adjust
|
|
2487
|
+
* @see https://tailwindcss.com/docs/forced-color-adjust
|
|
2488
|
+
*/
|
|
2489
|
+
'forced-color-adjust': [{
|
|
2490
|
+
'forced-color-adjust': ['auto', 'none']
|
|
2491
|
+
}]
|
|
2475
2492
|
},
|
|
2476
2493
|
conflictingClassGroups: {
|
|
2477
2494
|
overflow: ['overflow-x', 'overflow-y'],
|
|
@@ -2487,6 +2504,7 @@ function getDefaultConfig() {
|
|
|
2487
2504
|
m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
|
|
2488
2505
|
mx: ['mr', 'ml'],
|
|
2489
2506
|
my: ['mt', 'mb'],
|
|
2507
|
+
size: ['w', 'h'],
|
|
2490
2508
|
'font-size': ['leading'],
|
|
2491
2509
|
'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
|
|
2492
2510
|
'fvn-ordinal': ['fvn-normal'],
|
|
@@ -2494,6 +2512,7 @@ function getDefaultConfig() {
|
|
|
2494
2512
|
'fvn-figure': ['fvn-normal'],
|
|
2495
2513
|
'fvn-spacing': ['fvn-normal'],
|
|
2496
2514
|
'fvn-fraction': ['fvn-normal'],
|
|
2515
|
+
'line-clamp': ['display', 'overflow'],
|
|
2497
2516
|
rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],
|
|
2498
2517
|
'rounded-s': ['rounded-ss', 'rounded-es'],
|
|
2499
2518
|
'rounded-e': ['rounded-se', 'rounded-ee'],
|
|
@@ -2513,7 +2532,11 @@ function getDefaultConfig() {
|
|
|
2513
2532
|
'scroll-my': ['scroll-mt', 'scroll-mb'],
|
|
2514
2533
|
'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
|
|
2515
2534
|
'scroll-px': ['scroll-pr', 'scroll-pl'],
|
|
2516
|
-
'scroll-py': ['scroll-pt', 'scroll-pb']
|
|
2535
|
+
'scroll-py': ['scroll-pt', 'scroll-pb'],
|
|
2536
|
+
touch: ['touch-x', 'touch-y', 'touch-pz'],
|
|
2537
|
+
'touch-x': ['touch'],
|
|
2538
|
+
'touch-y': ['touch'],
|
|
2539
|
+
'touch-pz': ['touch']
|
|
2517
2540
|
},
|
|
2518
2541
|
conflictingClassGroupModifiers: {
|
|
2519
2542
|
'font-size': ['leading']
|
|
@@ -2525,45 +2548,61 @@ function getDefaultConfig() {
|
|
|
2525
2548
|
* @param baseConfig Config where other config will be merged into. This object will be mutated.
|
|
2526
2549
|
* @param configExtension Partial config to merge into the `baseConfig`.
|
|
2527
2550
|
*/
|
|
2528
|
-
function mergeConfigs(baseConfig,
|
|
2529
|
-
|
|
2530
|
-
|
|
2551
|
+
function mergeConfigs(baseConfig, {
|
|
2552
|
+
cacheSize,
|
|
2553
|
+
prefix,
|
|
2554
|
+
separator,
|
|
2555
|
+
extend = {},
|
|
2556
|
+
override = {}
|
|
2557
|
+
}) {
|
|
2558
|
+
overrideProperty(baseConfig, 'cacheSize', cacheSize);
|
|
2559
|
+
overrideProperty(baseConfig, 'prefix', prefix);
|
|
2560
|
+
overrideProperty(baseConfig, 'separator', separator);
|
|
2561
|
+
for (const configKey in override) {
|
|
2562
|
+
overrideConfigProperties(baseConfig[configKey], override[configKey]);
|
|
2563
|
+
}
|
|
2564
|
+
for (const key in extend) {
|
|
2565
|
+
mergeConfigProperties(baseConfig[key], extend[key]);
|
|
2531
2566
|
}
|
|
2532
2567
|
return baseConfig;
|
|
2533
2568
|
}
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
if (!hasOwnProperty.call(baseObject, mergeKey) || overrideTypes.has(typeof mergeValue) || mergeValue === null) {
|
|
2538
|
-
baseObject[mergeKey] = mergeValue;
|
|
2539
|
-
return;
|
|
2569
|
+
function overrideProperty(baseObject, overrideKey, overrideValue) {
|
|
2570
|
+
if (overrideValue !== undefined) {
|
|
2571
|
+
baseObject[overrideKey] = overrideValue;
|
|
2540
2572
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
if (baseObject[mergeKey] === null) {
|
|
2547
|
-
baseObject[mergeKey] = mergeValue;
|
|
2548
|
-
return;
|
|
2549
|
-
}
|
|
2550
|
-
for (var nextKey in mergeValue) {
|
|
2551
|
-
mergePropertyRecursively(baseObject[mergeKey], nextKey, mergeValue[nextKey]);
|
|
2573
|
+
}
|
|
2574
|
+
function overrideConfigProperties(baseObject, overrideObject) {
|
|
2575
|
+
if (overrideObject) {
|
|
2576
|
+
for (const key in overrideObject) {
|
|
2577
|
+
overrideProperty(baseObject, key, overrideObject[key]);
|
|
2552
2578
|
}
|
|
2553
2579
|
}
|
|
2554
2580
|
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2581
|
+
function mergeConfigProperties(baseObject, mergeObject) {
|
|
2582
|
+
if (mergeObject) {
|
|
2583
|
+
for (const key in mergeObject) {
|
|
2584
|
+
const mergeValue = mergeObject[key];
|
|
2585
|
+
if (mergeValue !== undefined) {
|
|
2586
|
+
baseObject[key] = (baseObject[key] || []).concat(mergeValue);
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2559
2589
|
}
|
|
2560
|
-
return typeof configExtension === 'function' ? createTailwindMerge.apply(void 0, [getDefaultConfig, configExtension].concat(createConfig)) : createTailwindMerge.apply(void 0, [function () {
|
|
2561
|
-
return mergeConfigs(getDefaultConfig(), configExtension);
|
|
2562
|
-
}].concat(createConfig));
|
|
2563
2590
|
}
|
|
2591
|
+
function extendTailwindMerge(configExtension, ...createConfig) {
|
|
2592
|
+
return typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);
|
|
2593
|
+
}
|
|
2594
|
+
const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
|
|
2595
|
+
exports.createTailwindMerge = createTailwindMerge;
|
|
2596
|
+
exports.extendTailwindMerge = extendTailwindMerge;
|
|
2597
|
+
exports.fromTheme = fromTheme;
|
|
2598
|
+
exports.getDefaultConfig = getDefaultConfig;
|
|
2599
|
+
exports.mergeConfigs = mergeConfigs;
|
|
2600
|
+
exports.twJoin = twJoin;
|
|
2601
|
+
exports.twMerge = twMerge;
|
|
2602
|
+
exports.validators = validators;
|
|
2603
|
+
//# sourceMappingURL=bundle-cjs.js.map
|
|
2604
|
+
});
|
|
2564
2605
|
|
|
2565
|
-
var twMerge =
|
|
2566
|
-
|
|
2567
|
-
var re={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Z=i=>i||void 0,j=(...i)=>Z(y(i).filter(Boolean).join(" ")),B=null,O={},R=!1,A=(...i)=>v=>v.twMerge?((!B||R)&&(R=!1,B=l(O)?twMerge:extendTailwindMerge(O)),Z(B(j(i)))):j(i),Y=(i,v)=>{for(let e in v)i.hasOwnProperty(e)?i[e]=j(i[e],v[e]):i[e]=v[e];return i},ce=(i,v)=>{let{extend:e$1=null,slots:N={},variants:q={},compoundVariants:C=[],compoundSlots:V=[],defaultVariants:F={}}=i,m={...re,...v},M=e$1!=null&&e$1.base?j(e$1.base,i==null?void 0:i.base):i==null?void 0:i.base,g$1=e$1!=null&&e$1.variants&&!l(e$1.variants)?p(q,e$1.variants):q,h=e$1!=null&&e$1.defaultVariants&&!l(e$1.defaultVariants)?{...e$1.defaultVariants,...F}:F;!l(m.twMergeConfig)&&!u(m.twMergeConfig,O)&&(R=!0,O=m.twMergeConfig);let $=l(N)?{}:{base:i==null?void 0:i.base,...N},w=l(e$1==null?void 0:e$1.slots)?$:Y(e$1==null?void 0:e$1.slots,l($)?{base:i==null?void 0:i.base}:$),d=f=>{if(l(g$1)&&l(N)&&l(e$1==null?void 0:e$1.slots))return A(M,f==null?void 0:f.class,f==null?void 0:f.className)(m);if(C&&!Array.isArray(C))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof C}`);if(V&&!Array.isArray(V))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof V}`);let K=(t,n,a=[],s)=>{let r=a;if(typeof n=="string")r=r.concat(g(n).split(" ").map(l=>`${t}:${l}`));else if(Array.isArray(n))r=r.concat(n.reduce((l,c)=>l.concat(`${t}:${c}`),[]));else if(typeof n=="object"&&typeof s=="string"){for(let l in n)if(n.hasOwnProperty(l)&&l===s){let c=n[l];if(c&&typeof c=="string"){let y=g(c);r[s]?r[s]=r[s].concat(y.split(" ").map(u=>`${t}:${u}`)):r[s]=y.split(" ").map(u=>`${t}:${u}`);}else Array.isArray(c)&&c.length>0&&(r[s]=c.reduce((y,u)=>y.concat(`${t}:${u}`),[]));}}return r},U=(t,n=g$1,a$1=null,s=null)=>{var H;let r=n[t];if(!r||l(r))return null;let l$1=(H=s==null?void 0:s[t])!=null?H:f==null?void 0:f[t];if(l$1===null)return null;let c=a(l$1),y=Array.isArray(m.responsiveVariants)&&m.responsiveVariants.length>0||m.responsiveVariants===!0,u=h==null?void 0:h[t],b$1=[];if(typeof c=="object"&&y)for(let[k,I]of Object.entries(c)){let te=r[I];if(k==="initial"){u=I;continue}Array.isArray(m.responsiveVariants)&&!m.responsiveVariants.includes(k)||(b$1=K(k,te,b$1,a$1));}let S=r[c]||r[a(u)];return typeof b$1=="object"&&typeof a$1=="string"&&b$1[a$1]?Y(b$1,S):b$1.length>0?(b$1.push(S),b$1):S},x$1=()=>g$1?Object.keys(g$1).map(t=>U(t,g$1)):null,P=(t,n)=>{if(!g$1||typeof g$1!="object")return null;let a=new Array;for(let s in g$1){let r=U(s,g$1,t,n),l=t==="base"&&typeof r=="string"?r:r&&r[t];l&&(a[a.length]=l);}return a},W={};for(let t in f)f[t]!==void 0&&(W[t]=f[t]);let z=(t,n)=>{var s;let a=typeof(f==null?void 0:f[t])=="object"?{[t]:(s=f[t])==null?void 0:s.initial}:{};return {...h,...W,...a,...n}},D=(t=[],n)=>{let a=[];for(let{class:s,className:r,...l}of t){let c=!0;for(let[y,u]of Object.entries(l)){let b=z(y,n);if(Array.isArray(u)){if(!u.includes(b[y])){c=!1;break}}else if(b[y]!==u){c=!1;break}}c&&(s&&a.push(s),r&&a.push(r));}return a},G=t=>{let n=D(C,t),a=D(e$1==null?void 0:e$1.compoundVariants,t);return x(a,n)},p=t=>{let n=G(t);if(!Array.isArray(n))return n;let a={};for(let s of n)if(typeof s=="string"&&(a.base=A(a.base,s)(m)),typeof s=="object")for(let[r,l]of Object.entries(s))a[r]=A(a[r],l)(m);return a},ee=t=>{if(V.length<1)return null;let n={};for(let{slots:a=[],class:s,className:r,...l$1}of V){if(!l(l$1)){let c=!0;for(let y of Object.keys(l$1)){let u=z(y,t)[y];if(u===void 0||u!==l$1[y]){c=!1;break}}if(!c)continue}for(let c of a)n[c]=n[c]||[],n[c].push([s,r]);}return n};if(!l(N)||!l(e$1==null?void 0:e$1.slots)){let t={};if(typeof w=="object"&&!l(w))for(let n of Object.keys(w))t[n]=a=>{var s,r;return A(w[n],P(n,a),((s=p(a))!=null?s:[])[n],((r=ee(a))!=null?r:[])[n],a==null?void 0:a.class,a==null?void 0:a.className)(m)};return t}return A(M,x$1(),G(),f==null?void 0:f.class,f==null?void 0:f.className)(m)},_=()=>{if(!(!g$1||typeof g$1!="object"))return Object.keys(g$1)};return d.variantKeys=_(),d.extend=e$1,d.base=M,d.slots=w,d.variants=g$1,d.defaultVariants=h,d.compoundSlots=V,d.compoundVariants=C,d};
|
|
2606
|
+
var ie={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},_=s=>s||void 0,M=(...s)=>_(y(s).filter(Boolean).join(" ")),R=null,v={},q=!1,j=(...s)=>b$1=>b$1.twMerge?((!R||q)&&(q=!1,R=u(v)?bundleCjs.twMerge:bundleCjs.extendTailwindMerge({...v,extend:{theme:v.theme,classGroups:v.classGroups,conflictingClassGroupModifiers:v.conflictingClassGroupModifiers,conflictingClassGroups:v.conflictingClassGroups,...v.extend}})),_(R(M(s)))):M(s),Z=(s,b)=>{for(let e in b)s.hasOwnProperty(e)?s[e]=M(s[e],b[e]):s[e]=b[e];return s},ce=(s,b$1)=>{let{extend:e=null,slots:N={},variants:F={},compoundVariants:U=[],compoundSlots:C=[],defaultVariants:W={}}=s,m={...ie,...b$1},S=e!=null&&e.base?M(e.base,s==null?void 0:s.base):s==null?void 0:s.base,g$1=e!=null&&e.variants&&!u(e.variants)?p(F,e.variants):F,A=e!=null&&e.defaultVariants&&!u(e.defaultVariants)?{...e.defaultVariants,...W}:W;!u(m.twMergeConfig)&&!x(m.twMergeConfig,v)&&(q=!0,v=m.twMergeConfig);let O=u(e==null?void 0:e.slots),$=u(N)?{}:{base:M(s==null?void 0:s.base,O&&(e==null?void 0:e.base)),...N},w=O?$:Z({...e==null?void 0:e.slots},u($)?{base:s==null?void 0:s.base}:$),h$1=u(e==null?void 0:e.compoundVariants)?U:a(e==null?void 0:e.compoundVariants,U),V=f=>{if(u(g$1)&&u(N)&&O)return j(S,f==null?void 0:f.class,f==null?void 0:f.className)(m);if(h$1&&!Array.isArray(h$1))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof h$1}`);if(C&&!Array.isArray(C))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof C}`);let K=(t,n,a=[],i)=>{let r=a;if(typeof n=="string")r=r.concat(g(n).split(" ").map(o=>`${t}:${o}`));else if(Array.isArray(n))r=r.concat(n.reduce((o,c)=>o.concat(`${t}:${c}`),[]));else if(typeof n=="object"&&typeof i=="string"){for(let o in n)if(n.hasOwnProperty(o)&&o===i){let c=n[o];if(c&&typeof c=="string"){let l=g(c);r[i]?r[i]=r[i].concat(l.split(" ").map(u=>`${t}:${u}`)):r[i]=l.split(" ").map(u=>`${t}:${u}`);}else Array.isArray(c)&&c.length>0&&(r[i]=c.reduce((l,u)=>l.concat(`${t}:${u}`),[]));}}return r},z=(t,n=g$1,a$1=null,i=null)=>{var J;let r=n[t];if(!r||u(r))return null;let o=(J=i==null?void 0:i[t])!=null?J:f==null?void 0:f[t];if(o===null)return null;let c=l(o),l$1=Array.isArray(m.responsiveVariants)&&m.responsiveVariants.length>0||m.responsiveVariants===!0,u$1=A==null?void 0:A[t],d=[];if(typeof c=="object"&&l$1)for(let[T,L]of Object.entries(c)){let ne=r[L];if(T==="initial"){u$1=L;continue}Array.isArray(m.responsiveVariants)&&!m.responsiveVariants.includes(T)||(d=K(T,ne,d,a$1));}let ae=c!=null&&typeof c!="object"?c:l(u$1),k=r[ae||"false"];return typeof d=="object"&&typeof a$1=="string"&&d[a$1]?Z(d,k):d.length>0?(d.push(k),d):k},P=()=>g$1?Object.keys(g$1).map(t=>z(t,g$1)):null,p=(t,n)=>{if(!g$1||typeof g$1!="object")return null;let a=new Array;for(let i in g$1){let r=z(i,g$1,t,n),o=t==="base"&&typeof r=="string"?r:r&&r[t];o&&(a[a.length]=o);}return a},D={};for(let t in f)f[t]!==void 0&&(D[t]=f[t]);let H=(t,n)=>{var i;let a=typeof(f==null?void 0:f[t])=="object"?{[t]:(i=f[t])==null?void 0:i.initial}:{};return {...A,...D,...a,...n}},I=(t=[],n)=>{let a=[];for(let{class:i,className:r,...o}of t){let c=!0;for(let[l,u]of Object.entries(o)){let d=H(l,n);if(Array.isArray(u)){if(!u.includes(d[l])){c=!1;break}}else if(d[l]!==u){c=!1;break}}c&&(i&&a.push(i),r&&a.push(r));}return a},ee=t=>{let n=I(h$1,t);if(!Array.isArray(n))return n;let a={};for(let i of n)if(typeof i=="string"&&(a.base=j(a.base,i)(m)),typeof i=="object")for(let[r,o]of Object.entries(i))a[r]=j(a[r],o)(m);return a},te=t=>{if(C.length<1)return null;let n={};for(let{slots:a=[],class:i,className:r,...o}of C){if(!u(o)){let c=!0;for(let l of Object.keys(o)){let u=H(l,t)[l];if(u===void 0||(Array.isArray(o[l])?!o[l].includes(u):o[l]!==u)){c=!1;break}}if(!c)continue}for(let c of a)n[c]=n[c]||[],n[c].push([i,r]);}return n};if(!u(N)||!O){let t={};if(typeof w=="object"&&!u(w))for(let n of Object.keys(w))t[n]=a=>{var i,r;return j(w[n],p(n,a),((i=ee(a))!=null?i:[])[n],((r=te(a))!=null?r:[])[n],a==null?void 0:a.class,a==null?void 0:a.className)(m)};return t}return j(S,P(),I(h$1),f==null?void 0:f.class,f==null?void 0:f.className)(m)},x$1=()=>{if(!(!g$1||typeof g$1!="object"))return Object.keys(g$1)};return V.variantKeys=x$1(),V.extend=e,V.base=S,V.slots=w,V.variants=g$1,V.defaultVariants=A,V.compoundSlots=C,V.compoundVariants=h$1,V};
|
|
2568
2607
|
|
|
2569
2608
|
export { ce as c };
|