@trackunit/react-date-and-time-components 0.0.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.
Files changed (52) hide show
  1. package/README.md +18 -0
  2. package/index.cjs.d.ts +1 -0
  3. package/index.cjs.js +2798 -0
  4. package/index.esm.d.ts +1 -0
  5. package/index.esm.js +2789 -0
  6. package/package.json +16 -0
  7. package/src/DayPicker/DayPicker.d.ts +32 -0
  8. package/src/DayPicker/DayRangePicker.d.ts +52 -0
  9. package/src/DayPicker/DayRangePicker.stories.d.ts +12 -0
  10. package/src/DayPicker/DayRangePickerPopover.d.ts +46 -0
  11. package/src/DayPicker/index.d.ts +21 -0
  12. package/src/DayPicker/useLocale.d.ts +8 -0
  13. package/src/dateTime/DateTime.d.ts +30 -0
  14. package/src/dateTime/DateTime.stories.d.ts +8 -0
  15. package/src/dateTime/DateTimeHumanized.d.ts +11 -0
  16. package/src/dateTime/index.d.ts +2 -0
  17. package/src/index.d.ts +2 -0
  18. package/src/translation.d.ts +34 -0
  19. package/translation.cjs.js +20 -0
  20. package/translation.cjs10.js +20 -0
  21. package/translation.cjs11.js +20 -0
  22. package/translation.cjs12.js +20 -0
  23. package/translation.cjs13.js +20 -0
  24. package/translation.cjs14.js +20 -0
  25. package/translation.cjs15.js +20 -0
  26. package/translation.cjs16.js +20 -0
  27. package/translation.cjs17.js +20 -0
  28. package/translation.cjs2.js +20 -0
  29. package/translation.cjs3.js +20 -0
  30. package/translation.cjs4.js +20 -0
  31. package/translation.cjs5.js +20 -0
  32. package/translation.cjs6.js +20 -0
  33. package/translation.cjs7.js +20 -0
  34. package/translation.cjs8.js +20 -0
  35. package/translation.cjs9.js +20 -0
  36. package/translation.esm.js +18 -0
  37. package/translation.esm10.js +18 -0
  38. package/translation.esm11.js +18 -0
  39. package/translation.esm12.js +18 -0
  40. package/translation.esm13.js +18 -0
  41. package/translation.esm14.js +18 -0
  42. package/translation.esm15.js +18 -0
  43. package/translation.esm16.js +18 -0
  44. package/translation.esm17.js +18 -0
  45. package/translation.esm2.js +18 -0
  46. package/translation.esm3.js +18 -0
  47. package/translation.esm4.js +18 -0
  48. package/translation.esm5.js +18 -0
  49. package/translation.esm6.js +18 -0
  50. package/translation.esm7.js +18 -0
  51. package/translation.esm8.js +18 -0
  52. package/translation.esm9.js +18 -0
