bromcom-ui 2.12.2-test.0 → 2.12.2-test.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-08c75801.js +5 -0
- package/dist/bromcom-ui/{p-33a40e22.entry.js → p-0bc1d908.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2a609520.entry.js → p-0f29d0dd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d938b428.entry.js → p-112e0727.entry.js} +1 -1
- package/dist/bromcom-ui/{p-12133565.js → p-304db6c3.js} +1 -1
- package/dist/bromcom-ui/{p-6ebbc0c7.entry.js → p-3212201e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-758bf843.entry.js → p-35ff3206.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e4f7a11e.entry.js → p-38c63284.entry.js} +1 -1
- package/dist/bromcom-ui/{p-056785ca.entry.js → p-3cc4266d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c73b74f6.entry.js → p-4308aba0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cb99a9b8.entry.js → p-467ad7a1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5c03c44b.entry.js → p-4b440055.entry.js} +1 -1
- package/dist/bromcom-ui/{p-67352697.js → p-4efbc5c8.js} +1 -1
- package/dist/bromcom-ui/{p-d587c02a.entry.js → p-53d997e6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-84f2a816.entry.js → p-5dc6d136.entry.js} +1 -1
- package/dist/bromcom-ui/{p-14b725a7.entry.js → p-5dfb9f46.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d4cc8b4d.entry.js → p-5ed2f9cb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8b7bb213.entry.js → p-6c1af0c0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ce99c0ec.entry.js → p-6f22f3c9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-41e60400.entry.js → p-7a4ee5b3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-acad99a2.entry.js → p-80b5ebdd.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c0be6529.js → p-8927a715.js} +1 -1
- package/dist/bromcom-ui/{p-8c312ed4.js → p-8e98eedc.js} +1 -1
- package/dist/bromcom-ui/p-9156f5bb.entry.js +5 -0
- package/dist/bromcom-ui/{p-df48ff39.entry.js → p-96635cea.entry.js} +1 -1
- package/dist/bromcom-ui/{p-518bddef.js → p-a639d6c1.js} +1 -1
- package/dist/bromcom-ui/{p-cd9b19ec.entry.js → p-aebf1a6d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ccf83587.entry.js → p-b18e4392.entry.js} +2 -2
- package/dist/bromcom-ui/{p-2f5c9906.entry.js → p-b2731373.entry.js} +1 -1
- package/dist/bromcom-ui/{p-155da55c.js → p-d1298c40.js} +1 -1
- package/dist/bromcom-ui/{p-25b5138d.entry.js → p-dfa23b8e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-15f73583.entry.js → p-e089ce19.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1f8c2199.entry.js → p-e1cedfa7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-b721a12e.entry.js → p-eb425ca4.entry.js} +1 -1
- package/dist/bromcom-ui/p-ee591beb.entry.js +5 -0
- package/dist/cjs/bcm-accordion_63.cjs.entry.js +25 -38
- 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-8b79fe19.js → generate-2000269d.js} +1 -1
- package/dist/cjs/{global-8d54b6ff.js → global-d601eaab.js} +1 -1
- package/dist/cjs/{index-d3b89435.js → index-5279dea2.js} +347 -386
- package/dist/cjs/{input.style-890ee369.js → input.style-b5676e6a.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{number-helper-0dcca04f.js → number-helper-109c65dd.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-2af5ef6d.js → package-c7ade2f2.js} +1 -1
- package/dist/cjs/{validators-5c1442df.js → validators-23935b44.js} +1 -1
- package/dist/collection/components/molecules/menu/menu.js +0 -14
- package/dist/collection/components/organism/list/list.js +2 -2
- package/dist/collection/stories/ui-library/components/list/country.js +186 -0
- package/dist/components/generate.js +1 -1
- package/dist/components/index5.js +347 -386
- package/dist/components/list.js +2 -2
- package/dist/components/menu.js +0 -14
- package/dist/esm/bcm-accordion_63.entry.js +25 -38
- 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-e0d0677e.js → generate-e5e2493b.js} +1 -1
- package/dist/esm/{global-b4aafa0d.js → global-615575d3.js} +1 -1
- package/dist/esm/{index-9f698d35.js → index-3bc8c6e3.js} +347 -386
- package/dist/esm/{input.style-fadcc0bd.js → input.style-e855c0f3.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{number-helper-423b9a17.js → number-helper-c965b1ed.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-bb25563a.js → package-48eb1343.js} +1 -1
- package/dist/esm/{validators-4aa12ffe.js → validators-f1925841.js} +1 -1
- package/dist/types/stories/ui-library/components/list/country.d.ts +6 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-2e9ac83b.entry.js +0 -5
- package/dist/bromcom-ui/p-c0b3bf0d.entry.js +0 -5
- package/dist/bromcom-ui/p-ccc61045.js +0 -5
|
@@ -2,24 +2,57 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
var a=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,l=t=>!t||typeof t!="object"||Object.keys(t).length===0,u=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function i(t,e){t.forEach(function(n){Array.isArray(n)?i(n,e):e.push(n);});}function y(t){let e=[];return i(t,e),e}var x=(...t)=>y(t).filter(Boolean),p=(t,e)=>{let n={},c=Object.keys(t),f=Object.keys(e);for(let o of c)if(f.includes(o)){let r=t[o],s=e[o];typeof r=="object"&&typeof s=="object"?n[o]=p(r,s):n[o]=s+" "+r;}else n[o]=t[o];for(let o of f)c.includes(o)||(n[o]=e[o]);return n},g=t=>!t||typeof t!="string"?t:t.replace(/\s+/g," ").trim();
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
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
|
+
}
|
|
10
47
|
|
|
11
|
-
|
|
12
|
-
value: 'Module'
|
|
13
|
-
});
|
|
14
|
-
const CLASS_PART_SEPARATOR = '-';
|
|
48
|
+
var CLASS_PART_SEPARATOR = '-';
|
|
15
49
|
function createClassUtils(config) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
conflictingClassGroupModifiers
|
|
20
|
-
} = config;
|
|
50
|
+
var classMap = createClassMap(config);
|
|
51
|
+
var conflictingClassGroups = config.conflictingClassGroups,
|
|
52
|
+
_config$conflictingCl = config.conflictingClassGroupModifiers,
|
|
53
|
+
conflictingClassGroupModifiers = _config$conflictingCl === void 0 ? {} : _config$conflictingCl;
|
|
21
54
|
function getClassGroupId(className) {
|
|
22
|
-
|
|
55
|
+
var classParts = className.split(CLASS_PART_SEPARATOR);
|
|
23
56
|
// 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.
|
|
24
57
|
if (classParts[0] === '' && classParts.length !== 1) {
|
|
25
58
|
classParts.shift();
|
|
@@ -27,40 +60,41 @@ function createClassUtils(config) {
|
|
|
27
60
|
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
28
61
|
}
|
|
29
62
|
function getConflictingClassGroupIds(classGroupId, hasPostfixModifier) {
|
|
30
|
-
|
|
63
|
+
var conflicts = conflictingClassGroups[classGroupId] || [];
|
|
31
64
|
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
32
|
-
return [
|
|
65
|
+
return [].concat(conflicts, conflictingClassGroupModifiers[classGroupId]);
|
|
33
66
|
}
|
|
34
67
|
return conflicts;
|
|
35
68
|
}
|
|
36
69
|
return {
|
|
37
|
-
getClassGroupId,
|
|
38
|
-
getConflictingClassGroupIds
|
|
70
|
+
getClassGroupId: getClassGroupId,
|
|
71
|
+
getConflictingClassGroupIds: getConflictingClassGroupIds
|
|
39
72
|
};
|
|
40
73
|
}
|
|
41
74
|
function getGroupRecursive(classParts, classPartObject) {
|
|
42
75
|
if (classParts.length === 0) {
|
|
43
76
|
return classPartObject.classGroupId;
|
|
44
77
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
78
|
+
var currentClassPart = classParts[0];
|
|
79
|
+
var nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
80
|
+
var classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
|
|
48
81
|
if (classGroupFromNextClassPart) {
|
|
49
82
|
return classGroupFromNextClassPart;
|
|
50
83
|
}
|
|
51
84
|
if (classPartObject.validators.length === 0) {
|
|
52
85
|
return undefined;
|
|
53
86
|
}
|
|
54
|
-
|
|
55
|
-
return classPartObject.validators.find(({
|
|
56
|
-
validator
|
|
57
|
-
|
|
87
|
+
var classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
88
|
+
return classPartObject.validators.find(function (_ref) {
|
|
89
|
+
var validator = _ref.validator;
|
|
90
|
+
return validator(classRest);
|
|
91
|
+
})?.classGroupId;
|
|
58
92
|
}
|
|
59
|
-
|
|
93
|
+
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
60
94
|
function getGroupIdForArbitraryProperty(className) {
|
|
61
95
|
if (arbitraryPropertyRegex.test(className)) {
|
|
62
|
-
|
|
63
|
-
|
|
96
|
+
var arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
97
|
+
var property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
|
|
64
98
|
if (property) {
|
|
65
99
|
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
66
100
|
return 'arbitrary..' + property;
|
|
@@ -71,24 +105,24 @@ function getGroupIdForArbitraryProperty(className) {
|
|
|
71
105
|
* Exported for testing only
|
|
72
106
|
*/
|
|
73
107
|
function createClassMap(config) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} = config;
|
|
78
|
-
const classMap = {
|
|
108
|
+
var theme = config.theme,
|
|
109
|
+
prefix = config.prefix;
|
|
110
|
+
var classMap = {
|
|
79
111
|
nextPart: new Map(),
|
|
80
112
|
validators: []
|
|
81
113
|
};
|
|
82
|
-
|
|
83
|
-
prefixedClassGroupEntries.forEach((
|
|
114
|
+
var prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
|
|
115
|
+
prefixedClassGroupEntries.forEach(function (_ref2) {
|
|
116
|
+
var classGroupId = _ref2[0],
|
|
117
|
+
classGroup = _ref2[1];
|
|
84
118
|
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
85
119
|
});
|
|
86
120
|
return classMap;
|
|
87
121
|
}
|
|
88
122
|
function processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {
|
|
89
|
-
classGroup.forEach(classDefinition
|
|
123
|
+
classGroup.forEach(function (classDefinition) {
|
|
90
124
|
if (typeof classDefinition === 'string') {
|
|
91
|
-
|
|
125
|
+
var classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
|
|
92
126
|
classPartObjectToEdit.classGroupId = classGroupId;
|
|
93
127
|
return;
|
|
94
128
|
}
|
|
@@ -99,18 +133,20 @@ function processClassesRecursively(classGroup, classPartObject, classGroupId, th
|
|
|
99
133
|
}
|
|
100
134
|
classPartObject.validators.push({
|
|
101
135
|
validator: classDefinition,
|
|
102
|
-
classGroupId
|
|
136
|
+
classGroupId: classGroupId
|
|
103
137
|
});
|
|
104
138
|
return;
|
|
105
139
|
}
|
|
106
|
-
Object.entries(classDefinition).forEach((
|
|
140
|
+
Object.entries(classDefinition).forEach(function (_ref3) {
|
|
141
|
+
var key = _ref3[0],
|
|
142
|
+
classGroup = _ref3[1];
|
|
107
143
|
processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
|
|
108
144
|
});
|
|
109
145
|
});
|
|
110
146
|
}
|
|
111
147
|
function getPart(classPartObject, path) {
|
|
112
|
-
|
|
113
|
-
path.split(CLASS_PART_SEPARATOR).forEach(pathPart
|
|
148
|
+
var currentClassPartObject = classPartObject;
|
|
149
|
+
path.split(CLASS_PART_SEPARATOR).forEach(function (pathPart) {
|
|
114
150
|
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
115
151
|
currentClassPartObject.nextPart.set(pathPart, {
|
|
116
152
|
nextPart: new Map(),
|
|
@@ -128,13 +164,19 @@ function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
|
|
|
128
164
|
if (!prefix) {
|
|
129
165
|
return classGroupEntries;
|
|
130
166
|
}
|
|
131
|
-
return classGroupEntries.map((
|
|
132
|
-
|
|
167
|
+
return classGroupEntries.map(function (_ref4) {
|
|
168
|
+
var classGroupId = _ref4[0],
|
|
169
|
+
classGroup = _ref4[1];
|
|
170
|
+
var prefixedClassGroup = classGroup.map(function (classDefinition) {
|
|
133
171
|
if (typeof classDefinition === 'string') {
|
|
134
172
|
return prefix + classDefinition;
|
|
135
173
|
}
|
|
136
174
|
if (typeof classDefinition === 'object') {
|
|
137
|
-
return Object.fromEntries(Object.entries(classDefinition).map((
|
|
175
|
+
return Object.fromEntries(Object.entries(classDefinition).map(function (_ref5) {
|
|
176
|
+
var key = _ref5[0],
|
|
177
|
+
value = _ref5[1];
|
|
178
|
+
return [prefix + key, value];
|
|
179
|
+
}));
|
|
138
180
|
}
|
|
139
181
|
return classDefinition;
|
|
140
182
|
});
|
|
@@ -146,13 +188,15 @@ function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
|
|
|
146
188
|
function createLruCache(maxCacheSize) {
|
|
147
189
|
if (maxCacheSize < 1) {
|
|
148
190
|
return {
|
|
149
|
-
get: ()
|
|
150
|
-
|
|
191
|
+
get: function get() {
|
|
192
|
+
return undefined;
|
|
193
|
+
},
|
|
194
|
+
set: function set() {}
|
|
151
195
|
};
|
|
152
196
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
197
|
+
var cacheSize = 0;
|
|
198
|
+
var cache = new Map();
|
|
199
|
+
var previousCache = new Map();
|
|
156
200
|
function update(key, value) {
|
|
157
201
|
cache.set(key, value);
|
|
158
202
|
cacheSize++;
|
|
@@ -163,8 +207,8 @@ function createLruCache(maxCacheSize) {
|
|
|
163
207
|
}
|
|
164
208
|
}
|
|
165
209
|
return {
|
|
166
|
-
get(key) {
|
|
167
|
-
|
|
210
|
+
get: function get(key) {
|
|
211
|
+
var value = cache.get(key);
|
|
168
212
|
if (value !== undefined) {
|
|
169
213
|
return value;
|
|
170
214
|
}
|
|
@@ -173,7 +217,7 @@ function createLruCache(maxCacheSize) {
|
|
|
173
217
|
return value;
|
|
174
218
|
}
|
|
175
219
|
},
|
|
176
|
-
set(key, value) {
|
|
220
|
+
set: function set(key, value) {
|
|
177
221
|
if (cache.has(key)) {
|
|
178
222
|
cache.set(key, value);
|
|
179
223
|
} else {
|
|
@@ -182,20 +226,21 @@ function createLruCache(maxCacheSize) {
|
|
|
182
226
|
}
|
|
183
227
|
};
|
|
184
228
|
}
|
|
185
|
-
|
|
229
|
+
|
|
230
|
+
var IMPORTANT_MODIFIER = '!';
|
|
186
231
|
function createSplitModifiers(config) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
232
|
+
var separator = config.separator || ':';
|
|
233
|
+
var isSeparatorSingleCharacter = separator.length === 1;
|
|
234
|
+
var firstSeparatorCharacter = separator[0];
|
|
235
|
+
var separatorLength = separator.length;
|
|
191
236
|
// splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
|
|
192
237
|
return function splitModifiers(className) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
for (
|
|
198
|
-
|
|
238
|
+
var modifiers = [];
|
|
239
|
+
var bracketDepth = 0;
|
|
240
|
+
var modifierStart = 0;
|
|
241
|
+
var postfixModifierPosition;
|
|
242
|
+
for (var index = 0; index < className.length; index++) {
|
|
243
|
+
var currentCharacter = className[index];
|
|
199
244
|
if (bracketDepth === 0) {
|
|
200
245
|
if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
|
|
201
246
|
modifiers.push(className.slice(modifierStart, index));
|
|
@@ -213,15 +258,15 @@ function createSplitModifiers(config) {
|
|
|
213
258
|
bracketDepth--;
|
|
214
259
|
}
|
|
215
260
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
261
|
+
var baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
262
|
+
var hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
|
|
263
|
+
var baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
|
|
264
|
+
var maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
|
|
220
265
|
return {
|
|
221
|
-
modifiers,
|
|
222
|
-
hasImportantModifier,
|
|
223
|
-
baseClassName,
|
|
224
|
-
maybePostfixModifierPosition
|
|
266
|
+
modifiers: modifiers,
|
|
267
|
+
hasImportantModifier: hasImportantModifier,
|
|
268
|
+
baseClassName: baseClassName,
|
|
269
|
+
maybePostfixModifierPosition: maybePostfixModifierPosition
|
|
225
270
|
};
|
|
226
271
|
};
|
|
227
272
|
}
|
|
@@ -234,20 +279,21 @@ function sortModifiers(modifiers) {
|
|
|
234
279
|
if (modifiers.length <= 1) {
|
|
235
280
|
return modifiers;
|
|
236
281
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
modifiers.forEach(modifier
|
|
240
|
-
|
|
282
|
+
var sortedModifiers = [];
|
|
283
|
+
var unsortedModifiers = [];
|
|
284
|
+
modifiers.forEach(function (modifier) {
|
|
285
|
+
var isArbitraryVariant = modifier[0] === '[';
|
|
241
286
|
if (isArbitraryVariant) {
|
|
242
|
-
sortedModifiers.push(
|
|
287
|
+
sortedModifiers.push.apply(sortedModifiers, unsortedModifiers.sort().concat([modifier]));
|
|
243
288
|
unsortedModifiers = [];
|
|
244
289
|
} else {
|
|
245
290
|
unsortedModifiers.push(modifier);
|
|
246
291
|
}
|
|
247
292
|
});
|
|
248
|
-
sortedModifiers.push(
|
|
293
|
+
sortedModifiers.push.apply(sortedModifiers, unsortedModifiers.sort());
|
|
249
294
|
return sortedModifiers;
|
|
250
295
|
}
|
|
296
|
+
|
|
251
297
|
function createConfigUtils(config) {
|
|
252
298
|
return {
|
|
253
299
|
cache: createLruCache(config.cacheSize),
|
|
@@ -255,13 +301,12 @@ function createConfigUtils(config) {
|
|
|
255
301
|
...createClassUtils(config)
|
|
256
302
|
};
|
|
257
303
|
}
|
|
258
|
-
|
|
304
|
+
|
|
305
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
259
306
|
function mergeClassList(classList, configUtils) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
getConflictingClassGroupIds
|
|
264
|
-
} = configUtils;
|
|
307
|
+
var splitModifiers = configUtils.splitModifiers,
|
|
308
|
+
getClassGroupId = configUtils.getClassGroupId,
|
|
309
|
+
getConflictingClassGroupIds = configUtils.getConflictingClassGroupIds;
|
|
265
310
|
/**
|
|
266
311
|
* Set of classGroupIds in following format:
|
|
267
312
|
* `{importantModifier}{variantModifiers}{classGroupId}`
|
|
@@ -269,109 +314,77 @@ function mergeClassList(classList, configUtils) {
|
|
|
269
314
|
* @example 'hover:focus:bg-color'
|
|
270
315
|
* @example 'md:!pr'
|
|
271
316
|
*/
|
|
272
|
-
|
|
273
|
-
return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName
|
|
274
|
-
|
|
275
|
-
modifiers,
|
|
276
|
-
hasImportantModifier,
|
|
277
|
-
baseClassName,
|
|
278
|
-
maybePostfixModifierPosition
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
317
|
+
var classGroupsInConflict = new Set();
|
|
318
|
+
return classList.trim().split(SPLIT_CLASSES_REGEX).map(function (originalClassName) {
|
|
319
|
+
var _splitModifiers = splitModifiers(originalClassName),
|
|
320
|
+
modifiers = _splitModifiers.modifiers,
|
|
321
|
+
hasImportantModifier = _splitModifiers.hasImportantModifier,
|
|
322
|
+
baseClassName = _splitModifiers.baseClassName,
|
|
323
|
+
maybePostfixModifierPosition = _splitModifiers.maybePostfixModifierPosition;
|
|
324
|
+
var classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
325
|
+
var hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
282
326
|
if (!classGroupId) {
|
|
283
327
|
if (!maybePostfixModifierPosition) {
|
|
284
328
|
return {
|
|
285
329
|
isTailwindClass: false,
|
|
286
|
-
originalClassName
|
|
330
|
+
originalClassName: originalClassName
|
|
287
331
|
};
|
|
288
332
|
}
|
|
289
333
|
classGroupId = getClassGroupId(baseClassName);
|
|
290
334
|
if (!classGroupId) {
|
|
291
335
|
return {
|
|
292
336
|
isTailwindClass: false,
|
|
293
|
-
originalClassName
|
|
337
|
+
originalClassName: originalClassName
|
|
294
338
|
};
|
|
295
339
|
}
|
|
296
340
|
hasPostfixModifier = false;
|
|
297
341
|
}
|
|
298
|
-
|
|
299
|
-
|
|
342
|
+
var variantModifier = sortModifiers(modifiers).join(':');
|
|
343
|
+
var modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
300
344
|
return {
|
|
301
345
|
isTailwindClass: true,
|
|
302
|
-
modifierId,
|
|
303
|
-
classGroupId,
|
|
304
|
-
originalClassName,
|
|
305
|
-
hasPostfixModifier
|
|
346
|
+
modifierId: modifierId,
|
|
347
|
+
classGroupId: classGroupId,
|
|
348
|
+
originalClassName: originalClassName,
|
|
349
|
+
hasPostfixModifier: hasPostfixModifier
|
|
306
350
|
};
|
|
307
351
|
}).reverse()
|
|
308
352
|
// Last class in conflict wins, so we need to filter conflicting classes in reverse order.
|
|
309
|
-
.filter(parsed
|
|
353
|
+
.filter(function (parsed) {
|
|
310
354
|
if (!parsed.isTailwindClass) {
|
|
311
355
|
return true;
|
|
312
356
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
} = parsed;
|
|
318
|
-
const classId = modifierId + classGroupId;
|
|
357
|
+
var modifierId = parsed.modifierId,
|
|
358
|
+
classGroupId = parsed.classGroupId,
|
|
359
|
+
hasPostfixModifier = parsed.hasPostfixModifier;
|
|
360
|
+
var classId = modifierId + classGroupId;
|
|
319
361
|
if (classGroupsInConflict.has(classId)) {
|
|
320
362
|
return false;
|
|
321
363
|
}
|
|
322
364
|
classGroupsInConflict.add(classId);
|
|
323
|
-
getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(
|
|
365
|
+
getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(function (group) {
|
|
366
|
+
return classGroupsInConflict.add(modifierId + group);
|
|
367
|
+
});
|
|
324
368
|
return true;
|
|
325
|
-
}).reverse().map(
|
|
369
|
+
}).reverse().map(function (parsed) {
|
|
370
|
+
return parsed.originalClassName;
|
|
371
|
+
}).join(' ');
|
|
326
372
|
}
|
|
327
373
|
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
}
|
|
374
|
+
function createTailwindMerge() {
|
|
375
|
+
for (var _len = arguments.length, createConfig = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
376
|
+
createConfig[_key] = arguments[_key];
|
|
365
377
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
let cacheGet;
|
|
371
|
-
let cacheSet;
|
|
372
|
-
let functionToCall = initTailwindMerge;
|
|
378
|
+
var configUtils;
|
|
379
|
+
var cacheGet;
|
|
380
|
+
var cacheSet;
|
|
381
|
+
var functionToCall = initTailwindMerge;
|
|
373
382
|
function initTailwindMerge(classList) {
|
|
374
|
-
|
|
383
|
+
var firstCreateConfig = createConfig[0],
|
|
384
|
+
restCreateConfig = createConfig.slice(1);
|
|
385
|
+
var config = restCreateConfig.reduce(function (previousConfig, createConfigCurrent) {
|
|
386
|
+
return createConfigCurrent(previousConfig);
|
|
387
|
+
}, firstCreateConfig());
|
|
375
388
|
configUtils = createConfigUtils(config);
|
|
376
389
|
cacheGet = configUtils.cache.get;
|
|
377
390
|
cacheSet = configUtils.cache.set;
|
|
@@ -379,11 +392,11 @@ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
|
379
392
|
return tailwindMerge(classList);
|
|
380
393
|
}
|
|
381
394
|
function tailwindMerge(classList) {
|
|
382
|
-
|
|
395
|
+
var cachedResult = cacheGet(classList);
|
|
383
396
|
if (cachedResult) {
|
|
384
397
|
return cachedResult;
|
|
385
398
|
}
|
|
386
|
-
|
|
399
|
+
var result = mergeClassList(classList, configUtils);
|
|
387
400
|
cacheSet(classList, result);
|
|
388
401
|
return result;
|
|
389
402
|
}
|
|
@@ -391,156 +404,166 @@ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
|
391
404
|
return functionToCall(twJoin.apply(null, arguments));
|
|
392
405
|
};
|
|
393
406
|
}
|
|
407
|
+
|
|
394
408
|
function fromTheme(key) {
|
|
395
|
-
|
|
409
|
+
var themeGetter = function themeGetter(theme) {
|
|
410
|
+
return theme[key] || [];
|
|
411
|
+
};
|
|
396
412
|
themeGetter.isThemeGetter = true;
|
|
397
413
|
return themeGetter;
|
|
398
414
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
// Shadow always begins with x and y offset separated by underscore
|
|
406
|
-
|
|
407
|
-
const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
415
|
+
|
|
416
|
+
var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
417
|
+
var fractionRegex = /^\d+\/\d+$/;
|
|
418
|
+
var stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);
|
|
419
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
420
|
+
var 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$/;
|
|
421
|
+
// Shadow always begins with x and y offset separated by underscore
|
|
422
|
+
var shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
408
423
|
function isLength(value) {
|
|
409
|
-
return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
424
|
+
return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value) || isArbitraryLength(value);
|
|
410
425
|
}
|
|
411
426
|
function isArbitraryLength(value) {
|
|
412
427
|
return getIsArbitraryValue(value, 'length', isLengthOnly);
|
|
413
428
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
429
|
+
function isArbitrarySize(value) {
|
|
430
|
+
return getIsArbitraryValue(value, 'size', isNever);
|
|
431
|
+
}
|
|
432
|
+
function isArbitraryPosition(value) {
|
|
433
|
+
return getIsArbitraryValue(value, 'position', isNever);
|
|
434
|
+
}
|
|
435
|
+
function isArbitraryUrl(value) {
|
|
436
|
+
return getIsArbitraryValue(value, 'url', isUrl);
|
|
416
437
|
}
|
|
417
438
|
function isArbitraryNumber(value) {
|
|
418
439
|
return getIsArbitraryValue(value, 'number', isNumber);
|
|
419
440
|
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
441
|
+
function isNumber(value) {
|
|
442
|
+
return !Number.isNaN(Number(value));
|
|
422
443
|
}
|
|
423
444
|
function isPercent(value) {
|
|
424
445
|
return value.endsWith('%') && isNumber(value.slice(0, -1));
|
|
425
446
|
}
|
|
447
|
+
function isInteger(value) {
|
|
448
|
+
return isIntegerOnly(value) || getIsArbitraryValue(value, 'number', isIntegerOnly);
|
|
449
|
+
}
|
|
426
450
|
function isArbitraryValue(value) {
|
|
427
451
|
return arbitraryValueRegex.test(value);
|
|
428
452
|
}
|
|
453
|
+
function isAny() {
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
429
456
|
function isTshirtSize(value) {
|
|
430
457
|
return tshirtUnitRegex.test(value);
|
|
431
458
|
}
|
|
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
|
-
}
|
|
443
459
|
function isArbitraryShadow(value) {
|
|
444
460
|
return getIsArbitraryValue(value, '', isShadow);
|
|
445
461
|
}
|
|
446
|
-
function isAny() {
|
|
447
|
-
return true;
|
|
448
|
-
}
|
|
449
462
|
function getIsArbitraryValue(value, label, testValue) {
|
|
450
|
-
|
|
463
|
+
var result = arbitraryValueRegex.exec(value);
|
|
451
464
|
if (result) {
|
|
452
465
|
if (result[1]) {
|
|
453
|
-
return
|
|
466
|
+
return result[1] === label;
|
|
454
467
|
}
|
|
455
468
|
return testValue(result[2]);
|
|
456
469
|
}
|
|
457
470
|
return false;
|
|
458
471
|
}
|
|
459
472
|
function isLengthOnly(value) {
|
|
460
|
-
|
|
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);
|
|
473
|
+
return lengthUnitRegex.test(value);
|
|
464
474
|
}
|
|
465
475
|
function isNever() {
|
|
466
476
|
return false;
|
|
467
477
|
}
|
|
478
|
+
function isUrl(value) {
|
|
479
|
+
return value.startsWith('url(');
|
|
480
|
+
}
|
|
481
|
+
function isIntegerOnly(value) {
|
|
482
|
+
return Number.isInteger(Number(value));
|
|
483
|
+
}
|
|
468
484
|
function isShadow(value) {
|
|
469
485
|
return shadowRegex.test(value);
|
|
470
486
|
}
|
|
471
|
-
|
|
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
|
-
});
|
|
487
|
+
|
|
492
488
|
function getDefaultConfig() {
|
|
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
|
-
|
|
530
|
-
|
|
531
|
-
|
|
489
|
+
var colors = fromTheme('colors');
|
|
490
|
+
var spacing = fromTheme('spacing');
|
|
491
|
+
var blur = fromTheme('blur');
|
|
492
|
+
var brightness = fromTheme('brightness');
|
|
493
|
+
var borderColor = fromTheme('borderColor');
|
|
494
|
+
var borderRadius = fromTheme('borderRadius');
|
|
495
|
+
var borderSpacing = fromTheme('borderSpacing');
|
|
496
|
+
var borderWidth = fromTheme('borderWidth');
|
|
497
|
+
var contrast = fromTheme('contrast');
|
|
498
|
+
var grayscale = fromTheme('grayscale');
|
|
499
|
+
var hueRotate = fromTheme('hueRotate');
|
|
500
|
+
var invert = fromTheme('invert');
|
|
501
|
+
var gap = fromTheme('gap');
|
|
502
|
+
var gradientColorStops = fromTheme('gradientColorStops');
|
|
503
|
+
var gradientColorStopPositions = fromTheme('gradientColorStopPositions');
|
|
504
|
+
var inset = fromTheme('inset');
|
|
505
|
+
var margin = fromTheme('margin');
|
|
506
|
+
var opacity = fromTheme('opacity');
|
|
507
|
+
var padding = fromTheme('padding');
|
|
508
|
+
var saturate = fromTheme('saturate');
|
|
509
|
+
var scale = fromTheme('scale');
|
|
510
|
+
var sepia = fromTheme('sepia');
|
|
511
|
+
var skew = fromTheme('skew');
|
|
512
|
+
var space = fromTheme('space');
|
|
513
|
+
var translate = fromTheme('translate');
|
|
514
|
+
var getOverscroll = function getOverscroll() {
|
|
515
|
+
return ['auto', 'contain', 'none'];
|
|
516
|
+
};
|
|
517
|
+
var getOverflow = function getOverflow() {
|
|
518
|
+
return ['auto', 'hidden', 'clip', 'visible', 'scroll'];
|
|
519
|
+
};
|
|
520
|
+
var getSpacingWithAutoAndArbitrary = function getSpacingWithAutoAndArbitrary() {
|
|
521
|
+
return ['auto', isArbitraryValue, spacing];
|
|
522
|
+
};
|
|
523
|
+
var getSpacingWithArbitrary = function getSpacingWithArbitrary() {
|
|
524
|
+
return [isArbitraryValue, spacing];
|
|
525
|
+
};
|
|
526
|
+
var getLengthWithEmpty = function getLengthWithEmpty() {
|
|
527
|
+
return ['', isLength];
|
|
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
|
+
};
|
|
532
556
|
return {
|
|
533
557
|
cacheSize: 500,
|
|
534
|
-
separator: ':',
|
|
535
558
|
theme: {
|
|
536
559
|
colors: [isAny],
|
|
537
|
-
spacing: [isLength
|
|
560
|
+
spacing: [isLength],
|
|
538
561
|
blur: ['none', '', isTshirtSize, isArbitraryValue],
|
|
539
562
|
brightness: getNumber(),
|
|
540
563
|
borderColor: [colors],
|
|
541
564
|
borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],
|
|
542
565
|
borderSpacing: getSpacingWithArbitrary(),
|
|
543
|
-
borderWidth:
|
|
566
|
+
borderWidth: getLengthWithEmpty(),
|
|
544
567
|
contrast: getNumber(),
|
|
545
568
|
grayscale: getZeroAndEmpty(),
|
|
546
569
|
hueRotate: getNumberAndArbitrary(),
|
|
@@ -624,15 +647,15 @@ function getDefaultConfig() {
|
|
|
624
647
|
* Floats
|
|
625
648
|
* @see https://tailwindcss.com/docs/float
|
|
626
649
|
*/
|
|
627
|
-
float: [{
|
|
628
|
-
float: ['right', 'left', 'none'
|
|
650
|
+
"float": [{
|
|
651
|
+
"float": ['right', 'left', 'none']
|
|
629
652
|
}],
|
|
630
653
|
/**
|
|
631
654
|
* Clear
|
|
632
655
|
* @see https://tailwindcss.com/docs/clear
|
|
633
656
|
*/
|
|
634
657
|
clear: [{
|
|
635
|
-
clear: ['left', 'right', 'both', 'none'
|
|
658
|
+
clear: ['left', 'right', 'both', 'none']
|
|
636
659
|
}],
|
|
637
660
|
/**
|
|
638
661
|
* Isolation
|
|
@@ -651,7 +674,7 @@ function getDefaultConfig() {
|
|
|
651
674
|
* @see https://tailwindcss.com/docs/object-position
|
|
652
675
|
*/
|
|
653
676
|
'object-position': [{
|
|
654
|
-
object: [
|
|
677
|
+
object: [].concat(getPositions(), [isArbitraryValue])
|
|
655
678
|
}],
|
|
656
679
|
/**
|
|
657
680
|
* Overflow
|
|
@@ -773,7 +796,7 @@ function getDefaultConfig() {
|
|
|
773
796
|
* @see https://tailwindcss.com/docs/z-index
|
|
774
797
|
*/
|
|
775
798
|
z: [{
|
|
776
|
-
z: ['auto', isInteger
|
|
799
|
+
z: ['auto', isInteger]
|
|
777
800
|
}],
|
|
778
801
|
// Flexbox and Grid
|
|
779
802
|
/**
|
|
@@ -823,7 +846,7 @@ function getDefaultConfig() {
|
|
|
823
846
|
* @see https://tailwindcss.com/docs/order
|
|
824
847
|
*/
|
|
825
848
|
order: [{
|
|
826
|
-
order: ['first', 'last', 'none', isInteger
|
|
849
|
+
order: ['first', 'last', 'none', isInteger]
|
|
827
850
|
}],
|
|
828
851
|
/**
|
|
829
852
|
* Grid Template Columns
|
|
@@ -838,7 +861,7 @@ function getDefaultConfig() {
|
|
|
838
861
|
*/
|
|
839
862
|
'col-start-end': [{
|
|
840
863
|
col: ['auto', {
|
|
841
|
-
span: ['full', isInteger
|
|
864
|
+
span: ['full', isInteger]
|
|
842
865
|
}, isArbitraryValue]
|
|
843
866
|
}],
|
|
844
867
|
/**
|
|
@@ -868,7 +891,7 @@ function getDefaultConfig() {
|
|
|
868
891
|
*/
|
|
869
892
|
'row-start-end': [{
|
|
870
893
|
row: ['auto', {
|
|
871
|
-
span: [isInteger
|
|
894
|
+
span: [isInteger]
|
|
872
895
|
}, isArbitraryValue]
|
|
873
896
|
}],
|
|
874
897
|
/**
|
|
@@ -932,7 +955,7 @@ function getDefaultConfig() {
|
|
|
932
955
|
* @see https://tailwindcss.com/docs/justify-content
|
|
933
956
|
*/
|
|
934
957
|
'justify-content': [{
|
|
935
|
-
justify: ['normal'
|
|
958
|
+
justify: ['normal'].concat(getAlign())
|
|
936
959
|
}],
|
|
937
960
|
/**
|
|
938
961
|
* Justify Items
|
|
@@ -953,7 +976,7 @@ function getDefaultConfig() {
|
|
|
953
976
|
* @see https://tailwindcss.com/docs/align-content
|
|
954
977
|
*/
|
|
955
978
|
'align-content': [{
|
|
956
|
-
content: ['normal'
|
|
979
|
+
content: ['normal'].concat(getAlign(), ['baseline'])
|
|
957
980
|
}],
|
|
958
981
|
/**
|
|
959
982
|
* Align Items
|
|
@@ -974,7 +997,7 @@ function getDefaultConfig() {
|
|
|
974
997
|
* @see https://tailwindcss.com/docs/place-content
|
|
975
998
|
*/
|
|
976
999
|
'place-content': [{
|
|
977
|
-
'place-content': [
|
|
1000
|
+
'place-content': [].concat(getAlign(), ['baseline'])
|
|
978
1001
|
}],
|
|
979
1002
|
/**
|
|
980
1003
|
* Place Items
|
|
@@ -1147,51 +1170,44 @@ function getDefaultConfig() {
|
|
|
1147
1170
|
* @see https://tailwindcss.com/docs/width
|
|
1148
1171
|
*/
|
|
1149
1172
|
w: [{
|
|
1150
|
-
w: ['auto', 'min', 'max', 'fit',
|
|
1173
|
+
w: ['auto', 'min', 'max', 'fit', isArbitraryValue, spacing]
|
|
1151
1174
|
}],
|
|
1152
1175
|
/**
|
|
1153
1176
|
* Min-Width
|
|
1154
1177
|
* @see https://tailwindcss.com/docs/min-width
|
|
1155
1178
|
*/
|
|
1156
1179
|
'min-w': [{
|
|
1157
|
-
'min-w': [
|
|
1180
|
+
'min-w': ['min', 'max', 'fit', isArbitraryValue, isLength]
|
|
1158
1181
|
}],
|
|
1159
1182
|
/**
|
|
1160
1183
|
* Max-Width
|
|
1161
1184
|
* @see https://tailwindcss.com/docs/max-width
|
|
1162
1185
|
*/
|
|
1163
1186
|
'max-w': [{
|
|
1164
|
-
'max-w': [
|
|
1187
|
+
'max-w': ['0', 'none', 'full', 'min', 'max', 'fit', 'prose', {
|
|
1165
1188
|
screen: [isTshirtSize]
|
|
1166
|
-
}, isTshirtSize]
|
|
1189
|
+
}, isTshirtSize, isArbitraryValue]
|
|
1167
1190
|
}],
|
|
1168
1191
|
/**
|
|
1169
1192
|
* Height
|
|
1170
1193
|
* @see https://tailwindcss.com/docs/height
|
|
1171
1194
|
*/
|
|
1172
1195
|
h: [{
|
|
1173
|
-
h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit'
|
|
1196
|
+
h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']
|
|
1174
1197
|
}],
|
|
1175
1198
|
/**
|
|
1176
1199
|
* Min-Height
|
|
1177
1200
|
* @see https://tailwindcss.com/docs/min-height
|
|
1178
1201
|
*/
|
|
1179
1202
|
'min-h': [{
|
|
1180
|
-
'min-h': [
|
|
1203
|
+
'min-h': ['min', 'max', 'fit', isArbitraryValue, isLength]
|
|
1181
1204
|
}],
|
|
1182
1205
|
/**
|
|
1183
1206
|
* Max-Height
|
|
1184
1207
|
* @see https://tailwindcss.com/docs/max-height
|
|
1185
1208
|
*/
|
|
1186
1209
|
'max-h': [{
|
|
1187
|
-
'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit'
|
|
1188
|
-
}],
|
|
1189
|
-
/**
|
|
1190
|
-
* Size
|
|
1191
|
-
* @see https://tailwindcss.com/docs/size
|
|
1192
|
-
*/
|
|
1193
|
-
size: [{
|
|
1194
|
-
size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']
|
|
1210
|
+
'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit']
|
|
1195
1211
|
}],
|
|
1196
1212
|
// Typography
|
|
1197
1213
|
/**
|
|
@@ -1274,7 +1290,7 @@ function getDefaultConfig() {
|
|
|
1274
1290
|
* @see https://tailwindcss.com/docs/line-height
|
|
1275
1291
|
*/
|
|
1276
1292
|
leading: [{
|
|
1277
|
-
leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose',
|
|
1293
|
+
leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isArbitraryValue, isLength]
|
|
1278
1294
|
}],
|
|
1279
1295
|
/**
|
|
1280
1296
|
* List Style Image
|
|
@@ -1343,21 +1359,21 @@ function getDefaultConfig() {
|
|
|
1343
1359
|
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
1344
1360
|
*/
|
|
1345
1361
|
'text-decoration-style': [{
|
|
1346
|
-
decoration: [
|
|
1362
|
+
decoration: [].concat(getLineStyles(), ['wavy'])
|
|
1347
1363
|
}],
|
|
1348
1364
|
/**
|
|
1349
1365
|
* Text Decoration Thickness
|
|
1350
1366
|
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
1351
1367
|
*/
|
|
1352
1368
|
'text-decoration-thickness': [{
|
|
1353
|
-
decoration: ['auto', 'from-font', isLength
|
|
1369
|
+
decoration: ['auto', 'from-font', isLength]
|
|
1354
1370
|
}],
|
|
1355
1371
|
/**
|
|
1356
1372
|
* Text Underline Offset
|
|
1357
1373
|
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
1358
1374
|
*/
|
|
1359
1375
|
'underline-offset': [{
|
|
1360
|
-
'underline-offset': ['auto',
|
|
1376
|
+
'underline-offset': ['auto', isArbitraryValue, isLength]
|
|
1361
1377
|
}],
|
|
1362
1378
|
/**
|
|
1363
1379
|
* Text Decoration Color
|
|
@@ -1376,13 +1392,6 @@ function getDefaultConfig() {
|
|
|
1376
1392
|
* @see https://tailwindcss.com/docs/text-overflow
|
|
1377
1393
|
*/
|
|
1378
1394
|
'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
|
-
}],
|
|
1386
1395
|
/**
|
|
1387
1396
|
* Text Indent
|
|
1388
1397
|
* @see https://tailwindcss.com/docs/text-indent
|
|
@@ -1408,8 +1417,8 @@ function getDefaultConfig() {
|
|
|
1408
1417
|
* Word Break
|
|
1409
1418
|
* @see https://tailwindcss.com/docs/word-break
|
|
1410
1419
|
*/
|
|
1411
|
-
break: [{
|
|
1412
|
-
break: ['normal', 'words', 'all', 'keep']
|
|
1420
|
+
"break": [{
|
|
1421
|
+
"break": ['normal', 'words', 'all', 'keep']
|
|
1413
1422
|
}],
|
|
1414
1423
|
/**
|
|
1415
1424
|
* Hyphens
|
|
@@ -1460,7 +1469,7 @@ function getDefaultConfig() {
|
|
|
1460
1469
|
* @see https://tailwindcss.com/docs/background-position
|
|
1461
1470
|
*/
|
|
1462
1471
|
'bg-position': [{
|
|
1463
|
-
bg: [
|
|
1472
|
+
bg: [].concat(getPositions(), [isArbitraryPosition])
|
|
1464
1473
|
}],
|
|
1465
1474
|
/**
|
|
1466
1475
|
* Background Repeat
|
|
@@ -1485,7 +1494,7 @@ function getDefaultConfig() {
|
|
|
1485
1494
|
'bg-image': [{
|
|
1486
1495
|
bg: ['none', {
|
|
1487
1496
|
'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
|
|
1488
|
-
},
|
|
1497
|
+
}, isArbitraryUrl]
|
|
1489
1498
|
}],
|
|
1490
1499
|
/**
|
|
1491
1500
|
* Background Color
|
|
@@ -1717,7 +1726,7 @@ function getDefaultConfig() {
|
|
|
1717
1726
|
* @see https://tailwindcss.com/docs/border-style
|
|
1718
1727
|
*/
|
|
1719
1728
|
'border-style': [{
|
|
1720
|
-
border: [
|
|
1729
|
+
border: [].concat(getLineStyles(), ['hidden'])
|
|
1721
1730
|
}],
|
|
1722
1731
|
/**
|
|
1723
1732
|
* Divide Width X
|
|
@@ -1818,21 +1827,21 @@ function getDefaultConfig() {
|
|
|
1818
1827
|
* @see https://tailwindcss.com/docs/outline-style
|
|
1819
1828
|
*/
|
|
1820
1829
|
'outline-style': [{
|
|
1821
|
-
outline: [''
|
|
1830
|
+
outline: [''].concat(getLineStyles())
|
|
1822
1831
|
}],
|
|
1823
1832
|
/**
|
|
1824
1833
|
* Outline Offset
|
|
1825
1834
|
* @see https://tailwindcss.com/docs/outline-offset
|
|
1826
1835
|
*/
|
|
1827
1836
|
'outline-offset': [{
|
|
1828
|
-
'outline-offset': [
|
|
1837
|
+
'outline-offset': [isArbitraryValue, isLength]
|
|
1829
1838
|
}],
|
|
1830
1839
|
/**
|
|
1831
1840
|
* Outline Width
|
|
1832
1841
|
* @see https://tailwindcss.com/docs/outline-width
|
|
1833
1842
|
*/
|
|
1834
1843
|
'outline-w': [{
|
|
1835
|
-
outline: [isLength
|
|
1844
|
+
outline: [isLength]
|
|
1836
1845
|
}],
|
|
1837
1846
|
/**
|
|
1838
1847
|
* Outline Color
|
|
@@ -1846,7 +1855,7 @@ function getDefaultConfig() {
|
|
|
1846
1855
|
* @see https://tailwindcss.com/docs/ring-width
|
|
1847
1856
|
*/
|
|
1848
1857
|
'ring-w': [{
|
|
1849
|
-
ring:
|
|
1858
|
+
ring: getLengthWithEmpty()
|
|
1850
1859
|
}],
|
|
1851
1860
|
/**
|
|
1852
1861
|
* Ring Width Inset
|
|
@@ -1872,7 +1881,7 @@ function getDefaultConfig() {
|
|
|
1872
1881
|
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
1873
1882
|
*/
|
|
1874
1883
|
'ring-offset-w': [{
|
|
1875
|
-
'ring-offset': [isLength
|
|
1884
|
+
'ring-offset': [isLength]
|
|
1876
1885
|
}],
|
|
1877
1886
|
/**
|
|
1878
1887
|
* Ring Offset Color
|
|
@@ -2222,9 +2231,7 @@ function getDefaultConfig() {
|
|
|
2222
2231
|
* Appearance
|
|
2223
2232
|
* @see https://tailwindcss.com/docs/appearance
|
|
2224
2233
|
*/
|
|
2225
|
-
appearance: [
|
|
2226
|
-
appearance: ['none', 'auto']
|
|
2227
|
-
}],
|
|
2234
|
+
appearance: ['appearance-none'],
|
|
2228
2235
|
/**
|
|
2229
2236
|
* Cursor
|
|
2230
2237
|
* @see https://tailwindcss.com/docs/cursor
|
|
@@ -2419,27 +2426,10 @@ function getDefaultConfig() {
|
|
|
2419
2426
|
* @see https://tailwindcss.com/docs/touch-action
|
|
2420
2427
|
*/
|
|
2421
2428
|
touch: [{
|
|
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']
|
|
2429
|
+
touch: ['auto', 'none', 'pinch-zoom', 'manipulation', {
|
|
2430
|
+
pan: ['x', 'left', 'right', 'y', 'up', 'down']
|
|
2431
|
+
}]
|
|
2437
2432
|
}],
|
|
2438
|
-
/**
|
|
2439
|
-
* Touch Action Pinch Zoom
|
|
2440
|
-
* @see https://tailwindcss.com/docs/touch-action
|
|
2441
|
-
*/
|
|
2442
|
-
'touch-pz': ['touch-pinch-zoom'],
|
|
2443
2433
|
/**
|
|
2444
2434
|
* User Select
|
|
2445
2435
|
* @see https://tailwindcss.com/docs/user-select
|
|
@@ -2467,7 +2457,7 @@ function getDefaultConfig() {
|
|
|
2467
2457
|
* @see https://tailwindcss.com/docs/stroke-width
|
|
2468
2458
|
*/
|
|
2469
2459
|
'stroke-w': [{
|
|
2470
|
-
stroke: [isLength,
|
|
2460
|
+
stroke: [isLength, isArbitraryNumber]
|
|
2471
2461
|
}],
|
|
2472
2462
|
/**
|
|
2473
2463
|
* Stroke
|
|
@@ -2481,14 +2471,7 @@ function getDefaultConfig() {
|
|
|
2481
2471
|
* Screen Readers
|
|
2482
2472
|
* @see https://tailwindcss.com/docs/screen-readers
|
|
2483
2473
|
*/
|
|
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
|
-
}]
|
|
2474
|
+
sr: ['sr-only', 'not-sr-only']
|
|
2492
2475
|
},
|
|
2493
2476
|
conflictingClassGroups: {
|
|
2494
2477
|
overflow: ['overflow-x', 'overflow-y'],
|
|
@@ -2504,7 +2487,6 @@ function getDefaultConfig() {
|
|
|
2504
2487
|
m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
|
|
2505
2488
|
mx: ['mr', 'ml'],
|
|
2506
2489
|
my: ['mt', 'mb'],
|
|
2507
|
-
size: ['w', 'h'],
|
|
2508
2490
|
'font-size': ['leading'],
|
|
2509
2491
|
'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
|
|
2510
2492
|
'fvn-ordinal': ['fvn-normal'],
|
|
@@ -2512,7 +2494,6 @@ function getDefaultConfig() {
|
|
|
2512
2494
|
'fvn-figure': ['fvn-normal'],
|
|
2513
2495
|
'fvn-spacing': ['fvn-normal'],
|
|
2514
2496
|
'fvn-fraction': ['fvn-normal'],
|
|
2515
|
-
'line-clamp': ['display', 'overflow'],
|
|
2516
2497
|
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'],
|
|
2517
2498
|
'rounded-s': ['rounded-ss', 'rounded-es'],
|
|
2518
2499
|
'rounded-e': ['rounded-se', 'rounded-ee'],
|
|
@@ -2532,11 +2513,7 @@ function getDefaultConfig() {
|
|
|
2532
2513
|
'scroll-my': ['scroll-mt', 'scroll-mb'],
|
|
2533
2514
|
'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
|
|
2534
2515
|
'scroll-px': ['scroll-pr', 'scroll-pl'],
|
|
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']
|
|
2516
|
+
'scroll-py': ['scroll-pt', 'scroll-pb']
|
|
2540
2517
|
},
|
|
2541
2518
|
conflictingClassGroupModifiers: {
|
|
2542
2519
|
'font-size': ['leading']
|
|
@@ -2548,61 +2525,45 @@ function getDefaultConfig() {
|
|
|
2548
2525
|
* @param baseConfig Config where other config will be merged into. This object will be mutated.
|
|
2549
2526
|
* @param configExtension Partial config to merge into the `baseConfig`.
|
|
2550
2527
|
*/
|
|
2551
|
-
function mergeConfigs(baseConfig, {
|
|
2552
|
-
|
|
2553
|
-
|
|
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]);
|
|
2528
|
+
function mergeConfigs(baseConfig, configExtension) {
|
|
2529
|
+
for (var key in configExtension) {
|
|
2530
|
+
mergePropertyRecursively(baseConfig, key, configExtension[key]);
|
|
2566
2531
|
}
|
|
2567
2532
|
return baseConfig;
|
|
2568
2533
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2534
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2535
|
+
var overrideTypes = /*#__PURE__*/new Set(['string', 'number', 'boolean']);
|
|
2536
|
+
function mergePropertyRecursively(baseObject, mergeKey, mergeValue) {
|
|
2537
|
+
if (!hasOwnProperty.call(baseObject, mergeKey) || overrideTypes.has(typeof mergeValue) || mergeValue === null) {
|
|
2538
|
+
baseObject[mergeKey] = mergeValue;
|
|
2539
|
+
return;
|
|
2572
2540
|
}
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
for (const key in overrideObject) {
|
|
2577
|
-
overrideProperty(baseObject, key, overrideObject[key]);
|
|
2578
|
-
}
|
|
2541
|
+
if (Array.isArray(mergeValue) && Array.isArray(baseObject[mergeKey])) {
|
|
2542
|
+
baseObject[mergeKey] = baseObject[mergeKey].concat(mergeValue);
|
|
2543
|
+
return;
|
|
2579
2544
|
}
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
}
|
|
2545
|
+
if (typeof mergeValue === 'object' && typeof baseObject[mergeKey] === 'object') {
|
|
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]);
|
|
2588
2552
|
}
|
|
2589
2553
|
}
|
|
2590
2554
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2555
|
+
|
|
2556
|
+
function extendTailwindMerge(configExtension) {
|
|
2557
|
+
for (var _len = arguments.length, createConfig = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2558
|
+
createConfig[_key - 1] = arguments[_key];
|
|
2559
|
+
}
|
|
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));
|
|
2593
2563
|
}
|
|
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
|
-
});
|
|
2605
2564
|
|
|
2606
|
-
var
|
|
2565
|
+
var twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
|
|
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};
|
|
2607
2568
|
|
|
2608
2569
|
export { ce as c };
|