@wherabouts/react-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3105 @@
1
+ import { useAutocomplete, useCombobox, useReverseGeocode } from '@wherabouts/react';
2
+ import { useMemo, useRef, useState, useEffect } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ // src/utils/parse-address.ts
7
+ var COUNTRY_NAMES = {
8
+ AU: "Australia"
9
+ };
10
+ function toAddressWithParsed(suggestion) {
11
+ return {
12
+ id: suggestion.id,
13
+ formattedAddress: suggestion.formattedAddress,
14
+ latitude: suggestion.latitude,
15
+ longitude: suggestion.longitude,
16
+ streetAddress: suggestion.streetAddress,
17
+ suburb: suggestion.locality,
18
+ state: suggestion.state,
19
+ postcode: suggestion.postcode,
20
+ country: COUNTRY_NAMES[suggestion.country] ?? suggestion.country
21
+ };
22
+ }
23
+
24
+ // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
25
+ function r(e) {
26
+ var t, f, n = "";
27
+ if ("string" == typeof e || "number" == typeof e) n += e;
28
+ else if ("object" == typeof e) if (Array.isArray(e)) {
29
+ var o = e.length;
30
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
31
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
32
+ return n;
33
+ }
34
+ function clsx() {
35
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
36
+ return n;
37
+ }
38
+
39
+ // ../../node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
40
+ var CLASS_PART_SEPARATOR = "-";
41
+ var createClassGroupUtils = (config) => {
42
+ const classMap = createClassMap(config);
43
+ const {
44
+ conflictingClassGroups,
45
+ conflictingClassGroupModifiers
46
+ } = config;
47
+ const getClassGroupId = (className) => {
48
+ const classParts = className.split(CLASS_PART_SEPARATOR);
49
+ if (classParts[0] === "" && classParts.length !== 1) {
50
+ classParts.shift();
51
+ }
52
+ return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
53
+ };
54
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
55
+ const conflicts = conflictingClassGroups[classGroupId] || [];
56
+ if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
57
+ return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
58
+ }
59
+ return conflicts;
60
+ };
61
+ return {
62
+ getClassGroupId,
63
+ getConflictingClassGroupIds
64
+ };
65
+ };
66
+ var getGroupRecursive = (classParts, classPartObject) => {
67
+ if (classParts.length === 0) {
68
+ return classPartObject.classGroupId;
69
+ }
70
+ const currentClassPart = classParts[0];
71
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
72
+ const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
73
+ if (classGroupFromNextClassPart) {
74
+ return classGroupFromNextClassPart;
75
+ }
76
+ if (classPartObject.validators.length === 0) {
77
+ return void 0;
78
+ }
79
+ const classRest = classParts.join(CLASS_PART_SEPARATOR);
80
+ return classPartObject.validators.find(({
81
+ validator
82
+ }) => validator(classRest))?.classGroupId;
83
+ };
84
+ var arbitraryPropertyRegex = /^\[(.+)\]$/;
85
+ var getGroupIdForArbitraryProperty = (className) => {
86
+ if (arbitraryPropertyRegex.test(className)) {
87
+ const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
88
+ const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
89
+ if (property) {
90
+ return "arbitrary.." + property;
91
+ }
92
+ }
93
+ };
94
+ var createClassMap = (config) => {
95
+ const {
96
+ theme,
97
+ prefix
98
+ } = config;
99
+ const classMap = {
100
+ nextPart: /* @__PURE__ */ new Map(),
101
+ validators: []
102
+ };
103
+ const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
104
+ prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
105
+ processClassesRecursively(classGroup, classMap, classGroupId, theme);
106
+ });
107
+ return classMap;
108
+ };
109
+ var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
110
+ classGroup.forEach((classDefinition) => {
111
+ if (typeof classDefinition === "string") {
112
+ const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
113
+ classPartObjectToEdit.classGroupId = classGroupId;
114
+ return;
115
+ }
116
+ if (typeof classDefinition === "function") {
117
+ if (isThemeGetter(classDefinition)) {
118
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
119
+ return;
120
+ }
121
+ classPartObject.validators.push({
122
+ validator: classDefinition,
123
+ classGroupId
124
+ });
125
+ return;
126
+ }
127
+ Object.entries(classDefinition).forEach(([key, classGroup2]) => {
128
+ processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
129
+ });
130
+ });
131
+ };
132
+ var getPart = (classPartObject, path) => {
133
+ let currentClassPartObject = classPartObject;
134
+ path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
135
+ if (!currentClassPartObject.nextPart.has(pathPart)) {
136
+ currentClassPartObject.nextPart.set(pathPart, {
137
+ nextPart: /* @__PURE__ */ new Map(),
138
+ validators: []
139
+ });
140
+ }
141
+ currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
142
+ });
143
+ return currentClassPartObject;
144
+ };
145
+ var isThemeGetter = (func) => func.isThemeGetter;
146
+ var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
147
+ if (!prefix) {
148
+ return classGroupEntries;
149
+ }
150
+ return classGroupEntries.map(([classGroupId, classGroup]) => {
151
+ const prefixedClassGroup = classGroup.map((classDefinition) => {
152
+ if (typeof classDefinition === "string") {
153
+ return prefix + classDefinition;
154
+ }
155
+ if (typeof classDefinition === "object") {
156
+ return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
157
+ }
158
+ return classDefinition;
159
+ });
160
+ return [classGroupId, prefixedClassGroup];
161
+ });
162
+ };
163
+ var createLruCache = (maxCacheSize) => {
164
+ if (maxCacheSize < 1) {
165
+ return {
166
+ get: () => void 0,
167
+ set: () => {
168
+ }
169
+ };
170
+ }
171
+ let cacheSize = 0;
172
+ let cache = /* @__PURE__ */ new Map();
173
+ let previousCache = /* @__PURE__ */ new Map();
174
+ const update = (key, value) => {
175
+ cache.set(key, value);
176
+ cacheSize++;
177
+ if (cacheSize > maxCacheSize) {
178
+ cacheSize = 0;
179
+ previousCache = cache;
180
+ cache = /* @__PURE__ */ new Map();
181
+ }
182
+ };
183
+ return {
184
+ get(key) {
185
+ let value = cache.get(key);
186
+ if (value !== void 0) {
187
+ return value;
188
+ }
189
+ if ((value = previousCache.get(key)) !== void 0) {
190
+ update(key, value);
191
+ return value;
192
+ }
193
+ },
194
+ set(key, value) {
195
+ if (cache.has(key)) {
196
+ cache.set(key, value);
197
+ } else {
198
+ update(key, value);
199
+ }
200
+ }
201
+ };
202
+ };
203
+ var IMPORTANT_MODIFIER = "!";
204
+ var createParseClassName = (config) => {
205
+ const {
206
+ separator,
207
+ experimentalParseClassName
208
+ } = config;
209
+ const isSeparatorSingleCharacter = separator.length === 1;
210
+ const firstSeparatorCharacter = separator[0];
211
+ const separatorLength = separator.length;
212
+ const parseClassName = (className) => {
213
+ const modifiers = [];
214
+ let bracketDepth = 0;
215
+ let modifierStart = 0;
216
+ let postfixModifierPosition;
217
+ for (let index = 0; index < className.length; index++) {
218
+ let currentCharacter = className[index];
219
+ if (bracketDepth === 0) {
220
+ if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
221
+ modifiers.push(className.slice(modifierStart, index));
222
+ modifierStart = index + separatorLength;
223
+ continue;
224
+ }
225
+ if (currentCharacter === "/") {
226
+ postfixModifierPosition = index;
227
+ continue;
228
+ }
229
+ }
230
+ if (currentCharacter === "[") {
231
+ bracketDepth++;
232
+ } else if (currentCharacter === "]") {
233
+ bracketDepth--;
234
+ }
235
+ }
236
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
237
+ const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
238
+ const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
239
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
240
+ return {
241
+ modifiers,
242
+ hasImportantModifier,
243
+ baseClassName,
244
+ maybePostfixModifierPosition
245
+ };
246
+ };
247
+ if (experimentalParseClassName) {
248
+ return (className) => experimentalParseClassName({
249
+ className,
250
+ parseClassName
251
+ });
252
+ }
253
+ return parseClassName;
254
+ };
255
+ var sortModifiers = (modifiers) => {
256
+ if (modifiers.length <= 1) {
257
+ return modifiers;
258
+ }
259
+ const sortedModifiers = [];
260
+ let unsortedModifiers = [];
261
+ modifiers.forEach((modifier) => {
262
+ const isArbitraryVariant = modifier[0] === "[";
263
+ if (isArbitraryVariant) {
264
+ sortedModifiers.push(...unsortedModifiers.sort(), modifier);
265
+ unsortedModifiers = [];
266
+ } else {
267
+ unsortedModifiers.push(modifier);
268
+ }
269
+ });
270
+ sortedModifiers.push(...unsortedModifiers.sort());
271
+ return sortedModifiers;
272
+ };
273
+ var createConfigUtils = (config) => ({
274
+ cache: createLruCache(config.cacheSize),
275
+ parseClassName: createParseClassName(config),
276
+ ...createClassGroupUtils(config)
277
+ });
278
+ var SPLIT_CLASSES_REGEX = /\s+/;
279
+ var mergeClassList = (classList, configUtils) => {
280
+ const {
281
+ parseClassName,
282
+ getClassGroupId,
283
+ getConflictingClassGroupIds
284
+ } = configUtils;
285
+ const classGroupsInConflict = [];
286
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
287
+ let result = "";
288
+ for (let index = classNames.length - 1; index >= 0; index -= 1) {
289
+ const originalClassName = classNames[index];
290
+ const {
291
+ modifiers,
292
+ hasImportantModifier,
293
+ baseClassName,
294
+ maybePostfixModifierPosition
295
+ } = parseClassName(originalClassName);
296
+ let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
297
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
298
+ if (!classGroupId) {
299
+ if (!hasPostfixModifier) {
300
+ result = originalClassName + (result.length > 0 ? " " + result : result);
301
+ continue;
302
+ }
303
+ classGroupId = getClassGroupId(baseClassName);
304
+ if (!classGroupId) {
305
+ result = originalClassName + (result.length > 0 ? " " + result : result);
306
+ continue;
307
+ }
308
+ hasPostfixModifier = false;
309
+ }
310
+ const variantModifier = sortModifiers(modifiers).join(":");
311
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
312
+ const classId = modifierId + classGroupId;
313
+ if (classGroupsInConflict.includes(classId)) {
314
+ continue;
315
+ }
316
+ classGroupsInConflict.push(classId);
317
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
318
+ for (let i = 0; i < conflictGroups.length; ++i) {
319
+ const group = conflictGroups[i];
320
+ classGroupsInConflict.push(modifierId + group);
321
+ }
322
+ result = originalClassName + (result.length > 0 ? " " + result : result);
323
+ }
324
+ return result;
325
+ };
326
+ function twJoin() {
327
+ let index = 0;
328
+ let argument;
329
+ let resolvedValue;
330
+ let string = "";
331
+ while (index < arguments.length) {
332
+ if (argument = arguments[index++]) {
333
+ if (resolvedValue = toValue(argument)) {
334
+ string && (string += " ");
335
+ string += resolvedValue;
336
+ }
337
+ }
338
+ }
339
+ return string;
340
+ }
341
+ var toValue = (mix) => {
342
+ if (typeof mix === "string") {
343
+ return mix;
344
+ }
345
+ let resolvedValue;
346
+ let string = "";
347
+ for (let k = 0; k < mix.length; k++) {
348
+ if (mix[k]) {
349
+ if (resolvedValue = toValue(mix[k])) {
350
+ string && (string += " ");
351
+ string += resolvedValue;
352
+ }
353
+ }
354
+ }
355
+ return string;
356
+ };
357
+ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
358
+ let configUtils;
359
+ let cacheGet;
360
+ let cacheSet;
361
+ let functionToCall = initTailwindMerge;
362
+ function initTailwindMerge(classList) {
363
+ const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
364
+ configUtils = createConfigUtils(config);
365
+ cacheGet = configUtils.cache.get;
366
+ cacheSet = configUtils.cache.set;
367
+ functionToCall = tailwindMerge;
368
+ return tailwindMerge(classList);
369
+ }
370
+ function tailwindMerge(classList) {
371
+ const cachedResult = cacheGet(classList);
372
+ if (cachedResult) {
373
+ return cachedResult;
374
+ }
375
+ const result = mergeClassList(classList, configUtils);
376
+ cacheSet(classList, result);
377
+ return result;
378
+ }
379
+ return function callTailwindMerge() {
380
+ return functionToCall(twJoin.apply(null, arguments));
381
+ };
382
+ }
383
+ var fromTheme = (key) => {
384
+ const themeGetter = (theme) => theme[key] || [];
385
+ themeGetter.isThemeGetter = true;
386
+ return themeGetter;
387
+ };
388
+ var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
389
+ var fractionRegex = /^\d+\/\d+$/;
390
+ var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
391
+ var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
392
+ var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
393
+ var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
394
+ var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
395
+ var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
396
+ var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
397
+ var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
398
+ var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
399
+ var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
400
+ var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
401
+ var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
402
+ var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
403
+ var isTshirtSize = (value) => tshirtUnitRegex.test(value);
404
+ var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
405
+ var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
406
+ var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
407
+ var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
408
+ var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
409
+ var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
410
+ var isAny = () => true;
411
+ var getIsArbitraryValue = (value, label, testValue) => {
412
+ const result = arbitraryValueRegex.exec(value);
413
+ if (result) {
414
+ if (result[1]) {
415
+ return typeof label === "string" ? result[1] === label : label.has(result[1]);
416
+ }
417
+ return testValue(result[2]);
418
+ }
419
+ return false;
420
+ };
421
+ var isLengthOnly = (value) => (
422
+ // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
423
+ // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
424
+ // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
425
+ lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
426
+ );
427
+ var isNever = () => false;
428
+ var isShadow = (value) => shadowRegex.test(value);
429
+ var isImage = (value) => imageRegex.test(value);
430
+ var getDefaultConfig = () => {
431
+ const colors = fromTheme("colors");
432
+ const spacing = fromTheme("spacing");
433
+ const blur = fromTheme("blur");
434
+ const brightness = fromTheme("brightness");
435
+ const borderColor = fromTheme("borderColor");
436
+ const borderRadius = fromTheme("borderRadius");
437
+ const borderSpacing = fromTheme("borderSpacing");
438
+ const borderWidth = fromTheme("borderWidth");
439
+ const contrast = fromTheme("contrast");
440
+ const grayscale = fromTheme("grayscale");
441
+ const hueRotate = fromTheme("hueRotate");
442
+ const invert = fromTheme("invert");
443
+ const gap = fromTheme("gap");
444
+ const gradientColorStops = fromTheme("gradientColorStops");
445
+ const gradientColorStopPositions = fromTheme("gradientColorStopPositions");
446
+ const inset = fromTheme("inset");
447
+ const margin = fromTheme("margin");
448
+ const opacity = fromTheme("opacity");
449
+ const padding = fromTheme("padding");
450
+ const saturate = fromTheme("saturate");
451
+ const scale = fromTheme("scale");
452
+ const sepia = fromTheme("sepia");
453
+ const skew = fromTheme("skew");
454
+ const space = fromTheme("space");
455
+ const translate = fromTheme("translate");
456
+ const getOverscroll = () => ["auto", "contain", "none"];
457
+ const getOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
458
+ const getSpacingWithAutoAndArbitrary = () => ["auto", isArbitraryValue, spacing];
459
+ const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
460
+ const getLengthWithEmptyAndArbitrary = () => ["", isLength, isArbitraryLength];
461
+ const getNumberWithAutoAndArbitrary = () => ["auto", isNumber, isArbitraryValue];
462
+ const getPositions = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
463
+ const getLineStyles = () => ["solid", "dashed", "dotted", "double", "none"];
464
+ const getBlendModes = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
465
+ const getAlign = () => ["start", "end", "center", "between", "around", "evenly", "stretch"];
466
+ const getZeroAndEmpty = () => ["", "0", isArbitraryValue];
467
+ const getBreaks = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
468
+ const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
469
+ return {
470
+ cacheSize: 500,
471
+ separator: ":",
472
+ theme: {
473
+ colors: [isAny],
474
+ spacing: [isLength, isArbitraryLength],
475
+ blur: ["none", "", isTshirtSize, isArbitraryValue],
476
+ brightness: getNumberAndArbitrary(),
477
+ borderColor: [colors],
478
+ borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
479
+ borderSpacing: getSpacingWithArbitrary(),
480
+ borderWidth: getLengthWithEmptyAndArbitrary(),
481
+ contrast: getNumberAndArbitrary(),
482
+ grayscale: getZeroAndEmpty(),
483
+ hueRotate: getNumberAndArbitrary(),
484
+ invert: getZeroAndEmpty(),
485
+ gap: getSpacingWithArbitrary(),
486
+ gradientColorStops: [colors],
487
+ gradientColorStopPositions: [isPercent, isArbitraryLength],
488
+ inset: getSpacingWithAutoAndArbitrary(),
489
+ margin: getSpacingWithAutoAndArbitrary(),
490
+ opacity: getNumberAndArbitrary(),
491
+ padding: getSpacingWithArbitrary(),
492
+ saturate: getNumberAndArbitrary(),
493
+ scale: getNumberAndArbitrary(),
494
+ sepia: getZeroAndEmpty(),
495
+ skew: getNumberAndArbitrary(),
496
+ space: getSpacingWithArbitrary(),
497
+ translate: getSpacingWithArbitrary()
498
+ },
499
+ classGroups: {
500
+ // Layout
501
+ /**
502
+ * Aspect Ratio
503
+ * @see https://tailwindcss.com/docs/aspect-ratio
504
+ */
505
+ aspect: [{
506
+ aspect: ["auto", "square", "video", isArbitraryValue]
507
+ }],
508
+ /**
509
+ * Container
510
+ * @see https://tailwindcss.com/docs/container
511
+ */
512
+ container: ["container"],
513
+ /**
514
+ * Columns
515
+ * @see https://tailwindcss.com/docs/columns
516
+ */
517
+ columns: [{
518
+ columns: [isTshirtSize]
519
+ }],
520
+ /**
521
+ * Break After
522
+ * @see https://tailwindcss.com/docs/break-after
523
+ */
524
+ "break-after": [{
525
+ "break-after": getBreaks()
526
+ }],
527
+ /**
528
+ * Break Before
529
+ * @see https://tailwindcss.com/docs/break-before
530
+ */
531
+ "break-before": [{
532
+ "break-before": getBreaks()
533
+ }],
534
+ /**
535
+ * Break Inside
536
+ * @see https://tailwindcss.com/docs/break-inside
537
+ */
538
+ "break-inside": [{
539
+ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
540
+ }],
541
+ /**
542
+ * Box Decoration Break
543
+ * @see https://tailwindcss.com/docs/box-decoration-break
544
+ */
545
+ "box-decoration": [{
546
+ "box-decoration": ["slice", "clone"]
547
+ }],
548
+ /**
549
+ * Box Sizing
550
+ * @see https://tailwindcss.com/docs/box-sizing
551
+ */
552
+ box: [{
553
+ box: ["border", "content"]
554
+ }],
555
+ /**
556
+ * Display
557
+ * @see https://tailwindcss.com/docs/display
558
+ */
559
+ 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"],
560
+ /**
561
+ * Floats
562
+ * @see https://tailwindcss.com/docs/float
563
+ */
564
+ float: [{
565
+ float: ["right", "left", "none", "start", "end"]
566
+ }],
567
+ /**
568
+ * Clear
569
+ * @see https://tailwindcss.com/docs/clear
570
+ */
571
+ clear: [{
572
+ clear: ["left", "right", "both", "none", "start", "end"]
573
+ }],
574
+ /**
575
+ * Isolation
576
+ * @see https://tailwindcss.com/docs/isolation
577
+ */
578
+ isolation: ["isolate", "isolation-auto"],
579
+ /**
580
+ * Object Fit
581
+ * @see https://tailwindcss.com/docs/object-fit
582
+ */
583
+ "object-fit": [{
584
+ object: ["contain", "cover", "fill", "none", "scale-down"]
585
+ }],
586
+ /**
587
+ * Object Position
588
+ * @see https://tailwindcss.com/docs/object-position
589
+ */
590
+ "object-position": [{
591
+ object: [...getPositions(), isArbitraryValue]
592
+ }],
593
+ /**
594
+ * Overflow
595
+ * @see https://tailwindcss.com/docs/overflow
596
+ */
597
+ overflow: [{
598
+ overflow: getOverflow()
599
+ }],
600
+ /**
601
+ * Overflow X
602
+ * @see https://tailwindcss.com/docs/overflow
603
+ */
604
+ "overflow-x": [{
605
+ "overflow-x": getOverflow()
606
+ }],
607
+ /**
608
+ * Overflow Y
609
+ * @see https://tailwindcss.com/docs/overflow
610
+ */
611
+ "overflow-y": [{
612
+ "overflow-y": getOverflow()
613
+ }],
614
+ /**
615
+ * Overscroll Behavior
616
+ * @see https://tailwindcss.com/docs/overscroll-behavior
617
+ */
618
+ overscroll: [{
619
+ overscroll: getOverscroll()
620
+ }],
621
+ /**
622
+ * Overscroll Behavior X
623
+ * @see https://tailwindcss.com/docs/overscroll-behavior
624
+ */
625
+ "overscroll-x": [{
626
+ "overscroll-x": getOverscroll()
627
+ }],
628
+ /**
629
+ * Overscroll Behavior Y
630
+ * @see https://tailwindcss.com/docs/overscroll-behavior
631
+ */
632
+ "overscroll-y": [{
633
+ "overscroll-y": getOverscroll()
634
+ }],
635
+ /**
636
+ * Position
637
+ * @see https://tailwindcss.com/docs/position
638
+ */
639
+ position: ["static", "fixed", "absolute", "relative", "sticky"],
640
+ /**
641
+ * Top / Right / Bottom / Left
642
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
643
+ */
644
+ inset: [{
645
+ inset: [inset]
646
+ }],
647
+ /**
648
+ * Right / Left
649
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
650
+ */
651
+ "inset-x": [{
652
+ "inset-x": [inset]
653
+ }],
654
+ /**
655
+ * Top / Bottom
656
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
657
+ */
658
+ "inset-y": [{
659
+ "inset-y": [inset]
660
+ }],
661
+ /**
662
+ * Start
663
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
664
+ */
665
+ start: [{
666
+ start: [inset]
667
+ }],
668
+ /**
669
+ * End
670
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
671
+ */
672
+ end: [{
673
+ end: [inset]
674
+ }],
675
+ /**
676
+ * Top
677
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
678
+ */
679
+ top: [{
680
+ top: [inset]
681
+ }],
682
+ /**
683
+ * Right
684
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
685
+ */
686
+ right: [{
687
+ right: [inset]
688
+ }],
689
+ /**
690
+ * Bottom
691
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
692
+ */
693
+ bottom: [{
694
+ bottom: [inset]
695
+ }],
696
+ /**
697
+ * Left
698
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
699
+ */
700
+ left: [{
701
+ left: [inset]
702
+ }],
703
+ /**
704
+ * Visibility
705
+ * @see https://tailwindcss.com/docs/visibility
706
+ */
707
+ visibility: ["visible", "invisible", "collapse"],
708
+ /**
709
+ * Z-Index
710
+ * @see https://tailwindcss.com/docs/z-index
711
+ */
712
+ z: [{
713
+ z: ["auto", isInteger, isArbitraryValue]
714
+ }],
715
+ // Flexbox and Grid
716
+ /**
717
+ * Flex Basis
718
+ * @see https://tailwindcss.com/docs/flex-basis
719
+ */
720
+ basis: [{
721
+ basis: getSpacingWithAutoAndArbitrary()
722
+ }],
723
+ /**
724
+ * Flex Direction
725
+ * @see https://tailwindcss.com/docs/flex-direction
726
+ */
727
+ "flex-direction": [{
728
+ flex: ["row", "row-reverse", "col", "col-reverse"]
729
+ }],
730
+ /**
731
+ * Flex Wrap
732
+ * @see https://tailwindcss.com/docs/flex-wrap
733
+ */
734
+ "flex-wrap": [{
735
+ flex: ["wrap", "wrap-reverse", "nowrap"]
736
+ }],
737
+ /**
738
+ * Flex
739
+ * @see https://tailwindcss.com/docs/flex
740
+ */
741
+ flex: [{
742
+ flex: ["1", "auto", "initial", "none", isArbitraryValue]
743
+ }],
744
+ /**
745
+ * Flex Grow
746
+ * @see https://tailwindcss.com/docs/flex-grow
747
+ */
748
+ grow: [{
749
+ grow: getZeroAndEmpty()
750
+ }],
751
+ /**
752
+ * Flex Shrink
753
+ * @see https://tailwindcss.com/docs/flex-shrink
754
+ */
755
+ shrink: [{
756
+ shrink: getZeroAndEmpty()
757
+ }],
758
+ /**
759
+ * Order
760
+ * @see https://tailwindcss.com/docs/order
761
+ */
762
+ order: [{
763
+ order: ["first", "last", "none", isInteger, isArbitraryValue]
764
+ }],
765
+ /**
766
+ * Grid Template Columns
767
+ * @see https://tailwindcss.com/docs/grid-template-columns
768
+ */
769
+ "grid-cols": [{
770
+ "grid-cols": [isAny]
771
+ }],
772
+ /**
773
+ * Grid Column Start / End
774
+ * @see https://tailwindcss.com/docs/grid-column
775
+ */
776
+ "col-start-end": [{
777
+ col: ["auto", {
778
+ span: ["full", isInteger, isArbitraryValue]
779
+ }, isArbitraryValue]
780
+ }],
781
+ /**
782
+ * Grid Column Start
783
+ * @see https://tailwindcss.com/docs/grid-column
784
+ */
785
+ "col-start": [{
786
+ "col-start": getNumberWithAutoAndArbitrary()
787
+ }],
788
+ /**
789
+ * Grid Column End
790
+ * @see https://tailwindcss.com/docs/grid-column
791
+ */
792
+ "col-end": [{
793
+ "col-end": getNumberWithAutoAndArbitrary()
794
+ }],
795
+ /**
796
+ * Grid Template Rows
797
+ * @see https://tailwindcss.com/docs/grid-template-rows
798
+ */
799
+ "grid-rows": [{
800
+ "grid-rows": [isAny]
801
+ }],
802
+ /**
803
+ * Grid Row Start / End
804
+ * @see https://tailwindcss.com/docs/grid-row
805
+ */
806
+ "row-start-end": [{
807
+ row: ["auto", {
808
+ span: [isInteger, isArbitraryValue]
809
+ }, isArbitraryValue]
810
+ }],
811
+ /**
812
+ * Grid Row Start
813
+ * @see https://tailwindcss.com/docs/grid-row
814
+ */
815
+ "row-start": [{
816
+ "row-start": getNumberWithAutoAndArbitrary()
817
+ }],
818
+ /**
819
+ * Grid Row End
820
+ * @see https://tailwindcss.com/docs/grid-row
821
+ */
822
+ "row-end": [{
823
+ "row-end": getNumberWithAutoAndArbitrary()
824
+ }],
825
+ /**
826
+ * Grid Auto Flow
827
+ * @see https://tailwindcss.com/docs/grid-auto-flow
828
+ */
829
+ "grid-flow": [{
830
+ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
831
+ }],
832
+ /**
833
+ * Grid Auto Columns
834
+ * @see https://tailwindcss.com/docs/grid-auto-columns
835
+ */
836
+ "auto-cols": [{
837
+ "auto-cols": ["auto", "min", "max", "fr", isArbitraryValue]
838
+ }],
839
+ /**
840
+ * Grid Auto Rows
841
+ * @see https://tailwindcss.com/docs/grid-auto-rows
842
+ */
843
+ "auto-rows": [{
844
+ "auto-rows": ["auto", "min", "max", "fr", isArbitraryValue]
845
+ }],
846
+ /**
847
+ * Gap
848
+ * @see https://tailwindcss.com/docs/gap
849
+ */
850
+ gap: [{
851
+ gap: [gap]
852
+ }],
853
+ /**
854
+ * Gap X
855
+ * @see https://tailwindcss.com/docs/gap
856
+ */
857
+ "gap-x": [{
858
+ "gap-x": [gap]
859
+ }],
860
+ /**
861
+ * Gap Y
862
+ * @see https://tailwindcss.com/docs/gap
863
+ */
864
+ "gap-y": [{
865
+ "gap-y": [gap]
866
+ }],
867
+ /**
868
+ * Justify Content
869
+ * @see https://tailwindcss.com/docs/justify-content
870
+ */
871
+ "justify-content": [{
872
+ justify: ["normal", ...getAlign()]
873
+ }],
874
+ /**
875
+ * Justify Items
876
+ * @see https://tailwindcss.com/docs/justify-items
877
+ */
878
+ "justify-items": [{
879
+ "justify-items": ["start", "end", "center", "stretch"]
880
+ }],
881
+ /**
882
+ * Justify Self
883
+ * @see https://tailwindcss.com/docs/justify-self
884
+ */
885
+ "justify-self": [{
886
+ "justify-self": ["auto", "start", "end", "center", "stretch"]
887
+ }],
888
+ /**
889
+ * Align Content
890
+ * @see https://tailwindcss.com/docs/align-content
891
+ */
892
+ "align-content": [{
893
+ content: ["normal", ...getAlign(), "baseline"]
894
+ }],
895
+ /**
896
+ * Align Items
897
+ * @see https://tailwindcss.com/docs/align-items
898
+ */
899
+ "align-items": [{
900
+ items: ["start", "end", "center", "baseline", "stretch"]
901
+ }],
902
+ /**
903
+ * Align Self
904
+ * @see https://tailwindcss.com/docs/align-self
905
+ */
906
+ "align-self": [{
907
+ self: ["auto", "start", "end", "center", "stretch", "baseline"]
908
+ }],
909
+ /**
910
+ * Place Content
911
+ * @see https://tailwindcss.com/docs/place-content
912
+ */
913
+ "place-content": [{
914
+ "place-content": [...getAlign(), "baseline"]
915
+ }],
916
+ /**
917
+ * Place Items
918
+ * @see https://tailwindcss.com/docs/place-items
919
+ */
920
+ "place-items": [{
921
+ "place-items": ["start", "end", "center", "baseline", "stretch"]
922
+ }],
923
+ /**
924
+ * Place Self
925
+ * @see https://tailwindcss.com/docs/place-self
926
+ */
927
+ "place-self": [{
928
+ "place-self": ["auto", "start", "end", "center", "stretch"]
929
+ }],
930
+ // Spacing
931
+ /**
932
+ * Padding
933
+ * @see https://tailwindcss.com/docs/padding
934
+ */
935
+ p: [{
936
+ p: [padding]
937
+ }],
938
+ /**
939
+ * Padding X
940
+ * @see https://tailwindcss.com/docs/padding
941
+ */
942
+ px: [{
943
+ px: [padding]
944
+ }],
945
+ /**
946
+ * Padding Y
947
+ * @see https://tailwindcss.com/docs/padding
948
+ */
949
+ py: [{
950
+ py: [padding]
951
+ }],
952
+ /**
953
+ * Padding Start
954
+ * @see https://tailwindcss.com/docs/padding
955
+ */
956
+ ps: [{
957
+ ps: [padding]
958
+ }],
959
+ /**
960
+ * Padding End
961
+ * @see https://tailwindcss.com/docs/padding
962
+ */
963
+ pe: [{
964
+ pe: [padding]
965
+ }],
966
+ /**
967
+ * Padding Top
968
+ * @see https://tailwindcss.com/docs/padding
969
+ */
970
+ pt: [{
971
+ pt: [padding]
972
+ }],
973
+ /**
974
+ * Padding Right
975
+ * @see https://tailwindcss.com/docs/padding
976
+ */
977
+ pr: [{
978
+ pr: [padding]
979
+ }],
980
+ /**
981
+ * Padding Bottom
982
+ * @see https://tailwindcss.com/docs/padding
983
+ */
984
+ pb: [{
985
+ pb: [padding]
986
+ }],
987
+ /**
988
+ * Padding Left
989
+ * @see https://tailwindcss.com/docs/padding
990
+ */
991
+ pl: [{
992
+ pl: [padding]
993
+ }],
994
+ /**
995
+ * Margin
996
+ * @see https://tailwindcss.com/docs/margin
997
+ */
998
+ m: [{
999
+ m: [margin]
1000
+ }],
1001
+ /**
1002
+ * Margin X
1003
+ * @see https://tailwindcss.com/docs/margin
1004
+ */
1005
+ mx: [{
1006
+ mx: [margin]
1007
+ }],
1008
+ /**
1009
+ * Margin Y
1010
+ * @see https://tailwindcss.com/docs/margin
1011
+ */
1012
+ my: [{
1013
+ my: [margin]
1014
+ }],
1015
+ /**
1016
+ * Margin Start
1017
+ * @see https://tailwindcss.com/docs/margin
1018
+ */
1019
+ ms: [{
1020
+ ms: [margin]
1021
+ }],
1022
+ /**
1023
+ * Margin End
1024
+ * @see https://tailwindcss.com/docs/margin
1025
+ */
1026
+ me: [{
1027
+ me: [margin]
1028
+ }],
1029
+ /**
1030
+ * Margin Top
1031
+ * @see https://tailwindcss.com/docs/margin
1032
+ */
1033
+ mt: [{
1034
+ mt: [margin]
1035
+ }],
1036
+ /**
1037
+ * Margin Right
1038
+ * @see https://tailwindcss.com/docs/margin
1039
+ */
1040
+ mr: [{
1041
+ mr: [margin]
1042
+ }],
1043
+ /**
1044
+ * Margin Bottom
1045
+ * @see https://tailwindcss.com/docs/margin
1046
+ */
1047
+ mb: [{
1048
+ mb: [margin]
1049
+ }],
1050
+ /**
1051
+ * Margin Left
1052
+ * @see https://tailwindcss.com/docs/margin
1053
+ */
1054
+ ml: [{
1055
+ ml: [margin]
1056
+ }],
1057
+ /**
1058
+ * Space Between X
1059
+ * @see https://tailwindcss.com/docs/space
1060
+ */
1061
+ "space-x": [{
1062
+ "space-x": [space]
1063
+ }],
1064
+ /**
1065
+ * Space Between X Reverse
1066
+ * @see https://tailwindcss.com/docs/space
1067
+ */
1068
+ "space-x-reverse": ["space-x-reverse"],
1069
+ /**
1070
+ * Space Between Y
1071
+ * @see https://tailwindcss.com/docs/space
1072
+ */
1073
+ "space-y": [{
1074
+ "space-y": [space]
1075
+ }],
1076
+ /**
1077
+ * Space Between Y Reverse
1078
+ * @see https://tailwindcss.com/docs/space
1079
+ */
1080
+ "space-y-reverse": ["space-y-reverse"],
1081
+ // Sizing
1082
+ /**
1083
+ * Width
1084
+ * @see https://tailwindcss.com/docs/width
1085
+ */
1086
+ w: [{
1087
+ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", isArbitraryValue, spacing]
1088
+ }],
1089
+ /**
1090
+ * Min-Width
1091
+ * @see https://tailwindcss.com/docs/min-width
1092
+ */
1093
+ "min-w": [{
1094
+ "min-w": [isArbitraryValue, spacing, "min", "max", "fit"]
1095
+ }],
1096
+ /**
1097
+ * Max-Width
1098
+ * @see https://tailwindcss.com/docs/max-width
1099
+ */
1100
+ "max-w": [{
1101
+ "max-w": [isArbitraryValue, spacing, "none", "full", "min", "max", "fit", "prose", {
1102
+ screen: [isTshirtSize]
1103
+ }, isTshirtSize]
1104
+ }],
1105
+ /**
1106
+ * Height
1107
+ * @see https://tailwindcss.com/docs/height
1108
+ */
1109
+ h: [{
1110
+ h: [isArbitraryValue, spacing, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
1111
+ }],
1112
+ /**
1113
+ * Min-Height
1114
+ * @see https://tailwindcss.com/docs/min-height
1115
+ */
1116
+ "min-h": [{
1117
+ "min-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
1118
+ }],
1119
+ /**
1120
+ * Max-Height
1121
+ * @see https://tailwindcss.com/docs/max-height
1122
+ */
1123
+ "max-h": [{
1124
+ "max-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
1125
+ }],
1126
+ /**
1127
+ * Size
1128
+ * @see https://tailwindcss.com/docs/size
1129
+ */
1130
+ size: [{
1131
+ size: [isArbitraryValue, spacing, "auto", "min", "max", "fit"]
1132
+ }],
1133
+ // Typography
1134
+ /**
1135
+ * Font Size
1136
+ * @see https://tailwindcss.com/docs/font-size
1137
+ */
1138
+ "font-size": [{
1139
+ text: ["base", isTshirtSize, isArbitraryLength]
1140
+ }],
1141
+ /**
1142
+ * Font Smoothing
1143
+ * @see https://tailwindcss.com/docs/font-smoothing
1144
+ */
1145
+ "font-smoothing": ["antialiased", "subpixel-antialiased"],
1146
+ /**
1147
+ * Font Style
1148
+ * @see https://tailwindcss.com/docs/font-style
1149
+ */
1150
+ "font-style": ["italic", "not-italic"],
1151
+ /**
1152
+ * Font Weight
1153
+ * @see https://tailwindcss.com/docs/font-weight
1154
+ */
1155
+ "font-weight": [{
1156
+ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", isArbitraryNumber]
1157
+ }],
1158
+ /**
1159
+ * Font Family
1160
+ * @see https://tailwindcss.com/docs/font-family
1161
+ */
1162
+ "font-family": [{
1163
+ font: [isAny]
1164
+ }],
1165
+ /**
1166
+ * Font Variant Numeric
1167
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1168
+ */
1169
+ "fvn-normal": ["normal-nums"],
1170
+ /**
1171
+ * Font Variant Numeric
1172
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1173
+ */
1174
+ "fvn-ordinal": ["ordinal"],
1175
+ /**
1176
+ * Font Variant Numeric
1177
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1178
+ */
1179
+ "fvn-slashed-zero": ["slashed-zero"],
1180
+ /**
1181
+ * Font Variant Numeric
1182
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1183
+ */
1184
+ "fvn-figure": ["lining-nums", "oldstyle-nums"],
1185
+ /**
1186
+ * Font Variant Numeric
1187
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1188
+ */
1189
+ "fvn-spacing": ["proportional-nums", "tabular-nums"],
1190
+ /**
1191
+ * Font Variant Numeric
1192
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1193
+ */
1194
+ "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
1195
+ /**
1196
+ * Letter Spacing
1197
+ * @see https://tailwindcss.com/docs/letter-spacing
1198
+ */
1199
+ tracking: [{
1200
+ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", isArbitraryValue]
1201
+ }],
1202
+ /**
1203
+ * Line Clamp
1204
+ * @see https://tailwindcss.com/docs/line-clamp
1205
+ */
1206
+ "line-clamp": [{
1207
+ "line-clamp": ["none", isNumber, isArbitraryNumber]
1208
+ }],
1209
+ /**
1210
+ * Line Height
1211
+ * @see https://tailwindcss.com/docs/line-height
1212
+ */
1213
+ leading: [{
1214
+ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isLength, isArbitraryValue]
1215
+ }],
1216
+ /**
1217
+ * List Style Image
1218
+ * @see https://tailwindcss.com/docs/list-style-image
1219
+ */
1220
+ "list-image": [{
1221
+ "list-image": ["none", isArbitraryValue]
1222
+ }],
1223
+ /**
1224
+ * List Style Type
1225
+ * @see https://tailwindcss.com/docs/list-style-type
1226
+ */
1227
+ "list-style-type": [{
1228
+ list: ["none", "disc", "decimal", isArbitraryValue]
1229
+ }],
1230
+ /**
1231
+ * List Style Position
1232
+ * @see https://tailwindcss.com/docs/list-style-position
1233
+ */
1234
+ "list-style-position": [{
1235
+ list: ["inside", "outside"]
1236
+ }],
1237
+ /**
1238
+ * Placeholder Color
1239
+ * @deprecated since Tailwind CSS v3.0.0
1240
+ * @see https://tailwindcss.com/docs/placeholder-color
1241
+ */
1242
+ "placeholder-color": [{
1243
+ placeholder: [colors]
1244
+ }],
1245
+ /**
1246
+ * Placeholder Opacity
1247
+ * @see https://tailwindcss.com/docs/placeholder-opacity
1248
+ */
1249
+ "placeholder-opacity": [{
1250
+ "placeholder-opacity": [opacity]
1251
+ }],
1252
+ /**
1253
+ * Text Alignment
1254
+ * @see https://tailwindcss.com/docs/text-align
1255
+ */
1256
+ "text-alignment": [{
1257
+ text: ["left", "center", "right", "justify", "start", "end"]
1258
+ }],
1259
+ /**
1260
+ * Text Color
1261
+ * @see https://tailwindcss.com/docs/text-color
1262
+ */
1263
+ "text-color": [{
1264
+ text: [colors]
1265
+ }],
1266
+ /**
1267
+ * Text Opacity
1268
+ * @see https://tailwindcss.com/docs/text-opacity
1269
+ */
1270
+ "text-opacity": [{
1271
+ "text-opacity": [opacity]
1272
+ }],
1273
+ /**
1274
+ * Text Decoration
1275
+ * @see https://tailwindcss.com/docs/text-decoration
1276
+ */
1277
+ "text-decoration": ["underline", "overline", "line-through", "no-underline"],
1278
+ /**
1279
+ * Text Decoration Style
1280
+ * @see https://tailwindcss.com/docs/text-decoration-style
1281
+ */
1282
+ "text-decoration-style": [{
1283
+ decoration: [...getLineStyles(), "wavy"]
1284
+ }],
1285
+ /**
1286
+ * Text Decoration Thickness
1287
+ * @see https://tailwindcss.com/docs/text-decoration-thickness
1288
+ */
1289
+ "text-decoration-thickness": [{
1290
+ decoration: ["auto", "from-font", isLength, isArbitraryLength]
1291
+ }],
1292
+ /**
1293
+ * Text Underline Offset
1294
+ * @see https://tailwindcss.com/docs/text-underline-offset
1295
+ */
1296
+ "underline-offset": [{
1297
+ "underline-offset": ["auto", isLength, isArbitraryValue]
1298
+ }],
1299
+ /**
1300
+ * Text Decoration Color
1301
+ * @see https://tailwindcss.com/docs/text-decoration-color
1302
+ */
1303
+ "text-decoration-color": [{
1304
+ decoration: [colors]
1305
+ }],
1306
+ /**
1307
+ * Text Transform
1308
+ * @see https://tailwindcss.com/docs/text-transform
1309
+ */
1310
+ "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
1311
+ /**
1312
+ * Text Overflow
1313
+ * @see https://tailwindcss.com/docs/text-overflow
1314
+ */
1315
+ "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
1316
+ /**
1317
+ * Text Wrap
1318
+ * @see https://tailwindcss.com/docs/text-wrap
1319
+ */
1320
+ "text-wrap": [{
1321
+ text: ["wrap", "nowrap", "balance", "pretty"]
1322
+ }],
1323
+ /**
1324
+ * Text Indent
1325
+ * @see https://tailwindcss.com/docs/text-indent
1326
+ */
1327
+ indent: [{
1328
+ indent: getSpacingWithArbitrary()
1329
+ }],
1330
+ /**
1331
+ * Vertical Alignment
1332
+ * @see https://tailwindcss.com/docs/vertical-align
1333
+ */
1334
+ "vertical-align": [{
1335
+ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryValue]
1336
+ }],
1337
+ /**
1338
+ * Whitespace
1339
+ * @see https://tailwindcss.com/docs/whitespace
1340
+ */
1341
+ whitespace: [{
1342
+ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
1343
+ }],
1344
+ /**
1345
+ * Word Break
1346
+ * @see https://tailwindcss.com/docs/word-break
1347
+ */
1348
+ break: [{
1349
+ break: ["normal", "words", "all", "keep"]
1350
+ }],
1351
+ /**
1352
+ * Hyphens
1353
+ * @see https://tailwindcss.com/docs/hyphens
1354
+ */
1355
+ hyphens: [{
1356
+ hyphens: ["none", "manual", "auto"]
1357
+ }],
1358
+ /**
1359
+ * Content
1360
+ * @see https://tailwindcss.com/docs/content
1361
+ */
1362
+ content: [{
1363
+ content: ["none", isArbitraryValue]
1364
+ }],
1365
+ // Backgrounds
1366
+ /**
1367
+ * Background Attachment
1368
+ * @see https://tailwindcss.com/docs/background-attachment
1369
+ */
1370
+ "bg-attachment": [{
1371
+ bg: ["fixed", "local", "scroll"]
1372
+ }],
1373
+ /**
1374
+ * Background Clip
1375
+ * @see https://tailwindcss.com/docs/background-clip
1376
+ */
1377
+ "bg-clip": [{
1378
+ "bg-clip": ["border", "padding", "content", "text"]
1379
+ }],
1380
+ /**
1381
+ * Background Opacity
1382
+ * @deprecated since Tailwind CSS v3.0.0
1383
+ * @see https://tailwindcss.com/docs/background-opacity
1384
+ */
1385
+ "bg-opacity": [{
1386
+ "bg-opacity": [opacity]
1387
+ }],
1388
+ /**
1389
+ * Background Origin
1390
+ * @see https://tailwindcss.com/docs/background-origin
1391
+ */
1392
+ "bg-origin": [{
1393
+ "bg-origin": ["border", "padding", "content"]
1394
+ }],
1395
+ /**
1396
+ * Background Position
1397
+ * @see https://tailwindcss.com/docs/background-position
1398
+ */
1399
+ "bg-position": [{
1400
+ bg: [...getPositions(), isArbitraryPosition]
1401
+ }],
1402
+ /**
1403
+ * Background Repeat
1404
+ * @see https://tailwindcss.com/docs/background-repeat
1405
+ */
1406
+ "bg-repeat": [{
1407
+ bg: ["no-repeat", {
1408
+ repeat: ["", "x", "y", "round", "space"]
1409
+ }]
1410
+ }],
1411
+ /**
1412
+ * Background Size
1413
+ * @see https://tailwindcss.com/docs/background-size
1414
+ */
1415
+ "bg-size": [{
1416
+ bg: ["auto", "cover", "contain", isArbitrarySize]
1417
+ }],
1418
+ /**
1419
+ * Background Image
1420
+ * @see https://tailwindcss.com/docs/background-image
1421
+ */
1422
+ "bg-image": [{
1423
+ bg: ["none", {
1424
+ "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
1425
+ }, isArbitraryImage]
1426
+ }],
1427
+ /**
1428
+ * Background Color
1429
+ * @see https://tailwindcss.com/docs/background-color
1430
+ */
1431
+ "bg-color": [{
1432
+ bg: [colors]
1433
+ }],
1434
+ /**
1435
+ * Gradient Color Stops From Position
1436
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1437
+ */
1438
+ "gradient-from-pos": [{
1439
+ from: [gradientColorStopPositions]
1440
+ }],
1441
+ /**
1442
+ * Gradient Color Stops Via Position
1443
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1444
+ */
1445
+ "gradient-via-pos": [{
1446
+ via: [gradientColorStopPositions]
1447
+ }],
1448
+ /**
1449
+ * Gradient Color Stops To Position
1450
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1451
+ */
1452
+ "gradient-to-pos": [{
1453
+ to: [gradientColorStopPositions]
1454
+ }],
1455
+ /**
1456
+ * Gradient Color Stops From
1457
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1458
+ */
1459
+ "gradient-from": [{
1460
+ from: [gradientColorStops]
1461
+ }],
1462
+ /**
1463
+ * Gradient Color Stops Via
1464
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1465
+ */
1466
+ "gradient-via": [{
1467
+ via: [gradientColorStops]
1468
+ }],
1469
+ /**
1470
+ * Gradient Color Stops To
1471
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1472
+ */
1473
+ "gradient-to": [{
1474
+ to: [gradientColorStops]
1475
+ }],
1476
+ // Borders
1477
+ /**
1478
+ * Border Radius
1479
+ * @see https://tailwindcss.com/docs/border-radius
1480
+ */
1481
+ rounded: [{
1482
+ rounded: [borderRadius]
1483
+ }],
1484
+ /**
1485
+ * Border Radius Start
1486
+ * @see https://tailwindcss.com/docs/border-radius
1487
+ */
1488
+ "rounded-s": [{
1489
+ "rounded-s": [borderRadius]
1490
+ }],
1491
+ /**
1492
+ * Border Radius End
1493
+ * @see https://tailwindcss.com/docs/border-radius
1494
+ */
1495
+ "rounded-e": [{
1496
+ "rounded-e": [borderRadius]
1497
+ }],
1498
+ /**
1499
+ * Border Radius Top
1500
+ * @see https://tailwindcss.com/docs/border-radius
1501
+ */
1502
+ "rounded-t": [{
1503
+ "rounded-t": [borderRadius]
1504
+ }],
1505
+ /**
1506
+ * Border Radius Right
1507
+ * @see https://tailwindcss.com/docs/border-radius
1508
+ */
1509
+ "rounded-r": [{
1510
+ "rounded-r": [borderRadius]
1511
+ }],
1512
+ /**
1513
+ * Border Radius Bottom
1514
+ * @see https://tailwindcss.com/docs/border-radius
1515
+ */
1516
+ "rounded-b": [{
1517
+ "rounded-b": [borderRadius]
1518
+ }],
1519
+ /**
1520
+ * Border Radius Left
1521
+ * @see https://tailwindcss.com/docs/border-radius
1522
+ */
1523
+ "rounded-l": [{
1524
+ "rounded-l": [borderRadius]
1525
+ }],
1526
+ /**
1527
+ * Border Radius Start Start
1528
+ * @see https://tailwindcss.com/docs/border-radius
1529
+ */
1530
+ "rounded-ss": [{
1531
+ "rounded-ss": [borderRadius]
1532
+ }],
1533
+ /**
1534
+ * Border Radius Start End
1535
+ * @see https://tailwindcss.com/docs/border-radius
1536
+ */
1537
+ "rounded-se": [{
1538
+ "rounded-se": [borderRadius]
1539
+ }],
1540
+ /**
1541
+ * Border Radius End End
1542
+ * @see https://tailwindcss.com/docs/border-radius
1543
+ */
1544
+ "rounded-ee": [{
1545
+ "rounded-ee": [borderRadius]
1546
+ }],
1547
+ /**
1548
+ * Border Radius End Start
1549
+ * @see https://tailwindcss.com/docs/border-radius
1550
+ */
1551
+ "rounded-es": [{
1552
+ "rounded-es": [borderRadius]
1553
+ }],
1554
+ /**
1555
+ * Border Radius Top Left
1556
+ * @see https://tailwindcss.com/docs/border-radius
1557
+ */
1558
+ "rounded-tl": [{
1559
+ "rounded-tl": [borderRadius]
1560
+ }],
1561
+ /**
1562
+ * Border Radius Top Right
1563
+ * @see https://tailwindcss.com/docs/border-radius
1564
+ */
1565
+ "rounded-tr": [{
1566
+ "rounded-tr": [borderRadius]
1567
+ }],
1568
+ /**
1569
+ * Border Radius Bottom Right
1570
+ * @see https://tailwindcss.com/docs/border-radius
1571
+ */
1572
+ "rounded-br": [{
1573
+ "rounded-br": [borderRadius]
1574
+ }],
1575
+ /**
1576
+ * Border Radius Bottom Left
1577
+ * @see https://tailwindcss.com/docs/border-radius
1578
+ */
1579
+ "rounded-bl": [{
1580
+ "rounded-bl": [borderRadius]
1581
+ }],
1582
+ /**
1583
+ * Border Width
1584
+ * @see https://tailwindcss.com/docs/border-width
1585
+ */
1586
+ "border-w": [{
1587
+ border: [borderWidth]
1588
+ }],
1589
+ /**
1590
+ * Border Width X
1591
+ * @see https://tailwindcss.com/docs/border-width
1592
+ */
1593
+ "border-w-x": [{
1594
+ "border-x": [borderWidth]
1595
+ }],
1596
+ /**
1597
+ * Border Width Y
1598
+ * @see https://tailwindcss.com/docs/border-width
1599
+ */
1600
+ "border-w-y": [{
1601
+ "border-y": [borderWidth]
1602
+ }],
1603
+ /**
1604
+ * Border Width Start
1605
+ * @see https://tailwindcss.com/docs/border-width
1606
+ */
1607
+ "border-w-s": [{
1608
+ "border-s": [borderWidth]
1609
+ }],
1610
+ /**
1611
+ * Border Width End
1612
+ * @see https://tailwindcss.com/docs/border-width
1613
+ */
1614
+ "border-w-e": [{
1615
+ "border-e": [borderWidth]
1616
+ }],
1617
+ /**
1618
+ * Border Width Top
1619
+ * @see https://tailwindcss.com/docs/border-width
1620
+ */
1621
+ "border-w-t": [{
1622
+ "border-t": [borderWidth]
1623
+ }],
1624
+ /**
1625
+ * Border Width Right
1626
+ * @see https://tailwindcss.com/docs/border-width
1627
+ */
1628
+ "border-w-r": [{
1629
+ "border-r": [borderWidth]
1630
+ }],
1631
+ /**
1632
+ * Border Width Bottom
1633
+ * @see https://tailwindcss.com/docs/border-width
1634
+ */
1635
+ "border-w-b": [{
1636
+ "border-b": [borderWidth]
1637
+ }],
1638
+ /**
1639
+ * Border Width Left
1640
+ * @see https://tailwindcss.com/docs/border-width
1641
+ */
1642
+ "border-w-l": [{
1643
+ "border-l": [borderWidth]
1644
+ }],
1645
+ /**
1646
+ * Border Opacity
1647
+ * @see https://tailwindcss.com/docs/border-opacity
1648
+ */
1649
+ "border-opacity": [{
1650
+ "border-opacity": [opacity]
1651
+ }],
1652
+ /**
1653
+ * Border Style
1654
+ * @see https://tailwindcss.com/docs/border-style
1655
+ */
1656
+ "border-style": [{
1657
+ border: [...getLineStyles(), "hidden"]
1658
+ }],
1659
+ /**
1660
+ * Divide Width X
1661
+ * @see https://tailwindcss.com/docs/divide-width
1662
+ */
1663
+ "divide-x": [{
1664
+ "divide-x": [borderWidth]
1665
+ }],
1666
+ /**
1667
+ * Divide Width X Reverse
1668
+ * @see https://tailwindcss.com/docs/divide-width
1669
+ */
1670
+ "divide-x-reverse": ["divide-x-reverse"],
1671
+ /**
1672
+ * Divide Width Y
1673
+ * @see https://tailwindcss.com/docs/divide-width
1674
+ */
1675
+ "divide-y": [{
1676
+ "divide-y": [borderWidth]
1677
+ }],
1678
+ /**
1679
+ * Divide Width Y Reverse
1680
+ * @see https://tailwindcss.com/docs/divide-width
1681
+ */
1682
+ "divide-y-reverse": ["divide-y-reverse"],
1683
+ /**
1684
+ * Divide Opacity
1685
+ * @see https://tailwindcss.com/docs/divide-opacity
1686
+ */
1687
+ "divide-opacity": [{
1688
+ "divide-opacity": [opacity]
1689
+ }],
1690
+ /**
1691
+ * Divide Style
1692
+ * @see https://tailwindcss.com/docs/divide-style
1693
+ */
1694
+ "divide-style": [{
1695
+ divide: getLineStyles()
1696
+ }],
1697
+ /**
1698
+ * Border Color
1699
+ * @see https://tailwindcss.com/docs/border-color
1700
+ */
1701
+ "border-color": [{
1702
+ border: [borderColor]
1703
+ }],
1704
+ /**
1705
+ * Border Color X
1706
+ * @see https://tailwindcss.com/docs/border-color
1707
+ */
1708
+ "border-color-x": [{
1709
+ "border-x": [borderColor]
1710
+ }],
1711
+ /**
1712
+ * Border Color Y
1713
+ * @see https://tailwindcss.com/docs/border-color
1714
+ */
1715
+ "border-color-y": [{
1716
+ "border-y": [borderColor]
1717
+ }],
1718
+ /**
1719
+ * Border Color S
1720
+ * @see https://tailwindcss.com/docs/border-color
1721
+ */
1722
+ "border-color-s": [{
1723
+ "border-s": [borderColor]
1724
+ }],
1725
+ /**
1726
+ * Border Color E
1727
+ * @see https://tailwindcss.com/docs/border-color
1728
+ */
1729
+ "border-color-e": [{
1730
+ "border-e": [borderColor]
1731
+ }],
1732
+ /**
1733
+ * Border Color Top
1734
+ * @see https://tailwindcss.com/docs/border-color
1735
+ */
1736
+ "border-color-t": [{
1737
+ "border-t": [borderColor]
1738
+ }],
1739
+ /**
1740
+ * Border Color Right
1741
+ * @see https://tailwindcss.com/docs/border-color
1742
+ */
1743
+ "border-color-r": [{
1744
+ "border-r": [borderColor]
1745
+ }],
1746
+ /**
1747
+ * Border Color Bottom
1748
+ * @see https://tailwindcss.com/docs/border-color
1749
+ */
1750
+ "border-color-b": [{
1751
+ "border-b": [borderColor]
1752
+ }],
1753
+ /**
1754
+ * Border Color Left
1755
+ * @see https://tailwindcss.com/docs/border-color
1756
+ */
1757
+ "border-color-l": [{
1758
+ "border-l": [borderColor]
1759
+ }],
1760
+ /**
1761
+ * Divide Color
1762
+ * @see https://tailwindcss.com/docs/divide-color
1763
+ */
1764
+ "divide-color": [{
1765
+ divide: [borderColor]
1766
+ }],
1767
+ /**
1768
+ * Outline Style
1769
+ * @see https://tailwindcss.com/docs/outline-style
1770
+ */
1771
+ "outline-style": [{
1772
+ outline: ["", ...getLineStyles()]
1773
+ }],
1774
+ /**
1775
+ * Outline Offset
1776
+ * @see https://tailwindcss.com/docs/outline-offset
1777
+ */
1778
+ "outline-offset": [{
1779
+ "outline-offset": [isLength, isArbitraryValue]
1780
+ }],
1781
+ /**
1782
+ * Outline Width
1783
+ * @see https://tailwindcss.com/docs/outline-width
1784
+ */
1785
+ "outline-w": [{
1786
+ outline: [isLength, isArbitraryLength]
1787
+ }],
1788
+ /**
1789
+ * Outline Color
1790
+ * @see https://tailwindcss.com/docs/outline-color
1791
+ */
1792
+ "outline-color": [{
1793
+ outline: [colors]
1794
+ }],
1795
+ /**
1796
+ * Ring Width
1797
+ * @see https://tailwindcss.com/docs/ring-width
1798
+ */
1799
+ "ring-w": [{
1800
+ ring: getLengthWithEmptyAndArbitrary()
1801
+ }],
1802
+ /**
1803
+ * Ring Width Inset
1804
+ * @see https://tailwindcss.com/docs/ring-width
1805
+ */
1806
+ "ring-w-inset": ["ring-inset"],
1807
+ /**
1808
+ * Ring Color
1809
+ * @see https://tailwindcss.com/docs/ring-color
1810
+ */
1811
+ "ring-color": [{
1812
+ ring: [colors]
1813
+ }],
1814
+ /**
1815
+ * Ring Opacity
1816
+ * @see https://tailwindcss.com/docs/ring-opacity
1817
+ */
1818
+ "ring-opacity": [{
1819
+ "ring-opacity": [opacity]
1820
+ }],
1821
+ /**
1822
+ * Ring Offset Width
1823
+ * @see https://tailwindcss.com/docs/ring-offset-width
1824
+ */
1825
+ "ring-offset-w": [{
1826
+ "ring-offset": [isLength, isArbitraryLength]
1827
+ }],
1828
+ /**
1829
+ * Ring Offset Color
1830
+ * @see https://tailwindcss.com/docs/ring-offset-color
1831
+ */
1832
+ "ring-offset-color": [{
1833
+ "ring-offset": [colors]
1834
+ }],
1835
+ // Effects
1836
+ /**
1837
+ * Box Shadow
1838
+ * @see https://tailwindcss.com/docs/box-shadow
1839
+ */
1840
+ shadow: [{
1841
+ shadow: ["", "inner", "none", isTshirtSize, isArbitraryShadow]
1842
+ }],
1843
+ /**
1844
+ * Box Shadow Color
1845
+ * @see https://tailwindcss.com/docs/box-shadow-color
1846
+ */
1847
+ "shadow-color": [{
1848
+ shadow: [isAny]
1849
+ }],
1850
+ /**
1851
+ * Opacity
1852
+ * @see https://tailwindcss.com/docs/opacity
1853
+ */
1854
+ opacity: [{
1855
+ opacity: [opacity]
1856
+ }],
1857
+ /**
1858
+ * Mix Blend Mode
1859
+ * @see https://tailwindcss.com/docs/mix-blend-mode
1860
+ */
1861
+ "mix-blend": [{
1862
+ "mix-blend": [...getBlendModes(), "plus-lighter", "plus-darker"]
1863
+ }],
1864
+ /**
1865
+ * Background Blend Mode
1866
+ * @see https://tailwindcss.com/docs/background-blend-mode
1867
+ */
1868
+ "bg-blend": [{
1869
+ "bg-blend": getBlendModes()
1870
+ }],
1871
+ // Filters
1872
+ /**
1873
+ * Filter
1874
+ * @deprecated since Tailwind CSS v3.0.0
1875
+ * @see https://tailwindcss.com/docs/filter
1876
+ */
1877
+ filter: [{
1878
+ filter: ["", "none"]
1879
+ }],
1880
+ /**
1881
+ * Blur
1882
+ * @see https://tailwindcss.com/docs/blur
1883
+ */
1884
+ blur: [{
1885
+ blur: [blur]
1886
+ }],
1887
+ /**
1888
+ * Brightness
1889
+ * @see https://tailwindcss.com/docs/brightness
1890
+ */
1891
+ brightness: [{
1892
+ brightness: [brightness]
1893
+ }],
1894
+ /**
1895
+ * Contrast
1896
+ * @see https://tailwindcss.com/docs/contrast
1897
+ */
1898
+ contrast: [{
1899
+ contrast: [contrast]
1900
+ }],
1901
+ /**
1902
+ * Drop Shadow
1903
+ * @see https://tailwindcss.com/docs/drop-shadow
1904
+ */
1905
+ "drop-shadow": [{
1906
+ "drop-shadow": ["", "none", isTshirtSize, isArbitraryValue]
1907
+ }],
1908
+ /**
1909
+ * Grayscale
1910
+ * @see https://tailwindcss.com/docs/grayscale
1911
+ */
1912
+ grayscale: [{
1913
+ grayscale: [grayscale]
1914
+ }],
1915
+ /**
1916
+ * Hue Rotate
1917
+ * @see https://tailwindcss.com/docs/hue-rotate
1918
+ */
1919
+ "hue-rotate": [{
1920
+ "hue-rotate": [hueRotate]
1921
+ }],
1922
+ /**
1923
+ * Invert
1924
+ * @see https://tailwindcss.com/docs/invert
1925
+ */
1926
+ invert: [{
1927
+ invert: [invert]
1928
+ }],
1929
+ /**
1930
+ * Saturate
1931
+ * @see https://tailwindcss.com/docs/saturate
1932
+ */
1933
+ saturate: [{
1934
+ saturate: [saturate]
1935
+ }],
1936
+ /**
1937
+ * Sepia
1938
+ * @see https://tailwindcss.com/docs/sepia
1939
+ */
1940
+ sepia: [{
1941
+ sepia: [sepia]
1942
+ }],
1943
+ /**
1944
+ * Backdrop Filter
1945
+ * @deprecated since Tailwind CSS v3.0.0
1946
+ * @see https://tailwindcss.com/docs/backdrop-filter
1947
+ */
1948
+ "backdrop-filter": [{
1949
+ "backdrop-filter": ["", "none"]
1950
+ }],
1951
+ /**
1952
+ * Backdrop Blur
1953
+ * @see https://tailwindcss.com/docs/backdrop-blur
1954
+ */
1955
+ "backdrop-blur": [{
1956
+ "backdrop-blur": [blur]
1957
+ }],
1958
+ /**
1959
+ * Backdrop Brightness
1960
+ * @see https://tailwindcss.com/docs/backdrop-brightness
1961
+ */
1962
+ "backdrop-brightness": [{
1963
+ "backdrop-brightness": [brightness]
1964
+ }],
1965
+ /**
1966
+ * Backdrop Contrast
1967
+ * @see https://tailwindcss.com/docs/backdrop-contrast
1968
+ */
1969
+ "backdrop-contrast": [{
1970
+ "backdrop-contrast": [contrast]
1971
+ }],
1972
+ /**
1973
+ * Backdrop Grayscale
1974
+ * @see https://tailwindcss.com/docs/backdrop-grayscale
1975
+ */
1976
+ "backdrop-grayscale": [{
1977
+ "backdrop-grayscale": [grayscale]
1978
+ }],
1979
+ /**
1980
+ * Backdrop Hue Rotate
1981
+ * @see https://tailwindcss.com/docs/backdrop-hue-rotate
1982
+ */
1983
+ "backdrop-hue-rotate": [{
1984
+ "backdrop-hue-rotate": [hueRotate]
1985
+ }],
1986
+ /**
1987
+ * Backdrop Invert
1988
+ * @see https://tailwindcss.com/docs/backdrop-invert
1989
+ */
1990
+ "backdrop-invert": [{
1991
+ "backdrop-invert": [invert]
1992
+ }],
1993
+ /**
1994
+ * Backdrop Opacity
1995
+ * @see https://tailwindcss.com/docs/backdrop-opacity
1996
+ */
1997
+ "backdrop-opacity": [{
1998
+ "backdrop-opacity": [opacity]
1999
+ }],
2000
+ /**
2001
+ * Backdrop Saturate
2002
+ * @see https://tailwindcss.com/docs/backdrop-saturate
2003
+ */
2004
+ "backdrop-saturate": [{
2005
+ "backdrop-saturate": [saturate]
2006
+ }],
2007
+ /**
2008
+ * Backdrop Sepia
2009
+ * @see https://tailwindcss.com/docs/backdrop-sepia
2010
+ */
2011
+ "backdrop-sepia": [{
2012
+ "backdrop-sepia": [sepia]
2013
+ }],
2014
+ // Tables
2015
+ /**
2016
+ * Border Collapse
2017
+ * @see https://tailwindcss.com/docs/border-collapse
2018
+ */
2019
+ "border-collapse": [{
2020
+ border: ["collapse", "separate"]
2021
+ }],
2022
+ /**
2023
+ * Border Spacing
2024
+ * @see https://tailwindcss.com/docs/border-spacing
2025
+ */
2026
+ "border-spacing": [{
2027
+ "border-spacing": [borderSpacing]
2028
+ }],
2029
+ /**
2030
+ * Border Spacing X
2031
+ * @see https://tailwindcss.com/docs/border-spacing
2032
+ */
2033
+ "border-spacing-x": [{
2034
+ "border-spacing-x": [borderSpacing]
2035
+ }],
2036
+ /**
2037
+ * Border Spacing Y
2038
+ * @see https://tailwindcss.com/docs/border-spacing
2039
+ */
2040
+ "border-spacing-y": [{
2041
+ "border-spacing-y": [borderSpacing]
2042
+ }],
2043
+ /**
2044
+ * Table Layout
2045
+ * @see https://tailwindcss.com/docs/table-layout
2046
+ */
2047
+ "table-layout": [{
2048
+ table: ["auto", "fixed"]
2049
+ }],
2050
+ /**
2051
+ * Caption Side
2052
+ * @see https://tailwindcss.com/docs/caption-side
2053
+ */
2054
+ caption: [{
2055
+ caption: ["top", "bottom"]
2056
+ }],
2057
+ // Transitions and Animation
2058
+ /**
2059
+ * Tranisition Property
2060
+ * @see https://tailwindcss.com/docs/transition-property
2061
+ */
2062
+ transition: [{
2063
+ transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", isArbitraryValue]
2064
+ }],
2065
+ /**
2066
+ * Transition Duration
2067
+ * @see https://tailwindcss.com/docs/transition-duration
2068
+ */
2069
+ duration: [{
2070
+ duration: getNumberAndArbitrary()
2071
+ }],
2072
+ /**
2073
+ * Transition Timing Function
2074
+ * @see https://tailwindcss.com/docs/transition-timing-function
2075
+ */
2076
+ ease: [{
2077
+ ease: ["linear", "in", "out", "in-out", isArbitraryValue]
2078
+ }],
2079
+ /**
2080
+ * Transition Delay
2081
+ * @see https://tailwindcss.com/docs/transition-delay
2082
+ */
2083
+ delay: [{
2084
+ delay: getNumberAndArbitrary()
2085
+ }],
2086
+ /**
2087
+ * Animation
2088
+ * @see https://tailwindcss.com/docs/animation
2089
+ */
2090
+ animate: [{
2091
+ animate: ["none", "spin", "ping", "pulse", "bounce", isArbitraryValue]
2092
+ }],
2093
+ // Transforms
2094
+ /**
2095
+ * Transform
2096
+ * @see https://tailwindcss.com/docs/transform
2097
+ */
2098
+ transform: [{
2099
+ transform: ["", "gpu", "none"]
2100
+ }],
2101
+ /**
2102
+ * Scale
2103
+ * @see https://tailwindcss.com/docs/scale
2104
+ */
2105
+ scale: [{
2106
+ scale: [scale]
2107
+ }],
2108
+ /**
2109
+ * Scale X
2110
+ * @see https://tailwindcss.com/docs/scale
2111
+ */
2112
+ "scale-x": [{
2113
+ "scale-x": [scale]
2114
+ }],
2115
+ /**
2116
+ * Scale Y
2117
+ * @see https://tailwindcss.com/docs/scale
2118
+ */
2119
+ "scale-y": [{
2120
+ "scale-y": [scale]
2121
+ }],
2122
+ /**
2123
+ * Rotate
2124
+ * @see https://tailwindcss.com/docs/rotate
2125
+ */
2126
+ rotate: [{
2127
+ rotate: [isInteger, isArbitraryValue]
2128
+ }],
2129
+ /**
2130
+ * Translate X
2131
+ * @see https://tailwindcss.com/docs/translate
2132
+ */
2133
+ "translate-x": [{
2134
+ "translate-x": [translate]
2135
+ }],
2136
+ /**
2137
+ * Translate Y
2138
+ * @see https://tailwindcss.com/docs/translate
2139
+ */
2140
+ "translate-y": [{
2141
+ "translate-y": [translate]
2142
+ }],
2143
+ /**
2144
+ * Skew X
2145
+ * @see https://tailwindcss.com/docs/skew
2146
+ */
2147
+ "skew-x": [{
2148
+ "skew-x": [skew]
2149
+ }],
2150
+ /**
2151
+ * Skew Y
2152
+ * @see https://tailwindcss.com/docs/skew
2153
+ */
2154
+ "skew-y": [{
2155
+ "skew-y": [skew]
2156
+ }],
2157
+ /**
2158
+ * Transform Origin
2159
+ * @see https://tailwindcss.com/docs/transform-origin
2160
+ */
2161
+ "transform-origin": [{
2162
+ origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", isArbitraryValue]
2163
+ }],
2164
+ // Interactivity
2165
+ /**
2166
+ * Accent Color
2167
+ * @see https://tailwindcss.com/docs/accent-color
2168
+ */
2169
+ accent: [{
2170
+ accent: ["auto", colors]
2171
+ }],
2172
+ /**
2173
+ * Appearance
2174
+ * @see https://tailwindcss.com/docs/appearance
2175
+ */
2176
+ appearance: [{
2177
+ appearance: ["none", "auto"]
2178
+ }],
2179
+ /**
2180
+ * Cursor
2181
+ * @see https://tailwindcss.com/docs/cursor
2182
+ */
2183
+ cursor: [{
2184
+ 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]
2185
+ }],
2186
+ /**
2187
+ * Caret Color
2188
+ * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
2189
+ */
2190
+ "caret-color": [{
2191
+ caret: [colors]
2192
+ }],
2193
+ /**
2194
+ * Pointer Events
2195
+ * @see https://tailwindcss.com/docs/pointer-events
2196
+ */
2197
+ "pointer-events": [{
2198
+ "pointer-events": ["none", "auto"]
2199
+ }],
2200
+ /**
2201
+ * Resize
2202
+ * @see https://tailwindcss.com/docs/resize
2203
+ */
2204
+ resize: [{
2205
+ resize: ["none", "y", "x", ""]
2206
+ }],
2207
+ /**
2208
+ * Scroll Behavior
2209
+ * @see https://tailwindcss.com/docs/scroll-behavior
2210
+ */
2211
+ "scroll-behavior": [{
2212
+ scroll: ["auto", "smooth"]
2213
+ }],
2214
+ /**
2215
+ * Scroll Margin
2216
+ * @see https://tailwindcss.com/docs/scroll-margin
2217
+ */
2218
+ "scroll-m": [{
2219
+ "scroll-m": getSpacingWithArbitrary()
2220
+ }],
2221
+ /**
2222
+ * Scroll Margin X
2223
+ * @see https://tailwindcss.com/docs/scroll-margin
2224
+ */
2225
+ "scroll-mx": [{
2226
+ "scroll-mx": getSpacingWithArbitrary()
2227
+ }],
2228
+ /**
2229
+ * Scroll Margin Y
2230
+ * @see https://tailwindcss.com/docs/scroll-margin
2231
+ */
2232
+ "scroll-my": [{
2233
+ "scroll-my": getSpacingWithArbitrary()
2234
+ }],
2235
+ /**
2236
+ * Scroll Margin Start
2237
+ * @see https://tailwindcss.com/docs/scroll-margin
2238
+ */
2239
+ "scroll-ms": [{
2240
+ "scroll-ms": getSpacingWithArbitrary()
2241
+ }],
2242
+ /**
2243
+ * Scroll Margin End
2244
+ * @see https://tailwindcss.com/docs/scroll-margin
2245
+ */
2246
+ "scroll-me": [{
2247
+ "scroll-me": getSpacingWithArbitrary()
2248
+ }],
2249
+ /**
2250
+ * Scroll Margin Top
2251
+ * @see https://tailwindcss.com/docs/scroll-margin
2252
+ */
2253
+ "scroll-mt": [{
2254
+ "scroll-mt": getSpacingWithArbitrary()
2255
+ }],
2256
+ /**
2257
+ * Scroll Margin Right
2258
+ * @see https://tailwindcss.com/docs/scroll-margin
2259
+ */
2260
+ "scroll-mr": [{
2261
+ "scroll-mr": getSpacingWithArbitrary()
2262
+ }],
2263
+ /**
2264
+ * Scroll Margin Bottom
2265
+ * @see https://tailwindcss.com/docs/scroll-margin
2266
+ */
2267
+ "scroll-mb": [{
2268
+ "scroll-mb": getSpacingWithArbitrary()
2269
+ }],
2270
+ /**
2271
+ * Scroll Margin Left
2272
+ * @see https://tailwindcss.com/docs/scroll-margin
2273
+ */
2274
+ "scroll-ml": [{
2275
+ "scroll-ml": getSpacingWithArbitrary()
2276
+ }],
2277
+ /**
2278
+ * Scroll Padding
2279
+ * @see https://tailwindcss.com/docs/scroll-padding
2280
+ */
2281
+ "scroll-p": [{
2282
+ "scroll-p": getSpacingWithArbitrary()
2283
+ }],
2284
+ /**
2285
+ * Scroll Padding X
2286
+ * @see https://tailwindcss.com/docs/scroll-padding
2287
+ */
2288
+ "scroll-px": [{
2289
+ "scroll-px": getSpacingWithArbitrary()
2290
+ }],
2291
+ /**
2292
+ * Scroll Padding Y
2293
+ * @see https://tailwindcss.com/docs/scroll-padding
2294
+ */
2295
+ "scroll-py": [{
2296
+ "scroll-py": getSpacingWithArbitrary()
2297
+ }],
2298
+ /**
2299
+ * Scroll Padding Start
2300
+ * @see https://tailwindcss.com/docs/scroll-padding
2301
+ */
2302
+ "scroll-ps": [{
2303
+ "scroll-ps": getSpacingWithArbitrary()
2304
+ }],
2305
+ /**
2306
+ * Scroll Padding End
2307
+ * @see https://tailwindcss.com/docs/scroll-padding
2308
+ */
2309
+ "scroll-pe": [{
2310
+ "scroll-pe": getSpacingWithArbitrary()
2311
+ }],
2312
+ /**
2313
+ * Scroll Padding Top
2314
+ * @see https://tailwindcss.com/docs/scroll-padding
2315
+ */
2316
+ "scroll-pt": [{
2317
+ "scroll-pt": getSpacingWithArbitrary()
2318
+ }],
2319
+ /**
2320
+ * Scroll Padding Right
2321
+ * @see https://tailwindcss.com/docs/scroll-padding
2322
+ */
2323
+ "scroll-pr": [{
2324
+ "scroll-pr": getSpacingWithArbitrary()
2325
+ }],
2326
+ /**
2327
+ * Scroll Padding Bottom
2328
+ * @see https://tailwindcss.com/docs/scroll-padding
2329
+ */
2330
+ "scroll-pb": [{
2331
+ "scroll-pb": getSpacingWithArbitrary()
2332
+ }],
2333
+ /**
2334
+ * Scroll Padding Left
2335
+ * @see https://tailwindcss.com/docs/scroll-padding
2336
+ */
2337
+ "scroll-pl": [{
2338
+ "scroll-pl": getSpacingWithArbitrary()
2339
+ }],
2340
+ /**
2341
+ * Scroll Snap Align
2342
+ * @see https://tailwindcss.com/docs/scroll-snap-align
2343
+ */
2344
+ "snap-align": [{
2345
+ snap: ["start", "end", "center", "align-none"]
2346
+ }],
2347
+ /**
2348
+ * Scroll Snap Stop
2349
+ * @see https://tailwindcss.com/docs/scroll-snap-stop
2350
+ */
2351
+ "snap-stop": [{
2352
+ snap: ["normal", "always"]
2353
+ }],
2354
+ /**
2355
+ * Scroll Snap Type
2356
+ * @see https://tailwindcss.com/docs/scroll-snap-type
2357
+ */
2358
+ "snap-type": [{
2359
+ snap: ["none", "x", "y", "both"]
2360
+ }],
2361
+ /**
2362
+ * Scroll Snap Type Strictness
2363
+ * @see https://tailwindcss.com/docs/scroll-snap-type
2364
+ */
2365
+ "snap-strictness": [{
2366
+ snap: ["mandatory", "proximity"]
2367
+ }],
2368
+ /**
2369
+ * Touch Action
2370
+ * @see https://tailwindcss.com/docs/touch-action
2371
+ */
2372
+ touch: [{
2373
+ touch: ["auto", "none", "manipulation"]
2374
+ }],
2375
+ /**
2376
+ * Touch Action X
2377
+ * @see https://tailwindcss.com/docs/touch-action
2378
+ */
2379
+ "touch-x": [{
2380
+ "touch-pan": ["x", "left", "right"]
2381
+ }],
2382
+ /**
2383
+ * Touch Action Y
2384
+ * @see https://tailwindcss.com/docs/touch-action
2385
+ */
2386
+ "touch-y": [{
2387
+ "touch-pan": ["y", "up", "down"]
2388
+ }],
2389
+ /**
2390
+ * Touch Action Pinch Zoom
2391
+ * @see https://tailwindcss.com/docs/touch-action
2392
+ */
2393
+ "touch-pz": ["touch-pinch-zoom"],
2394
+ /**
2395
+ * User Select
2396
+ * @see https://tailwindcss.com/docs/user-select
2397
+ */
2398
+ select: [{
2399
+ select: ["none", "text", "all", "auto"]
2400
+ }],
2401
+ /**
2402
+ * Will Change
2403
+ * @see https://tailwindcss.com/docs/will-change
2404
+ */
2405
+ "will-change": [{
2406
+ "will-change": ["auto", "scroll", "contents", "transform", isArbitraryValue]
2407
+ }],
2408
+ // SVG
2409
+ /**
2410
+ * Fill
2411
+ * @see https://tailwindcss.com/docs/fill
2412
+ */
2413
+ fill: [{
2414
+ fill: [colors, "none"]
2415
+ }],
2416
+ /**
2417
+ * Stroke Width
2418
+ * @see https://tailwindcss.com/docs/stroke-width
2419
+ */
2420
+ "stroke-w": [{
2421
+ stroke: [isLength, isArbitraryLength, isArbitraryNumber]
2422
+ }],
2423
+ /**
2424
+ * Stroke
2425
+ * @see https://tailwindcss.com/docs/stroke
2426
+ */
2427
+ stroke: [{
2428
+ stroke: [colors, "none"]
2429
+ }],
2430
+ // Accessibility
2431
+ /**
2432
+ * Screen Readers
2433
+ * @see https://tailwindcss.com/docs/screen-readers
2434
+ */
2435
+ sr: ["sr-only", "not-sr-only"],
2436
+ /**
2437
+ * Forced Color Adjust
2438
+ * @see https://tailwindcss.com/docs/forced-color-adjust
2439
+ */
2440
+ "forced-color-adjust": [{
2441
+ "forced-color-adjust": ["auto", "none"]
2442
+ }]
2443
+ },
2444
+ conflictingClassGroups: {
2445
+ overflow: ["overflow-x", "overflow-y"],
2446
+ overscroll: ["overscroll-x", "overscroll-y"],
2447
+ inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
2448
+ "inset-x": ["right", "left"],
2449
+ "inset-y": ["top", "bottom"],
2450
+ flex: ["basis", "grow", "shrink"],
2451
+ gap: ["gap-x", "gap-y"],
2452
+ p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
2453
+ px: ["pr", "pl"],
2454
+ py: ["pt", "pb"],
2455
+ m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
2456
+ mx: ["mr", "ml"],
2457
+ my: ["mt", "mb"],
2458
+ size: ["w", "h"],
2459
+ "font-size": ["leading"],
2460
+ "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
2461
+ "fvn-ordinal": ["fvn-normal"],
2462
+ "fvn-slashed-zero": ["fvn-normal"],
2463
+ "fvn-figure": ["fvn-normal"],
2464
+ "fvn-spacing": ["fvn-normal"],
2465
+ "fvn-fraction": ["fvn-normal"],
2466
+ "line-clamp": ["display", "overflow"],
2467
+ 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"],
2468
+ "rounded-s": ["rounded-ss", "rounded-es"],
2469
+ "rounded-e": ["rounded-se", "rounded-ee"],
2470
+ "rounded-t": ["rounded-tl", "rounded-tr"],
2471
+ "rounded-r": ["rounded-tr", "rounded-br"],
2472
+ "rounded-b": ["rounded-br", "rounded-bl"],
2473
+ "rounded-l": ["rounded-tl", "rounded-bl"],
2474
+ "border-spacing": ["border-spacing-x", "border-spacing-y"],
2475
+ "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
2476
+ "border-w-x": ["border-w-r", "border-w-l"],
2477
+ "border-w-y": ["border-w-t", "border-w-b"],
2478
+ "border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
2479
+ "border-color-x": ["border-color-r", "border-color-l"],
2480
+ "border-color-y": ["border-color-t", "border-color-b"],
2481
+ "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
2482
+ "scroll-mx": ["scroll-mr", "scroll-ml"],
2483
+ "scroll-my": ["scroll-mt", "scroll-mb"],
2484
+ "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
2485
+ "scroll-px": ["scroll-pr", "scroll-pl"],
2486
+ "scroll-py": ["scroll-pt", "scroll-pb"],
2487
+ touch: ["touch-x", "touch-y", "touch-pz"],
2488
+ "touch-x": ["touch"],
2489
+ "touch-y": ["touch"],
2490
+ "touch-pz": ["touch"]
2491
+ },
2492
+ conflictingClassGroupModifiers: {
2493
+ "font-size": ["leading"]
2494
+ }
2495
+ };
2496
+ };
2497
+ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
2498
+
2499
+ // src/utils/cn.ts
2500
+ function cn(...inputs) {
2501
+ return twMerge(clsx(inputs));
2502
+ }
2503
+ function useAddressGeolocation(enabled) {
2504
+ const [lat, setLat] = useState(void 0);
2505
+ const [lng, setLng] = useState(void 0);
2506
+ const [loading, setLoading] = useState(false);
2507
+ const [error, setError] = useState(null);
2508
+ useEffect(() => {
2509
+ if (!enabled) {
2510
+ return;
2511
+ }
2512
+ if (typeof navigator === "undefined" || !("geolocation" in navigator)) {
2513
+ return;
2514
+ }
2515
+ setLoading(true);
2516
+ const controller = new AbortController();
2517
+ navigator.geolocation.getCurrentPosition(
2518
+ (position) => {
2519
+ if (!controller.signal.aborted) {
2520
+ setLat(position.coords.latitude);
2521
+ setLng(position.coords.longitude);
2522
+ setError(null);
2523
+ setLoading(false);
2524
+ }
2525
+ },
2526
+ (err) => {
2527
+ if (!controller.signal.aborted) {
2528
+ setError(err);
2529
+ setLoading(false);
2530
+ }
2531
+ }
2532
+ );
2533
+ return () => {
2534
+ controller.abort();
2535
+ };
2536
+ }, [enabled]);
2537
+ return { lat, lng, loading, error };
2538
+ }
2539
+ var DEFAULT_I18N = {
2540
+ noResults: "No addresses found",
2541
+ enterManually: "Enter address manually",
2542
+ errorRetry: "Try again",
2543
+ geolocationError: "Location access denied"
2544
+ };
2545
+ var DROPDOWN_GAP_PX = 4;
2546
+ function computeDropdownPosition(rect) {
2547
+ return {
2548
+ top: rect.bottom + DROPDOWN_GAP_PX,
2549
+ left: rect.left,
2550
+ width: rect.width
2551
+ };
2552
+ }
2553
+ function AddressAutocomplete({
2554
+ client,
2555
+ onQueryChange,
2556
+ onSelect,
2557
+ error: externalError,
2558
+ required,
2559
+ disabled,
2560
+ debounceMs = 300,
2561
+ minCharsToSearch = 2,
2562
+ maxSuggestions = 5,
2563
+ enableGeolocation,
2564
+ userLat,
2565
+ userLng,
2566
+ sessionToken,
2567
+ className,
2568
+ placeholder,
2569
+ renderSuggestion,
2570
+ renderEmpty,
2571
+ renderError,
2572
+ renderLoading,
2573
+ i18nStrings: customI18n,
2574
+ id: customId
2575
+ }) {
2576
+ const id = customId ?? "wherabouts-autocomplete";
2577
+ const i18n = useMemo(
2578
+ () => ({ ...DEFAULT_I18N, ...customI18n }),
2579
+ [customI18n]
2580
+ );
2581
+ const { lat: geoLat, lng: geoLng } = useAddressGeolocation(
2582
+ enableGeolocation ?? false
2583
+ );
2584
+ const effectiveLat = userLat ?? geoLat;
2585
+ const effectiveLng = userLng ?? geoLng;
2586
+ const {
2587
+ query,
2588
+ setQuery,
2589
+ results,
2590
+ error: autocompleteError,
2591
+ status
2592
+ } = useAutocomplete(client, {
2593
+ debounceMs,
2594
+ minLength: minCharsToSearch,
2595
+ limit: maxSuggestions,
2596
+ lat: effectiveLat,
2597
+ lng: effectiveLng,
2598
+ sessionToken,
2599
+ keepPreviousData: true
2600
+ });
2601
+ const { getInputProps, getListboxProps, getItemProps, isOpen } = useCombobox({
2602
+ id,
2603
+ count: results.length,
2604
+ onSelect: (index) => {
2605
+ const item = results[index];
2606
+ if (item) {
2607
+ const parsed = toAddressWithParsed(item);
2608
+ onSelect?.(parsed);
2609
+ setQuery("");
2610
+ }
2611
+ }
2612
+ });
2613
+ const inputRef = useRef(null);
2614
+ const [dropdownPosition, setDropdownPosition] = useState(null);
2615
+ useEffect(() => {
2616
+ if (!isOpen) {
2617
+ return;
2618
+ }
2619
+ const updatePosition = () => {
2620
+ const el = inputRef.current;
2621
+ if (el) {
2622
+ setDropdownPosition(
2623
+ computeDropdownPosition(el.getBoundingClientRect())
2624
+ );
2625
+ }
2626
+ };
2627
+ updatePosition();
2628
+ window.addEventListener("scroll", updatePosition, true);
2629
+ window.addEventListener("resize", updatePosition);
2630
+ return () => {
2631
+ window.removeEventListener("scroll", updatePosition, true);
2632
+ window.removeEventListener("resize", updatePosition);
2633
+ };
2634
+ }, [isOpen]);
2635
+ const error = externalError || (status === "error" ? autocompleteError : null);
2636
+ const inputProps = getInputProps();
2637
+ const handleKeyDown = (e) => {
2638
+ const handler = inputProps.onKeyDown;
2639
+ if (handler) {
2640
+ handler(e.nativeEvent);
2641
+ }
2642
+ };
2643
+ return /* @__PURE__ */ jsxs(
2644
+ "div",
2645
+ {
2646
+ className: cn("relative w-full", className),
2647
+ "data-slot": "address-autocomplete",
2648
+ children: [
2649
+ /* @__PURE__ */ jsx(
2650
+ "input",
2651
+ {
2652
+ ...inputProps,
2653
+ "aria-invalid": error ? "true" : "false",
2654
+ className: "block h-8 w-full rounded-none border border-input bg-transparent px-2.5 py-1 text-foreground text-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:bg-input/30",
2655
+ "data-slot": "address-input",
2656
+ disabled,
2657
+ onChange: (e) => {
2658
+ setQuery(e.target.value);
2659
+ onQueryChange?.(e.target.value);
2660
+ },
2661
+ onKeyDown: handleKeyDown,
2662
+ placeholder: placeholder ?? i18n.noResults,
2663
+ ref: inputRef,
2664
+ required,
2665
+ type: "text",
2666
+ value: query
2667
+ }
2668
+ ),
2669
+ isOpen && dropdownPosition && typeof document !== "undefined" && createPortal(
2670
+ /* @__PURE__ */ jsxs(
2671
+ "div",
2672
+ {
2673
+ className: "z-50 overflow-hidden rounded-none border border-border bg-popover text-popover-foreground shadow-md",
2674
+ "data-slot": "address-dropdown",
2675
+ style: {
2676
+ position: "fixed",
2677
+ top: dropdownPosition.top,
2678
+ left: dropdownPosition.left,
2679
+ width: dropdownPosition.width
2680
+ },
2681
+ children: [
2682
+ /* @__PURE__ */ jsxs(
2683
+ "ul",
2684
+ {
2685
+ ...getListboxProps(),
2686
+ className: "max-h-80 overflow-y-auto",
2687
+ "data-slot": "address-listbox",
2688
+ children: [
2689
+ status === "loading" && /* @__PURE__ */ jsx(
2690
+ "li",
2691
+ {
2692
+ className: "flex items-center justify-center px-3 py-2 text-muted-foreground text-sm",
2693
+ "data-slot": "address-item",
2694
+ "data-status": "loading",
2695
+ children: renderLoading?.() ?? "Loading..."
2696
+ }
2697
+ ),
2698
+ status === "error" && /* @__PURE__ */ jsx(
2699
+ "li",
2700
+ {
2701
+ className: "flex items-center justify-center px-3 py-2 text-destructive text-sm",
2702
+ "data-slot": "address-item",
2703
+ "data-status": "error",
2704
+ children: renderError?.(error instanceof Error ? error : null) ?? i18n.errorRetry
2705
+ }
2706
+ ),
2707
+ status === "empty" && /* @__PURE__ */ jsx(
2708
+ "li",
2709
+ {
2710
+ className: "flex items-center justify-center px-3 py-2 text-muted-foreground text-sm",
2711
+ "data-slot": "address-item",
2712
+ "data-status": "empty",
2713
+ children: renderEmpty?.() ?? i18n.noResults
2714
+ }
2715
+ ),
2716
+ status === "success" && results.map((result, index) => {
2717
+ const itemProps = getItemProps(index);
2718
+ const ariaSelected = itemProps["aria-selected"];
2719
+ const isActive = ariaSelected === true || ariaSelected === "true";
2720
+ const parsed = toAddressWithParsed(result);
2721
+ return /* @__PURE__ */ jsx(
2722
+ "li",
2723
+ {
2724
+ ...itemProps,
2725
+ className: "flex cursor-pointer items-center rounded-none px-3 py-2 transition-colors hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",
2726
+ "data-slot": "address-item",
2727
+ onClick: () => {
2728
+ onSelect?.(parsed);
2729
+ setQuery("");
2730
+ },
2731
+ onMouseDown: (e) => {
2732
+ e.preventDefault();
2733
+ },
2734
+ children: renderSuggestion ? renderSuggestion(parsed, isActive) : /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
2735
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-foreground text-sm", children: parsed.streetAddress }),
2736
+ /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground text-xs", children: [
2737
+ parsed.suburb,
2738
+ ", ",
2739
+ parsed.state,
2740
+ " ",
2741
+ parsed.postcode
2742
+ ] })
2743
+ ] })
2744
+ },
2745
+ result.id
2746
+ );
2747
+ })
2748
+ ]
2749
+ }
2750
+ ),
2751
+ status === "success" && results.length > 0 && /* @__PURE__ */ jsx(
2752
+ "div",
2753
+ {
2754
+ className: "border-border border-t bg-muted/40 px-3 py-2",
2755
+ "data-slot": "address-powered-by",
2756
+ children: /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-xs", children: [
2757
+ "Suggestions powered by",
2758
+ " ",
2759
+ /* @__PURE__ */ jsx(
2760
+ "a",
2761
+ {
2762
+ className: "font-semibold text-foreground hover:underline",
2763
+ href: "https://wherabouts.com",
2764
+ rel: "noopener noreferrer",
2765
+ target: "_blank",
2766
+ children: "Wherabouts"
2767
+ }
2768
+ )
2769
+ ] })
2770
+ }
2771
+ )
2772
+ ]
2773
+ }
2774
+ ),
2775
+ document.body
2776
+ )
2777
+ ]
2778
+ }
2779
+ );
2780
+ }
2781
+ function AddressFormField({
2782
+ label,
2783
+ labelClassName,
2784
+ errorClassName,
2785
+ error,
2786
+ required,
2787
+ disabled,
2788
+ id: customId,
2789
+ className,
2790
+ ...autocompleteProps
2791
+ }) {
2792
+ const id = customId ?? "wherabouts-field";
2793
+ return /* @__PURE__ */ jsxs(
2794
+ "div",
2795
+ {
2796
+ "data-slot": "address-form-field",
2797
+ className: "flex flex-col gap-2",
2798
+ children: [
2799
+ /* @__PURE__ */ jsxs(
2800
+ "label",
2801
+ {
2802
+ htmlFor: id,
2803
+ className: cn(
2804
+ "block text-sm font-medium text-gray-900",
2805
+ labelClassName
2806
+ ),
2807
+ children: [
2808
+ label,
2809
+ required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-1 text-red-600", children: "*" })
2810
+ ]
2811
+ }
2812
+ ),
2813
+ /* @__PURE__ */ jsx(
2814
+ AddressAutocomplete,
2815
+ {
2816
+ ...autocompleteProps,
2817
+ id,
2818
+ required,
2819
+ disabled,
2820
+ error,
2821
+ className
2822
+ }
2823
+ ),
2824
+ error && /* @__PURE__ */ jsx(
2825
+ "p",
2826
+ {
2827
+ role: "alert",
2828
+ "aria-live": "polite",
2829
+ className: cn(
2830
+ "text-sm text-red-600",
2831
+ errorClassName
2832
+ ),
2833
+ children: error
2834
+ }
2835
+ )
2836
+ ]
2837
+ }
2838
+ );
2839
+ }
2840
+ function ReverseGeocodeInput({
2841
+ client,
2842
+ latitude,
2843
+ longitude,
2844
+ onResult,
2845
+ className,
2846
+ disabled,
2847
+ placeholder = "Address will appear here",
2848
+ id
2849
+ }) {
2850
+ const { address, distance } = useReverseGeocode(
2851
+ client,
2852
+ latitude != null && longitude != null ? { lat: latitude, lng: longitude } : null
2853
+ );
2854
+ useEffect(() => {
2855
+ onResult?.({
2856
+ address: address?.formattedAddress ?? null,
2857
+ distance: distance ?? null
2858
+ });
2859
+ }, [address, distance, onResult]);
2860
+ const displayText = address?.formattedAddress ?? "";
2861
+ return /* @__PURE__ */ jsx(
2862
+ "input",
2863
+ {
2864
+ id,
2865
+ "data-slot": "geocode-input",
2866
+ type: "text",
2867
+ readOnly: true,
2868
+ disabled,
2869
+ value: displayText,
2870
+ placeholder,
2871
+ className: cn(
2872
+ "block h-8 w-full cursor-default rounded-none border border-input bg-muted/40 px-2.5 py-1 text-foreground text-xs",
2873
+ className
2874
+ )
2875
+ }
2876
+ );
2877
+ }
2878
+ var toGeocodeAddress = (address) => address ? {
2879
+ id: address.id,
2880
+ formattedAddress: address.formattedAddress,
2881
+ latitude: address.latitude,
2882
+ longitude: address.longitude
2883
+ } : null;
2884
+ function useForwardGeocode(client, query) {
2885
+ const [data, setData] = useState(null);
2886
+ const [loading, setLoading] = useState(false);
2887
+ const [error, setError] = useState(null);
2888
+ useEffect(() => {
2889
+ if (!query) {
2890
+ setData(null);
2891
+ setError(null);
2892
+ return;
2893
+ }
2894
+ const controller = new AbortController();
2895
+ async function fetch() {
2896
+ setLoading(true);
2897
+ setError(null);
2898
+ try {
2899
+ const response = await client.geocode.forward(
2900
+ { q: query },
2901
+ { signal: controller.signal }
2902
+ );
2903
+ if (controller.signal.aborted) {
2904
+ return;
2905
+ }
2906
+ setData(toGeocodeAddress(response.address));
2907
+ } catch (err) {
2908
+ if (controller.signal.aborted) {
2909
+ return;
2910
+ }
2911
+ setError(err instanceof Error ? err : new Error(String(err)));
2912
+ setData(null);
2913
+ } finally {
2914
+ if (!controller.signal.aborted) {
2915
+ setLoading(false);
2916
+ }
2917
+ }
2918
+ }
2919
+ fetch();
2920
+ return () => {
2921
+ controller.abort();
2922
+ };
2923
+ }, [client, query]);
2924
+ return { data, loading, error };
2925
+ }
2926
+ function ForwardGeocodeInput({
2927
+ client,
2928
+ query,
2929
+ onResult,
2930
+ className,
2931
+ disabled,
2932
+ placeholder = "Coordinates will appear here",
2933
+ id
2934
+ }) {
2935
+ const { data } = useForwardGeocode(client, query);
2936
+ useEffect(() => {
2937
+ onResult?.({
2938
+ latitude: data?.latitude ?? null,
2939
+ longitude: data?.longitude ?? null,
2940
+ formattedAddress: data?.formattedAddress ?? null
2941
+ });
2942
+ }, [data, onResult]);
2943
+ const displayText = data ? `${data.latitude.toFixed(4)}, ${data.longitude.toFixed(4)}` : "";
2944
+ return /* @__PURE__ */ jsx(
2945
+ "input",
2946
+ {
2947
+ id,
2948
+ "data-slot": "geocode-input",
2949
+ type: "text",
2950
+ readOnly: true,
2951
+ disabled,
2952
+ value: displayText,
2953
+ placeholder,
2954
+ className: cn(
2955
+ "block h-8 w-full cursor-default rounded-none border border-input bg-muted/40 px-2.5 py-1 text-foreground text-xs",
2956
+ className
2957
+ )
2958
+ }
2959
+ );
2960
+ }
2961
+ function AddressFieldGroup({
2962
+ client,
2963
+ value,
2964
+ onChange,
2965
+ className,
2966
+ disabled,
2967
+ streetLabel = "Street Address",
2968
+ suburbLabel = "Suburb",
2969
+ stateLabel = "State",
2970
+ postcodeLabel = "Postcode"
2971
+ }) {
2972
+ const handleAutocompleteSelect = (address) => {
2973
+ onChange({
2974
+ street: address.streetAddress,
2975
+ suburb: address.suburb,
2976
+ state: address.state,
2977
+ postcode: address.postcode
2978
+ });
2979
+ };
2980
+ const handleFieldChange = (field, fieldValue) => {
2981
+ onChange({
2982
+ ...value,
2983
+ [field]: fieldValue
2984
+ });
2985
+ };
2986
+ return /* @__PURE__ */ jsxs(
2987
+ "div",
2988
+ {
2989
+ "data-slot": "address-field-group",
2990
+ className: cn("flex flex-col gap-4", className),
2991
+ children: [
2992
+ /* @__PURE__ */ jsx(
2993
+ AddressAutocomplete,
2994
+ {
2995
+ client,
2996
+ disabled,
2997
+ onSelect: handleAutocompleteSelect,
2998
+ placeholder: "Search for an address..."
2999
+ }
3000
+ ),
3001
+ /* @__PURE__ */ jsxs(
3002
+ "div",
3003
+ {
3004
+ "data-slot": "address-field-group-inputs",
3005
+ className: "grid grid-cols-2 gap-4",
3006
+ children: [
3007
+ /* @__PURE__ */ jsxs("div", { className: "col-span-2", children: [
3008
+ /* @__PURE__ */ jsx(
3009
+ "label",
3010
+ {
3011
+ htmlFor: "field-street",
3012
+ className: "mb-1 block font-medium text-foreground text-sm",
3013
+ children: streetLabel
3014
+ }
3015
+ ),
3016
+ /* @__PURE__ */ jsx(
3017
+ "input",
3018
+ {
3019
+ id: "field-street",
3020
+ type: "text",
3021
+ disabled,
3022
+ value: value.street,
3023
+ onChange: (e) => handleFieldChange("street", e.target.value),
3024
+ className: "block h-8 w-full rounded-none border border-input bg-transparent px-2.5 py-1 text-foreground text-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
3025
+ placeholder: "Street address"
3026
+ }
3027
+ )
3028
+ ] }),
3029
+ /* @__PURE__ */ jsxs("div", { children: [
3030
+ /* @__PURE__ */ jsx(
3031
+ "label",
3032
+ {
3033
+ htmlFor: "field-suburb",
3034
+ className: "mb-1 block font-medium text-foreground text-sm",
3035
+ children: suburbLabel
3036
+ }
3037
+ ),
3038
+ /* @__PURE__ */ jsx(
3039
+ "input",
3040
+ {
3041
+ id: "field-suburb",
3042
+ type: "text",
3043
+ disabled,
3044
+ value: value.suburb,
3045
+ onChange: (e) => handleFieldChange("suburb", e.target.value),
3046
+ className: "block h-8 w-full rounded-none border border-input bg-transparent px-2.5 py-1 text-foreground text-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
3047
+ placeholder: "Suburb"
3048
+ }
3049
+ )
3050
+ ] }),
3051
+ /* @__PURE__ */ jsxs("div", { children: [
3052
+ /* @__PURE__ */ jsx(
3053
+ "label",
3054
+ {
3055
+ htmlFor: "field-state",
3056
+ className: "mb-1 block font-medium text-foreground text-sm",
3057
+ children: stateLabel
3058
+ }
3059
+ ),
3060
+ /* @__PURE__ */ jsx(
3061
+ "input",
3062
+ {
3063
+ id: "field-state",
3064
+ type: "text",
3065
+ disabled,
3066
+ value: value.state,
3067
+ onChange: (e) => handleFieldChange("state", e.target.value),
3068
+ className: "block h-8 w-full rounded-none border border-input bg-transparent px-2.5 py-1 text-foreground text-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
3069
+ placeholder: "State"
3070
+ }
3071
+ )
3072
+ ] }),
3073
+ /* @__PURE__ */ jsxs("div", { children: [
3074
+ /* @__PURE__ */ jsx(
3075
+ "label",
3076
+ {
3077
+ htmlFor: "field-postcode",
3078
+ className: "mb-1 block font-medium text-foreground text-sm",
3079
+ children: postcodeLabel
3080
+ }
3081
+ ),
3082
+ /* @__PURE__ */ jsx(
3083
+ "input",
3084
+ {
3085
+ id: "field-postcode",
3086
+ type: "text",
3087
+ disabled,
3088
+ value: value.postcode,
3089
+ onChange: (e) => handleFieldChange("postcode", e.target.value),
3090
+ className: "block h-8 w-full rounded-none border border-input bg-transparent px-2.5 py-1 text-foreground text-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
3091
+ placeholder: "Postcode"
3092
+ }
3093
+ )
3094
+ ] })
3095
+ ]
3096
+ }
3097
+ )
3098
+ ]
3099
+ }
3100
+ );
3101
+ }
3102
+
3103
+ export { AddressAutocomplete, AddressFieldGroup, AddressFormField, ForwardGeocodeInput, ReverseGeocodeInput, cn, toAddressWithParsed };
3104
+ //# sourceMappingURL=index.js.map
3105
+ //# sourceMappingURL=index.js.map