package/index.cjs.js ADDED
@@ -0,0 +1,2798 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var i18nLibraryTranslation = require('@trackunit/i18n-library-translation');
7
+ var reactDateAndTimeHooks = require('@trackunit/react-date-and-time-hooks');
8
+ var dateAndTimeUtils = require('@trackunit/date-and-time-utils');
9
+ var uiDesignTokens = require('@trackunit/ui-design-tokens');
10
+ var react = require('react');
11
+ var reactComponents = require('@trackunit/react-components');
12
+ var sharedUtils = require('@trackunit/shared-utils');
13
+ var reactDayPicker = require('react-day-picker');
14
+ var locale = require('date-fns/locale');
15
+ var reactCoreHooks = require('@trackunit/react-core-hooks');
16
+
17
+ var defaultTranslations = {
18
+ "dateTime.instant.now": "Now",
19
+ "dayRangePickerPopover.icon.tooltip.calendar": "Calendar",
20
+ "layout.actions.apply": "Apply",
21
+ "layout.actions.cancel": "Cancel",
22
+ "layout.actions.clear": "Clear",
23
+ "shared.timePeriods.days": "{{count}} day",
24
+ "shared.timePeriods.days_plural": "{{count}} days",
25
+ "shared.timePeriods.hours": "{{count}} hour",
26
+ "shared.timePeriods.hours_plural": "{{count}} hours",
27
+ "shared.timePeriods.months": "{{count}} month",
28
+ "shared.timePeriods.months_plural": "{{count}} months",
29
+ "shared.timePeriods.today": "Today",
30
+ "shared.timePeriods.weeks": "{{count}} week",
31
+ "shared.timePeriods.weeks_plural": "{{count}} weeks"
32
+ };
33
+
34
+ /** The translation namespace for this library */
35
+ const namespace = "date-and-time.date-and-time-components";
36
+ /**
37
+ * The TranslationResource for this Library.
38
+ * Holds lazy loaded imports for all languages supported by the library.
39
+ *
40
+ * This is used to register the translations for this library before initializing i18next.
41
+ */
42
+ const translations = {
43
+ ns: namespace,
44
+ default: defaultTranslations,
45
+ languages: {
46
+ de: () => Promise.resolve().then(function () { return require('./translation.cjs.js'); }),
47
+ da: () => Promise.resolve().then(function () { return require('./translation.cjs2.js'); }),
48
+ cs: () => Promise.resolve().then(function () { return require('./translation.cjs3.js'); }),
49
+ nl: () => Promise.resolve().then(function () { return require('./translation.cjs4.js'); }),
50
+ fr: () => Promise.resolve().then(function () { return require('./translation.cjs5.js'); }),
51
+ fi: () => Promise.resolve().then(function () { return require('./translation.cjs6.js'); }),
52
+ hu: () => Promise.resolve().then(function () { return require('./translation.cjs7.js'); }),
53
+ it: () => Promise.resolve().then(function () { return require('./translation.cjs8.js'); }),
54
+ nb: () => Promise.resolve().then(function () { return require('./translation.cjs9.js'); }),
55
+ pl: () => Promise.resolve().then(function () { return require('./translation.cjs10.js'); }),
56
+ pt: () => Promise.resolve().then(function () { return require('./translation.cjs11.js'); }),
57
+ ru: () => Promise.resolve().then(function () { return require('./translation.cjs12.js'); }),
58
+ ro: () => Promise.resolve().then(function () { return require('./translation.cjs13.js'); }),
59
+ es: () => Promise.resolve().then(function () { return require('./translation.cjs14.js'); }),
60
+ sv: () => Promise.resolve().then(function () { return require('./translation.cjs15.js'); }),
61
+ ja: () => Promise.resolve().then(function () { return require('./translation.cjs16.js'); }),
62
+ th: () => Promise.resolve().then(function () { return require('./translation.cjs17.js'); }),
63
+ },
64
+ };
65
+ /**
66
+ * Local useTranslation for this specific library
67
+ */
68
+ const useTranslation = () => i18nLibraryTranslation.useNamespaceTranslation(namespace);
69
+ /**
70
+ * Registers the translations for this library
71
+ */
72
+ const setupLibraryTranslations = () => {
73
+ i18nLibraryTranslation.registerTranslations(translations);
74
+ };
75
+
76
+ const MS_PER_HOUR = 60 * 60 * 1000;
77
+ /**
78
+ * DateTime component
79
+ *
80
+ * @param { DateTimeProps } props - The properties for the DateTime component.
81
+ * @param props.value Date | string | number | null | undefined
82
+ * @param props.format DateTimeFormat | TemporalFormat | string
83
+ * @param props.className string
84
+ * @param props.fromNow boolean
85
+ * @param props.withTitle boolean
86
+ * @param props.titleFormat string
87
+ * @param props.timezone TimeZone
88
+ * @param props.subtle boolean
89
+ * @param props.calendar boolean | object
90
+ */
91
+ const DateTime = ({ value, format, className, fromNow, withTitle, titleFormat, timezone, subtle, calendar, }) => {
92
+ const { t } = useTranslation();
93
+ const language = reactDateAndTimeHooks.useLocale();
94
+ const nowDate = react.useMemo(() => new Date(), []);
95
+ const date = value ? dateAndTimeUtils.toDateUtil(value) : nowDate;
96
+ const newDateTime = dateAndTimeUtils.formatDateUtil(date, format, timezone === null || timezone === void 0 ? void 0 : timezone.id, language);
97
+ const titleDateTime = withTitle ? dateAndTimeUtils.formatDateUtil(date, titleFormat, timezone === null || timezone === void 0 ? void 0 : timezone.id, language) : undefined;
98
+ const getTimeSince = react.useCallback((from, to) => {
99
+ const same = dateAndTimeUtils.isEqualUtil(from, to);
100
+ if (same) {
101
+ return t("dateTime.instant.now");
102
+ }
103
+ return dateAndTimeUtils.timeSinceAuto(from, to, timezone === null || timezone === void 0 ? void 0 : timezone.id, language);
104
+ }, [language, t, timezone === null || timezone === void 0 ? void 0 : timezone.id]);
105
+ const dateValue = react.useMemo(() => {
106
+ return fromNow ? getTimeSince(date, nowDate) : newDateTime;
107
+ }, [date, fromNow, getTimeSince, newDateTime, nowDate]);
108
+ return (jsxRuntime.jsx("time", { className: className, dateTime: newDateTime, style: subtle ? { color: uiDesignTokens.color("NEUTRAL", 600, "CSS") } : undefined, title: titleDateTime, children: dateValue }));
109
+ };
110
+
111
+ /**
112
+ * DateTimeHumanized component
113
+ *
114
+ * @param { RelativeDateTimeProps } props - The properties for the DateTimeHumanized component.
115
+ * @param props.value Date | string | number | null | undefined
116
+ */
117
+ const DateTimeHumanized = ({ value }) => {
118
+ const tooltipFormat = sharedUtils.DateTimeFormat.DATE_LONG_TIME;
119
+ return (jsxRuntime.jsx(reactComponents.Tooltip, { label: jsxRuntime.jsx(DateTime, { format: tooltipFormat, value: value }), children: jsxRuntime.jsx(DateTime, { className: "underline decoration-neutral-300 decoration-dotted", fromNow: true, value: value }) }));
120
+ };
121
+
122
+ const CLASS_PART_SEPARATOR = '-';
123
+ function createClassUtils(config) {
124
+ const classMap = createClassMap(config);
125
+ const {
126
+ conflictingClassGroups,
127
+ conflictingClassGroupModifiers
128
+ } = config;
129
+ function getClassGroupId(className) {
130
+ const classParts = className.split(CLASS_PART_SEPARATOR);
131
+ // 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.
132
+ if (classParts[0] === '' && classParts.length !== 1) {
133
+ classParts.shift();
134
+ }
135
+ return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
136
+ }
137
+ function getConflictingClassGroupIds(classGroupId, hasPostfixModifier) {
138
+ const conflicts = conflictingClassGroups[classGroupId] || [];
139
+ if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
140
+ return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
141
+ }
142
+ return conflicts;
143
+ }
144
+ return {
145
+ getClassGroupId,
146
+ getConflictingClassGroupIds
147
+ };
148
+ }
149
+ function getGroupRecursive(classParts, classPartObject) {
150
+ if (classParts.length === 0) {
151
+ return classPartObject.classGroupId;
152
+ }
153
+ const currentClassPart = classParts[0];
154
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
155
+ const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
156
+ if (classGroupFromNextClassPart) {
157
+ return classGroupFromNextClassPart;
158
+ }
159
+ if (classPartObject.validators.length === 0) {
160
+ return undefined;
161
+ }
162
+ const classRest = classParts.join(CLASS_PART_SEPARATOR);
163
+ return classPartObject.validators.find(({
164
+ validator
165
+ }) => validator(classRest))?.classGroupId;
166
+ }
167
+ const arbitraryPropertyRegex = /^\[(.+)\]$/;
168
+ function getGroupIdForArbitraryProperty(className) {
169
+ if (arbitraryPropertyRegex.test(className)) {
170
+ const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
171
+ const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
172
+ if (property) {
173
+ // I use two dots here because one dot is used as prefix for class groups in plugins
174
+ return 'arbitrary..' + property;
175
+ }
176
+ }
177
+ }
178
+ /**
179
+ * Exported for testing only
180
+ */
181
+ function createClassMap(config) {
182
+ const {
183
+ theme,
184
+ prefix
185
+ } = config;
186
+ const classMap = {
187
+ nextPart: new Map(),
188
+ validators: []
189
+ };
190
+ const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
191
+ prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
192
+ processClassesRecursively(classGroup, classMap, classGroupId, theme);
193
+ });
194
+ return classMap;
195
+ }
196
+ function processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {
197
+ classGroup.forEach(classDefinition => {
198
+ if (typeof classDefinition === 'string') {
199
+ const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
200
+ classPartObjectToEdit.classGroupId = classGroupId;
201
+ return;
202
+ }
203
+ if (typeof classDefinition === 'function') {
204
+ if (isThemeGetter(classDefinition)) {
205
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
206
+ return;
207
+ }
208
+ classPartObject.validators.push({
209
+ validator: classDefinition,
210
+ classGroupId
211
+ });
212
+ return;
213
+ }
214
+ Object.entries(classDefinition).forEach(([key, classGroup]) => {
215
+ processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
216
+ });
217
+ });
218
+ }
219
+ function getPart(classPartObject, path) {
220
+ let currentClassPartObject = classPartObject;
221
+ path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {
222
+ if (!currentClassPartObject.nextPart.has(pathPart)) {
223
+ currentClassPartObject.nextPart.set(pathPart, {
224
+ nextPart: new Map(),
225
+ validators: []
226
+ });
227
+ }
228
+ currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
229
+ });
230
+ return currentClassPartObject;
231
+ }
232
+ function isThemeGetter(func) {
233
+ return func.isThemeGetter;
234
+ }
235
+ function getPrefixedClassGroupEntries(classGroupEntries, prefix) {
236
+ if (!prefix) {
237
+ return classGroupEntries;
238
+ }
239
+ return classGroupEntries.map(([classGroupId, classGroup]) => {
240
+ const prefixedClassGroup = classGroup.map(classDefinition => {
241
+ if (typeof classDefinition === 'string') {
242
+ return prefix + classDefinition;
243
+ }
244
+ if (typeof classDefinition === 'object') {
245
+ return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
246
+ }
247
+ return classDefinition;
248
+ });
249
+ return [classGroupId, prefixedClassGroup];
250
+ });
251
+ }
252
+
253
+ // LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance
254
+ function createLruCache(maxCacheSize) {
255
+ if (maxCacheSize < 1) {
256
+ return {
257
+ get: () => undefined,
258
+ set: () => {}
259
+ };
260
+ }
261
+ let cacheSize = 0;
262
+ let cache = new Map();
263
+ let previousCache = new Map();
264
+ function update(key, value) {
265
+ cache.set(key, value);
266
+ cacheSize++;
267
+ if (cacheSize > maxCacheSize) {
268
+ cacheSize = 0;
269
+ previousCache = cache;
270
+ cache = new Map();
271
+ }
272
+ }
273
+ return {
274
+ get(key) {
275
+ let value = cache.get(key);
276
+ if (value !== undefined) {
277
+ return value;
278
+ }
279
+ if ((value = previousCache.get(key)) !== undefined) {
280
+ update(key, value);
281
+ return value;
282
+ }
283
+ },
284
+ set(key, value) {
285
+ if (cache.has(key)) {
286
+ cache.set(key, value);
287
+ } else {
288
+ update(key, value);
289
+ }
290
+ }
291
+ };
292
+ }
293
+ const IMPORTANT_MODIFIER = '!';
294
+ function createSplitModifiers(config) {
295
+ const separator = config.separator;
296
+ const isSeparatorSingleCharacter = separator.length === 1;
297
+ const firstSeparatorCharacter = separator[0];
298
+ const separatorLength = separator.length;
299
+ // splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
300
+ return function splitModifiers(className) {
301
+ const modifiers = [];
302
+ let bracketDepth = 0;
303
+ let modifierStart = 0;
304
+ let postfixModifierPosition;
305
+ for (let index = 0; index < className.length; index++) {
306
+ let currentCharacter = className[index];
307
+ if (bracketDepth === 0) {
308
+ if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
309
+ modifiers.push(className.slice(modifierStart, index));
310
+ modifierStart = index + separatorLength;
311
+ continue;
312
+ }
313
+ if (currentCharacter === '/') {
314
+ postfixModifierPosition = index;
315
+ continue;
316
+ }
317
+ }
318
+ if (currentCharacter === '[') {
319
+ bracketDepth++;
320
+ } else if (currentCharacter === ']') {
321
+ bracketDepth--;
322
+ }
323
+ }
324
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
325
+ const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
326
+ const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
327
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
328
+ return {
329
+ modifiers,
330
+ hasImportantModifier,
331
+ baseClassName,
332
+ maybePostfixModifierPosition
333
+ };
334
+ };
335
+ }
336
+ /**
337
+ * Sorts modifiers according to following schema:
338
+ * - Predefined modifiers are sorted alphabetically
339
+ * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
340
+ */
341
+ function sortModifiers(modifiers) {
342
+ if (modifiers.length <= 1) {
343
+ return modifiers;
344
+ }
345
+ const sortedModifiers = [];
346
+ let unsortedModifiers = [];
347
+ modifiers.forEach(modifier => {
348
+ const isArbitraryVariant = modifier[0] === '[';
349
+ if (isArbitraryVariant) {
350
+ sortedModifiers.push(...unsortedModifiers.sort(), modifier);
351
+ unsortedModifiers = [];
352
+ } else {
353
+ unsortedModifiers.push(modifier);
354
+ }
355
+ });
356
+ sortedModifiers.push(...unsortedModifiers.sort());
357
+ return sortedModifiers;
358
+ }
359
+ function createConfigUtils(config) {
360
+ return {
361
+ cache: createLruCache(config.cacheSize),
362
+ splitModifiers: createSplitModifiers(config),
363
+ ...createClassUtils(config)
364
+ };
365
+ }
366
+ const SPLIT_CLASSES_REGEX = /\s+/;
367
+ function mergeClassList(classList, configUtils) {
368
+ const {
369
+ splitModifiers,
370
+ getClassGroupId,
371
+ getConflictingClassGroupIds
372
+ } = configUtils;
373
+ /**
374
+ * Set of classGroupIds in following format:
375
+ * `{importantModifier}{variantModifiers}{classGroupId}`
376
+ * @example 'float'
377
+ * @example 'hover:focus:bg-color'
378
+ * @example 'md:!pr'
379
+ */
380
+ const classGroupsInConflict = new Set();
381
+ return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName => {
382
+ const {
383
+ modifiers,
384
+ hasImportantModifier,
385
+ baseClassName,
386
+ maybePostfixModifierPosition
387
+ } = splitModifiers(originalClassName);
388
+ let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
389
+ let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
390
+ if (!classGroupId) {
391
+ if (!maybePostfixModifierPosition) {
392
+ return {
393
+ isTailwindClass: false,
394
+ originalClassName
395
+ };
396
+ }
397
+ classGroupId = getClassGroupId(baseClassName);
398
+ if (!classGroupId) {
399
+ return {
400
+ isTailwindClass: false,
401
+ originalClassName
402
+ };
403
+ }
404
+ hasPostfixModifier = false;
405
+ }
406
+ const variantModifier = sortModifiers(modifiers).join(':');
407
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
408
+ return {
409
+ isTailwindClass: true,
410
+ modifierId,
411
+ classGroupId,
412
+ originalClassName,
413
+ hasPostfixModifier
414
+ };
415
+ }).reverse()
416
+ // Last class in conflict wins, so we need to filter conflicting classes in reverse order.
417
+ .filter(parsed => {
418
+ if (!parsed.isTailwindClass) {
419
+ return true;
420
+ }
421
+ const {
422
+ modifierId,
423
+ classGroupId,
424
+ hasPostfixModifier
425
+ } = parsed;
426
+ const classId = modifierId + classGroupId;
427
+ if (classGroupsInConflict.has(classId)) {
428
+ return false;
429
+ }
430
+ classGroupsInConflict.add(classId);
431
+ getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(group => classGroupsInConflict.add(modifierId + group));
432
+ return true;
433
+ }).reverse().map(parsed => parsed.originalClassName).join(' ');
434
+ }
435
+
436
+ /**
437
+ * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
438
+ *
439
+ * Specifically:
440
+ * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
441
+ * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
442
+ *
443
+ * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
444
+ */
445
+ function twJoin() {
446
+ let index = 0;
447
+ let argument;
448
+ let resolvedValue;
449
+ let string = '';
450
+ while (index < arguments.length) {
451
+ if (argument = arguments[index++]) {
452
+ if (resolvedValue = toValue(argument)) {
453
+ string && (string += ' ');
454
+ string += resolvedValue;
455
+ }
456
+ }
457
+ }
458
+ return string;
459
+ }
460
+ function toValue(mix) {
461
+ if (typeof mix === 'string') {
462
+ return mix;
463
+ }
464
+ let resolvedValue;
465
+ let string = '';
466
+ for (let k = 0; k < mix.length; k++) {
467
+ if (mix[k]) {
468
+ if (resolvedValue = toValue(mix[k])) {
469
+ string && (string += ' ');
470
+ string += resolvedValue;
471
+ }
472
+ }
473
+ }
474
+ return string;
475
+ }
476
+ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
477
+ let configUtils;
478
+ let cacheGet;
479
+ let cacheSet;
480
+ let functionToCall = initTailwindMerge;
481
+ function initTailwindMerge(classList) {
482
+ const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
483
+ configUtils = createConfigUtils(config);
484
+ cacheGet = configUtils.cache.get;
485
+ cacheSet = configUtils.cache.set;
486
+ functionToCall = tailwindMerge;
487
+ return tailwindMerge(classList);
488
+ }
489
+ function tailwindMerge(classList) {
490
+ const cachedResult = cacheGet(classList);
491
+ if (cachedResult) {
492
+ return cachedResult;
493
+ }
494
+ const result = mergeClassList(classList, configUtils);
495
+ cacheSet(classList, result);
496
+ return result;
497
+ }
498
+ return function callTailwindMerge() {
499
+ return functionToCall(twJoin.apply(null, arguments));
500
+ };
501
+ }
502
+ function fromTheme(key) {
503
+ const themeGetter = theme => theme[key] || [];
504
+ themeGetter.isThemeGetter = true;
505
+ return themeGetter;
506
+ }
507
+ const arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
508
+ const fractionRegex = /^\d+\/\d+$/;
509
+ const stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);
510
+ const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
511
+ 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$/;
512
+ // Shadow always begins with x and y offset separated by underscore
513
+ const shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
514
+ const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
515
+ function isLength(value) {
516
+ return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
517
+ }
518
+ function isArbitraryLength(value) {
519
+ return getIsArbitraryValue(value, 'length', isLengthOnly);
520
+ }
521
+ function isNumber(value) {
522
+ return Boolean(value) && !Number.isNaN(Number(value));
523
+ }
524
+ function isArbitraryNumber(value) {
525
+ return getIsArbitraryValue(value, 'number', isNumber);
526
+ }
527
+ function isInteger(value) {
528
+ return Boolean(value) && Number.isInteger(Number(value));
529
+ }
530
+ function isPercent(value) {
531
+ return value.endsWith('%') && isNumber(value.slice(0, -1));
532
+ }
533
+ function isArbitraryValue(value) {
534
+ return arbitraryValueRegex.test(value);
535
+ }
536
+ function isTshirtSize(value) {
537
+ return tshirtUnitRegex.test(value);
538
+ }
539
+ const sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);
540
+ function isArbitrarySize(value) {
541
+ return getIsArbitraryValue(value, sizeLabels, isNever);
542
+ }
543
+ function isArbitraryPosition(value) {
544
+ return getIsArbitraryValue(value, 'position', isNever);
545
+ }
546
+ const imageLabels = /*#__PURE__*/new Set(['image', 'url']);
547
+ function isArbitraryImage(value) {
548
+ return getIsArbitraryValue(value, imageLabels, isImage);
549
+ }
550
+ function isArbitraryShadow(value) {
551
+ return getIsArbitraryValue(value, '', isShadow);
552
+ }
553
+ function isAny() {
554
+ return true;
555
+ }
556
+ function getIsArbitraryValue(value, label, testValue) {
557
+ const result = arbitraryValueRegex.exec(value);
558
+ if (result) {
559
+ if (result[1]) {
560
+ return typeof label === 'string' ? result[1] === label : label.has(result[1]);
561
+ }
562
+ return testValue(result[2]);
563
+ }
564
+ return false;
565
+ }
566
+ function isLengthOnly(value) {
567
+ return lengthUnitRegex.test(value);
568
+ }
569
+ function isNever() {
570
+ return false;
571
+ }
572
+ function isShadow(value) {
573
+ return shadowRegex.test(value);
574
+ }
575
+ function isImage(value) {
576
+ return imageRegex.test(value);
577
+ }
578
+ function getDefaultConfig() {
579
+ const colors = fromTheme('colors');
580
+ const spacing = fromTheme('spacing');
581
+ const blur = fromTheme('blur');
582
+ const brightness = fromTheme('brightness');
583
+ const borderColor = fromTheme('borderColor');
584
+ const borderRadius = fromTheme('borderRadius');
585
+ const borderSpacing = fromTheme('borderSpacing');
586
+ const borderWidth = fromTheme('borderWidth');
587
+ const contrast = fromTheme('contrast');
588
+ const grayscale = fromTheme('grayscale');
589
+ const hueRotate = fromTheme('hueRotate');
590
+ const invert = fromTheme('invert');
591
+ const gap = fromTheme('gap');
592
+ const gradientColorStops = fromTheme('gradientColorStops');
593
+ const gradientColorStopPositions = fromTheme('gradientColorStopPositions');
594
+ const inset = fromTheme('inset');
595
+ const margin = fromTheme('margin');
596
+ const opacity = fromTheme('opacity');
597
+ const padding = fromTheme('padding');
598
+ const saturate = fromTheme('saturate');
599
+ const scale = fromTheme('scale');
600
+ const sepia = fromTheme('sepia');
601
+ const skew = fromTheme('skew');
602
+ const space = fromTheme('space');
603
+ const translate = fromTheme('translate');
604
+ const getOverscroll = () => ['auto', 'contain', 'none'];
605
+ const getOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
606
+ const getSpacingWithAutoAndArbitrary = () => ['auto', isArbitraryValue, spacing];
607
+ const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
608
+ const getLengthWithEmptyAndArbitrary = () => ['', isLength, isArbitraryLength];
609
+ const getNumberWithAutoAndArbitrary = () => ['auto', isNumber, isArbitraryValue];
610
+ const getPositions = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];
611
+ const getLineStyles = () => ['solid', 'dashed', 'dotted', 'double', 'none'];
612
+ const getBlendModes = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];
613
+ const getAlign = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];
614
+ const getZeroAndEmpty = () => ['', '0', isArbitraryValue];
615
+ const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
616
+ const getNumber = () => [isNumber, isArbitraryNumber];
617
+ const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
618
+ return {
619
+ cacheSize: 500,
620
+ separator: ':',
621
+ theme: {
622
+ colors: [isAny],
623
+ spacing: [isLength, isArbitraryLength],
624
+ blur: ['none', '', isTshirtSize, isArbitraryValue],
625
+ brightness: getNumber(),
626
+ borderColor: [colors],
627
+ borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],
628
+ borderSpacing: getSpacingWithArbitrary(),
629
+ borderWidth: getLengthWithEmptyAndArbitrary(),
630
+ contrast: getNumber(),
631
+ grayscale: getZeroAndEmpty(),
632
+ hueRotate: getNumberAndArbitrary(),
633
+ invert: getZeroAndEmpty(),
634
+ gap: getSpacingWithArbitrary(),
635
+ gradientColorStops: [colors],
636
+ gradientColorStopPositions: [isPercent, isArbitraryLength],
637
+ inset: getSpacingWithAutoAndArbitrary(),
638
+ margin: getSpacingWithAutoAndArbitrary(),
639
+ opacity: getNumber(),
640
+ padding: getSpacingWithArbitrary(),
641
+ saturate: getNumber(),
642
+ scale: getNumber(),
643
+ sepia: getZeroAndEmpty(),
644
+ skew: getNumberAndArbitrary(),
645
+ space: getSpacingWithArbitrary(),
646
+ translate: getSpacingWithArbitrary()
647
+ },
648
+ classGroups: {
649
+ // Layout
650
+ /**
651
+ * Aspect Ratio
652
+ * @see https://tailwindcss.com/docs/aspect-ratio
653
+ */
654
+ aspect: [{
655
+ aspect: ['auto', 'square', 'video', isArbitraryValue]
656
+ }],
657
+ /**
658
+ * Container
659
+ * @see https://tailwindcss.com/docs/container
660
+ */
661
+ container: ['container'],
662
+ /**
663
+ * Columns
664
+ * @see https://tailwindcss.com/docs/columns
665
+ */
666
+ columns: [{
667
+ columns: [isTshirtSize]
668
+ }],
669
+ /**
670
+ * Break After
671
+ * @see https://tailwindcss.com/docs/break-after
672
+ */
673
+ 'break-after': [{
674
+ 'break-after': getBreaks()
675
+ }],
676
+ /**
677
+ * Break Before
678
+ * @see https://tailwindcss.com/docs/break-before
679
+ */
680
+ 'break-before': [{
681
+ 'break-before': getBreaks()
682
+ }],
683
+ /**
684
+ * Break Inside
685
+ * @see https://tailwindcss.com/docs/break-inside
686
+ */
687
+ 'break-inside': [{
688
+ 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']
689
+ }],
690
+ /**
691
+ * Box Decoration Break
692
+ * @see https://tailwindcss.com/docs/box-decoration-break
693
+ */
694
+ 'box-decoration': [{
695
+ 'box-decoration': ['slice', 'clone']
696
+ }],
697
+ /**
698
+ * Box Sizing
699
+ * @see https://tailwindcss.com/docs/box-sizing
700
+ */
701
+ box: [{
702
+ box: ['border', 'content']
703
+ }],
704
+ /**
705
+ * Display
706
+ * @see https://tailwindcss.com/docs/display
707
+ */
708
+ display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],
709
+ /**
710
+ * Floats
711
+ * @see https://tailwindcss.com/docs/float
712
+ */
713
+ float: [{
714
+ float: ['right', 'left', 'none']
715
+ }],
716
+ /**
717
+ * Clear
718
+ * @see https://tailwindcss.com/docs/clear
719
+ */
720
+ clear: [{
721
+ clear: ['left', 'right', 'both', 'none']
722
+ }],
723
+ /**
724
+ * Isolation
725
+ * @see https://tailwindcss.com/docs/isolation
726
+ */
727
+ isolation: ['isolate', 'isolation-auto'],
728
+ /**
729
+ * Object Fit
730
+ * @see https://tailwindcss.com/docs/object-fit
731
+ */
732
+ 'object-fit': [{
733
+ object: ['contain', 'cover', 'fill', 'none', 'scale-down']
734
+ }],
735
+ /**
736
+ * Object Position
737
+ * @see https://tailwindcss.com/docs/object-position
738
+ */
739
+ 'object-position': [{
740
+ object: [...getPositions(), isArbitraryValue]
741
+ }],
742
+ /**
743
+ * Overflow
744
+ * @see https://tailwindcss.com/docs/overflow
745
+ */
746
+ overflow: [{
747
+ overflow: getOverflow()
748
+ }],
749
+ /**
750
+ * Overflow X
751
+ * @see https://tailwindcss.com/docs/overflow
752
+ */
753
+ 'overflow-x': [{
754
+ 'overflow-x': getOverflow()
755
+ }],
756
+ /**
757
+ * Overflow Y
758
+ * @see https://tailwindcss.com/docs/overflow
759
+ */
760
+ 'overflow-y': [{
761
+ 'overflow-y': getOverflow()
762
+ }],
763
+ /**
764
+ * Overscroll Behavior
765
+ * @see https://tailwindcss.com/docs/overscroll-behavior
766
+ */
767
+ overscroll: [{
768
+ overscroll: getOverscroll()
769
+ }],
770
+ /**
771
+ * Overscroll Behavior X
772
+ * @see https://tailwindcss.com/docs/overscroll-behavior
773
+ */
774
+ 'overscroll-x': [{
775
+ 'overscroll-x': getOverscroll()
776
+ }],
777
+ /**
778
+ * Overscroll Behavior Y
779
+ * @see https://tailwindcss.com/docs/overscroll-behavior
780
+ */
781
+ 'overscroll-y': [{
782
+ 'overscroll-y': getOverscroll()
783
+ }],
784
+ /**
785
+ * Position
786
+ * @see https://tailwindcss.com/docs/position
787
+ */
788
+ position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],
789
+ /**
790
+ * Top / Right / Bottom / Left
791
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
792
+ */
793
+ inset: [{
794
+ inset: [inset]
795
+ }],
796
+ /**
797
+ * Right / Left
798
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
799
+ */
800
+ 'inset-x': [{
801
+ 'inset-x': [inset]
802
+ }],
803
+ /**
804
+ * Top / Bottom
805
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
806
+ */
807
+ 'inset-y': [{
808
+ 'inset-y': [inset]
809
+ }],
810
+ /**
811
+ * Start
812
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
813
+ */
814
+ start: [{
815
+ start: [inset]
816
+ }],
817
+ /**
818
+ * End
819
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
820
+ */
821
+ end: [{
822
+ end: [inset]
823
+ }],
824
+ /**
825
+ * Top
826
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
827
+ */
828
+ top: [{
829
+ top: [inset]
830
+ }],
831
+ /**
832
+ * Right
833
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
834
+ */
835
+ right: [{
836
+ right: [inset]
837
+ }],
838
+ /**
839
+ * Bottom
840
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
841
+ */
842
+ bottom: [{
843
+ bottom: [inset]
844
+ }],
845
+ /**
846
+ * Left
847
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
848
+ */
849
+ left: [{
850
+ left: [inset]
851
+ }],
852
+ /**
853
+ * Visibility
854
+ * @see https://tailwindcss.com/docs/visibility
855
+ */
856
+ visibility: ['visible', 'invisible', 'collapse'],
857
+ /**
858
+ * Z-Index
859
+ * @see https://tailwindcss.com/docs/z-index
860
+ */
861
+ z: [{
862
+ z: ['auto', isInteger, isArbitraryValue]
863
+ }],
864
+ // Flexbox and Grid
865
+ /**
866
+ * Flex Basis
867
+ * @see https://tailwindcss.com/docs/flex-basis
868
+ */
869
+ basis: [{
870
+ basis: getSpacingWithAutoAndArbitrary()
871
+ }],
872
+ /**
873
+ * Flex Direction
874
+ * @see https://tailwindcss.com/docs/flex-direction
875
+ */
876
+ 'flex-direction': [{
877
+ flex: ['row', 'row-reverse', 'col', 'col-reverse']
878
+ }],
879
+ /**
880
+ * Flex Wrap
881
+ * @see https://tailwindcss.com/docs/flex-wrap
882
+ */
883
+ 'flex-wrap': [{
884
+ flex: ['wrap', 'wrap-reverse', 'nowrap']
885
+ }],
886
+ /**
887
+ * Flex
888
+ * @see https://tailwindcss.com/docs/flex
889
+ */
890
+ flex: [{
891
+ flex: ['1', 'auto', 'initial', 'none', isArbitraryValue]
892
+ }],
893
+ /**
894
+ * Flex Grow
895
+ * @see https://tailwindcss.com/docs/flex-grow
896
+ */
897
+ grow: [{
898
+ grow: getZeroAndEmpty()
899
+ }],
900
+ /**
901
+ * Flex Shrink
902
+ * @see https://tailwindcss.com/docs/flex-shrink
903
+ */
904
+ shrink: [{
905
+ shrink: getZeroAndEmpty()
906
+ }],
907
+ /**
908
+ * Order
909
+ * @see https://tailwindcss.com/docs/order
910
+ */
911
+ order: [{
912
+ order: ['first', 'last', 'none', isInteger, isArbitraryValue]
913
+ }],
914
+ /**
915
+ * Grid Template Columns
916
+ * @see https://tailwindcss.com/docs/grid-template-columns
917
+ */
918
+ 'grid-cols': [{
919
+ 'grid-cols': [isAny]
920
+ }],
921
+ /**
922
+ * Grid Column Start / End
923
+ * @see https://tailwindcss.com/docs/grid-column
924
+ */
925
+ 'col-start-end': [{
926
+ col: ['auto', {
927
+ span: ['full', isInteger, isArbitraryValue]
928
+ }, isArbitraryValue]
929
+ }],
930
+ /**
931
+ * Grid Column Start
932
+ * @see https://tailwindcss.com/docs/grid-column
933
+ */
934
+ 'col-start': [{
935
+ 'col-start': getNumberWithAutoAndArbitrary()
936
+ }],
937
+ /**
938
+ * Grid Column End
939
+ * @see https://tailwindcss.com/docs/grid-column
940
+ */
941
+ 'col-end': [{
942
+ 'col-end': getNumberWithAutoAndArbitrary()
943
+ }],
944
+ /**
945
+ * Grid Template Rows
946
+ * @see https://tailwindcss.com/docs/grid-template-rows
947
+ */
948
+ 'grid-rows': [{
949
+ 'grid-rows': [isAny]
950
+ }],
951
+ /**
952
+ * Grid Row Start / End
953
+ * @see https://tailwindcss.com/docs/grid-row
954
+ */
955
+ 'row-start-end': [{
956
+ row: ['auto', {
957
+ span: [isInteger, isArbitraryValue]
958
+ }, isArbitraryValue]
959
+ }],
960
+ /**
961
+ * Grid Row Start
962
+ * @see https://tailwindcss.com/docs/grid-row
963
+ */
964
+ 'row-start': [{
965
+ 'row-start': getNumberWithAutoAndArbitrary()
966
+ }],
967
+ /**
968
+ * Grid Row End
969
+ * @see https://tailwindcss.com/docs/grid-row
970
+ */
971
+ 'row-end': [{
972
+ 'row-end': getNumberWithAutoAndArbitrary()
973
+ }],
974
+ /**
975
+ * Grid Auto Flow
976
+ * @see https://tailwindcss.com/docs/grid-auto-flow
977
+ */
978
+ 'grid-flow': [{
979
+ 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']
980
+ }],
981
+ /**
982
+ * Grid Auto Columns
983
+ * @see https://tailwindcss.com/docs/grid-auto-columns
984
+ */
985
+ 'auto-cols': [{
986
+ 'auto-cols': ['auto', 'min', 'max', 'fr', isArbitraryValue]
987
+ }],
988
+ /**
989
+ * Grid Auto Rows
990
+ * @see https://tailwindcss.com/docs/grid-auto-rows
991
+ */
992
+ 'auto-rows': [{
993
+ 'auto-rows': ['auto', 'min', 'max', 'fr', isArbitraryValue]
994
+ }],
995
+ /**
996
+ * Gap
997
+ * @see https://tailwindcss.com/docs/gap
998
+ */
999
+ gap: [{
1000
+ gap: [gap]
1001
+ }],
1002
+ /**
1003
+ * Gap X
1004
+ * @see https://tailwindcss.com/docs/gap
1005
+ */
1006
+ 'gap-x': [{
1007
+ 'gap-x': [gap]
1008
+ }],
1009
+ /**
1010
+ * Gap Y
1011
+ * @see https://tailwindcss.com/docs/gap
1012
+ */
1013
+ 'gap-y': [{
1014
+ 'gap-y': [gap]
1015
+ }],
1016
+ /**
1017
+ * Justify Content
1018
+ * @see https://tailwindcss.com/docs/justify-content
1019
+ */
1020
+ 'justify-content': [{
1021
+ justify: ['normal', ...getAlign()]
1022
+ }],
1023
+ /**
1024
+ * Justify Items
1025
+ * @see https://tailwindcss.com/docs/justify-items
1026
+ */
1027
+ 'justify-items': [{
1028
+ 'justify-items': ['start', 'end', 'center', 'stretch']
1029
+ }],
1030
+ /**
1031
+ * Justify Self
1032
+ * @see https://tailwindcss.com/docs/justify-self
1033
+ */
1034
+ 'justify-self': [{
1035
+ 'justify-self': ['auto', 'start', 'end', 'center', 'stretch']
1036
+ }],
1037
+ /**
1038
+ * Align Content
1039
+ * @see https://tailwindcss.com/docs/align-content
1040
+ */
1041
+ 'align-content': [{
1042
+ content: ['normal', ...getAlign(), 'baseline']
1043
+ }],
1044
+ /**
1045
+ * Align Items
1046
+ * @see https://tailwindcss.com/docs/align-items
1047
+ */
1048
+ 'align-items': [{
1049
+ items: ['start', 'end', 'center', 'baseline', 'stretch']
1050
+ }],
1051
+ /**
1052
+ * Align Self
1053
+ * @see https://tailwindcss.com/docs/align-self
1054
+ */
1055
+ 'align-self': [{
1056
+ self: ['auto', 'start', 'end', 'center', 'stretch', 'baseline']
1057
+ }],
1058
+ /**
1059
+ * Place Content
1060
+ * @see https://tailwindcss.com/docs/place-content
1061
+ */
1062
+ 'place-content': [{
1063
+ 'place-content': [...getAlign(), 'baseline']
1064
+ }],
1065
+ /**
1066
+ * Place Items
1067
+ * @see https://tailwindcss.com/docs/place-items
1068
+ */
1069
+ 'place-items': [{
1070
+ 'place-items': ['start', 'end', 'center', 'baseline', 'stretch']
1071
+ }],
1072
+ /**
1073
+ * Place Self
1074
+ * @see https://tailwindcss.com/docs/place-self
1075
+ */
1076
+ 'place-self': [{
1077
+ 'place-self': ['auto', 'start', 'end', 'center', 'stretch']
1078
+ }],
1079
+ // Spacing
1080
+ /**
1081
+ * Padding
1082
+ * @see https://tailwindcss.com/docs/padding
1083
+ */
1084
+ p: [{
1085
+ p: [padding]
1086
+ }],
1087
+ /**
1088
+ * Padding X
1089
+ * @see https://tailwindcss.com/docs/padding
1090
+ */
1091
+ px: [{
1092
+ px: [padding]
1093
+ }],
1094
+ /**
1095
+ * Padding Y
1096
+ * @see https://tailwindcss.com/docs/padding
1097
+ */
1098
+ py: [{
1099
+ py: [padding]
1100
+ }],
1101
+ /**
1102
+ * Padding Start
1103
+ * @see https://tailwindcss.com/docs/padding
1104
+ */
1105
+ ps: [{
1106
+ ps: [padding]
1107
+ }],
1108
+ /**
1109
+ * Padding End
1110
+ * @see https://tailwindcss.com/docs/padding
1111
+ */
1112
+ pe: [{
1113
+ pe: [padding]
1114
+ }],
1115
+ /**
1116
+ * Padding Top
1117
+ * @see https://tailwindcss.com/docs/padding
1118
+ */
1119
+ pt: [{
1120
+ pt: [padding]
1121
+ }],
1122
+ /**
1123
+ * Padding Right
1124
+ * @see https://tailwindcss.com/docs/padding
1125
+ */
1126
+ pr: [{
1127
+ pr: [padding]
1128
+ }],
1129
+ /**
1130
+ * Padding Bottom
1131
+ * @see https://tailwindcss.com/docs/padding
1132
+ */
1133
+ pb: [{
1134
+ pb: [padding]
1135
+ }],
1136
+ /**
1137
+ * Padding Left
1138
+ * @see https://tailwindcss.com/docs/padding
1139
+ */
1140
+ pl: [{
1141
+ pl: [padding]
1142
+ }],
1143
+ /**
1144
+ * Margin
1145
+ * @see https://tailwindcss.com/docs/margin
1146
+ */
1147
+ m: [{
1148
+ m: [margin]
1149
+ }],
1150
+ /**
1151
+ * Margin X
1152
+ * @see https://tailwindcss.com/docs/margin
1153
+ */
1154
+ mx: [{
1155
+ mx: [margin]
1156
+ }],
1157
+ /**
1158
+ * Margin Y
1159
+ * @see https://tailwindcss.com/docs/margin
1160
+ */
1161
+ my: [{
1162
+ my: [margin]
1163
+ }],
1164
+ /**
1165
+ * Margin Start
1166
+ * @see https://tailwindcss.com/docs/margin
1167
+ */
1168
+ ms: [{
1169
+ ms: [margin]
1170
+ }],
1171
+ /**
1172
+ * Margin End
1173
+ * @see https://tailwindcss.com/docs/margin
1174
+ */
1175
+ me: [{
1176
+ me: [margin]
1177
+ }],
1178
+ /**
1179
+ * Margin Top
1180
+ * @see https://tailwindcss.com/docs/margin
1181
+ */
1182
+ mt: [{
1183
+ mt: [margin]
1184
+ }],
1185
+ /**
1186
+ * Margin Right
1187
+ * @see https://tailwindcss.com/docs/margin
1188
+ */
1189
+ mr: [{
1190
+ mr: [margin]
1191
+ }],
1192
+ /**
1193
+ * Margin Bottom
1194
+ * @see https://tailwindcss.com/docs/margin
1195
+ */
1196
+ mb: [{
1197
+ mb: [margin]
1198
+ }],
1199
+ /**
1200
+ * Margin Left
1201
+ * @see https://tailwindcss.com/docs/margin
1202
+ */
1203
+ ml: [{
1204
+ ml: [margin]
1205
+ }],
1206
+ /**
1207
+ * Space Between X
1208
+ * @see https://tailwindcss.com/docs/space
1209
+ */
1210
+ 'space-x': [{
1211
+ 'space-x': [space]
1212
+ }],
1213
+ /**
1214
+ * Space Between X Reverse
1215
+ * @see https://tailwindcss.com/docs/space
1216
+ */
1217
+ 'space-x-reverse': ['space-x-reverse'],
1218
+ /**
1219
+ * Space Between Y
1220
+ * @see https://tailwindcss.com/docs/space
1221
+ */
1222
+ 'space-y': [{
1223
+ 'space-y': [space]
1224
+ }],
1225
+ /**
1226
+ * Space Between Y Reverse
1227
+ * @see https://tailwindcss.com/docs/space
1228
+ */
1229
+ 'space-y-reverse': ['space-y-reverse'],
1230
+ // Sizing
1231
+ /**
1232
+ * Width
1233
+ * @see https://tailwindcss.com/docs/width
1234
+ */
1235
+ w: [{
1236
+ w: ['auto', 'min', 'max', 'fit', isArbitraryValue, spacing]
1237
+ }],
1238
+ /**
1239
+ * Min-Width
1240
+ * @see https://tailwindcss.com/docs/min-width
1241
+ */
1242
+ 'min-w': [{
1243
+ 'min-w': ['min', 'max', 'fit', isArbitraryValue, isLength]
1244
+ }],
1245
+ /**
1246
+ * Max-Width
1247
+ * @see https://tailwindcss.com/docs/max-width
1248
+ */
1249
+ 'max-w': [{
1250
+ 'max-w': ['0', 'none', 'full', 'min', 'max', 'fit', 'prose', {
1251
+ screen: [isTshirtSize]
1252
+ }, isTshirtSize, isArbitraryValue]
1253
+ }],
1254
+ /**
1255
+ * Height
1256
+ * @see https://tailwindcss.com/docs/height
1257
+ */
1258
+ h: [{
1259
+ h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']
1260
+ }],
1261
+ /**
1262
+ * Min-Height
1263
+ * @see https://tailwindcss.com/docs/min-height
1264
+ */
1265
+ 'min-h': [{
1266
+ 'min-h': ['min', 'max', 'fit', isLength, isArbitraryValue]
1267
+ }],
1268
+ /**
1269
+ * Max-Height
1270
+ * @see https://tailwindcss.com/docs/max-height
1271
+ */
1272
+ 'max-h': [{
1273
+ 'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit']
1274
+ }],
1275
+ // Typography
1276
+ /**
1277
+ * Font Size
1278
+ * @see https://tailwindcss.com/docs/font-size
1279
+ */
1280
+ 'font-size': [{
1281
+ text: ['base', isTshirtSize, isArbitraryLength]
1282
+ }],
1283
+ /**
1284
+ * Font Smoothing
1285
+ * @see https://tailwindcss.com/docs/font-smoothing
1286
+ */
1287
+ 'font-smoothing': ['antialiased', 'subpixel-antialiased'],
1288
+ /**
1289
+ * Font Style
1290
+ * @see https://tailwindcss.com/docs/font-style
1291
+ */
1292
+ 'font-style': ['italic', 'not-italic'],
1293
+ /**
1294
+ * Font Weight
1295
+ * @see https://tailwindcss.com/docs/font-weight
1296
+ */
1297
+ 'font-weight': [{
1298
+ font: ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black', isArbitraryNumber]
1299
+ }],
1300
+ /**
1301
+ * Font Family
1302
+ * @see https://tailwindcss.com/docs/font-family
1303
+ */
1304
+ 'font-family': [{
1305
+ font: [isAny]
1306
+ }],
1307
+ /**
1308
+ * Font Variant Numeric
1309
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1310
+ */
1311
+ 'fvn-normal': ['normal-nums'],
1312
+ /**
1313
+ * Font Variant Numeric
1314
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1315
+ */
1316
+ 'fvn-ordinal': ['ordinal'],
1317
+ /**
1318
+ * Font Variant Numeric
1319
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1320
+ */
1321
+ 'fvn-slashed-zero': ['slashed-zero'],
1322
+ /**
1323
+ * Font Variant Numeric
1324
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1325
+ */
1326
+ 'fvn-figure': ['lining-nums', 'oldstyle-nums'],
1327
+ /**
1328
+ * Font Variant Numeric
1329
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1330
+ */
1331
+ 'fvn-spacing': ['proportional-nums', 'tabular-nums'],
1332
+ /**
1333
+ * Font Variant Numeric
1334
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1335
+ */
1336
+ 'fvn-fraction': ['diagonal-fractions', 'stacked-fractons'],
1337
+ /**
1338
+ * Letter Spacing
1339
+ * @see https://tailwindcss.com/docs/letter-spacing
1340
+ */
1341
+ tracking: [{
1342
+ tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest', isArbitraryValue]
1343
+ }],
1344
+ /**
1345
+ * Line Clamp
1346
+ * @see https://tailwindcss.com/docs/line-clamp
1347
+ */
1348
+ 'line-clamp': [{
1349
+ 'line-clamp': ['none', isNumber, isArbitraryNumber]
1350
+ }],
1351
+ /**
1352
+ * Line Height
1353
+ * @see https://tailwindcss.com/docs/line-height
1354
+ */
1355
+ leading: [{
1356
+ leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue]
1357
+ }],
1358
+ /**
1359
+ * List Style Image
1360
+ * @see https://tailwindcss.com/docs/list-style-image
1361
+ */
1362
+ 'list-image': [{
1363
+ 'list-image': ['none', isArbitraryValue]
1364
+ }],
1365
+ /**
1366
+ * List Style Type
1367
+ * @see https://tailwindcss.com/docs/list-style-type
1368
+ */
1369
+ 'list-style-type': [{
1370
+ list: ['none', 'disc', 'decimal', isArbitraryValue]
1371
+ }],
1372
+ /**
1373
+ * List Style Position
1374
+ * @see https://tailwindcss.com/docs/list-style-position
1375
+ */
1376
+ 'list-style-position': [{
1377
+ list: ['inside', 'outside']
1378
+ }],
1379
+ /**
1380
+ * Placeholder Color
1381
+ * @deprecated since Tailwind CSS v3.0.0
1382
+ * @see https://tailwindcss.com/docs/placeholder-color
1383
+ */
1384
+ 'placeholder-color': [{
1385
+ placeholder: [colors]
1386
+ }],
1387
+ /**
1388
+ * Placeholder Opacity
1389
+ * @see https://tailwindcss.com/docs/placeholder-opacity
1390
+ */
1391
+ 'placeholder-opacity': [{
1392
+ 'placeholder-opacity': [opacity]
1393
+ }],
1394
+ /**
1395
+ * Text Alignment
1396
+ * @see https://tailwindcss.com/docs/text-align
1397
+ */
1398
+ 'text-alignment': [{
1399
+ text: ['left', 'center', 'right', 'justify', 'start', 'end']
1400
+ }],
1401
+ /**
1402
+ * Text Color
1403
+ * @see https://tailwindcss.com/docs/text-color
1404
+ */
1405
+ 'text-color': [{
1406
+ text: [colors]
1407
+ }],
1408
+ /**
1409
+ * Text Opacity
1410
+ * @see https://tailwindcss.com/docs/text-opacity
1411
+ */
1412
+ 'text-opacity': [{
1413
+ 'text-opacity': [opacity]
1414
+ }],
1415
+ /**
1416
+ * Text Decoration
1417
+ * @see https://tailwindcss.com/docs/text-decoration
1418
+ */
1419
+ 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],
1420
+ /**
1421
+ * Text Decoration Style
1422
+ * @see https://tailwindcss.com/docs/text-decoration-style
1423
+ */
1424
+ 'text-decoration-style': [{
1425
+ decoration: [...getLineStyles(), 'wavy']
1426
+ }],
1427
+ /**
1428
+ * Text Decoration Thickness
1429
+ * @see https://tailwindcss.com/docs/text-decoration-thickness
1430
+ */
1431
+ 'text-decoration-thickness': [{
1432
+ decoration: ['auto', 'from-font', isLength, isArbitraryLength]
1433
+ }],
1434
+ /**
1435
+ * Text Underline Offset
1436
+ * @see https://tailwindcss.com/docs/text-underline-offset
1437
+ */
1438
+ 'underline-offset': [{
1439
+ 'underline-offset': ['auto', isLength, isArbitraryValue]
1440
+ }],
1441
+ /**
1442
+ * Text Decoration Color
1443
+ * @see https://tailwindcss.com/docs/text-decoration-color
1444
+ */
1445
+ 'text-decoration-color': [{
1446
+ decoration: [colors]
1447
+ }],
1448
+ /**
1449
+ * Text Transform
1450
+ * @see https://tailwindcss.com/docs/text-transform
1451
+ */
1452
+ 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],
1453
+ /**
1454
+ * Text Overflow
1455
+ * @see https://tailwindcss.com/docs/text-overflow
1456
+ */
1457
+ 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],
1458
+ /**
1459
+ * Text Indent
1460
+ * @see https://tailwindcss.com/docs/text-indent
1461
+ */
1462
+ indent: [{
1463
+ indent: getSpacingWithArbitrary()
1464
+ }],
1465
+ /**
1466
+ * Vertical Alignment
1467
+ * @see https://tailwindcss.com/docs/vertical-align
1468
+ */
1469
+ 'vertical-align': [{
1470
+ align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryValue]
1471
+ }],
1472
+ /**
1473
+ * Whitespace
1474
+ * @see https://tailwindcss.com/docs/whitespace
1475
+ */
1476
+ whitespace: [{
1477
+ whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']
1478
+ }],
1479
+ /**
1480
+ * Word Break
1481
+ * @see https://tailwindcss.com/docs/word-break
1482
+ */
1483
+ break: [{
1484
+ break: ['normal', 'words', 'all', 'keep']
1485
+ }],
1486
+ /**
1487
+ * Hyphens
1488
+ * @see https://tailwindcss.com/docs/hyphens
1489
+ */
1490
+ hyphens: [{
1491
+ hyphens: ['none', 'manual', 'auto']
1492
+ }],
1493
+ /**
1494
+ * Content
1495
+ * @see https://tailwindcss.com/docs/content
1496
+ */
1497
+ content: [{
1498
+ content: ['none', isArbitraryValue]
1499
+ }],
1500
+ // Backgrounds
1501
+ /**
1502
+ * Background Attachment
1503
+ * @see https://tailwindcss.com/docs/background-attachment
1504
+ */
1505
+ 'bg-attachment': [{
1506
+ bg: ['fixed', 'local', 'scroll']
1507
+ }],
1508
+ /**
1509
+ * Background Clip
1510
+ * @see https://tailwindcss.com/docs/background-clip
1511
+ */
1512
+ 'bg-clip': [{
1513
+ 'bg-clip': ['border', 'padding', 'content', 'text']
1514
+ }],
1515
+ /**
1516
+ * Background Opacity
1517
+ * @deprecated since Tailwind CSS v3.0.0
1518
+ * @see https://tailwindcss.com/docs/background-opacity
1519
+ */
1520
+ 'bg-opacity': [{
1521
+ 'bg-opacity': [opacity]
1522
+ }],
1523
+ /**
1524
+ * Background Origin
1525
+ * @see https://tailwindcss.com/docs/background-origin
1526
+ */
1527
+ 'bg-origin': [{
1528
+ 'bg-origin': ['border', 'padding', 'content']
1529
+ }],
1530
+ /**
1531
+ * Background Position
1532
+ * @see https://tailwindcss.com/docs/background-position
1533
+ */
1534
+ 'bg-position': [{
1535
+ bg: [...getPositions(), isArbitraryPosition]
1536
+ }],
1537
+ /**
1538
+ * Background Repeat
1539
+ * @see https://tailwindcss.com/docs/background-repeat
1540
+ */
1541
+ 'bg-repeat': [{
1542
+ bg: ['no-repeat', {
1543
+ repeat: ['', 'x', 'y', 'round', 'space']
1544
+ }]
1545
+ }],
1546
+ /**
1547
+ * Background Size
1548
+ * @see https://tailwindcss.com/docs/background-size
1549
+ */
1550
+ 'bg-size': [{
1551
+ bg: ['auto', 'cover', 'contain', isArbitrarySize]
1552
+ }],
1553
+ /**
1554
+ * Background Image
1555
+ * @see https://tailwindcss.com/docs/background-image
1556
+ */
1557
+ 'bg-image': [{
1558
+ bg: ['none', {
1559
+ 'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
1560
+ }, isArbitraryImage]
1561
+ }],
1562
+ /**
1563
+ * Background Color
1564
+ * @see https://tailwindcss.com/docs/background-color
1565
+ */
1566
+ 'bg-color': [{
1567
+ bg: [colors]
1568
+ }],
1569
+ /**
1570
+ * Gradient Color Stops From Position
1571
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1572
+ */
1573
+ 'gradient-from-pos': [{
1574
+ from: [gradientColorStopPositions]
1575
+ }],
1576
+ /**
1577
+ * Gradient Color Stops Via Position
1578
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1579
+ */
1580
+ 'gradient-via-pos': [{
1581
+ via: [gradientColorStopPositions]
1582
+ }],
1583
+ /**
1584
+ * Gradient Color Stops To Position
1585
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1586
+ */
1587
+ 'gradient-to-pos': [{
1588
+ to: [gradientColorStopPositions]
1589
+ }],
1590
+ /**
1591
+ * Gradient Color Stops From
1592
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1593
+ */
1594
+ 'gradient-from': [{
1595
+ from: [gradientColorStops]
1596
+ }],
1597
+ /**
1598
+ * Gradient Color Stops Via
1599
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1600
+ */
1601
+ 'gradient-via': [{
1602
+ via: [gradientColorStops]
1603
+ }],
1604
+ /**
1605
+ * Gradient Color Stops To
1606
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1607
+ */
1608
+ 'gradient-to': [{
1609
+ to: [gradientColorStops]
1610
+ }],
1611
+ // Borders
1612
+ /**
1613
+ * Border Radius
1614
+ * @see https://tailwindcss.com/docs/border-radius
1615
+ */
1616
+ rounded: [{
1617
+ rounded: [borderRadius]
1618
+ }],
1619
+ /**
1620
+ * Border Radius Start
1621
+ * @see https://tailwindcss.com/docs/border-radius
1622
+ */
1623
+ 'rounded-s': [{
1624
+ 'rounded-s': [borderRadius]
1625
+ }],
1626
+ /**
1627
+ * Border Radius End
1628
+ * @see https://tailwindcss.com/docs/border-radius
1629
+ */
1630
+ 'rounded-e': [{
1631
+ 'rounded-e': [borderRadius]
1632
+ }],
1633
+ /**
1634
+ * Border Radius Top
1635
+ * @see https://tailwindcss.com/docs/border-radius
1636
+ */
1637
+ 'rounded-t': [{
1638
+ 'rounded-t': [borderRadius]
1639
+ }],
1640
+ /**
1641
+ * Border Radius Right
1642
+ * @see https://tailwindcss.com/docs/border-radius
1643
+ */
1644
+ 'rounded-r': [{
1645
+ 'rounded-r': [borderRadius]
1646
+ }],
1647
+ /**
1648
+ * Border Radius Bottom
1649
+ * @see https://tailwindcss.com/docs/border-radius
1650
+ */
1651
+ 'rounded-b': [{
1652
+ 'rounded-b': [borderRadius]
1653
+ }],
1654
+ /**
1655
+ * Border Radius Left
1656
+ * @see https://tailwindcss.com/docs/border-radius
1657
+ */
1658
+ 'rounded-l': [{
1659
+ 'rounded-l': [borderRadius]
1660
+ }],
1661
+ /**
1662
+ * Border Radius Start Start
1663
+ * @see https://tailwindcss.com/docs/border-radius
1664
+ */
1665
+ 'rounded-ss': [{
1666
+ 'rounded-ss': [borderRadius]
1667
+ }],
1668
+ /**
1669
+ * Border Radius Start End
1670
+ * @see https://tailwindcss.com/docs/border-radius
1671
+ */
1672
+ 'rounded-se': [{
1673
+ 'rounded-se': [borderRadius]
1674
+ }],
1675
+ /**
1676
+ * Border Radius End End
1677
+ * @see https://tailwindcss.com/docs/border-radius
1678
+ */
1679
+ 'rounded-ee': [{
1680
+ 'rounded-ee': [borderRadius]
1681
+ }],
1682
+ /**
1683
+ * Border Radius End Start
1684
+ * @see https://tailwindcss.com/docs/border-radius
1685
+ */
1686
+ 'rounded-es': [{
1687
+ 'rounded-es': [borderRadius]
1688
+ }],
1689
+ /**
1690
+ * Border Radius Top Left
1691
+ * @see https://tailwindcss.com/docs/border-radius
1692
+ */
1693
+ 'rounded-tl': [{
1694
+ 'rounded-tl': [borderRadius]
1695
+ }],
1696
+ /**
1697
+ * Border Radius Top Right
1698
+ * @see https://tailwindcss.com/docs/border-radius
1699
+ */
1700
+ 'rounded-tr': [{
1701
+ 'rounded-tr': [borderRadius]
1702
+ }],
1703
+ /**
1704
+ * Border Radius Bottom Right
1705
+ * @see https://tailwindcss.com/docs/border-radius
1706
+ */
1707
+ 'rounded-br': [{
1708
+ 'rounded-br': [borderRadius]
1709
+ }],
1710
+ /**
1711
+ * Border Radius Bottom Left
1712
+ * @see https://tailwindcss.com/docs/border-radius
1713
+ */
1714
+ 'rounded-bl': [{
1715
+ 'rounded-bl': [borderRadius]
1716
+ }],
1717
+ /**
1718
+ * Border Width
1719
+ * @see https://tailwindcss.com/docs/border-width
1720
+ */
1721
+ 'border-w': [{
1722
+ border: [borderWidth]
1723
+ }],
1724
+ /**
1725
+ * Border Width X
1726
+ * @see https://tailwindcss.com/docs/border-width
1727
+ */
1728
+ 'border-w-x': [{
1729
+ 'border-x': [borderWidth]
1730
+ }],
1731
+ /**
1732
+ * Border Width Y
1733
+ * @see https://tailwindcss.com/docs/border-width
1734
+ */
1735
+ 'border-w-y': [{
1736
+ 'border-y': [borderWidth]
1737
+ }],
1738
+ /**
1739
+ * Border Width Start
1740
+ * @see https://tailwindcss.com/docs/border-width
1741
+ */
1742
+ 'border-w-s': [{
1743
+ 'border-s': [borderWidth]
1744
+ }],
1745
+ /**
1746
+ * Border Width End
1747
+ * @see https://tailwindcss.com/docs/border-width
1748
+ */
1749
+ 'border-w-e': [{
1750
+ 'border-e': [borderWidth]
1751
+ }],
1752
+ /**
1753
+ * Border Width Top
1754
+ * @see https://tailwindcss.com/docs/border-width
1755
+ */
1756
+ 'border-w-t': [{
1757
+ 'border-t': [borderWidth]
1758
+ }],
1759
+ /**
1760
+ * Border Width Right
1761
+ * @see https://tailwindcss.com/docs/border-width
1762
+ */
1763
+ 'border-w-r': [{
1764
+ 'border-r': [borderWidth]
1765
+ }],
1766
+ /**
1767
+ * Border Width Bottom
1768
+ * @see https://tailwindcss.com/docs/border-width
1769
+ */
1770
+ 'border-w-b': [{
1771
+ 'border-b': [borderWidth]
1772
+ }],
1773
+ /**
1774
+ * Border Width Left
1775
+ * @see https://tailwindcss.com/docs/border-width
1776
+ */
1777
+ 'border-w-l': [{
1778
+ 'border-l': [borderWidth]
1779
+ }],
1780
+ /**
1781
+ * Border Opacity
1782
+ * @see https://tailwindcss.com/docs/border-opacity
1783
+ */
1784
+ 'border-opacity': [{
1785
+ 'border-opacity': [opacity]
1786
+ }],
1787
+ /**
1788
+ * Border Style
1789
+ * @see https://tailwindcss.com/docs/border-style
1790
+ */
1791
+ 'border-style': [{
1792
+ border: [...getLineStyles(), 'hidden']
1793
+ }],
1794
+ /**
1795
+ * Divide Width X
1796
+ * @see https://tailwindcss.com/docs/divide-width
1797
+ */
1798
+ 'divide-x': [{
1799
+ 'divide-x': [borderWidth]
1800
+ }],
1801
+ /**
1802
+ * Divide Width X Reverse
1803
+ * @see https://tailwindcss.com/docs/divide-width
1804
+ */
1805
+ 'divide-x-reverse': ['divide-x-reverse'],
1806
+ /**
1807
+ * Divide Width Y
1808
+ * @see https://tailwindcss.com/docs/divide-width
1809
+ */
1810
+ 'divide-y': [{
1811
+ 'divide-y': [borderWidth]
1812
+ }],
1813
+ /**
1814
+ * Divide Width Y Reverse
1815
+ * @see https://tailwindcss.com/docs/divide-width
1816
+ */
1817
+ 'divide-y-reverse': ['divide-y-reverse'],
1818
+ /**
1819
+ * Divide Opacity
1820
+ * @see https://tailwindcss.com/docs/divide-opacity
1821
+ */
1822
+ 'divide-opacity': [{
1823
+ 'divide-opacity': [opacity]
1824
+ }],
1825
+ /**
1826
+ * Divide Style
1827
+ * @see https://tailwindcss.com/docs/divide-style
1828
+ */
1829
+ 'divide-style': [{
1830
+ divide: getLineStyles()
1831
+ }],
1832
+ /**
1833
+ * Border Color
1834
+ * @see https://tailwindcss.com/docs/border-color
1835
+ */
1836
+ 'border-color': [{
1837
+ border: [borderColor]
1838
+ }],
1839
+ /**
1840
+ * Border Color X
1841
+ * @see https://tailwindcss.com/docs/border-color
1842
+ */
1843
+ 'border-color-x': [{
1844
+ 'border-x': [borderColor]
1845
+ }],
1846
+ /**
1847
+ * Border Color Y
1848
+ * @see https://tailwindcss.com/docs/border-color
1849
+ */
1850
+ 'border-color-y': [{
1851
+ 'border-y': [borderColor]
1852
+ }],
1853
+ /**
1854
+ * Border Color Top
1855
+ * @see https://tailwindcss.com/docs/border-color
1856
+ */
1857
+ 'border-color-t': [{
1858
+ 'border-t': [borderColor]
1859
+ }],
1860
+ /**
1861
+ * Border Color Right
1862
+ * @see https://tailwindcss.com/docs/border-color
1863
+ */
1864
+ 'border-color-r': [{
1865
+ 'border-r': [borderColor]
1866
+ }],
1867
+ /**
1868
+ * Border Color Bottom
1869
+ * @see https://tailwindcss.com/docs/border-color
1870
+ */
1871
+ 'border-color-b': [{
1872
+ 'border-b': [borderColor]
1873
+ }],
1874
+ /**
1875
+ * Border Color Left
1876
+ * @see https://tailwindcss.com/docs/border-color
1877
+ */
1878
+ 'border-color-l': [{
1879
+ 'border-l': [borderColor]
1880
+ }],
1881
+ /**
1882
+ * Divide Color
1883
+ * @see https://tailwindcss.com/docs/divide-color
1884
+ */
1885
+ 'divide-color': [{
1886
+ divide: [borderColor]
1887
+ }],
1888
+ /**
1889
+ * Outline Style
1890
+ * @see https://tailwindcss.com/docs/outline-style
1891
+ */
1892
+ 'outline-style': [{
1893
+ outline: ['', ...getLineStyles()]
1894
+ }],
1895
+ /**
1896
+ * Outline Offset
1897
+ * @see https://tailwindcss.com/docs/outline-offset
1898
+ */
1899
+ 'outline-offset': [{
1900
+ 'outline-offset': [isLength, isArbitraryValue]
1901
+ }],
1902
+ /**
1903
+ * Outline Width
1904
+ * @see https://tailwindcss.com/docs/outline-width
1905
+ */
1906
+ 'outline-w': [{
1907
+ outline: [isLength, isArbitraryLength]
1908
+ }],
1909
+ /**
1910
+ * Outline Color
1911
+ * @see https://tailwindcss.com/docs/outline-color
1912
+ */
1913
+ 'outline-color': [{
1914
+ outline: [colors]
1915
+ }],
1916
+ /**
1917
+ * Ring Width
1918
+ * @see https://tailwindcss.com/docs/ring-width
1919
+ */
1920
+ 'ring-w': [{
1921
+ ring: getLengthWithEmptyAndArbitrary()
1922
+ }],
1923
+ /**
1924
+ * Ring Width Inset
1925
+ * @see https://tailwindcss.com/docs/ring-width
1926
+ */
1927
+ 'ring-w-inset': ['ring-inset'],
1928
+ /**
1929
+ * Ring Color
1930
+ * @see https://tailwindcss.com/docs/ring-color
1931
+ */
1932
+ 'ring-color': [{
1933
+ ring: [colors]
1934
+ }],
1935
+ /**
1936
+ * Ring Opacity
1937
+ * @see https://tailwindcss.com/docs/ring-opacity
1938
+ */
1939
+ 'ring-opacity': [{
1940
+ 'ring-opacity': [opacity]
1941
+ }],
1942
+ /**
1943
+ * Ring Offset Width
1944
+ * @see https://tailwindcss.com/docs/ring-offset-width
1945
+ */
1946
+ 'ring-offset-w': [{
1947
+ 'ring-offset': [isLength, isArbitraryLength]
1948
+ }],
1949
+ /**
1950
+ * Ring Offset Color
1951
+ * @see https://tailwindcss.com/docs/ring-offset-color
1952
+ */
1953
+ 'ring-offset-color': [{
1954
+ 'ring-offset': [colors]
1955
+ }],
1956
+ // Effects
1957
+ /**
1958
+ * Box Shadow
1959
+ * @see https://tailwindcss.com/docs/box-shadow
1960
+ */
1961
+ shadow: [{
1962
+ shadow: ['', 'inner', 'none', isTshirtSize, isArbitraryShadow]
1963
+ }],
1964
+ /**
1965
+ * Box Shadow Color
1966
+ * @see https://tailwindcss.com/docs/box-shadow-color
1967
+ */
1968
+ 'shadow-color': [{
1969
+ shadow: [isAny]
1970
+ }],
1971
+ /**
1972
+ * Opacity
1973
+ * @see https://tailwindcss.com/docs/opacity
1974
+ */
1975
+ opacity: [{
1976
+ opacity: [opacity]
1977
+ }],
1978
+ /**
1979
+ * Mix Blend Mode
1980
+ * @see https://tailwindcss.com/docs/mix-blend-mode
1981
+ */
1982
+ 'mix-blend': [{
1983
+ 'mix-blend': getBlendModes()
1984
+ }],
1985
+ /**
1986
+ * Background Blend Mode
1987
+ * @see https://tailwindcss.com/docs/background-blend-mode
1988
+ */
1989
+ 'bg-blend': [{
1990
+ 'bg-blend': getBlendModes()
1991
+ }],
1992
+ // Filters
1993
+ /**
1994
+ * Filter
1995
+ * @deprecated since Tailwind CSS v3.0.0
1996
+ * @see https://tailwindcss.com/docs/filter
1997
+ */
1998
+ filter: [{
1999
+ filter: ['', 'none']
2000
+ }],
2001
+ /**
2002
+ * Blur
2003
+ * @see https://tailwindcss.com/docs/blur
2004
+ */
2005
+ blur: [{
2006
+ blur: [blur]
2007
+ }],
2008
+ /**
2009
+ * Brightness
2010
+ * @see https://tailwindcss.com/docs/brightness
2011
+ */
2012
+ brightness: [{
2013
+ brightness: [brightness]
2014
+ }],
2015
+ /**
2016
+ * Contrast
2017
+ * @see https://tailwindcss.com/docs/contrast
2018
+ */
2019
+ contrast: [{
2020
+ contrast: [contrast]
2021
+ }],
2022
+ /**
2023
+ * Drop Shadow
2024
+ * @see https://tailwindcss.com/docs/drop-shadow
2025
+ */
2026
+ 'drop-shadow': [{
2027
+ 'drop-shadow': ['', 'none', isTshirtSize, isArbitraryValue]
2028
+ }],
2029
+ /**
2030
+ * Grayscale
2031
+ * @see https://tailwindcss.com/docs/grayscale
2032
+ */
2033
+ grayscale: [{
2034
+ grayscale: [grayscale]
2035
+ }],
2036
+ /**
2037
+ * Hue Rotate
2038
+ * @see https://tailwindcss.com/docs/hue-rotate
2039
+ */
2040
+ 'hue-rotate': [{
2041
+ 'hue-rotate': [hueRotate]
2042
+ }],
2043
+ /**
2044
+ * Invert
2045
+ * @see https://tailwindcss.com/docs/invert
2046
+ */
2047
+ invert: [{
2048
+ invert: [invert]
2049
+ }],
2050
+ /**
2051
+ * Saturate
2052
+ * @see https://tailwindcss.com/docs/saturate
2053
+ */
2054
+ saturate: [{
2055
+ saturate: [saturate]
2056
+ }],
2057
+ /**
2058
+ * Sepia
2059
+ * @see https://tailwindcss.com/docs/sepia
2060
+ */
2061
+ sepia: [{
2062
+ sepia: [sepia]
2063
+ }],
2064
+ /**
2065
+ * Backdrop Filter
2066
+ * @deprecated since Tailwind CSS v3.0.0
2067
+ * @see https://tailwindcss.com/docs/backdrop-filter
2068
+ */
2069
+ 'backdrop-filter': [{
2070
+ 'backdrop-filter': ['', 'none']
2071
+ }],
2072
+ /**
2073
+ * Backdrop Blur
2074
+ * @see https://tailwindcss.com/docs/backdrop-blur
2075
+ */
2076
+ 'backdrop-blur': [{
2077
+ 'backdrop-blur': [blur]
2078
+ }],
2079
+ /**
2080
+ * Backdrop Brightness
2081
+ * @see https://tailwindcss.com/docs/backdrop-brightness
2082
+ */
2083
+ 'backdrop-brightness': [{
2084
+ 'backdrop-brightness': [brightness]
2085
+ }],
2086
+ /**
2087
+ * Backdrop Contrast
2088
+ * @see https://tailwindcss.com/docs/backdrop-contrast
2089
+ */
2090
+ 'backdrop-contrast': [{
2091
+ 'backdrop-contrast': [contrast]
2092
+ }],
2093
+ /**
2094
+ * Backdrop Grayscale
2095
+ * @see https://tailwindcss.com/docs/backdrop-grayscale
2096
+ */
2097
+ 'backdrop-grayscale': [{
2098
+ 'backdrop-grayscale': [grayscale]
2099
+ }],
2100
+ /**
2101
+ * Backdrop Hue Rotate
2102
+ * @see https://tailwindcss.com/docs/backdrop-hue-rotate
2103
+ */
2104
+ 'backdrop-hue-rotate': [{
2105
+ 'backdrop-hue-rotate': [hueRotate]
2106
+ }],
2107
+ /**
2108
+ * Backdrop Invert
2109
+ * @see https://tailwindcss.com/docs/backdrop-invert
2110
+ */
2111
+ 'backdrop-invert': [{
2112
+ 'backdrop-invert': [invert]
2113
+ }],
2114
+ /**
2115
+ * Backdrop Opacity
2116
+ * @see https://tailwindcss.com/docs/backdrop-opacity
2117
+ */
2118
+ 'backdrop-opacity': [{
2119
+ 'backdrop-opacity': [opacity]
2120
+ }],
2121
+ /**
2122
+ * Backdrop Saturate
2123
+ * @see https://tailwindcss.com/docs/backdrop-saturate
2124
+ */
2125
+ 'backdrop-saturate': [{
2126
+ 'backdrop-saturate': [saturate]
2127
+ }],
2128
+ /**
2129
+ * Backdrop Sepia
2130
+ * @see https://tailwindcss.com/docs/backdrop-sepia
2131
+ */
2132
+ 'backdrop-sepia': [{
2133
+ 'backdrop-sepia': [sepia]
2134
+ }],
2135
+ // Tables
2136
+ /**
2137
+ * Border Collapse
2138
+ * @see https://tailwindcss.com/docs/border-collapse
2139
+ */
2140
+ 'border-collapse': [{
2141
+ border: ['collapse', 'separate']
2142
+ }],
2143
+ /**
2144
+ * Border Spacing
2145
+ * @see https://tailwindcss.com/docs/border-spacing
2146
+ */
2147
+ 'border-spacing': [{
2148
+ 'border-spacing': [borderSpacing]
2149
+ }],
2150
+ /**
2151
+ * Border Spacing X
2152
+ * @see https://tailwindcss.com/docs/border-spacing
2153
+ */
2154
+ 'border-spacing-x': [{
2155
+ 'border-spacing-x': [borderSpacing]
2156
+ }],
2157
+ /**
2158
+ * Border Spacing Y
2159
+ * @see https://tailwindcss.com/docs/border-spacing
2160
+ */
2161
+ 'border-spacing-y': [{
2162
+ 'border-spacing-y': [borderSpacing]
2163
+ }],
2164
+ /**
2165
+ * Table Layout
2166
+ * @see https://tailwindcss.com/docs/table-layout
2167
+ */
2168
+ 'table-layout': [{
2169
+ table: ['auto', 'fixed']
2170
+ }],
2171
+ /**
2172
+ * Caption Side
2173
+ * @see https://tailwindcss.com/docs/caption-side
2174
+ */
2175
+ caption: [{
2176
+ caption: ['top', 'bottom']
2177
+ }],
2178
+ // Transitions and Animation
2179
+ /**
2180
+ * Tranisition Property
2181
+ * @see https://tailwindcss.com/docs/transition-property
2182
+ */
2183
+ transition: [{
2184
+ transition: ['none', 'all', '', 'colors', 'opacity', 'shadow', 'transform', isArbitraryValue]
2185
+ }],
2186
+ /**
2187
+ * Transition Duration
2188
+ * @see https://tailwindcss.com/docs/transition-duration
2189
+ */
2190
+ duration: [{
2191
+ duration: getNumberAndArbitrary()
2192
+ }],
2193
+ /**
2194
+ * Transition Timing Function
2195
+ * @see https://tailwindcss.com/docs/transition-timing-function
2196
+ */
2197
+ ease: [{
2198
+ ease: ['linear', 'in', 'out', 'in-out', isArbitraryValue]
2199
+ }],
2200
+ /**
2201
+ * Transition Delay
2202
+ * @see https://tailwindcss.com/docs/transition-delay
2203
+ */
2204
+ delay: [{
2205
+ delay: getNumberAndArbitrary()
2206
+ }],
2207
+ /**
2208
+ * Animation
2209
+ * @see https://tailwindcss.com/docs/animation
2210
+ */
2211
+ animate: [{
2212
+ animate: ['none', 'spin', 'ping', 'pulse', 'bounce', isArbitraryValue]
2213
+ }],
2214
+ // Transforms
2215
+ /**
2216
+ * Transform
2217
+ * @see https://tailwindcss.com/docs/transform
2218
+ */
2219
+ transform: [{
2220
+ transform: ['', 'gpu', 'none']
2221
+ }],
2222
+ /**
2223
+ * Scale
2224
+ * @see https://tailwindcss.com/docs/scale
2225
+ */
2226
+ scale: [{
2227
+ scale: [scale]
2228
+ }],
2229
+ /**
2230
+ * Scale X
2231
+ * @see https://tailwindcss.com/docs/scale
2232
+ */
2233
+ 'scale-x': [{
2234
+ 'scale-x': [scale]
2235
+ }],
2236
+ /**
2237
+ * Scale Y
2238
+ * @see https://tailwindcss.com/docs/scale
2239
+ */
2240
+ 'scale-y': [{
2241
+ 'scale-y': [scale]
2242
+ }],
2243
+ /**
2244
+ * Rotate
2245
+ * @see https://tailwindcss.com/docs/rotate
2246
+ */
2247
+ rotate: [{
2248
+ rotate: [isInteger, isArbitraryValue]
2249
+ }],
2250
+ /**
2251
+ * Translate X
2252
+ * @see https://tailwindcss.com/docs/translate
2253
+ */
2254
+ 'translate-x': [{
2255
+ 'translate-x': [translate]
2256
+ }],
2257
+ /**
2258
+ * Translate Y
2259
+ * @see https://tailwindcss.com/docs/translate
2260
+ */
2261
+ 'translate-y': [{
2262
+ 'translate-y': [translate]
2263
+ }],
2264
+ /**
2265
+ * Skew X
2266
+ * @see https://tailwindcss.com/docs/skew
2267
+ */
2268
+ 'skew-x': [{
2269
+ 'skew-x': [skew]
2270
+ }],
2271
+ /**
2272
+ * Skew Y
2273
+ * @see https://tailwindcss.com/docs/skew
2274
+ */
2275
+ 'skew-y': [{
2276
+ 'skew-y': [skew]
2277
+ }],
2278
+ /**
2279
+ * Transform Origin
2280
+ * @see https://tailwindcss.com/docs/transform-origin
2281
+ */
2282
+ 'transform-origin': [{
2283
+ origin: ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryValue]
2284
+ }],
2285
+ // Interactivity
2286
+ /**
2287
+ * Accent Color
2288
+ * @see https://tailwindcss.com/docs/accent-color
2289
+ */
2290
+ accent: [{
2291
+ accent: ['auto', colors]
2292
+ }],
2293
+ /**
2294
+ * Appearance
2295
+ * @see https://tailwindcss.com/docs/appearance
2296
+ */
2297
+ appearance: ['appearance-none'],
2298
+ /**
2299
+ * Cursor
2300
+ * @see https://tailwindcss.com/docs/cursor
2301
+ */
2302
+ cursor: [{
2303
+ cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryValue]
2304
+ }],
2305
+ /**
2306
+ * Caret Color
2307
+ * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
2308
+ */
2309
+ 'caret-color': [{
2310
+ caret: [colors]
2311
+ }],
2312
+ /**
2313
+ * Pointer Events
2314
+ * @see https://tailwindcss.com/docs/pointer-events
2315
+ */
2316
+ 'pointer-events': [{
2317
+ 'pointer-events': ['none', 'auto']
2318
+ }],
2319
+ /**
2320
+ * Resize
2321
+ * @see https://tailwindcss.com/docs/resize
2322
+ */
2323
+ resize: [{
2324
+ resize: ['none', 'y', 'x', '']
2325
+ }],
2326
+ /**
2327
+ * Scroll Behavior
2328
+ * @see https://tailwindcss.com/docs/scroll-behavior
2329
+ */
2330
+ 'scroll-behavior': [{
2331
+ scroll: ['auto', 'smooth']
2332
+ }],
2333
+ /**
2334
+ * Scroll Margin
2335
+ * @see https://tailwindcss.com/docs/scroll-margin
2336
+ */
2337
+ 'scroll-m': [{
2338
+ 'scroll-m': getSpacingWithArbitrary()
2339
+ }],
2340
+ /**
2341
+ * Scroll Margin X
2342
+ * @see https://tailwindcss.com/docs/scroll-margin
2343
+ */
2344
+ 'scroll-mx': [{
2345
+ 'scroll-mx': getSpacingWithArbitrary()
2346
+ }],
2347
+ /**
2348
+ * Scroll Margin Y
2349
+ * @see https://tailwindcss.com/docs/scroll-margin
2350
+ */
2351
+ 'scroll-my': [{
2352
+ 'scroll-my': getSpacingWithArbitrary()
2353
+ }],
2354
+ /**
2355
+ * Scroll Margin Start
2356
+ * @see https://tailwindcss.com/docs/scroll-margin
2357
+ */
2358
+ 'scroll-ms': [{
2359
+ 'scroll-ms': getSpacingWithArbitrary()
2360
+ }],
2361
+ /**
2362
+ * Scroll Margin End
2363
+ * @see https://tailwindcss.com/docs/scroll-margin
2364
+ */
2365
+ 'scroll-me': [{
2366
+ 'scroll-me': getSpacingWithArbitrary()
2367
+ }],
2368
+ /**
2369
+ * Scroll Margin Top
2370
+ * @see https://tailwindcss.com/docs/scroll-margin
2371
+ */
2372
+ 'scroll-mt': [{
2373
+ 'scroll-mt': getSpacingWithArbitrary()
2374
+ }],
2375
+ /**
2376
+ * Scroll Margin Right
2377
+ * @see https://tailwindcss.com/docs/scroll-margin
2378
+ */
2379
+ 'scroll-mr': [{
2380
+ 'scroll-mr': getSpacingWithArbitrary()
2381
+ }],
2382
+ /**
2383
+ * Scroll Margin Bottom
2384
+ * @see https://tailwindcss.com/docs/scroll-margin
2385
+ */
2386
+ 'scroll-mb': [{
2387
+ 'scroll-mb': getSpacingWithArbitrary()
2388
+ }],
2389
+ /**
2390
+ * Scroll Margin Left
2391
+ * @see https://tailwindcss.com/docs/scroll-margin
2392
+ */
2393
+ 'scroll-ml': [{
2394
+ 'scroll-ml': getSpacingWithArbitrary()
2395
+ }],
2396
+ /**
2397
+ * Scroll Padding
2398
+ * @see https://tailwindcss.com/docs/scroll-padding
2399
+ */
2400
+ 'scroll-p': [{
2401
+ 'scroll-p': getSpacingWithArbitrary()
2402
+ }],
2403
+ /**
2404
+ * Scroll Padding X
2405
+ * @see https://tailwindcss.com/docs/scroll-padding
2406
+ */
2407
+ 'scroll-px': [{
2408
+ 'scroll-px': getSpacingWithArbitrary()
2409
+ }],
2410
+ /**
2411
+ * Scroll Padding Y
2412
+ * @see https://tailwindcss.com/docs/scroll-padding
2413
+ */
2414
+ 'scroll-py': [{
2415
+ 'scroll-py': getSpacingWithArbitrary()
2416
+ }],
2417
+ /**
2418
+ * Scroll Padding Start
2419
+ * @see https://tailwindcss.com/docs/scroll-padding
2420
+ */
2421
+ 'scroll-ps': [{
2422
+ 'scroll-ps': getSpacingWithArbitrary()
2423
+ }],
2424
+ /**
2425
+ * Scroll Padding End
2426
+ * @see https://tailwindcss.com/docs/scroll-padding
2427
+ */
2428
+ 'scroll-pe': [{
2429
+ 'scroll-pe': getSpacingWithArbitrary()
2430
+ }],
2431
+ /**
2432
+ * Scroll Padding Top
2433
+ * @see https://tailwindcss.com/docs/scroll-padding
2434
+ */
2435
+ 'scroll-pt': [{
2436
+ 'scroll-pt': getSpacingWithArbitrary()
2437
+ }],
2438
+ /**
2439
+ * Scroll Padding Right
2440
+ * @see https://tailwindcss.com/docs/scroll-padding
2441
+ */
2442
+ 'scroll-pr': [{
2443
+ 'scroll-pr': getSpacingWithArbitrary()
2444
+ }],
2445
+ /**
2446
+ * Scroll Padding Bottom
2447
+ * @see https://tailwindcss.com/docs/scroll-padding
2448
+ */
2449
+ 'scroll-pb': [{
2450
+ 'scroll-pb': getSpacingWithArbitrary()
2451
+ }],
2452
+ /**
2453
+ * Scroll Padding Left
2454
+ * @see https://tailwindcss.com/docs/scroll-padding
2455
+ */
2456
+ 'scroll-pl': [{
2457
+ 'scroll-pl': getSpacingWithArbitrary()
2458
+ }],
2459
+ /**
2460
+ * Scroll Snap Align
2461
+ * @see https://tailwindcss.com/docs/scroll-snap-align
2462
+ */
2463
+ 'snap-align': [{
2464
+ snap: ['start', 'end', 'center', 'align-none']
2465
+ }],
2466
+ /**
2467
+ * Scroll Snap Stop
2468
+ * @see https://tailwindcss.com/docs/scroll-snap-stop
2469
+ */
2470
+ 'snap-stop': [{
2471
+ snap: ['normal', 'always']
2472
+ }],
2473
+ /**
2474
+ * Scroll Snap Type
2475
+ * @see https://tailwindcss.com/docs/scroll-snap-type
2476
+ */
2477
+ 'snap-type': [{
2478
+ snap: ['none', 'x', 'y', 'both']
2479
+ }],
2480
+ /**
2481
+ * Scroll Snap Type Strictness
2482
+ * @see https://tailwindcss.com/docs/scroll-snap-type
2483
+ */
2484
+ 'snap-strictness': [{
2485
+ snap: ['mandatory', 'proximity']
2486
+ }],
2487
+ /**
2488
+ * Touch Action
2489
+ * @see https://tailwindcss.com/docs/touch-action
2490
+ */
2491
+ touch: [{
2492
+ touch: ['auto', 'none', 'manipulation']
2493
+ }],
2494
+ /**
2495
+ * Touch Action X
2496
+ * @see https://tailwindcss.com/docs/touch-action
2497
+ */
2498
+ 'touch-x': [{
2499
+ 'touch-pan': ['x', 'left', 'right']
2500
+ }],
2501
+ /**
2502
+ * Touch Action Y
2503
+ * @see https://tailwindcss.com/docs/touch-action
2504
+ */
2505
+ 'touch-y': [{
2506
+ 'touch-pan': ['y', 'up', 'down']
2507
+ }],
2508
+ /**
2509
+ * Touch Action Pinch Zoom
2510
+ * @see https://tailwindcss.com/docs/touch-action
2511
+ */
2512
+ 'touch-pz': ['touch-pinch-zoom'],
2513
+ /**
2514
+ * User Select
2515
+ * @see https://tailwindcss.com/docs/user-select
2516
+ */
2517
+ select: [{
2518
+ select: ['none', 'text', 'all', 'auto']
2519
+ }],
2520
+ /**
2521
+ * Will Change
2522
+ * @see https://tailwindcss.com/docs/will-change
2523
+ */
2524
+ 'will-change': [{
2525
+ 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryValue]
2526
+ }],
2527
+ // SVG
2528
+ /**
2529
+ * Fill
2530
+ * @see https://tailwindcss.com/docs/fill
2531
+ */
2532
+ fill: [{
2533
+ fill: [colors, 'none']
2534
+ }],
2535
+ /**
2536
+ * Stroke Width
2537
+ * @see https://tailwindcss.com/docs/stroke-width
2538
+ */
2539
+ 'stroke-w': [{
2540
+ stroke: [isLength, isArbitraryLength, isArbitraryNumber]
2541
+ }],
2542
+ /**
2543
+ * Stroke
2544
+ * @see https://tailwindcss.com/docs/stroke
2545
+ */
2546
+ stroke: [{
2547
+ stroke: [colors, 'none']
2548
+ }],
2549
+ // Accessibility
2550
+ /**
2551
+ * Screen Readers
2552
+ * @see https://tailwindcss.com/docs/screen-readers
2553
+ */
2554
+ sr: ['sr-only', 'not-sr-only']
2555
+ },
2556
+ conflictingClassGroups: {
2557
+ overflow: ['overflow-x', 'overflow-y'],
2558
+ overscroll: ['overscroll-x', 'overscroll-y'],
2559
+ inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],
2560
+ 'inset-x': ['right', 'left'],
2561
+ 'inset-y': ['top', 'bottom'],
2562
+ flex: ['basis', 'grow', 'shrink'],
2563
+ gap: ['gap-x', 'gap-y'],
2564
+ p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],
2565
+ px: ['pr', 'pl'],
2566
+ py: ['pt', 'pb'],
2567
+ m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
2568
+ mx: ['mr', 'ml'],
2569
+ my: ['mt', 'mb'],
2570
+ 'font-size': ['leading'],
2571
+ 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
2572
+ 'fvn-ordinal': ['fvn-normal'],
2573
+ 'fvn-slashed-zero': ['fvn-normal'],
2574
+ 'fvn-figure': ['fvn-normal'],
2575
+ 'fvn-spacing': ['fvn-normal'],
2576
+ 'fvn-fraction': ['fvn-normal'],
2577
+ 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'],
2578
+ 'rounded-s': ['rounded-ss', 'rounded-es'],
2579
+ 'rounded-e': ['rounded-se', 'rounded-ee'],
2580
+ 'rounded-t': ['rounded-tl', 'rounded-tr'],
2581
+ 'rounded-r': ['rounded-tr', 'rounded-br'],
2582
+ 'rounded-b': ['rounded-br', 'rounded-bl'],
2583
+ 'rounded-l': ['rounded-tl', 'rounded-bl'],
2584
+ 'border-spacing': ['border-spacing-x', 'border-spacing-y'],
2585
+ 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
2586
+ 'border-w-x': ['border-w-r', 'border-w-l'],
2587
+ 'border-w-y': ['border-w-t', 'border-w-b'],
2588
+ 'border-color': ['border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
2589
+ 'border-color-x': ['border-color-r', 'border-color-l'],
2590
+ 'border-color-y': ['border-color-t', 'border-color-b'],
2591
+ 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
2592
+ 'scroll-mx': ['scroll-mr', 'scroll-ml'],
2593
+ 'scroll-my': ['scroll-mt', 'scroll-mb'],
2594
+ 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
2595
+ 'scroll-px': ['scroll-pr', 'scroll-pl'],
2596
+ 'scroll-py': ['scroll-pt', 'scroll-pb'],
2597
+ touch: ['touch-x', 'touch-y', 'touch-pz'],
2598
+ 'touch-x': ['touch'],
2599
+ 'touch-y': ['touch'],
2600
+ 'touch-pz': ['touch']
2601
+ },
2602
+ conflictingClassGroupModifiers: {
2603
+ 'font-size': ['leading']
2604
+ }
2605
+ };
2606
+ }
2607
+ const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
2608
+
2609
+ const localeLookup = {
2610
+ en: locale.enGB,
2611
+ "en-US": locale.enUS,
2612
+ "en-GB": locale.enGB,
2613
+ da: locale.da,
2614
+ de: locale.de,
2615
+ cs: locale.cs,
2616
+ nl: locale.nl,
2617
+ fr: locale.fr,
2618
+ fi: locale.fi,
2619
+ hu: locale.hu,
2620
+ it: locale.it,
2621
+ nb: locale.nb,
2622
+ pl: locale.pl,
2623
+ pt: locale.pt,
2624
+ ru: locale.ru,
2625
+ ro: locale.ro,
2626
+ es: locale.es,
2627
+ sv: locale.sv,
2628
+ ja: locale.ja,
2629
+ th: locale.th,
2630
+ };
2631
+ /**
2632
+ * A helper function to get the matching Locale object for a given language.
2633
+ *
2634
+ * @param {string} language The language to match
2635
+ * @returns {Locale} The corresponding Locale object
2636
+ */
2637
+ const useLocale = (language) => {
2638
+ return localeLookup[language] || localeLookup.en || locale.enGB;
2639
+ };
2640
+
2641
+ /**
2642
+ * The DayPicker component is used when the user needs to select a date.
2643
+
2644
+ * @param {DayPickerProps} props - The props for the DayPicker component
2645
+ * @returns {JSX.Element} DayPicker component
2646
+ */
2647
+ const DayPicker = ({ onDaySelect, disabledDays, selectedDays, language, className, dataTestId, max, }) => {
2648
+ const locale = useLocale(language);
2649
+ return (jsxRuntime.jsx(reactDayPicker.DayPicker, { className: twMerge("custom-day-picker", className), disabled: disabledDays, footer: jsxRuntime.jsx("div", { "data-testid": dataTestId }), locale: locale, max: max, onDayClick: onDaySelect, selected: selectedDays }));
2650
+ };
2651
+
2652
+ /**
2653
+ * The DayRangePicker component should be used when the user needs to select a range of dates.
2654
+ *
2655
+ * @param {DayRangePickerProps} props - The props for the DayRangePicker component
2656
+ * @returns {JSX.Element} DayRangePicker component
2657
+ */
2658
+ const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, dataTestId, language, className, max, showQuickOptions, timezone, onClose, }) => {
2659
+ const [newRange, setNewRange] = react.useState(selectedDays !== null && selectedDays !== void 0 ? selectedDays : { from: undefined, to: undefined });
2660
+ const [t] = useTranslation();
2661
+ const locale = useLocale(language);
2662
+ react.useEffect(() => {
2663
+ if (selectedDays) {
2664
+ setNewRange(selectedDays);
2665
+ }
2666
+ }, [selectedDays]);
2667
+ const handleOnRangeSelect = react.useCallback((range) => {
2668
+ // store the range
2669
+ if (range) {
2670
+ if (range.to === undefined) {
2671
+ setNewRange({ from: range.from, to: range.from });
2672
+ }
2673
+ else {
2674
+ setNewRange({ from: range.from, to: range.to });
2675
+ }
2676
+ }
2677
+ else {
2678
+ setNewRange({ from: undefined, to: undefined });
2679
+ }
2680
+ }, []);
2681
+ const handleCancel = react.useCallback(() => {
2682
+ if (selectedDays) {
2683
+ setNewRange(selectedDays);
2684
+ }
2685
+ onClose && onClose();
2686
+ }, [selectedDays, onClose]);
2687
+ const clearSelectedDays = () => {
2688
+ setNewRange({ from: undefined, to: undefined });
2689
+ };
2690
+ const handleApply = react.useCallback(() => {
2691
+ onRangeSelect && onRangeSelect(newRange);
2692
+ onClose && onClose();
2693
+ }, [onRangeSelect, newRange, onClose]);
2694
+ return (jsxRuntime.jsxs("div", { className: "z-20 flex w-min flex-col gap-4", children: [jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: !!showQuickOptions &&
2695
+ calcQuickOptions(showQuickOptions.dataRetention).map(option => (jsxRuntime.jsx(QuickOptionButton, { onClick: handleOnRangeSelect, option: option, timezone: timezone }, `${option.unit}${option.last}${option.includeExtraDay ? "-include-extra-day" : ""}`))) }), !!onClose && (jsxRuntime.jsx("div", { className: "flex-grow text-right", children: jsxRuntime.jsx(reactComponents.IconButton, { dataTestId: "close-button", icon: jsxRuntime.jsx(reactComponents.Icon, { name: "XMark", size: "small" }), onClick: () => handleApply(), variant: "ghost-neutral" }) }))] }), jsxRuntime.jsx(reactDayPicker.DayPicker, { className: twMerge("custom-day-picker", "range-picker", className), defaultMonth: selectedDays ? selectedDays.from : undefined, disabled: disabledDays, footer: jsxRuntime.jsx("div", { "data-testid": dataTestId }), locale: locale, max: max, mode: "range", onSelect: handleOnRangeSelect, selected: newRange }), jsxRuntime.jsxs("div", { className: "flex w-full gap-2", children: [jsxRuntime.jsx(reactComponents.Button, { className: "mr-auto", dataTestId: "range-popover-clear-button", onClick: clearSelectedDays, variant: "secondary", children: t("layout.actions.clear") }), jsxRuntime.jsx(reactComponents.Button, { dataTestId: "range-popover-cancel-button", onClick: () => handleCancel(), variant: "secondary", children: t("layout.actions.cancel") }), jsxRuntime.jsx(reactComponents.Button, { dataTestId: "range-popover-apply-button", disabled: !newRange.from || !newRange.to, onClick: () => handleApply(), children: t("layout.actions.apply") })] })] }));
2696
+ };
2697
+ const calcQuickOptions = (numberOfDays) => {
2698
+ const quickOptions = [];
2699
+ if (numberOfDays > 7 && numberOfDays < 35) {
2700
+ quickOptions.push({ last: 1, unit: "days" }, { last: numberOfDays, unit: "days", includeExtraDay: true });
2701
+ }
2702
+ else if (numberOfDays >= 35 && numberOfDays < 185) {
2703
+ quickOptions.push({ last: 1, unit: "days" }, { last: 7, unit: "days", includeExtraDay: true }, { last: 30, unit: "days", includeExtraDay: true }, { last: numberOfDays, unit: "days", includeExtraDay: true });
2704
+ }
2705
+ else if (numberOfDays >= 185) {
2706
+ quickOptions.push({ last: 1, unit: "days" }, { last: 14, unit: "days", includeExtraDay: true }, { last: 30, unit: "days", includeExtraDay: true }, { last: numberOfDays, unit: "days", includeExtraDay: true });
2707
+ }
2708
+ return quickOptions;
2709
+ };
2710
+ const QuickOptionButton = ({ option, onClick, timezone }) => {
2711
+ const [t] = useTranslation();
2712
+ const { nowDate, endOf, subtract, add } = reactDateAndTimeHooks.useDateAndTime();
2713
+ const handleClick = react.useCallback(() => {
2714
+ const from = subtract(endOf(nowDate, "day"), option.last, option.unit);
2715
+ onClick({
2716
+ from: option.includeExtraDay ? from : add(from, 1, "days"),
2717
+ to: endOf(nowDate, "day"),
2718
+ });
2719
+ }, [subtract, endOf, nowDate, option.last, option.unit, option.includeExtraDay, onClick, add]);
2720
+ const translatedUnits = (unit) => {
2721
+ switch (unit) {
2722
+ case "hours":
2723
+ return "shared.timePeriods.hours";
2724
+ case "days":
2725
+ return "shared.timePeriods.days";
2726
+ case "months":
2727
+ return "shared.timePeriods.months";
2728
+ case "weeks":
2729
+ return "shared.timePeriods.weeks";
2730
+ default:
2731
+ return null;
2732
+ }
2733
+ };
2734
+ const getLabel = () => {
2735
+ if (option.label) {
2736
+ return option.label;
2737
+ }
2738
+ else if (option.last === 1 && option.unit === "days") {
2739
+ return t("shared.timePeriods.today");
2740
+ }
2741
+ else {
2742
+ const tKey = translatedUnits(option.unit);
2743
+ return tKey
2744
+ ? t(tKey, {
2745
+ count: option.last,
2746
+ })
2747
+ : null;
2748
+ }
2749
+ };
2750
+ return (jsxRuntime.jsx(reactComponents.Button, { dataTestId: `${option.unit}${option.last}${option.includeExtraDay ? "-include-extra-day" : ""}`, onClick: handleClick, size: "small", variant: "secondary", children: getLabel() }));
2751
+ };
2752
+
2753
+ /**
2754
+ * A popover to select a range of dates. Consider providing quick options.
2755
+ * quickOptions takes optional "includeExtraDay". This is because customers often want to see 8 days when selecting "week" so they can compare this monday to last weeks monday. Same goes for months. This option will not impact the label of the button.
2756
+ *
2757
+ * @param { DayRangePickerPopoverProps} props - The properties for the DayRangePickerPopover component.
2758
+ * @param props.interval initial date range
2759
+ * @param props.showQuickOptions display additional buttons for quick date range selection
2760
+ * @param props.disabledDays disable days from selecting possibility
2761
+ * @param props.className custom className to be added to the component
2762
+ * @param props.dataTestId id used for tests
2763
+ * @param props.onRangeSelect hook function to handle applied date range
2764
+ * @param props.variant popover button variant
2765
+ * @param props.size popover button size
2766
+ * @param props.placement popover button placement
2767
+ * @param props.timezone timezone for DayRangePicker
2768
+ * @param props.fullwidth popover button fill width
2769
+ * @param props.buttonContent popover button content
2770
+ * @param props.max The maximum amount of days that can be selected
2771
+ * @param props.disabled disabling popover button
2772
+ */
2773
+ const DayRangePickerPopover = ({ interval = { from: undefined, to: undefined }, showQuickOptions, disabledDays, className, dataTestId, onRangeSelect, variant = "ghost-neutral", size = "small", placement, timezone, fullwidth, bindTo, buttonContent, max, disabled, }) => {
2774
+ const { language } = reactCoreHooks.useCurrentUserLanguage();
2775
+ const [t] = useTranslation();
2776
+ const handleOnRangeSelect = react.useCallback((range) => {
2777
+ if (range) {
2778
+ onRangeSelect(range);
2779
+ }
2780
+ }, [onRangeSelect]);
2781
+ return (jsxRuntime.jsxs(reactComponents.Popover, { placement: placement, children: [jsxRuntime.jsx(reactComponents.PopoverTrigger, { children: jsxRuntime.jsx(reactComponents.Button, { className: className, dataTestId: dataTestId !== null && dataTestId !== void 0 ? dataTestId : "show-date-range", disabled: disabled, fullWidth: fullwidth, size: size, suffix: jsxRuntime.jsx(reactComponents.Icon, { name: "Calendar", size: "small", title: t("dayRangePickerPopover.icon.tooltip.calendar") }), variant: variant, children: buttonContent }) }), jsxRuntime.jsx(reactComponents.PopoverContent, { children: close => (jsxRuntime.jsx(reactComponents.Card, { className: "min-w-min p-4", dataTestId: "range-popover-list", children: jsxRuntime.jsx(DayRangePicker, { disabledDays: disabledDays, language: language || "en", max: max, onClose: close, onRangeSelect: handleOnRangeSelect, selectedDays: interval, showQuickOptions: showQuickOptions, timezone: timezone }) })) })] }));
2782
+ };
2783
+
2784
+ /*
2785
+ * ----------------------------
2786
+ * | SETUP TRANSLATIONS START |
2787
+ * ----------------------------
2788
+ * This import and function call is needed to register translations for this library.
2789
+ * Do not remove this if this library has translations.
2790
+ */
2791
+ setupLibraryTranslations();
2792
+
2793
+ exports.DateTime = DateTime;
2794
+ exports.DateTimeHumanized = DateTimeHumanized;
2795
+ exports.DayPicker = DayPicker;
2796
+ exports.DayRangePicker = DayRangePicker;
2797
+ exports.DayRangePickerPopover = DayRangePickerPopover;
2798
+ exports.MS_PER_HOUR = MS_PER_HOUR;