@koaris/bloom-ui 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +138 -154
- package/dist/index.mjs +135 -151
- package/dist/tailwind.css +156 -130
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -86,14 +86,16 @@ declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "r
|
|
|
86
86
|
|
|
87
87
|
interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
88
88
|
disabled?: boolean;
|
|
89
|
+
reference?: React.RefObject<HTMLTextAreaElement>;
|
|
89
90
|
placeholder?: string;
|
|
90
91
|
value?: string;
|
|
91
92
|
validated?: boolean;
|
|
92
93
|
error: boolean;
|
|
93
94
|
required?: boolean;
|
|
95
|
+
resize?: boolean;
|
|
94
96
|
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
|
|
95
97
|
}
|
|
96
|
-
declare const TextArea: ({ className, disabled, value, error, required, placeholder, onClick, ...rest }: TextAreaProps) => react_jsx_runtime.JSX.Element;
|
|
98
|
+
declare const TextArea: ({ className, disabled, reference, value, error, required, placeholder, resize, onClick, ...rest }: TextAreaProps) => react_jsx_runtime.JSX.Element;
|
|
97
99
|
|
|
98
100
|
interface TextProps extends DetailedHTMLProps<HTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
99
101
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -86,14 +86,16 @@ declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "r
|
|
|
86
86
|
|
|
87
87
|
interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
88
88
|
disabled?: boolean;
|
|
89
|
+
reference?: React.RefObject<HTMLTextAreaElement>;
|
|
89
90
|
placeholder?: string;
|
|
90
91
|
value?: string;
|
|
91
92
|
validated?: boolean;
|
|
92
93
|
error: boolean;
|
|
93
94
|
required?: boolean;
|
|
95
|
+
resize?: boolean;
|
|
94
96
|
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
|
|
95
97
|
}
|
|
96
|
-
declare const TextArea: ({ className, disabled, value, error, required, placeholder, onClick, ...rest }: TextAreaProps) => react_jsx_runtime.JSX.Element;
|
|
98
|
+
declare const TextArea: ({ className, disabled, reference, value, error, required, placeholder, resize, onClick, ...rest }: TextAreaProps) => react_jsx_runtime.JSX.Element;
|
|
97
99
|
|
|
98
100
|
interface TextProps extends DetailedHTMLProps<HTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
99
101
|
children: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -47,8 +47,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
47
47
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
48
|
|
|
49
49
|
// src/index.tsx
|
|
50
|
-
var
|
|
51
|
-
__export(
|
|
50
|
+
var index_exports = {};
|
|
51
|
+
__export(index_exports, {
|
|
52
52
|
Avatar: () => Avatar,
|
|
53
53
|
Box: () => Box,
|
|
54
54
|
Button: () => Button,
|
|
@@ -64,36 +64,36 @@ __export(src_exports, {
|
|
|
64
64
|
TextArea: () => TextArea,
|
|
65
65
|
TextInput: () => TextInput
|
|
66
66
|
});
|
|
67
|
-
module.exports = __toCommonJS(
|
|
67
|
+
module.exports = __toCommonJS(index_exports);
|
|
68
68
|
|
|
69
69
|
// ../../node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
70
70
|
var CLASS_PART_SEPARATOR = "-";
|
|
71
|
-
|
|
71
|
+
var createClassGroupUtils = (config) => {
|
|
72
72
|
const classMap = createClassMap(config);
|
|
73
73
|
const {
|
|
74
74
|
conflictingClassGroups,
|
|
75
75
|
conflictingClassGroupModifiers
|
|
76
76
|
} = config;
|
|
77
|
-
|
|
77
|
+
const getClassGroupId = (className) => {
|
|
78
78
|
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
79
79
|
if (classParts[0] === "" && classParts.length !== 1) {
|
|
80
80
|
classParts.shift();
|
|
81
81
|
}
|
|
82
82
|
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
83
|
-
}
|
|
84
|
-
|
|
83
|
+
};
|
|
84
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
85
85
|
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
86
86
|
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
87
87
|
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
88
88
|
}
|
|
89
89
|
return conflicts;
|
|
90
|
-
}
|
|
90
|
+
};
|
|
91
91
|
return {
|
|
92
92
|
getClassGroupId,
|
|
93
93
|
getConflictingClassGroupIds
|
|
94
94
|
};
|
|
95
|
-
}
|
|
96
|
-
|
|
95
|
+
};
|
|
96
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
97
97
|
var _a;
|
|
98
98
|
if (classParts.length === 0) {
|
|
99
99
|
return classPartObject.classGroupId;
|
|
@@ -111,9 +111,9 @@ function getGroupRecursive(classParts, classPartObject) {
|
|
|
111
111
|
return (_a = classPartObject.validators.find(({
|
|
112
112
|
validator
|
|
113
113
|
}) => validator(classRest))) == null ? void 0 : _a.classGroupId;
|
|
114
|
-
}
|
|
114
|
+
};
|
|
115
115
|
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
116
|
-
|
|
116
|
+
var getGroupIdForArbitraryProperty = (className) => {
|
|
117
117
|
if (arbitraryPropertyRegex.test(className)) {
|
|
118
118
|
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
119
119
|
const property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
@@ -121,8 +121,8 @@ function getGroupIdForArbitraryProperty(className) {
|
|
|
121
121
|
return "arbitrary.." + property;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
}
|
|
125
|
-
|
|
124
|
+
};
|
|
125
|
+
var createClassMap = (config) => {
|
|
126
126
|
const {
|
|
127
127
|
theme,
|
|
128
128
|
prefix
|
|
@@ -136,8 +136,8 @@ function createClassMap(config) {
|
|
|
136
136
|
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
137
137
|
});
|
|
138
138
|
return classMap;
|
|
139
|
-
}
|
|
140
|
-
|
|
139
|
+
};
|
|
140
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
141
141
|
classGroup.forEach((classDefinition) => {
|
|
142
142
|
if (typeof classDefinition === "string") {
|
|
143
143
|
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
@@ -159,8 +159,8 @@ function processClassesRecursively(classGroup, classPartObject, classGroupId, th
|
|
|
159
159
|
processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
162
|
-
}
|
|
163
|
-
|
|
162
|
+
};
|
|
163
|
+
var getPart = (classPartObject, path) => {
|
|
164
164
|
let currentClassPartObject = classPartObject;
|
|
165
165
|
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
166
166
|
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
@@ -172,11 +172,9 @@ function getPart(classPartObject, path) {
|
|
|
172
172
|
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
173
173
|
});
|
|
174
174
|
return currentClassPartObject;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
|
|
175
|
+
};
|
|
176
|
+
var isThemeGetter = (func) => func.isThemeGetter;
|
|
177
|
+
var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
|
|
180
178
|
if (!prefix) {
|
|
181
179
|
return classGroupEntries;
|
|
182
180
|
}
|
|
@@ -192,8 +190,8 @@ function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
|
|
|
192
190
|
});
|
|
193
191
|
return [classGroupId, prefixedClassGroup];
|
|
194
192
|
});
|
|
195
|
-
}
|
|
196
|
-
|
|
193
|
+
};
|
|
194
|
+
var createLruCache = (maxCacheSize) => {
|
|
197
195
|
if (maxCacheSize < 1) {
|
|
198
196
|
return {
|
|
199
197
|
get: () => void 0,
|
|
@@ -204,7 +202,7 @@ function createLruCache(maxCacheSize) {
|
|
|
204
202
|
let cacheSize = 0;
|
|
205
203
|
let cache = /* @__PURE__ */ new Map();
|
|
206
204
|
let previousCache = /* @__PURE__ */ new Map();
|
|
207
|
-
|
|
205
|
+
const update = (key, value) => {
|
|
208
206
|
cache.set(key, value);
|
|
209
207
|
cacheSize++;
|
|
210
208
|
if (cacheSize > maxCacheSize) {
|
|
@@ -212,7 +210,7 @@ function createLruCache(maxCacheSize) {
|
|
|
212
210
|
previousCache = cache;
|
|
213
211
|
cache = /* @__PURE__ */ new Map();
|
|
214
212
|
}
|
|
215
|
-
}
|
|
213
|
+
};
|
|
216
214
|
return {
|
|
217
215
|
get(key) {
|
|
218
216
|
let value = cache.get(key);
|
|
@@ -232,14 +230,17 @@ function createLruCache(maxCacheSize) {
|
|
|
232
230
|
}
|
|
233
231
|
}
|
|
234
232
|
};
|
|
235
|
-
}
|
|
233
|
+
};
|
|
236
234
|
var IMPORTANT_MODIFIER = "!";
|
|
237
|
-
|
|
238
|
-
const
|
|
235
|
+
var createParseClassName = (config) => {
|
|
236
|
+
const {
|
|
237
|
+
separator,
|
|
238
|
+
experimentalParseClassName
|
|
239
|
+
} = config;
|
|
239
240
|
const isSeparatorSingleCharacter = separator.length === 1;
|
|
240
241
|
const firstSeparatorCharacter = separator[0];
|
|
241
242
|
const separatorLength = separator.length;
|
|
242
|
-
|
|
243
|
+
const parseClassName = (className) => {
|
|
243
244
|
const modifiers = [];
|
|
244
245
|
let bracketDepth = 0;
|
|
245
246
|
let modifierStart = 0;
|
|
@@ -274,8 +275,15 @@ function createSplitModifiers(config) {
|
|
|
274
275
|
maybePostfixModifierPosition
|
|
275
276
|
};
|
|
276
277
|
};
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
if (experimentalParseClassName) {
|
|
279
|
+
return (className) => experimentalParseClassName({
|
|
280
|
+
className,
|
|
281
|
+
parseClassName
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return parseClassName;
|
|
285
|
+
};
|
|
286
|
+
var sortModifiers = (modifiers) => {
|
|
279
287
|
if (modifiers.length <= 1) {
|
|
280
288
|
return modifiers;
|
|
281
289
|
}
|
|
@@ -292,73 +300,59 @@ function sortModifiers(modifiers) {
|
|
|
292
300
|
});
|
|
293
301
|
sortedModifiers.push(...unsortedModifiers.sort());
|
|
294
302
|
return sortedModifiers;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}, createClassUtils(config));
|
|
301
|
-
}
|
|
303
|
+
};
|
|
304
|
+
var createConfigUtils = (config) => __spreadValues({
|
|
305
|
+
cache: createLruCache(config.cacheSize),
|
|
306
|
+
parseClassName: createParseClassName(config)
|
|
307
|
+
}, createClassGroupUtils(config));
|
|
302
308
|
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
303
|
-
|
|
309
|
+
var mergeClassList = (classList, configUtils) => {
|
|
304
310
|
const {
|
|
305
|
-
|
|
311
|
+
parseClassName,
|
|
306
312
|
getClassGroupId,
|
|
307
313
|
getConflictingClassGroupIds
|
|
308
314
|
} = configUtils;
|
|
309
|
-
const classGroupsInConflict =
|
|
310
|
-
|
|
315
|
+
const classGroupsInConflict = [];
|
|
316
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
317
|
+
let result = "";
|
|
318
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
319
|
+
const originalClassName = classNames[index];
|
|
311
320
|
const {
|
|
312
321
|
modifiers,
|
|
313
322
|
hasImportantModifier,
|
|
314
323
|
baseClassName,
|
|
315
324
|
maybePostfixModifierPosition
|
|
316
|
-
} =
|
|
317
|
-
let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
325
|
+
} = parseClassName(originalClassName);
|
|
318
326
|
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
327
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
319
328
|
if (!classGroupId) {
|
|
320
|
-
if (!
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
originalClassName
|
|
324
|
-
};
|
|
329
|
+
if (!hasPostfixModifier) {
|
|
330
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
331
|
+
continue;
|
|
325
332
|
}
|
|
326
333
|
classGroupId = getClassGroupId(baseClassName);
|
|
327
334
|
if (!classGroupId) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
originalClassName
|
|
331
|
-
};
|
|
335
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
336
|
+
continue;
|
|
332
337
|
}
|
|
333
338
|
hasPostfixModifier = false;
|
|
334
339
|
}
|
|
335
340
|
const variantModifier = sortModifiers(modifiers).join(":");
|
|
336
341
|
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
337
|
-
return {
|
|
338
|
-
isTailwindClass: true,
|
|
339
|
-
modifierId,
|
|
340
|
-
classGroupId,
|
|
341
|
-
originalClassName,
|
|
342
|
-
hasPostfixModifier
|
|
343
|
-
};
|
|
344
|
-
}).reverse().filter((parsed) => {
|
|
345
|
-
if (!parsed.isTailwindClass) {
|
|
346
|
-
return true;
|
|
347
|
-
}
|
|
348
|
-
const {
|
|
349
|
-
modifierId,
|
|
350
|
-
classGroupId,
|
|
351
|
-
hasPostfixModifier
|
|
352
|
-
} = parsed;
|
|
353
342
|
const classId = modifierId + classGroupId;
|
|
354
|
-
if (classGroupsInConflict.
|
|
355
|
-
|
|
343
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
344
|
+
continue;
|
|
356
345
|
}
|
|
357
|
-
classGroupsInConflict.
|
|
358
|
-
getConflictingClassGroupIds(classGroupId, hasPostfixModifier)
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
346
|
+
classGroupsInConflict.push(classId);
|
|
347
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
348
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
349
|
+
const group = conflictGroups[i];
|
|
350
|
+
classGroupsInConflict.push(modifierId + group);
|
|
351
|
+
}
|
|
352
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
355
|
+
};
|
|
362
356
|
function twJoin() {
|
|
363
357
|
let index = 0;
|
|
364
358
|
let argument;
|
|
@@ -374,7 +368,7 @@ function twJoin() {
|
|
|
374
368
|
}
|
|
375
369
|
return string;
|
|
376
370
|
}
|
|
377
|
-
|
|
371
|
+
var toValue = (mix) => {
|
|
378
372
|
if (typeof mix === "string") {
|
|
379
373
|
return mix;
|
|
380
374
|
}
|
|
@@ -389,7 +383,7 @@ function toValue(mix) {
|
|
|
389
383
|
}
|
|
390
384
|
}
|
|
391
385
|
return string;
|
|
392
|
-
}
|
|
386
|
+
};
|
|
393
387
|
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
394
388
|
let configUtils;
|
|
395
389
|
let cacheGet;
|
|
@@ -416,61 +410,35 @@ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
|
416
410
|
return functionToCall(twJoin.apply(null, arguments));
|
|
417
411
|
};
|
|
418
412
|
}
|
|
419
|
-
|
|
413
|
+
var fromTheme = (key) => {
|
|
420
414
|
const themeGetter = (theme) => theme[key] || [];
|
|
421
415
|
themeGetter.isThemeGetter = true;
|
|
422
416
|
return themeGetter;
|
|
423
|
-
}
|
|
417
|
+
};
|
|
424
418
|
var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
425
419
|
var fractionRegex = /^\d+\/\d+$/;
|
|
426
420
|
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
427
421
|
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
428
422
|
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$/;
|
|
429
423
|
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
|
|
430
|
-
var shadowRegex =
|
|
424
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
431
425
|
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}
|
|
441
|
-
function isArbitraryNumber(value) {
|
|
442
|
-
return getIsArbitraryValue(value, "number", isNumber);
|
|
443
|
-
}
|
|
444
|
-
function isInteger(value) {
|
|
445
|
-
return Boolean(value) && Number.isInteger(Number(value));
|
|
446
|
-
}
|
|
447
|
-
function isPercent(value) {
|
|
448
|
-
return value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
449
|
-
}
|
|
450
|
-
function isArbitraryValue(value) {
|
|
451
|
-
return arbitraryValueRegex.test(value);
|
|
452
|
-
}
|
|
453
|
-
function isTshirtSize(value) {
|
|
454
|
-
return tshirtUnitRegex.test(value);
|
|
455
|
-
}
|
|
426
|
+
var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
427
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
|
|
428
|
+
var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
|
|
429
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
|
|
430
|
+
var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
|
|
431
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
432
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
433
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
456
434
|
var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
function isArbitraryPosition(value) {
|
|
461
|
-
return getIsArbitraryValue(value, "position", isNever);
|
|
462
|
-
}
|
|
435
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
|
|
436
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
|
|
463
437
|
var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
return getIsArbitraryValue(value, "", isShadow);
|
|
469
|
-
}
|
|
470
|
-
function isAny() {
|
|
471
|
-
return true;
|
|
472
|
-
}
|
|
473
|
-
function getIsArbitraryValue(value, label, testValue) {
|
|
438
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
|
|
439
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
|
|
440
|
+
var isAny = () => true;
|
|
441
|
+
var getIsArbitraryValue = (value, label, testValue) => {
|
|
474
442
|
const result = arbitraryValueRegex.exec(value);
|
|
475
443
|
if (result) {
|
|
476
444
|
if (result[1]) {
|
|
@@ -479,20 +447,17 @@ function getIsArbitraryValue(value, label, testValue) {
|
|
|
479
447
|
return testValue(result[2]);
|
|
480
448
|
}
|
|
481
449
|
return false;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return imageRegex.test(value);
|
|
494
|
-
}
|
|
495
|
-
function getDefaultConfig() {
|
|
450
|
+
};
|
|
451
|
+
var isLengthOnly = (value) => (
|
|
452
|
+
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
453
|
+
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
454
|
+
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
455
|
+
lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
|
|
456
|
+
);
|
|
457
|
+
var isNever = () => false;
|
|
458
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
459
|
+
var isImage = (value) => imageRegex.test(value);
|
|
460
|
+
var getDefaultConfig = () => {
|
|
496
461
|
const colors = fromTheme("colors");
|
|
497
462
|
const spacing = fromTheme("spacing");
|
|
498
463
|
const blur = fromTheme("blur");
|
|
@@ -526,11 +491,10 @@ function getDefaultConfig() {
|
|
|
526
491
|
const getNumberWithAutoAndArbitrary = () => ["auto", isNumber, isArbitraryValue];
|
|
527
492
|
const getPositions = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
|
|
528
493
|
const getLineStyles = () => ["solid", "dashed", "dotted", "double", "none"];
|
|
529
|
-
const getBlendModes = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"
|
|
494
|
+
const getBlendModes = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
530
495
|
const getAlign = () => ["start", "end", "center", "between", "around", "evenly", "stretch"];
|
|
531
496
|
const getZeroAndEmpty = () => ["", "0", isArbitraryValue];
|
|
532
497
|
const getBreaks = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
|
|
533
|
-
const getNumber = () => [isNumber, isArbitraryNumber];
|
|
534
498
|
const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
|
|
535
499
|
return {
|
|
536
500
|
cacheSize: 500,
|
|
@@ -539,12 +503,12 @@ function getDefaultConfig() {
|
|
|
539
503
|
colors: [isAny],
|
|
540
504
|
spacing: [isLength, isArbitraryLength],
|
|
541
505
|
blur: ["none", "", isTshirtSize, isArbitraryValue],
|
|
542
|
-
brightness:
|
|
506
|
+
brightness: getNumberAndArbitrary(),
|
|
543
507
|
borderColor: [colors],
|
|
544
508
|
borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
|
|
545
509
|
borderSpacing: getSpacingWithArbitrary(),
|
|
546
510
|
borderWidth: getLengthWithEmptyAndArbitrary(),
|
|
547
|
-
contrast:
|
|
511
|
+
contrast: getNumberAndArbitrary(),
|
|
548
512
|
grayscale: getZeroAndEmpty(),
|
|
549
513
|
hueRotate: getNumberAndArbitrary(),
|
|
550
514
|
invert: getZeroAndEmpty(),
|
|
@@ -553,10 +517,10 @@ function getDefaultConfig() {
|
|
|
553
517
|
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
554
518
|
inset: getSpacingWithAutoAndArbitrary(),
|
|
555
519
|
margin: getSpacingWithAutoAndArbitrary(),
|
|
556
|
-
opacity:
|
|
520
|
+
opacity: getNumberAndArbitrary(),
|
|
557
521
|
padding: getSpacingWithArbitrary(),
|
|
558
|
-
saturate:
|
|
559
|
-
scale:
|
|
522
|
+
saturate: getNumberAndArbitrary(),
|
|
523
|
+
scale: getNumberAndArbitrary(),
|
|
560
524
|
sepia: getZeroAndEmpty(),
|
|
561
525
|
skew: getNumberAndArbitrary(),
|
|
562
526
|
space: getSpacingWithArbitrary(),
|
|
@@ -1257,7 +1221,7 @@ function getDefaultConfig() {
|
|
|
1257
1221
|
* Font Variant Numeric
|
|
1258
1222
|
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1259
1223
|
*/
|
|
1260
|
-
"fvn-fraction": ["diagonal-fractions", "stacked-
|
|
1224
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1261
1225
|
/**
|
|
1262
1226
|
* Letter Spacing
|
|
1263
1227
|
* @see https://tailwindcss.com/docs/letter-spacing
|
|
@@ -1781,6 +1745,20 @@ function getDefaultConfig() {
|
|
|
1781
1745
|
"border-color-y": [{
|
|
1782
1746
|
"border-y": [borderColor]
|
|
1783
1747
|
}],
|
|
1748
|
+
/**
|
|
1749
|
+
* Border Color S
|
|
1750
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1751
|
+
*/
|
|
1752
|
+
"border-color-s": [{
|
|
1753
|
+
"border-s": [borderColor]
|
|
1754
|
+
}],
|
|
1755
|
+
/**
|
|
1756
|
+
* Border Color E
|
|
1757
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1758
|
+
*/
|
|
1759
|
+
"border-color-e": [{
|
|
1760
|
+
"border-e": [borderColor]
|
|
1761
|
+
}],
|
|
1784
1762
|
/**
|
|
1785
1763
|
* Border Color Top
|
|
1786
1764
|
* @see https://tailwindcss.com/docs/border-color
|
|
@@ -1911,7 +1889,7 @@ function getDefaultConfig() {
|
|
|
1911
1889
|
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
1912
1890
|
*/
|
|
1913
1891
|
"mix-blend": [{
|
|
1914
|
-
"mix-blend": getBlendModes()
|
|
1892
|
+
"mix-blend": [...getBlendModes(), "plus-lighter", "plus-darker"]
|
|
1915
1893
|
}],
|
|
1916
1894
|
/**
|
|
1917
1895
|
* Background Blend Mode
|
|
@@ -2527,7 +2505,7 @@ function getDefaultConfig() {
|
|
|
2527
2505
|
"border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
|
|
2528
2506
|
"border-w-x": ["border-w-r", "border-w-l"],
|
|
2529
2507
|
"border-w-y": ["border-w-t", "border-w-b"],
|
|
2530
|
-
"border-color": ["border-color-t", "border-color-r", "border-color-b", "border-color-l"],
|
|
2508
|
+
"border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
|
|
2531
2509
|
"border-color-x": ["border-color-r", "border-color-l"],
|
|
2532
2510
|
"border-color-y": ["border-color-t", "border-color-b"],
|
|
2533
2511
|
"scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
|
|
@@ -2545,7 +2523,7 @@ function getDefaultConfig() {
|
|
|
2545
2523
|
"font-size": ["leading"]
|
|
2546
2524
|
}
|
|
2547
2525
|
};
|
|
2548
|
-
}
|
|
2526
|
+
};
|
|
2549
2527
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
2550
2528
|
|
|
2551
2529
|
// src/components/Card/index.tsx
|
|
@@ -2583,10 +2561,10 @@ var Card = (_a) => {
|
|
|
2583
2561
|
),
|
|
2584
2562
|
onClick,
|
|
2585
2563
|
children: [
|
|
2586
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: rest.image, alt: rest.title, width: imageSize }),
|
|
2587
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", { className: twMerge(direction === "col" && "text-center"), children: [
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: rest.image, alt: rest.title, width: imageSize, height: "auto" }),
|
|
2565
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", { className: twMerge(direction === "col" && "text-center", "flex flex-col gap-2"), children: [
|
|
2588
2566
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-xl font-bold font-default leading-tight", children: rest.title }),
|
|
2589
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "", children: rest.content })
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-justify", children: rest.content })
|
|
2590
2568
|
] })
|
|
2591
2569
|
]
|
|
2592
2570
|
}
|
|
@@ -2613,7 +2591,7 @@ var Button = (_a) => {
|
|
|
2613
2591
|
"button",
|
|
2614
2592
|
__spreadValues({
|
|
2615
2593
|
className: twMerge(
|
|
2616
|
-
"flex gap-4 items-center justify-center rounded-sm px-8 py-2 text-md font-medium hover:shadow-md hover:shadow-neutral-500 w-full",
|
|
2594
|
+
"flex gap-4 items-center justify-center rounded-sm px-8 py-2 text-md font-medium hover:shadow-md hover:shadow-neutral-500 w-full max-w-[180px]",
|
|
2617
2595
|
variant === "primary" && "bg-orange-500 text-neutral hover:bg-orange-700",
|
|
2618
2596
|
variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:text-orange-100 hover:bg-orange-500",
|
|
2619
2597
|
size === "sm" && "px-6 py-1",
|
|
@@ -2716,7 +2694,7 @@ var Checkbox = ({ className, required, disabled }) => {
|
|
|
2716
2694
|
const handleCheckboxChange = (value) => {
|
|
2717
2695
|
setSelected(!value);
|
|
2718
2696
|
};
|
|
2719
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex items-center justify-center
|
|
2697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
2720
2698
|
"label",
|
|
2721
2699
|
{
|
|
2722
2700
|
className: twMerge(
|
|
@@ -3013,18 +2991,22 @@ var TextArea = (_a) => {
|
|
|
3013
2991
|
var _b = _a, {
|
|
3014
2992
|
className,
|
|
3015
2993
|
disabled,
|
|
2994
|
+
reference,
|
|
3016
2995
|
value,
|
|
3017
2996
|
error,
|
|
3018
2997
|
required,
|
|
3019
2998
|
placeholder,
|
|
2999
|
+
resize,
|
|
3020
3000
|
onClick
|
|
3021
3001
|
} = _b, rest = __objRest(_b, [
|
|
3022
3002
|
"className",
|
|
3023
3003
|
"disabled",
|
|
3004
|
+
"reference",
|
|
3024
3005
|
"value",
|
|
3025
3006
|
"error",
|
|
3026
3007
|
"required",
|
|
3027
3008
|
"placeholder",
|
|
3009
|
+
"resize",
|
|
3028
3010
|
"onClick"
|
|
3029
3011
|
]);
|
|
3030
3012
|
const [selected, setSelected] = (0, import_react5.useState)(false);
|
|
@@ -3045,6 +3027,7 @@ var TextArea = (_a) => {
|
|
|
3045
3027
|
"textarea",
|
|
3046
3028
|
__spreadValues({
|
|
3047
3029
|
required,
|
|
3030
|
+
ref: reference,
|
|
3048
3031
|
disabled,
|
|
3049
3032
|
className: twMerge(
|
|
3050
3033
|
"rounded-sm w-full px-3 py-2 border-2 border-neutral text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
|
|
@@ -3052,7 +3035,8 @@ var TextArea = (_a) => {
|
|
|
3052
3035
|
className,
|
|
3053
3036
|
disabled === true && "opacity-50 cursor-not-allowed",
|
|
3054
3037
|
selected === true && "border-2 border-orange-500",
|
|
3055
|
-
error === true && "border-2 border-red-900"
|
|
3038
|
+
error === true && "border-2 border-red-900",
|
|
3039
|
+
resize === false && "resize-none overflow-hidden"
|
|
3056
3040
|
),
|
|
3057
3041
|
onClick,
|
|
3058
3042
|
onFocus: handleFocus,
|