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